## PulseAudio Restart Bug – Solved

I enjoy my Linux computers, and one reason is the fact that many technical issues can be resolved, without having to reboot endlessly. However, in my past usage, there has been an irritating exception to this pattern. It’s common under Linux, that we can simply restart the PulseAudio Server from the command-line, using one out of several methods, and that the subject should be done with. But alas, every time I have ever restarted PulseAudio in this way, or, if the server restarted on its own, afterwards, when looking up the Plasma 5 -generated status display (which is actually referred to as “Phonon”), I’d be missing a Devices List, like so:

This type of display can be interpreted to mean several things, such as, that the PulseAudio server did restart, but that perhaps, it simply failed to connect to the inter-process, session-unique, message-bus. Therefore, in the past, whenever I had such a display, I eventually did what I thought I had to do, which was, to log out and back in again, or, to reboot. On my system, PulseAudio is configured such, that it runs as one user-name, and not as root.

In fact, a peculiar side effect of this bug was, that the list of available output devices was still being displayed, within ‘pavucontrol‘.

But this ordeal has now become even more inconvenient than it ever was because on the computer which I name ‘Phosphene’, the need may recur more frequently, ‘just to restart the PulseAudio server’.

However, I have finally found the true cause for this malfunction, which was, that when PulseAudio is restarted from within an existing session, it simply fails to load one module, which is also the module that it needs, in order to be able to list the available devices:


module-device-manager



In fact, there exists a script in ‘/usr/bin‘, that loads a series of X11-related modules.

Therefore, after a restart of this service, I can simply give the following command now:


/usr/bin/start-pulseaudio-x11



And Eureka! I can now obtain a list of available devices, without ever having to log out and back in, or, without ever having to reboot:

In fact, I have created a shell-script, which I can click on as user, and which carries out this task, safely.

I’ve also discovered that the ‘ProjectM’ music visualization application still works, and detects the beat of the playing music as before. What this means is that theoretically, after ‘ProjectM’ was installed, instead of rebooting, I could have just restarted the PulseAudio server as described here, to get that working.

( Edited 2019/10/29, 23h35 … )

I know that there exists an unrelated problem, that just happens to give the same appearance within ‘Phonon’, but that cannot be resolved in this way…

## Quantum Mechanics is Falsifiable.

One concept which exists in Science, is that certain theories are Falsifiable. This means that a given hypothesis will predict some sort of experimental outcome, which other theories would not predict, and then an experiment can be performed to test whether this outcome is according to the theory. If it is not, then this test will break the theory, and will thus falsify it.

Quantum Mechanics is often Falsifiable. If the reader thinks it is not, then maybe the reader is confusing Quantum Mechanics with String Theory, which is supposedly not falsifiable? And thinking that String Theory is just the same thing as Quantum-Mechanics, is a bit like thinking that Cosmology is just the same thing as Astronomy.

(Edit 02/03/2018 :

There is an aspect to a theory being Falsifiable, which I did not spell out above, assuming that the reader could infer it. But certain conversations I’ve had with people I personally know, suggest that those people do not understand this concept.

The result of a physical experiment can easily be, that the outcome is according to the theory. Just as much as the inverse situation would falsify the theory, such an outcome can eventually confirm the theory, and without confirming the theory, there is no real way in which Scientists can know, whether a new theory is in fact valid.

There is no specific imperative to prove a theory wrong, in the theory being Falsifiable. )

(Edit 02/15/2018 :

One aspect to how this posting should be read, which some readers might infer, but which other readers might not infer, is that it begins by stating a hypothesis. At first, I declared this hypothesis as distinct from several other theoretical explanations of light.

But it would break the flow of a blog-posting, if every paragraph which I wrote after that, began with a redeclaration, stating that the truth of the paragraph depends on the initial hypothesis.

This dependency should be assumed, and belongs to my intended meaning. )

According to Quantum Mechanics, light can be polarized, just as it can according to the classical, wave-based theory of light. Only, because according to Quantum-Mechanics light is driven by particles – by photons – its explanation of polarization is quite different from polarized light, according to the classical, electrodynamic explanation.

According to wave-based light, plane-polarized light is the primary phenomenon, and circular-polarized light is secondary. Circular-polarized light would follow, when waves of light are polarized in two planes at right-angles to each other, but when these waves also have a 90⁰ phase-shift.

(Edit 02/20/2018: A Hypothesis which I’ve just disproved, but which this whole posting’s validity depends on.) According to Quantum-Mechanics, the photon is in itself a circular-polarized quantum of light, of which there can trivially be left- and right-handed examples. According to Quantum-Mechanics, plane-polarized light forms, when left- and right-handed photons pair up, so that their electrostatic components form constructive interference in one plane, while canceling at right-angles to that plane.

From a thermodynamic point of view, there is little reason to doubt that photons could do this, since the particles which make up matter are always agitated, and since the photons in an original light-source also have some random basis. So a conventional plane-polarizing filter, of the kind that we used to attach to our film-cameras, would not be so hard to explain. It would just need to phase-shift the present left-handed photons in one way, while phase-shifting the present right-handed ones oppositely, until they line up.

But there exists one area in which the predictions of Quantum-Mechanics do not match those of classical wave-mechanics. If we are given a digital camera that accepts lens-attachments, we will want to attach circular polarizing filters, instead of plane-polarizing filters. And the classical explanation of what a circular polarizer does, is first to act as a plane-polarizer, which thereby selects a plane of polarization which we want our camera to be sensitive to, but the output of which is next circularly-polarized, so that light reaches the autofocus mechanism of the camera, which is still not plane-polarized. Apparently, fully plane-polarized light will cause the autofocus to fail.

This behavior of a polarizer is easily explained according to Quantum-Mechanics. The plane-polarized light which is at first admitted by our filter, already possesses left- and right-handed photons. After that, we could visualize sorting out the photons that are circular-polarized in the wrong direction.

But the opposite behavior of a filter would not be predicted by Quantum-Mechanics. According to that, if we first pass randomly-polarized light through a circular polarizer, and if we then pass the resulting beam into a plane-polarizer, we should not be able to obtain plane-polarized output from the last polarizer.

According to the classical explanation of light, this should still be an easy thing to do. Our circularly-polarized light is supposed to have two components at right-angles, and our plane-polarizer should only allow vibration in one plane. But according to Quantum-Mechanics, if the incident beam is already circularly-polarized, it should only consist of either left-handed or right-handed photons, and then a simple filter should not be able to conjure photons that are not present in the original beam. And so our circularly-polarized light should not be convertible into plane-polarized light.

## Music Visualization Plugins Under Linux

It is only very recently, that I have looked at an aspect of my Linux computers, which certain mainstream users would appreciate more than I, usually, which is to set them up, just for listening to music.

A part of music appreciation, can be to have visualizations display, that respond in some way, however minimalistic that may be, to the ‘mood’, the general spectral composition and rhythms. And so if we are used to Windows and its Media Player, we already know about such plugins as ‘Goom‘… And when we are using “Amarok” to listen to music under Linux, we may find ourselves missing such niceties.

There is a comment which I must make about such plugins as Goom though. This type of content is considered to be intellectual property, and the authors wish to be paid, for the numbers of users who view their art while listening. And so one thing which Linux cannot do, would be just to copy each of these plugins. I think that in the past, doing so caused some disputes somewhere.

But that does not mean, that the world of Linux may not have visualization plugins of its own. Hence, the question does arise, as to where those might be.

And the answer for some time has been disappointing. While the sound system on Linux computers has shifted from OSS, ALSA and ESOUND to such standards as ‘Pulse Audio‘ and ‘Phonon‘, this has thrown a bit of a monkey-wrench into the availability of visualizations. Those used to exist specifically for ‘Amarok‘ and ‘Kaffeine‘, but actually do not because of the versions having progressed to a state of incompatibility.

It used to be, that installing such additional packages as ‘libvisual‘, would mean that a visualization panel would become available within Amarok itself. For now this does not happen. And so I have found another way. I would say that the following packages need to be installed:


libvisual
libvisual-dev
libvisual-lugins
libvisual-projectm

libprojectm2
libprojectm-dev
libprojectm-qt1
libprojectm-qt-dev
projectm-data
projectm-dbg

projectm-pulseaudio



I am going whole hog here, and pretending that some of us might actually want to write some of our own visualizations at some point in time, but also that we would want the collections to be available to us, which have already been written by Debian devs. There is a new player on this list, which is known as ‘projectM‘. This is a framework for visualizations to be displayed with OpenGL, GPU acceleration (unlike how ‘libvisual‘ used to work). And a key package I have just now recommended is ‘projectm-pulseaudio‘.

What this does, is put an entry into our application menus, which opens a window, which displays those visuals, for whatever sound sources are in fact playing, through pulseaudio.

So we do not have to use Amarok necessarily. We can use some other music player, and as long as the music is being piped through pulseaudio, the visuals will try to adapt to it.

The only downside to this platform, is the fact that the projectM window sometimes needs a few extra seconds, to detect shifts in the mood of the music, and to select a new theme of visuals to keep up with that. Also, even though some of this is GPU-accelerated, the CPU-load of all that is still quite high, especially if we have Amarok displaying as a full window, and not as a notification tray icon.

But the whole thing works! And I did suppose, that I should add the ‘mood bar’ to Amarok as well…

Dirk