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:

Screenshot_20191026_152751

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:

Screenshot_20191026_152853

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…

Continue reading PulseAudio Restart Bug – Solved

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