Xupeng's blog

圆外之大,心向往之

Pulseaudio is very cool!

I finally moved to pulseaudio after having used alsa/esd for years, pulseauido has been there for many years, but I didn’t really learn something about it, I should have tried it if I knew it’s so cool! On my Debian unstable, I installed pulseaudio this way:
apt-get install pulseaudio libao2 paprefs libpulse-mainloop-glib0 \
    pulseaudio-module-jack pavucontrol alsaplayer-alsa pulseaudio-module-hal \
    pulseaudio-module-x11 pulseaudio-module-lirc pulseaudio-utils \
    pulseaudio-module-zeroconf libasound2-plugins padevchooser paman \
    pulseaudio-module-gconf libgconfmm-2.6-1c2 libpulse-browse0 pavumeter \
    libglademm-2.4-1c2a pulseaudio-esound-compat libpulse0 libpulse-dev
The next step is to make sure the desktop user is in these groups: audio, pulse, pulse-access and pulse-rt, for me, my username is “xupeng”, so the following commands make user “xupeng” belong to these groups:
gpasswd -a xupeng audio
gpasswd -a xupeng pulse
gpasswd -a xupeng pulse-access
gpasswd -a xupeng pulse-rt
Relogin the desktop environment(I use Gnome) is needed for the new groups permission to take effect, can use “id xupeng” to comfirm that the group permissions after re-logging into the desktop environment.
xupeng@hopes:~$ id
uid=1000(xupeng) gid=1000(xupeng)
groups=20(dialout),24(cdrom),25(floppy),29(audio),44(video),46(plugdev),
112(powerdev),115(netdev),118(vboxusers),122(pulse),123(pulse-access),
124(pulse-rt),1000(xupeng),1001(vmware)
Another important thing to make applications using ALSA work is: creating $HOME/.asoundrc with the following settings:
pcm.pulse {
    type pulse
}

ctl.pulse {
    type pulse
}

pcm.!default {
    type pulse
}

ctl.!default {
    type pulse
}
This activate the pulseaudio plugin for alsalibs, and make the pulseaudio driver as default. For applications using esound, adding these to $HOME/.bash_profile:
if [ ! -e /tmp/.esd-${UID} ]; then
        ln -s /tmp/.esd /tmp/.esd-${UID}
fi
Then I went to “System” - “Sound”, set all sound devices to “PulseAudio Sound Server”. There are useful wiki pages to get pulseaudio work well, here are the ones I read as reference:
  • http://www.pulseaudio.org/wiki/PerfectSetup
  • http://rudd-o.com/en/linux-and-free-software/how-pulseaudio-works

Comments