Saturday, July 10, 2010

Pulseaudio

I've run into some troubles a while ago when I looked for a nice way to use two soundcards at the same time.
I've tried a plain alsa install but I wasn't happy with the results. It was just too limited and some tools couldn't be configured like i wanted to do it.
Especially flash and media in the web gave me some headache because I couldn't choose the output device on fly and had troubles with devices kept busy until i closed the browser and such.

The only solution which is really working for me like i want it is Pulseaudio.
It let me switch the devices on fly, to mute them separately, dublex is working and it saves the settings for each tool.
I'm still not happy with it though. The sound is cranky sometimes and it's a bit slow, funny shock moments included. The volume is usually turned up to max if a tool is starting to play sound and it takes a second or two before Pulse toggles the volume if the system is under heavy load.

The good thing.. it's running almost out of the box.

Here's what i did to get sound in every tool, also in browser and flash:

Editing /etc/make.conf and adding pulseaudio useflag:

USE=" [.. snip ..]
mplayer webkit gimp imagemagick ffmpeg jack lash lame \
libsamplerate jpeg2k real wavpack theora pulseaudio gstreamer"


Emerging world with the new useflag:

emerge world -NDavq


Adding my user to the pulseaudio and plugdev group:

usermod -a -G pulseaudio plugdev <user>


Forcing alsa to use Pulseaudio as output build the alsa plugins:

emerge alsa-plugins -avq


And add the following into ~/.asoundrc:

pcm.pulse {
type pulse
}

ctl.pulse {
type pulse
}

pcm.!default {
type pulse
}

ctl.!default {
type pulse
}


And I finally emerged a useful tool to control the Pulseaudio:

emerge pavucontrol -avq


There's no need to add Pulseaudio to a runlevel. It's starting as soon as an application wants to send something to your soundcard.

Don't forget to relog into your account to activate your new group settings. Though the savest way to get all tools running with Pulseaudio would be a restart of your box. Yes.. a restart is sometimes easier.. even with Linux <.<°

Some Links for further infos:
http://www.pulseaudio.org/
http://en.gentoo-wiki.com/wiki/PulseAudio

No comments:

Post a Comment