Home Wiki > SDB:Pulseaudio
Sign up | Login

SDB:Pulseaudio

tagline: From openSUSE

PulseAudio is a networked sound server that allows software mixing of audio. See the PulseAudio website for more details.
Tested on openSUSE Recommended articles Related articles
Icon-checked.png

Icon-manual.png
Icon-help.png

General

PulseAudio provides:

  • Software mixing of multiple audio streams, bypassing any restrictions the hardware has.
  • Network transparency, allowing an application to play back or record audio on a different machine than the one it is running on.
  • Sound API abstraction, alleviating the need for multiple backends in applications to handle the wide diversity of sound systems out there.
  • Generic hardware abstraction, giving the possibility of doing things like individual volumes per application.

PulseAudio comes with many plugin modules. All audio from/to clients and audio interfaces goes through modules. PulseAudio clients can send audio to "sinks" and receive audio from "sources". A client can be GStreamer, xinelib, MPlayer or any other audio application. Only the device drivers/audio interfaces can be either sources or sinks (they are often hardware in- and out-puts).


Configuration

Starting with openSUSE 11.0 pulseaudio is used for GNOME installations. By default the daemon is automatically started if an application tries to use pulseaudio. This makes it a source of problems given the wide range of sound systems/applications being used in multimedia applications. That's why if you are having issues with PulseAudio, before reporting them to our Bugzilla, make sure you read this article about the perfect PulseAudio setup. It contains information about making all available sound systems use PulseAudio for the actual sound playing. If on the other hand you wish to disable pulseaudio altogether and fall-back to ALSA for all GNOME based applications, please read section Disabling pulseaudio completely (ALSA fall-back) below.

Packages

GNOME installations include all necessary tools and packages by default. In other enviroments pulseaudio is often dragged in due to dependencies but without the tools to control it. Therefore the following packages may need to be manually installed in order to control the pulseaudio daemon:

  • pavucontrol - PulseAudio Volume Control
  • paprefs - PulseAudio Preferences
  • pulseaudio-utils - PulseAudio utilities
  • padevchooser - PulseAudio Device Chooser
  • paman - PulseAudio Manager
  • alsa-plugins-pulse (-32bit) - Pulseaudio Plug-In for the ALSA Library

Using Pulseaudio as alsa back-end by default

To make all applications that support alsa but not pulseaudio to play sound via pulseaudio you need to install alsa-plugins-pulse (as well as the 32bit package if you are on 64bit) and set the following environment variable:

export ALSA_CONFIG_PATH=/etc/alsa-pulse.conf

In a GNOME session this variable is set by default. If you like to set this environment variable system wide, paste the line from above into /etc/environment (including the export command).

openSUSE 11.2, KDE 4.2

Pulseaudio is not used as default sound server. Run as root:

setup-pulseaudio --enable

to make it default. If on the other hand you wish to disable pulseaudio altogether and fall-back to ALSA for all GNOME based applications, please read section Disabling pulseaudio completely (ALSA fall-back) below.

Disabling the OSS module

Certain applications using the OSS audio output, if not correctly configured, could interrupt pulseaudio, such that pulseaudio cannot connect to the output hardware device. This can be disabled by running

rmmod snd-pcm-oss

and then appending blacklist snd-pcm-oss to the file /etc/modprobe.d/50-blacklist.conf . (Taken from ArchLinux wiki.)

Disabling Pulseaudio autospawn

Due to dependencies it is often not possible to uninstall pulseaudio completely. To prevent use of pulseaudio nevertheless autostarting the daemon can be prevented by setting autospawn = no in /etc/pulse/client.conf


Issues

No sound after installation

There have been cases where the volume is muted by default, and this isn't exposed in the KDE mixer. To fix this, run padevchooser (you may have to install it), click the tray icon, and choose "Volume Control". Check that everything is not muted, including after you start playing sound through an application (the application should show up in the "Playback" tab).

If the sound still isn't working, or the pulseaudio tools aren't working, try adding your user to the "pulse" and "pulse-access" groups (Yast > User and Group Management > [select user] > Edit > Details > Additional Groups). You'll have to log off and back in for this to take effect.

5.1 Sound

There were issues getting 5.1 sound working out of the box, see bug 381686 for more information. Many people have a surround card, but have speakers for just two channels, so PulseAudio can't really default to a surround setup. To enable all the channels, edit /etc/pulse/daemon.conf: uncomment the default-sample-channels line (i.e. remove the semicolon from the beginning of the line) and set the value to 6 if you have a 5.1 setup, or 8 if you have 7.1 setup etc. Or even easier, you can run paprefs and set the speaker setup via the paprefs GUI.

paprefs-speaker-setup.png

Glitches in audio playback

Edit /etc/pulse/daemon.conf: uncomment the default-fragments and default-fragment-size-msec, and change values from the default 4 and 25 to 16 and 21.

Please report back in bug 381686if this works or not for you.

Returning to esound

Remove all pulseaudio* packages and install esound.

Crackling Sound with OpenAL (Games)

The alsa plugin that forces applications to use pulseaudio often causes low sound quality in games that use OpenAL for sound output. Up to and including openSUSE 11.1 openal-soft did not support puseaudio natively. To fix sound in games either get rid of pulseaudio or install a backport from Factory

Disabling pulseaudio completely (ALSA fall-back)

Under openSUSE 11.2, pulseaudio is the audio subsystem of choice for all GNOME based applications. This may cause various coexistence problems, especially in relation to phonon, KDE's sound subsystem that uses ALSA. A very common symptom is that ALSA audio is unable to acquire real-time (or more precisely near-real-time) scheduling, in effect causing delayed and/or clipped sound. Many have found that disabling pulseaudio completely, and thus forcing all GNOME based applications to use ALSA, works much better for them. To accomplish this do the following:

  • Disable pulseaudio:
setup-pulseaudio --disable
  • Remove all pulseaudio packages except libpulse-mainloop-glib0 and libpulse0, as these are required by all GNOME based applications (since they are compiled with pulseaudio by default).
  • Hide the libraries provided by the libpulse-mainloop-glib0 and libpulse0 packages, in order to force GNOME applications to ALSA fall-back. To do this, move them out of the way by issuing the following commands as root (openSUSE 11.2 x86_x64 assumed):
cd /usr/lib64

md HIDDEN mv *pulse* HIDDEN

ldconfig

Note that if under $HOME/.pulse you have properly setup configuration files (e.g. from when pulseaudio was enabled), the last step above for hiding the pulseaudio libraries may not be required. However, if you accidentally (or intentionally) delete $HOME/.pulse, GNOME based applications will loose audio once again. Regardless of the contents of /etc/asound.conf, moving the libraries out of the way is the only guaranteed method to force fall-back to ALSA.

  • Use an ALSA compatible mixer (e.g. kmix under KDE or alsamixer in a terminal) and make sure all channels of interest are not muted.

Note that this is a work-around, not a definite solution: if either the libpulse-mainloop-glib0 and/or the libpulse0 package is updated, you will need to reissue the above commands to move the pulseaudio libraries out of the way once again, by using the above commands.


See also


External links