scientificlinuxforum.org QR code
Scientific Linux Forum.org



  Reply to this topicStart new topicStart Poll

> disabling PulseAudio in SL6, how-to
tux99
 Posted: Jun 29 2011, 12:54 AM
Quote Post


SLF Guru
********

Group: Members
Posts: 1253
Member No.: 224
Joined: 28-May 11









Despite having been around a for quite a while, Pulseaudio is still often a nuisance, for example I find it tends to use noticeable amounts of cpu time on netbook cpus (Intel Atom, AMD Zacate), I have seen it using 20% cpu-time on my AMD Zacate mobo when playing back a DD 5.1 soundtrack as analog stereo.
Personally I have no use for Pulseaudio therefore I normally disable it, I don't like wasting cpu cycles.

Please note this thread is purely to discuss how to disable Pulseaudio on SL6 as cleanly as possible, do not start a religious discussion for or against Pulseaudio in this thread!

Please also note that if you use Bluetooth audio on your SL6 PC then AFAIK you cannot disable Pulseaudio, as Linux Bluetooth audio heavily depends on Pulseaudio.

Here are the steps I found are necessary on my SL6 install to cleanly disable PA after a SL6 Desktop install:

1. add comma separated list of login username(s) to group 'audio' in /etc/group.
for example:
CODE
audio:x:63:username1,username2


2. remove plugin that redirects alsa output to pulseaudio:
CODE
yum remove alsa-plugins-pulseaudio


3. configure analogue stereo audio as the default alsa output device (this might not be necessary in some cases, and in some cases you might want to pick HDMI audio or S/PDIF instead):
CODE
mv /etc/asound.conf /etc/asound.conf-orig
cat > /etc/asound.conf << EOF
pcm.!default {
   type hw
   card SB
}
ctl.!default {
   type hw
   card SB
}
EOF

SB is the name of my soundcard, check the output of aplay -L (the CARD=xxx bit) for your card name.

4. reconfigure default alsa mixer device to card "1" (in my case HDA ATI SB):
CODE
sed -i "s|default \"0\"|default \"1\"|g" /etc/alsa/alsactl.conf

This is necessary if the default card is not card "0", check output of aplay -l

5. reconfigure gstreamer to use alsa as default audio output sink:
CODE
sed -i "s|autoaudiosink|alsasink|g" /etc/gconf/schemas/gstreamer-0.10.schemas \
/etc/gconf/gconf.xml.defaults/%gconf-tree.xml


6. install package containing 'gstreamer-properties', useful to check gstreamer config (not strictly necessary to disable pulseaudio):
CODE
yum install gnome-media-apps


7. install package 'alsa-plugins-vdownmix' to allow 5.1 to 2.0 downmix (not strictly necessary to disable pulseaudio):
CODE
yum install alsa-plugins-vdownmix


8. disable gdm sound:
CODE
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \
--type Boolean --set /apps/gdm/simple-greeter/settings-manager-plugins/sound/active False


9. disable pulseaudio from being spawned by gdm:
CODE
cat > /var/lib/gdm/.pulse/client.conf << EOF
autospawn = no
daemon-binary = /bin/true
EOF
chown gdm:gdm /var/lib/gdm/.pulse/client.conf


10. remove as many pulseaudio packages as possible without affecting dependencies, these can be removed (using yum remove), list them with:
CODE
rpm -qa | grep pulse

CODE
pulseaudio
pulseaudio-module-bluetooth
pulseaudio-module-zeroconf
pulseaudio-module-gconf
pulseaudio-module-x11
pulseaudio-esound-compat
pulseaudio-libs-zeroconf
pulseaudio-utils

only these should be left alone to avoid breaking dependencies:
CODE
pulseaudio-gdm-hooks
pulseaudio-libs
pulseaudio-libs-glib2


11. edit /etc/pulse/client.conf to stop pulseaudio from autospawning:
CODE
mv /etc/pulse/client.conf /etc/pulse/client.conf-orig
cat > /etc/pulse/client.conf << EOF
autospawn = no
daemon-binary = /bin/true
EOF


After doing all this all applications using sound should still work fine as before (including flash audio), not all of the above steps are strictly necessary but they shouldn't do any damage either.
The only sound that will be disabled by this, is Gnome desktop sound effects, which at least for me is no loss, I always disable them anyway.


Please let me know your experience if you try this.

Remember: If it ain't broken don't fix it!!
(Don't attempt this in the unlikely event that sound/pulseaudio is working perfectly for you!)


--------------------
My personal SL6 repository, specialized in audio/video software: http://pkgrepo.linuxtech.net/el6/
(can be used together with EPEL and ELRepo repositories)
PM
^
tux99
 Posted: Jun 29 2011, 12:42 PM
Quote Post


SLF Guru
********

Group: Members
Posts: 1253
Member No.: 224
Joined: 28-May 11









Since the default gnome volume control is specifically for Pulseaudio (i.e. it doesn't work with plain ALSA) I have packaged up 'gnome-alsamixer'. You can find it in my repo, currently in the 'testing' repo, but I will soon move it to the 'release' repo once I have tested it a bit more.

I have found a few other mixer apps that I might check out and package up, so there is some choice.


--------------------
My personal SL6 repository, specialized in audio/video software: http://pkgrepo.linuxtech.net/el6/
(can be used together with EPEL and ELRepo repositories)
PM
^
tux99
 Posted: Oct 14 2011, 10:10 AM
Quote Post


SLF Guru
********

Group: Members
Posts: 1253
Member No.: 224
Joined: 28-May 11









I just installed SL6.1 on a new PC and when testing gstreamer video playback I frequently get the following error:
An error occurred
pa_stream_writable_size() failed: Connection terminated


Needless to say this appears to be a (another) Pulseaudio bug that was around at the time RHEL 6 was originally released, here is a Ubuntu forum thread about it:http://ubuntuforums.org/showthread.php?t=1487019
Redhat seems to be aware of it, but clearly hasn't fixed it yet:
https://bugzilla.redhat.com/show_bug.cgi?id=587286
https://bugzilla.redhat.com/show_bug.cgi?id=520230
https://bugzilla.redhat.com/show_bug.cgi?id=566915

And guess what, the best solution to solve this issue (short of debugging PA source code) is to get rid of this completely useless pile of cr@p called Pulseaudio! mad.gif

See instructions in the first post of this thread on how to get rid of PA in SL6.x.


--------------------
My personal SL6 repository, specialized in audio/video software: http://pkgrepo.linuxtech.net/el6/
(can be used together with EPEL and ELRepo repositories)
PM
^
U308
 Posted: Oct 14 2011, 10:47 AM
Quote Post


SLF Expert
******

Group: Members
Posts: 508
Member No.: 32
Joined: 11-April 11









I don't have any of those problems, but then I am not streaming over a network, only locally.
Have you tried padevchooser ?
PM
^
tux99
 Posted: Oct 14 2011, 11:06 AM
Quote Post


SLF Guru
********

Group: Members
Posts: 1253
Member No.: 224
Joined: 28-May 11









QUOTE (U308 @ Oct 14 2011, 11:47 AM)
I don't have any of those problems, but then I am not streaming over a network, only locally.
Have you tried padevchooser ?


I don't stream over the network either, this is playback of local files. Gstreamer is the name of the decoder library that Totem (the default SL6 movie player) uses.

You probably don't get these problems because you use a powerful PC, Pulseaudio is generally ok on a fast modern cpu, but on netbook cpus (Intel Atom, AMD Zacate) or older cpus it's a resource hog. Even on a fast modern cpu Pulseaudio is a waste of cpu resources (even if you don't notice it).

The PC I just got this issue on is a Atom D525 (1.8GHz dual core Atom) based PC.

Sound works perfectly fine on Atom based PCs and Linux, only when Pulseaudio is used then timeouts and errors happen.


--------------------
My personal SL6 repository, specialized in audio/video software: http://pkgrepo.linuxtech.net/el6/
(can be used together with EPEL and ELRepo repositories)
PM
^
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll