SDB:Pulseaudio

Icon-warning.png
Attenzione! Traduzione in corso
PulseAudio è un server sonoro, con supporto per le reti, che consente il missaggio del suono a livello software. Per maggiori dettagli consultare il sito di PulseAudio.
Provato su openSUSE Articoli consigliati Articoli correlati
Icon-checked.png

Icon-manual.png
Icon-help.png

Caratteristiche generali

PulseAudio fornisce:

  • Missaggio software di flussi audio da più fonti diverse, per superare eventuali limitazioni dell'hardware.
  • Trasparenza alla rete, consentendo ad un applicazione di riprodurre o di registrare l'audio su una macchina diversa da quella su cui il esso è in esecuzione.
  • API per l'astrazione dell'architettura audio, riducendo la necessità di avere nelle applicazioni più di un backend per coprire la varietà di sistemi sonori con cui potrebbero dover interagire.
  • Astrazione completa dall'hardware, offrendo, per esempio, la possibilità di impostare livelli di volume audio diverso per ciascuna applicazione.

PulseAudio fornisce numerosi plugin caricabili sotto forma di moduli. Tutto il suono da e verso i client e le interfacce audio passa attraverso questi moduli. I client di PulseAudio sono in grado di inviare l'audio ai ricevitori, chiamati "sink(s)" (pozzi) e di ricevere l'audio dalle sorgenti, chiamate "source(s)". Possono agire da client GStreamer, xinelib, MPlayer o qualsiasi altra applicazione audio. Soltanto i driver dei dispositivi o le interfacce audio possono comportarsi sia da source che da sink (che sono spesso flussi hardware in ingresso e in uscita).


Configurazione

A partire da (almeno) openSUSE 11.4 pulseaudio viene usato sia con le installazioni con GNOME che con KDE. Per impostazione predefinita il demone viene avviato automaticamente quando un'applicazione cerca di usare 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.


Vedere anche


Collegamenti esterni