Zero_Dogg

Random comments on geeky things

Working around pulseaudio on GNOME 3

A few months ago I switched to GNOME 3. After an initial period where some of it felt rather awkward I settled in, and can now safely say that I don’t want to return to a more «conventional» desktop environment. gnome-shell is very convenient and efficient to use.

That being said, GNOME 3 has one major issue: it uses pulseaudio.

While pulseaudio may bring many useful features to the table, it does so at the price of breaking sound at random intervals for no good reason. The largest design flaw is, imho, that it has decided that it’s better at everything, and thus everything should use it - and so it redirects output to alsa’s default devices to itself. If it was 1:1, 100% compatible with ALSA (yes, bug for bug if need be), that wouldn’t be a problem - but it isn’t, and thus it breaks stuff. The gain for me personally from using pulseaudio is nowhere to be seen, so I don’t see any point in keeping it around.

Since GNOME 3 uses pulseaudio, though, I can’t easily remove it. That would break ie. GNOME’s volume control. As a quick hacky workaround I edited /usr/share/alsa/pulse-alsa.conf - and by «edited» I mean «replaced with an empty file». This should, in theory, make ALSA’s default output go to your soundcard again, instead of to pulseaudio. The file is not a real config file, though, so it gets replaced on each update of its package. A simple echo > /usr/share/alsa/pulse-alsa.conf in /etc/rc.local is enough to keep that monster at bay though (for the most part).

Sometimes the above hack fails to make stuff work again though, so an even more blunt «HULK SMASH!» method is needed, namely: killing the pulseaudio process. Pulseaudio is a tricky beast, though, and keeps respawning itself. Luckily, it’s easy to tell it not to do that. Edit ~/.pulse/client.conf and add autospawn=no - that should make it stay dead after you kill it.

I wish GNOME would reconsider its use of pulseaudio. At least for me, it’s not just worth the extra work, I would much rather have my sound just work. Even if pulse is not to blame for all of my sound issues, killing it usually resolves them.

Comments

If you have any comments, please don't hesitate to contact me via e-mail, IRC or IM.