Make Phonon to forget about pulseaudio

Post your tutorials and howtos here.
User avatar
Snap
Posts: 1244
Joined: 25 Aug 2013 20:01
Location: Spain

Make Phonon to forget about pulseaudio

Postby Snap » 23 Aug 2015 09:01

Coming from here.

If you don't use pulseaudio, specially if using jack, you might be interested in this. Originally I had the intention to title this topic as “Please, Phonon. Leave me alone!” if you know why, this is for you.

Since I purged pulseaudio and configured my system to use alsa and jack instead (via Cadence), phonon has been complaining from time to time when launching certain Qt apps that are compiled with phonon support. It displays notifications about soundcards detected but it cannot manage anymore since pulse is not used and jack overrides it completely (Kmix no longer works. It's a phonon front end. It can be removed). Using phonon is not mandatory for those apps. It's just an option. But if they have been built with phonon support they check if phonon is there and then phonon "wants to help" them.

At first instance, I don't get why phonon has to be unavoidably in the way and on top of the sound system (ALSA, OSS or FFADO) and the sound servers if any server is used (pulse or jack). No other Desktop Environment does such a thing. KDE adds an extra layer on top of the server and/or the sound system.

AFAIK, phonon cannot be removed and haven't found a way to disable it. Wish it would be an independent thus removable module. That would make a whole lot more sense.

The phonon backends cannot be removed either. If you have more than one in your system you can remove all of them excepting one. At least a phonon backend must be installed and if removed it wants to pull half KDE along with it. The problem is that along with the backends some pulseaudio bits unavoidably remain within the system. For this reason, once pulseaudio is disabled or purged, phonon keeps listing (though grayed-out) the pulseaudio devices it can find and asking for them. If you select “Don't ask for these devices anymore” in the popup window, be sure it will ask for them over and over again.

Let's see how to circumvent them and force phonon to forget about pulse for once and for all in order to simply deal with ALSA. If Jack is used it will do it's job on it's own. It won't interfere or work with phonon.

This takes basically one action, but two would be convenient.

Fisrt let's make phonon to skip anything pulse. By simply renaming the backend's pulseaudio plugin, phonon will forget about pulse. If you use the VLC-backend (anyone using gstreamer?) run this oneliner in a terminal:

Code: Select all

sudo mv /usr/lib/vlc/plugins/audio_output/libpulse_plugin.so /usr/lib/vlc/plugins/audio_output/libpulse_plugin.so.bak
The second action will restart phonon with fresh new settings and only the desired devices after next login.

Code: Select all

mv ~/.kde/share/config/phonondevicesrc ~/.kde/share/config/phonondevicesrc.bak
Logout, login and now phonon will list only alsa devices.

If you want to revert the changes simply remove the .bak suffix from the file names.

According to an old KDE manual, it is (was?) posible to disable phonon entirely by setting the profile off. That tab in the System Settings>MultiMedia>Audio and Video Settings panel isn't present in late KDE4 versions anymore. I'll try to find where in the kde configs is living this particular setting if it still exists. For now, this is an useful workaround.

BTW, if you use jack, Kmix is a rather useless applet. If you don't want to remove it but don't want to see it doing about nothing in your systray either, open ~/.kde/share/config/kmixrc and simply add this line under the [Global] section:

Code: Select all

AutoStart=false 
This likely means that your installation is broken. -Mr Pixbuf.

Image

User avatar
Arjen Balfoort
Site Admin
Posts: 9517
Joined: 26 Jan 2013 19:36
Location: Netherlands
Contact:

Re: Make Phonon to forget about pulseaudio

Postby Arjen Balfoort » 23 Aug 2015 14:44

Moved to the Tutorials section.

/usr/lib/vlc/plugins/audio_output/libpulse_plugin.so is part of the vlc package. When vlc is updated, the plugin is installed again. You can prevent this by diverting the file instead of moving it:

Code: Select all

sudo dpkg-divert --add --rename --divert /usr/lib/vlc/plugins/audio_output/libpulse_plugin.so.divert /usr/lib/vlc/plugins/audio_output/libpulse_plugin.so
See man dpkg-divert for more information.


SolydXK needs you!
Development | Testing | Translations

User avatar
Snap
Posts: 1244
Joined: 25 Aug 2013 20:01
Location: Spain

Re: Make Phonon to forget about pulseaudio

Postby Snap » 23 Aug 2015 16:30

I guessed so, but didn't knew how to do it. I swear I copied these instructions a while ago but cannot find them anywhere in my HDs... :roll: Thanks for re-posting the way of diverting changes, Schoelje.

I have to say I'm only partially happy with this solution. Regular apps seem to behave as expected, but for some reason When running Virtual machines in VirtualBox the popup from phonon appears again. It looks like some kind of racing/fighting for the soundcard between phonon and VB.

Not always happens. It seems it's with some machines only. Or maybe if running two at the same time (I use to do it). Or maybe due to the driver used in the VMs. Different systems need different VB drivers for the sound to work... maybe a given driver makes this happen. I'll have to check all that.
This likely means that your installation is broken. -Mr Pixbuf.

Image


Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 16 guests