Difference between revisions of "PulseAudio"

From ArchWiki
Jump to: navigation, search
(libao)
(Troubleshooting: Added troubleshooting information when pulseaudio does not detect all functionality.)
(46 intermediate revisions by 24 users not shown)
Line 1: Line 1:
 
[[Category:Audio/Video]]
 
[[Category:Audio/Video]]
 +
[[Category:Sound]]
 
[[cs:PulseAudio]]
 
[[cs:PulseAudio]]
 
[[es:PulseAudio]]
 
[[es:PulseAudio]]
Line 15: Line 16:
 
{{Article summary end}}
 
{{Article summary end}}
  
==Installation==
+
== Installation ==
*Required PKG:  {{Pkg|pulseaudio}}
+
*Optional GUIs: {{Pkg|paprefs}} and {{Pkg|pavucontrol}}
+
*Optional volume control via mapped keyboard keys: {{AUR|pulseaudio_ctl}}
+
*Optional console mixer: {{AUR|ponymix-git}} and {{AUR|pamixer-git}}
+
*Optional system tray icon: {{AUR|pasystray-git}}
+
*Optional kde plasma applet: {{AUR|kdeplasma-applets-veromix}}
+
  
==Running==
+
* Required package:  {{Pkg|pulseaudio}}
{{Note|Pulseaudio requires [[D-Bus]] to function.}}
+
* Optional GTK GUIs: {{Pkg|paprefs}} and {{Pkg|pavucontrol}}
{{Note|Most X11 environments start pulseaudio automatically with the X11 session.}}
+
* Optional volume control via mapped keyboard keys: {{AUR|pulseaudio_ctl}}
 +
* Optional console mixer: {{AUR|ponymix-git}} and {{AUR|pamixer-git}}
 +
* Optional system tray icon: {{AUR|pasystray-git}}
 +
* Optional KDE plasma applet: {{Pkg|kdemultimedia-kmix}} and {{AUR|kdeplasma-applets-veromix}}
 +
 
 +
== Running ==
 +
{{Warning|If you have per-user copies of configuration files (such as client.conf, daemon.conf or default.pa) in ~/.pulse/, make sure you keep them in sync with changes to the packaged files in /etc/pulse/. Otherwise, PulseAudio may refuse to start due to configuration errors.}}
 +
 
 +
{{Note|
 +
* Pulseaudio requires [[D-Bus]] to function.
 +
* Most X11 environments start pulseaudio automatically with the X11 session.
 +
}}
  
 
In the unlikely event that pulseaudio is not automatically called upon entering X, it can can be started with:
 
In the unlikely event that pulseaudio is not automatically called upon entering X, it can can be started with:
Line 31: Line 37:
  
 
PulseAudio can be stopped with:
 
PulseAudio can be stopped with:
  $ pulseaudio --kill
+
  $ pulseaudio -k
  
==Equalizer==
+
== Equalizer ==
  
 
Newer pulseaudio versions have an intergrated 10-band equalizer system. In order to use the equalizer do the following:
 
Newer pulseaudio versions have an intergrated 10-band equalizer system. In order to use the equalizer do the following:
  
===Load equalizer sink module===
+
=== Load equalizer sink module ===
  
 
  $ pactl load-module module-equalizer-sink
 
  $ pactl load-module module-equalizer-sink
  
===Install and run the gui frontend===
+
=== Install and run the gui frontend ===
  
# pacman -S --needed python2-pyqt
+
Install {{Pkg|python2-pyqt}} and execute:
  
 
  $ qpaeq
 
  $ qpaeq
Line 49: Line 55:
 
{{Note|If qpaeq has no effect, install pavucontrol and change "ALSA Playback on" to "FFT based equalizer on ..." while the media player is running.}}
 
{{Note|If qpaeq has no effect, install pavucontrol and change "ALSA Playback on" to "FFT based equalizer on ..." while the media player is running.}}
  
===Load equalizer module on every boot===
+
=== Load equalizer module on every boot ===
  
 
Edit the file {{ic|/etc/pulse/default.pa}} with your favorite editor and append the following lines:
 
Edit the file {{ic|/etc/pulse/default.pa}} with your favorite editor and append the following lines:
Line 56: Line 62:
 
  load-module module-equalizer-sink
 
  load-module module-equalizer-sink
  
==Backend Configuration==
+
== Backend Configuration ==
  
===ALSA===
+
=== ALSA ===
*Recommended PKG: {{Pkg|pulseaudio-alsa}}
+
*Optional PKGs: {{Pkg|lib32-libpulse}} and {{Pkg|lib32-alsa-plugins}}
+
  
{{Note|Optional PKGs are needed only if running x86_64 and wanting to have sound for 32 bit programs (like Wine).}}
+
* Recommended package: {{Pkg|pulseaudio-alsa}}
 +
* Optional packages: {{Pkg|lib32-libpulse}} and {{Pkg|lib32-alsa-plugins}}
 +
 
 +
{{Note|Optional packages are needed only if running x86_64 and wanting to have sound for 32 bit programs (like Wine).}}
  
 
For the applications that do not support PulseAudio and support ALSA it is '''recommended''' to install the PulseAudio plugin for ALSA.  This package also contains the necessary {{ic|/etc/asound.conf}} for configuring ALSA to use PulseAudio.
 
For the applications that do not support PulseAudio and support ALSA it is '''recommended''' to install the PulseAudio plugin for ALSA.  This package also contains the necessary {{ic|/etc/asound.conf}} for configuring ALSA to use PulseAudio.
Line 69: Line 76:
 
  # rmmod snd_pcm_oss
 
  # rmmod snd_pcm_oss
  
===ALSA/dmix without grabbing hardware device===
+
=== ALSA/dmix without grabbing hardware device ===
{{Note|This section describes alternative configuration, which is generally NOT recommended.}}
+
 
 +
{{Note|This section describes alternative configuration, which is generally '''not''' recommended.}}
  
 
You may want to use ALSA directly in most of your applications and to be able to use other applications, which constantly require PulseAudio at the same time. The following steps allow you to make PulseAudio use dmix instead of grabbing ALSA hardware device.
 
You may want to use ALSA directly in most of your applications and to be able to use other applications, which constantly require PulseAudio at the same time. The following steps allow you to make PulseAudio use dmix instead of grabbing ALSA hardware device.
  
*Remove package {{Pkg|pulseaudio-alsa}}, which provides compatibility layer between ALSA applications and PulseAudio. After this your ALSA apps will use ALSA directly without being hooked by Pulse.
+
* Remove package {{Pkg|pulseaudio-alsa}}, which provides compatibility layer between ALSA applications and PulseAudio. After this your ALSA apps will use ALSA directly without being hooked by Pulse.
$ sudo pacman -R pulseaudio-alsa
+
  
*Edit {{ic|/etc/pulse/default.pa}}.
+
* Edit {{ic|/etc/pulse/default.pa}}.
 
:Find and uncomment lines which load backend drivers. Add '''device''' parameters as follows. Then find and comment lines which load autodetect modules.
 
:Find and uncomment lines which load backend drivers. Add '''device''' parameters as follows. Then find and comment lines which load autodetect modules.
 
  load-module module-alsa-sink '''device=dmix'''
 
  load-module module-alsa-sink '''device=dmix'''
Line 84: Line 91:
 
  # load-module module-detect
 
  # load-module module-detect
  
*''Optional:'' If you use {{Pkg|kdemultimedia-kmix}} you may want to control ALSA volume instead of PulseAudio volume:
+
* ''Optional:'' If you use {{Pkg|kdemultimedia-kmix}} you may want to control ALSA volume instead of PulseAudio volume:
 
  $ echo export KMIX_PULSEAUDIO_DISABLE=1 > ~/.kde4/env/kmix_disable_pulse.sh
 
  $ echo export KMIX_PULSEAUDIO_DISABLE=1 > ~/.kde4/env/kmix_disable_pulse.sh
 
  $ chmod +x ~/.kde4/env/kmix_disable_pulse.sh
 
  $ chmod +x ~/.kde4/env/kmix_disable_pulse.sh
  
*Now, reboot your computer and try running alsa and pulseaudio applications at the same time. They both should produce sound simultaneously.
+
* Now, reboot your computer and try running alsa and pulseaudio applications at the same time. They both should produce sound simultaneously.
 
:Use {{Pkg|pavucontrol}} to control PulseAudio volume if needed.
 
:Use {{Pkg|pavucontrol}} to control PulseAudio volume if needed.
  
===OSS===
+
 
 +
=== OSS ===
 +
 
 
There are multiple ways of making OSS-only programs play to PulseAudio:
 
There are multiple ways of making OSS-only programs play to PulseAudio:
  
====ossp====
+
==== ossp ====
Start {{Pkg|ossp}} with:
+
rc.d start osspd
+
  
Afterwards, add it to DAEMONS in {{ic|rc.conf}}.
+
Install {{Pkg|ossp}} package and start '''ossp''' service.
 +
 
 +
==== padsp wrapper (part of PulseAudio) ====
  
====padsp wrapper (part of PulseAudio)====
 
 
Programs using OSS can work with PulseAudio by starting it with padsp:
 
Programs using OSS can work with PulseAudio by starting it with padsp:
  
Line 108: Line 116:
 
  $ padsp sox foo.wav -t ossdsp /dev/dsp
 
  $ padsp sox foo.wav -t ossdsp /dev/dsp
  
One can also rename the {{ic|OSSprogram-bin}} binary and replace it with a script like this:   
+
You can also add a custom wrapper script like this:   
{{hc|/usr/bin/OSSProgram|<nowiki>
+
{{hc|/usr/local/bin/OSSProgram|<nowiki>
 
#!/bin/sh
 
#!/bin/sh
if test -x /usr/bin/padsp; then
+
exec padsp /usr/bin/OSSprogram "$@"
    exec /usr/bin/padsp /usr/bin/OSSprogram-bin "$@"
+
else
+
    exec /usr/bin/OSSprogram "$@"
+
fi
+
 
</nowiki>}}
 
</nowiki>}}
 +
Make sure {{ic|/usr/local/bin}} comes before {{ic|/usr/bin}} in your '''PATH'''.
  
===GStreamer===
+
=== GStreamer ===
To make [[GStreamer]] use PulseAudio, you need to install {{Pkg|gstreamer0.10-good-plugins}}, execute {{ic|gstreamer-properties}} (part of ''gnome-media'' package) and select ''PulseAudio Sound Server'' in both Audio Input and Output. Alternatively, this can be done by setting the gconf variables {{ic|/system/gstreamer/0.10/default/audiosink}} to ''pulsesink'' and {{ic|/system/gstreamer/0.10/default/audiosrc}} to ''pulsesrc'':
+
  $ gconftool-2 -t string --set /system/gstreamer/0.10/default/audiosink pulsesink
+
  $ gconftool-2 -t string --set /system/gstreamer/0.10/default/audiosrc pulsesrc
+
  
Some applications (like Rhythmbox) ignore the ''audiosink'' property, but rely instead on ''musicaudiosink'', which cannot be configured using {{ic|gstreamer-properties}} but needs to be manually set using {{ic|gconf-editor}} or the {{ic|gconftool-2}}:
+
To make [[GStreamer]] use PulseAudio, you need to install {{Pkg|gst-plugins-good}} or {{Pkg|gstreamer0.10-good-plugins}}.
  $ gconftool-2 -t string --set /system/gstreamer/0.10/default/musicaudiosink pulsesink
+
 
 +
=== OpenAL ===
  
===OpenAL===
 
 
OpenAL Soft should use PulseAudio by default, but can be explicitly configured to do so: {{hc|/etc/openal/alsoft.conf|2=drivers=pulse,alsa}}
 
OpenAL Soft should use PulseAudio by default, but can be explicitly configured to do so: {{hc|/etc/openal/alsoft.conf|2=drivers=pulse,alsa}}
  
===libao===
+
=== libao ===
 +
 
 
Edit the libao configuration file:
 
Edit the libao configuration file:
{{hc|/etc/libao.conf|2=default_driver=pulse}}
+
{{hc|# /etc/libao.conf|2=default_driver=pulse}}
Be sure to remove the ''dev=default'' option of the alsa driver or adjust it to specify a specific Pulse sink name or number (This is especially true for command line utils, such as aplay or pianobar). Alternatively, note that you could keep the libao standard of outputting to the ''alsa'' driver and its default device if you install {{Pkg|pulseaudio-alsa}} since the ALSA default device then '''is''' PulseAudio.
+
Be sure to remove the {{ic|1=dev=default}} option of the alsa driver or adjust it to specify a specific Pulse sink name or number.  
 +
 
 +
{{Note|You could possibly also keep the libao standard of outputting to the ''alsa'' driver and its default device if you install {{pkg|pulseaudio-alsa}} since the ALSA default device then '''is''' PulseAudio.}}
 +
 
 +
=== ESD ===
  
===ESD===
 
 
PulseAudio is a drop-in replacement for the enlightened sound daemon (ESD). While PulseAudio is running, ESD clients should be able to output to it without configuration.
 
PulseAudio is a drop-in replacement for the enlightened sound daemon (ESD). While PulseAudio is running, ESD clients should be able to output to it without configuration.
  
==Desktop Environments==
+
== Desktop environments ==
===General X11===
+
 
 +
=== General X11 ===
 +
 
 
{{Note|As mentioned previously, PulseAudio is very likely launched automatically via either {{ic|/etc/X11/xinit/xinitrc.d/pulseaudio}} or the files in {{ic|/etc/xdg/autostart/}} if users have some DE installed.}}
 
{{Note|As mentioned previously, PulseAudio is very likely launched automatically via either {{ic|/etc/X11/xinit/xinitrc.d/pulseaudio}} or the files in {{ic|/etc/xdg/autostart/}} if users have some DE installed.}}
  
 
Check to see if PulseAudio is running:
 
Check to see if PulseAudio is running:
  
$ ps aux | grep pulse
+
{{hc|<nowiki>$ ps aux | grep pulse</nowiki>|
 
  facade  1794  0.0  0.0 360464  6532 ?        S<l  15:33  0:00 /usr/bin/pulseaudio --start
 
  facade  1794  0.0  0.0 360464  6532 ?        S<l  15:33  0:00 /usr/bin/pulseaudio --start
 
  facade  1827  0.0  0.0  68888  2608 ?        S    15:33  0:00 /usr/lib/pulse/gconf-helper
 
  facade  1827  0.0  0.0  68888  2608 ?        S    15:33  0:00 /usr/lib/pulse/gconf-helper
 +
}}
  
 
If Pulseaudio is not running and users are using X, the following will start PulseAudio with the needed the X11 plugins manually:
 
If Pulseaudio is not running and users are using X, the following will start PulseAudio with the needed the X11 plugins manually:
 
  $ start-pulseaudio-x11
 
  $ start-pulseaudio-x11
  
If you are not running Gnome, KDE or XFCE and your {{ic|~/.xinitrc}} does not source the scripts in {{ic|/etc/X11/xinit/xinitrc.d}} (such as is done in the example file {{ic|/etc/skel/.xinitrc}}) then you can launch PulseAudio on boot by adding the following line to ~/.xinitrc:
+
If you are not running Gnome, KDE or XFCE and your {{ic|~/.xinitrc}} does not source the scripts in {{ic|/etc/X11/xinit/xinitrc.d}} (such as is done in the example file {{ic|/etc/skel/.xinitrc}}) then you can launch PulseAudio on boot with:
/usr/bin/start-pulseaudio-x11
+
{{hc|~/.xinitrc|
 +
/usr/bin/start-pulseaudio-x11
 +
}}
 +
 
 +
=== GNOME ===
  
===GNOME===
 
 
As of GNOME 3, GNOME fully integrates with PulseAudio and no extra configuration is needed.
 
As of GNOME 3, GNOME fully integrates with PulseAudio and no extra configuration is needed.
  
===KDE 3===
+
=== KDE 3 ===
 +
 
 
PulseAudio is ''not'' a drop-in replacement for aRts. Users of KDE 3 cannot use PulseAudio. However note, recent versions of PulseAudio may have eliminated the prohibition:
 
PulseAudio is ''not'' a drop-in replacement for aRts. Users of KDE 3 cannot use PulseAudio. However note, recent versions of PulseAudio may have eliminated the prohibition:
  
See: http://www.pulseaudio.org/wiki/PerfectSetup KDE 3 uses the artsd sound server by default. However, artsd itself can be configured to use an Esound backend. Edit kcmartsrc (either in /etc/kde or /usr/share/config for global configuration or .kde/share/config to configure only one user) like this:
+
See: http://www.pulseaudio.org/wiki/PerfectSetup KDE 3 uses the artsd sound server by default. However, artsd itself can be configured to use an Esound backend. Edit {{ic|kcmartsrc}} (either in {{ic|/etc/kde}} or {{ic|/usr/share/config}} for global configuration or {{ic|.kde/share/config}} to configure only one user) like this:
  
 
  [Arts]
 
  [Arts]
Line 166: Line 179:
 
  SuspendTime=1
 
  SuspendTime=1
  
===KDE Plasma Workspaces and Qt4===
+
=== KDE Plasma Workspaces and Qt4 ===
 +
 
 
PulseAudio, it will be used by KDE/Qt4 applications. For more information see the [http://www.pulseaudio.org/wiki/KDE KDE page in the PulseAudio wiki].
 
PulseAudio, it will be used by KDE/Qt4 applications. For more information see the [http://www.pulseaudio.org/wiki/KDE KDE page in the PulseAudio wiki].
  
Line 177: Line 191:
 
Additionally, the {{AUR|kdeplasma-applets-veromix}} is available in the [[AUR]] as a KDE alternative to KMix or pavucontrol.
 
Additionally, the {{AUR|kdeplasma-applets-veromix}} is available in the [[AUR]] as a KDE alternative to KMix or pavucontrol.
  
===Xfce===
+
=== Xfce ===
 +
 
 
Applications running under Xfce can take advantage of PulseAudio. To manage PulseAudio settings you can use {{Pkg|pavucontrol}}.
 
Applications running under Xfce can take advantage of PulseAudio. To manage PulseAudio settings you can use {{Pkg|pavucontrol}}.
  
==Applications==
+
== Applications ==
===Audacious===
+
 
 +
=== Audacious ===
 +
 
 
[[Audacious]] natively supports PulseAudio. In order to use it, set Audacious Preferences -> Audio -> Current output plugin to 'PulseAudio Output Plugin'.
 
[[Audacious]] natively supports PulseAudio. In order to use it, set Audacious Preferences -> Audio -> Current output plugin to 'PulseAudio Output Plugin'.
  
===Java/OpenJDK 6===
+
=== Java/OpenJDK 6 ===
 +
 
 
Create a wrapper for the java executable using padsp as seen on the [[Java#Java_sound_with_Pulseaudio|Java sound with Pulseaudio]] page.
 
Create a wrapper for the java executable using padsp as seen on the [[Java#Java_sound_with_Pulseaudio|Java sound with Pulseaudio]] page.
  
===Music Player Daemon (MPD)===
+
=== Music Player Daemon (MPD) ===
[http://mpd.wikia.com/wiki/PulseAudio configure] [[MPD]] to use PulseAudio.
+
 
 +
[http://mpd.wikia.com/wiki/PulseAudio configure] [[MPD]] to use PulseAudio. See also [[MPD/Tips_and_Tricks#MPD_.26_PulseAudio]].
 +
 
 +
=== MPlayer ===
  
===MPlayer===
 
 
[[MPlayer]] natively supports PulseAudio output with the "{{ic|-ao pulse}}" option. It can also be configured to default to PulseAudio output, in {{ic|~/.mplayer/config}} for per-user, or {{ic|/etc/mplayer/mplayer.conf}} for system-wide:
 
[[MPlayer]] natively supports PulseAudio output with the "{{ic|-ao pulse}}" option. It can also be configured to default to PulseAudio output, in {{ic|~/.mplayer/config}} for per-user, or {{ic|/etc/mplayer/mplayer.conf}} for system-wide:
 
{{hc|/etc/mplayer/mplayer.conf|2=ao=pulse}}
 
{{hc|/etc/mplayer/mplayer.conf|2=ao=pulse}}
  
===Skype (x86_64 only)===
+
=== Skype (x86_64 only) ===
 +
 
 
Install {{Pkg|lib32-libpulse}}, otherwise the following error will occur when trying to initiate a call: "Problem with Audio Playback".
 
Install {{Pkg|lib32-libpulse}}, otherwise the following error will occur when trying to initiate a call: "Problem with Audio Playback".
  
==Troubleshooting==
+
== Troubleshooting ==
===No sound after install===
+
 
 +
=== No sound after install ===
 +
 
 +
==== Muted audio device ====
  
====Muted audio device====
+
If one experiences no audio output via any means while using ALSA, attempt to unmute the sound card.  To do this, launch {{ic|alsamixer}} and make sure each column has a green 00 under it (this can be toggled by pressing {{ic|m}}):
If one experiences no audio output via any means while using ALSA, attempt to unmute the sound card.  To do this, launch alsamixer and make sure each column has a green 00 under it (this can be toggled by pressing 'm')
+
 
  $ alsamixer -c 0
 
  $ alsamixer -c 0
  
====Bad configuration files====
+
==== Auto-Mute Mode ====
 +
 
 +
Auto-Mute Mode may be enabled. It can be disabled using {{ic|alsamixer}}.
 +
 
 +
See http://superuser.com/questions/431079/how-to-disable-auto-mute-mode for more.
 +
 
 +
==== Bad configuration files ====
 +
 
 
If after starting pulseaudio, the system outputs no sound, it may be necessary to delete the contents of {{ic|~/.pulse}}. Pulseaudio will automatically create new configuration files on its next start.
 
If after starting pulseaudio, the system outputs no sound, it may be necessary to delete the contents of {{ic|~/.pulse}}. Pulseaudio will automatically create new configuration files on its next start.
  
====Flash Content====
+
==== Flash content ====
 +
 
 
Since Adobe Flash does not directly support PulseAudio the recommended way is to [https://wiki.archlinux.org/index.php/PulseAudio#ALSA configure ALSA to use the virtual PulseAudio soundcard].
 
Since Adobe Flash does not directly support PulseAudio the recommended way is to [https://wiki.archlinux.org/index.php/PulseAudio#ALSA configure ALSA to use the virtual PulseAudio soundcard].
  
Line 213: Line 244:
 
{{Note|This may invariably crash the flash plugin.}}
 
{{Note|This may invariably crash the flash plugin.}}
  
====No cards====
+
==== No cards ====
 +
 
 
If PulseAudio starts, run {{ic|pacmd list}}. If no cards are reported, make sure that the ALSA devices are not in use:
 
If PulseAudio starts, run {{ic|pacmd list}}. If no cards are reported, make sure that the ALSA devices are not in use:
 
  $ fuser -v /dev/snd/*
 
  $ fuser -v /dev/snd/*
Line 220: Line 252:
 
Make sure any applications using the pcm or dsp files are shut down before restarting PulseAudio.
 
Make sure any applications using the pcm or dsp files are shut down before restarting PulseAudio.
  
====The only device shown is "dummy output"====
+
==== The only device shown is "dummy output" ====
This may be caused by different reasons, one of them being the .asoundrc file in $HOME is taking precedence over the systemwide /etc/asound.conf.
+
  
The user file is modified also by the tool '''asoundconf''' or by its graphical variant '''asoundconf-gtk''' (the latter is named "Default sound card" in the menu) as soon as it  runs. Prevent the effects of .asoundrc altogether by commenting the last line like this:
+
This may be caused by different reasons, one of them being the {{ic|.asoundrc}} file in $HOME is taking precedence over the systemwide {{ic|/etc/asound.conf}}.
  
  #</home/<yourusername>/.asoundrc.asoundconf>
+
The user file is modified also by the tool {{ic|asoundconf}} or by its graphical variant {{ic|asoundconf-gtk}} (the latter is named "Default sound card" in the menu) as soon as it runs.  Prevent the effects of {{ic|.asoundrc}} altogether by commenting the last line like this:
 +
{{hc|.asoundrc|
 +
# </home/''yourusername''/.asoundrc.asoundconf>
 +
}}
  
====KDE4====
+
Maybe some program is monopolizing the audio device:
It may be that another output device set as preferred in phonon. Make sure that every setting reflects the preferred output device at the top, and check the playback streams tab in kmix to make sure that applications are using the device for output.
+
{{hc|# fuser -v /dev/snd/*|
 +
                    USER      PID  ACCESS COMMAND
 +
/dev/snd/controlC0:  root        931 F....  timidity
 +
                    bob        1195 F....  panel-6-mixer
 +
/dev/snd/controlC1:  bob        1195 F....  panel-6-mixer
 +
                    bob        1215 F....  pulseaudio
 +
/dev/snd/pcmC0D0p:  root        931 F...m  timidity
 +
/dev/snd/seq:        root        931 F....  timidity
 +
/dev/snd/timer:      root        931 f....  timidity
 +
}}
  
====Failed to create sink input: sink is suspended====
+
That means timidity blocks pulseaudio from accessing the audio devices. Just killing timidity will make the sound work again.
If you do not have any output sound and receive dozens of errors related to a suspended sink in your '''journalctl -b''' log, then backup first and then delete your user-specific pulse folders:
+
 
 +
Another reason is [[FluidSynth]] conclicting with pulseaudio as discussed in [https://bbs.archlinux.org/viewtopic.php?id=154002 this thread]. The solution is to remove FluidSynth:
 +
 
 +
# pacman -Rnsc fluidsynth
 +
 
 +
==== KDE4 ====
 +
 
 +
It may be that another output device set as preferred in phonon. Make sure that every setting reflects the preferred output device at the top, and check the playback streams tab in {{ic|kmix}} to make sure that applications are using the device for output.
 +
 
 +
==== Failed to create sink input: sink is suspended ====
 +
 
 +
If you do not have any output sound and receive dozens of errors related to a suspended sink in your {{ic|journalctl -b}} log, then backup first and then delete your user-specific pulse folders:
  
 
  $ rm -r ~/.pulse ~/.pulse-cookie
 
  $ rm -r ~/.pulse ~/.pulse-cookie
  
===Bluetooth headset replay problems===
+
=== No HDMI sound output after some time with the monitor turned off ===
 +
 
 +
The monitor is connected via HDMI/DisplayPort, and the audio jack is plugged in the headphone jack of the monitor, but pulseaudio insists that it's unplugged:
 +
{{hc|pactl list sinks|
 +
...
 +
hdmi-output-0: HDMI / DisplayPort (priority: 5900, not available)
 +
...
 +
}}
 +
 
 +
This leads to no sound coming from HDMI output. A workaround for this is to switch to another TTY and back again. This problem has been reported by ATI/Nvidia/Intel users.
 +
 
 +
=== Can't update configuration of sound device in pavucontrol ===
 +
 
 +
{{Pkg|pavucontrol}} is a handy GUI utility for configuring pulseaudio. Under its 'Configuration' tab, you can select different profiles for each of your sound devices e.g. analogue stereo, digital output (IEC958), HDMI 5.1 Surround etc.
 +
 
 +
However, you may run into an instance where selecting a different profile for a card results in the pulse daemon crashing and auto restarting without the new selection "sticking". If this occurs, use the other useful GUI tool, {{Pkg|paprefs}}, to check under the "Simultaneous Output" tab for a virtual simultaneous device. If this setting is active (checked), it will prevent you changing any card's profile in pavucontrol. Uncheck this setting, then adjust your profile in pavucontrol prior to re-enabling simultaneous output in paprefs.
 +
 
 +
=== Simultaneous output to multiple sound cards / devices ===
 +
 
 +
Simultaneous output to two different devices can be very useful. For example, being able to send audio to your A/V receiver via your graphics card's HDMI output, while also sending the same audio through the analogue output of your motherboard's built-in audio. This is much less hassle than it used to be (in this example, we are using GNOME desktop).
 +
 
 +
Using {{Pkg|paprefs}}, simply select "Add virtual output device for simultaneous output on all local sound cards" from under the "Simultaneous Output" tab. Then, under GNOME's "sound settings", select the simultaneous output you have just created.
 +
 
 +
If this doesn't work, try adding the following to ~/.asoundrc:
 +
 
 +
pcm.dsp {
 +
    type plug
 +
    slave.pcm "dmix"
 +
}
 +
 
 +
=== Simultaneous output to multiple sinks on the same sound card not working===
 +
This can be useful for users who have multiple sound sources and want to play them on different sinks/outputs.
 +
An example use-case for this would be if you play music and also voice chat and want to output music to speakers (in this case Digital S/PDIF) and voice to headphones. (Analog)
 +
 
 +
This is sometimes auto detected by pulseaudio but not always. If you know that your soundcard can output to both Analog and S/PDIF at the same time and pulseaudio does not have this option in it's profiles in pavucontrol, or veromix then you probably need to create a configuration file for your soundcard.
 +
 
 +
 
 +
More in detail you need to create a profile-set for your specific soundcard.
 +
This is done in two steps mostly.
 +
*Create udev rule to make pulseaudio choose your pulseaudio configuration file specific to the soundcard.
 +
* Create the actual configuration.
 +
 
 +
 
 +
Create a pulseadio udev rule.
 +
{{Note| This is only an example for Asus Xonar Essence STX.
 +
Read [[udev]] to find out the correct values.}}
 +
{{Note| Your configuration file should have lower number than the original pulseaudio rule to take effect.}}
 +
{{hc|/usr/lib/udev/rules.d/90-pulseaudio-Xonar-STX.rules|
 +
ACTION&#61;&#61;"change", SUBSYSTEM&#61;&#61;"sound", KERNEL&#61;&#61;"card*", \
 +
ATTRS&#123;subsystem_vendor&#125;&#61;&#61;"0x1043", ATTRS&#123;subsystem_device&#125;&#61;&#61;"0x835c", ENV&#123;PULSE_PROFILE_SET&#125;&#61;"asus-xonar-essence-stx.conf"
 +
}}
 +
 
 +
 
 +
 
 +
Create now a configuration file. If you bother you can start from scratch and make if saucy. However you can also use the default configuration file rename it and then add your profile there that you know works. Less pretty but also faster.
 +
 
 +
To enable multiple sinks for Asus Xonar Essence STX you need only to add this in.
 +
{{Note| asus-xonar-essence-stx.conf also includes all code/mappings from default.conf.}}
 +
{{hc|/usr/share/pulseaudio/alsa-mixer/profile-sets/asus-xonar-essence-stx.conf|
 +
[Profile analog-stereo+iec958-stereo]
 +
description &#61; Analog Stereo Duplex + Digital Stereo Output
 +
input-mappings &#61; analog-stereo
 +
output-mappings &#61; analog-stereo iec958-stereo
 +
skip-probe &#61; yes
 +
}}
 +
 
 +
This will auto-profile your Asus Xonar Essence STX with default profiles and add your own profile so you can have multiple sinks.
 +
 
 +
You need to create another profile in the configuration file if you want to have the same functionality with AC3 Digital 5.1 output.
 +
 
 +
 
 +
[https://www.freedesktop.org/wiki/Software/PulseAudio/Backends/ALSA/Profiles/ See pulseaudio article about profiles]
 +
 
 +
=== Bluetooth headset replay problems ===
 +
 
 
Some user [https://bbs.archlinux.org/viewtopic.php?id=117420 report] huge delays or even no sound when the bluetooth connection does not send any data. This is due to an idle-suspend-module that puts the related sinks/sources automatically into suspend. As this can cause problems with headset, the responsible module can be deactivated.  
 
Some user [https://bbs.archlinux.org/viewtopic.php?id=117420 report] huge delays or even no sound when the bluetooth connection does not send any data. This is due to an idle-suspend-module that puts the related sinks/sources automatically into suspend. As this can cause problems with headset, the responsible module can be deactivated.  
  
  1. cp /etc/pulse/default.pa ~/.pulse/default.pa
+
  $ cp /etc/pulse/default.pa ~/.pulse/default.pa
2. comment out the "load-module module-suspend-on-idle" line in ~/.pulse/default.pa
+
 
  3. pulseaudio -k && pulseaudio --start
+
{{hc|~/.pulse/default.pa|
 +
; load-module module-suspend-on-idle
 +
}}
 +
 
 +
  $ pulseaudio -k && pulseaudio --start
  
 
[http://robert.orzanna.de/2011/08/prevent-idle-suspend-with-bluetooth.html More information]
 
[http://robert.orzanna.de/2011/08/prevent-idle-suspend-with-bluetooth.html More information]
  
===Automatically switch to Bluetooth or USB headset===
+
=== Automatically switch to Bluetooth or USB headset ===
Add the following to your /etc/pulse/default.pa:
+
 
 +
Add the following:
 +
{{hc|/etc/pulse/default.pa|
 +
# automatically switch to newly-connected devices
 +
load-module module-switch-on-connect
 +
}}
  
# automatically switch to newly-connected devices
+
=== Pulse overwrites ALSA settings ===
load-module module-switch-on-connect
+
  
===Pulse overwrites ALSA settings===
+
Pulseaudio usually overwrites the ALSA settings- for example set with alsamixer- at start up, even when the alsa daemon is loaded. Since there seems to be no other way to restrict this behaviour, a workaround is to restore the alsa settings again after pulseaudio had started. Add the following command to {{ic|.xinitrc}} or {{ic|.bash_profile}} or any other [[Autostarting|autostart]] file:
Pulseaudio usually overwrites the ALSA settings- for example set with alsamixer- at start up, even when the alsa daemon is loaded. Since there seems to be no other way to restrict this behaviour, a workaround is to restore the alsa settings again after pulseaudio had started. Add the following command to {{ic|.xinitrc}} {{ic|.bash_login}} or any other autostart file:
+
  
 
  restore_alsa() {
 
  restore_alsa() {
   while [ -z "`pidof pulseaudio`" ]; do
+
   while [ -z "$(pidof pulseaudio)" ]; do
 
   sleep 0.5
 
   sleep 0.5
 
   done
 
   done
Line 261: Line 396:
 
  restore_alsa &
 
  restore_alsa &
  
===Prevent Pulse from restarting after being killed===
+
=== Prevent Pulse from restarting after being killed ===
 +
 
 
Sometimes you may wish to temporarily disable Pulse. In order to do so you will have to prevent Pulse from restarting after being killed.
 
Sometimes you may wish to temporarily disable Pulse. In order to do so you will have to prevent Pulse from restarting after being killed.
  
 
  $ echo autospawn=no > ~/.pulse/client.conf
 
  $ echo autospawn=no > ~/.pulse/client.conf
  
===Daemon startup failed===
+
=== Daemon startup failed ===
Try resetting PulseAudio. To do that:
+
$ pulseaudio --kill
+
$ killall pulseaudio
+
$ killall -9 pulseaudio
+
$ rm -rf ~/.pulse*
+
$ rm -rf /tmp/pulse*
+
  
Afterwards, start PulseAudio again.
+
Try resetting PulseAudio:
 +
$ rm -rf /tmp/pulse* ~/.pulse*
 +
$ pulseaudio -k
 +
$ pulseaudio --start
  
===padevchooser===
+
If there is no server running but pulseaudio fails to start with an error message "User-configured server at ... refusing to start/autospawn", the issue may be with PulseAudio settings from a previous login. Check to see if there are any stale properties attached to the X11 root window with {{ic|pax11publish -d}}, and if there are, remove them with {{ic|pax11publish -r}} before trying to start the server. This manual cleanup is always required when using LXDM because it does not restart the X server on logout; see [[LXDM#PulseAudio]].
If one cannot launch the PulseAudio Device Chooser, first (re)start the Avahi daemon as follows:
+
 
$ rc.d restart avahi-daemon
+
==== inotify issue ====
 +
 
 +
If the previous fix doesn't work, run the following:
 +
$ pulseaudio -vvvv
 +
 
 +
If you see an error that looks like this:
 +
E: [pulseaudio] module-udev-detect.c: You apparently ran out of inotify watches, probably because Tracker/Beagle took them all away. I wished people would do their homework first and fix inotify before using it for watching whole directory trees which is something the current inotify is certainly not useful for. Please make sure to drop the Tracker/Beagle guys a line complaining about their broken use of inotify.
 +
 
 +
Then you have run out of inotify watches.
 +
 
 +
This can quickly be resolved by running:
 +
$ echo 100000 > /proc/sys/fs/inotify/max_user_watches
 +
 
 +
To have it permanently changed, add to {{ic|/etc/sysctl.conf}}
 +
 
 +
# Increase inotify max watchs per user
 +
fs.inotify.max_user_watches = 100000
 +
 
 +
=== padevchooser ===
 +
 
 +
If one cannot launch the PulseAudio Device Chooser, first restart the Avahi daemon ('''avahi-daemon''').
 +
 
 +
=== Glitches, skips or crackling ===
  
===Glitches, skips or crackling===
 
 
The newer implementation of PulseAudio sound server uses a timer-based audio scheduling instead of the traditional interrupt-driven approach.  
 
The newer implementation of PulseAudio sound server uses a timer-based audio scheduling instead of the traditional interrupt-driven approach.  
  
 
Timer-based scheduling may expose issues in some ALSA drivers. On the other hand, other drivers might be glitchy without it on, so check to see what works on your system.  
 
Timer-based scheduling may expose issues in some ALSA drivers. On the other hand, other drivers might be glitchy without it on, so check to see what works on your system.  
  
To turn timer-based scheduling off, replace the line:
+
To turn timer-based scheduling off add {{ic|1=tsched=0}} in {{ic|/etc/pulse/default.pa}}:
load-module module-udev-detect
+
{{hc|/etc/pulse/default.pa|<nowiki>
in {{ic|/etc/pulse/default.pa}} by:
+
load-module module-udev-detect tsched=0
load-module module-udev-detect tsched=0
+
</nowiki>}}
Then restart the PulseAudio server.
+
 
 +
Then restart the PulseAudio server:
 +
$ pulseaudio -k
 +
$ pulseaudio --start
  
 
Do the reverse to enable timer-based scheduling, if not already enabled by default.
 
Do the reverse to enable timer-based scheduling, if not already enabled by default.
Line 295: Line 452:
 
Please report any such cards to [http://pulseaudio.org/wiki/BrokenSoundDrivers PulseAudio Broken Sound Driver page]
 
Please report any such cards to [http://pulseaudio.org/wiki/BrokenSoundDrivers PulseAudio Broken Sound Driver page]
  
===Setting the default fragment number and buffer size in Pulseaudio===
+
=== Setting the default fragment number and buffer size in Pulseaudio ===
+
 
1. Finding out your audio device parameters
+
[http://forums.linuxmint.com/viewtopic.php?f=42&t=44862 More Information]
 +
 
 +
==== Finding out your audio device parameters (1/4) ====
  
Run the following Bash commands to find your sound card buffering settings:
+
To find your sound card buffering settings:
  echo autospawn = no >> ~/.pulse/client.conf
+
  $ echo autospawn = no >> ~/.pulse/client.conf
  killall pulseaudio
+
  $ pulseaudio -k
  LANG=C timeout --foreground -k 10 -s kill 10 pulseaudio -vvvv 2>&1 | grep device.buffering -B 10
+
  $ LANG=C timeout --foreground -k 10 -s kill 10 pulseaudio -vvvv 2>&1 | grep device.buffering -B 10
  sed -i '$d' ~/.pulse/client.conf
+
  $ sed -i '$d' ~/.pulse/client.conf
  
 
For each sound card detected by Pulseaudio, you will see output similar to this:
 
For each sound card detected by Pulseaudio, you will see output similar to this:
Line 321: Line 480:
 
Take note the buffer_size and fragment_size values for the relevant sound card.
 
Take note the buffer_size and fragment_size values for the relevant sound card.
  
2. Calculate your fragment size in msecs and number of fragments
+
==== Calculate your fragment size in msecs and number of fragments (2/4) ====
  
Pulseaudio's default sampling rate and bit depth are set to 44100Hz @ 16 bits.
+
Pulseaudio's default sampling rate and bit depth are set to {{ic|44100Hz}} @ {{ic|16 bits}}.
  
With this configuration, the bit rate we need is 44100*16 = 705600 bits per second. That's 1411200 bps for stereo.
+
With this configuration, the bit rate we need is {{ic|44100}}*{{ic|16}} = {{ic|705600 bits per second. That's {{ic|1411200 bps}} for stereo.
  
 
Let's take a look at the parameters we've found in the previous step:
 
Let's take a look at the parameters we've found in the previous step:
Line 332: Line 491:
 
  device.buffering.fragment_size = "384000" => 384000/1411200 = 0.272108843537s = 272 msecs
 
  device.buffering.fragment_size = "384000" => 384000/1411200 = 0.272108843537s = 272 msecs
  
3.Modify Pulseaudio's configuration file
+
==== Modify Pulseaudio's configuration file (3/4) ====
 
+
Edit the configuration file located at {{ic|/etc/pulse/daemon.conf}} using the editor of your choice.
+
 
+
For example:
+
sudo vi /etc/pulse/daemon.conf
+
 
+
Locate & uncomment (remove leading semicolons) these lines:
+
 
+
; default-fragments = X
+
; default-fragment-size-msec = Y
+
  
 +
{{hc|/etc/pulse/daemon.conf|<nowiki>
 +
; default-fragments = X
 +
; default-fragment-size-msec = Y
 +
</nowiki>}}
  
 
In the previous step, we calculated the fragment size parameter.
 
In the previous step, we calculated the fragment size parameter.
The number of fragments is simply buffer_size/fragment_size, which in this case (544/272) is 2.
+
The number of fragments is simply buffer_size/fragment_size, which in this case ({{ic|544/272}}) is {{ic|2}}:
  
Edit the lines to use your calculated settings:
+
{{hc|/etc/pulse/daemon.conf|<nowiki>
 +
; default-fragments = '''272'''
 +
; default-fragment-size-msec = '''2'''
 +
</nowiki>}}
  
default-fragment-size-msec = 272
+
==== Restart the Pulseaudio daemon (4/4) ====
default-fragments = 2
+
  
Save the file.
+
$ pulseaudio -k
 +
$ pulseaudio --start
  
 +
For more information, see: [http://forums.linuxmint.com/viewtopic.php?f=42&t=44862 Linux Mint topic]
  
4.Restart the Pulseaudio daemon
+
=== Laggy sound ===
  
pulseaudio -k
 
pulseaudio --start
 
 
Source: [http://forums.linuxmint.com/viewtopic.php?f=42&t=44862 kwevej @ Linux Mint Forums]
 
 
===Laggy sound===
 
 
This issue is due to incorrect buffer sizes.
 
This issue is due to incorrect buffer sizes.
Edit {{ic|/etc/pulse/daemon.conf}}
 
  
Either disable any modifications (if any) to these entries, or, if issue still exists, uncomment and change them in the following way:
+
Either disable any modifications (if any) to these entries, or, if issue still exists, uncomment:
default-fragments = 8
+
{{hc|/etc/pulse/daemon.conf|<nowiki>
default-fragment-size-msec = 5
+
default-fragments = 8
 +
default-fragment-size-msec = 5
 +
</nowiki>}}
  
===Choppy, overdriven sound===
+
=== Choppy, overdriven sound ===
Choppy sound in pulsaudio can result from wrong settings for the sample rate in {{Ic|/etc/pulse/daemon.conf}}. Try changing the line
+
 
; default-sample-rate = 44100
+
Choppy sound in pulsaudio can result from wrong settings for the sample rate. Try:
to
+
{{hc|/etc/pulse/daemon.conf|<nowiki>
default-sample-rate = 48000
+
default-sample-rate = 48000
 +
</nowiki>}}
 
and restart the PulseAudio server.
 
and restart the PulseAudio server.
  
If one experiences choppy sound in applications using openAL, change the sample rate in /etc/openal/alsoft.conf:
+
If one experiences choppy sound in applications using openAL, change the sample rate in {{ic|/etc/openal/alsoft.conf}}:
 
  frequency = 48000
 
  frequency = 48000
  
 
Setting the PCM volume above 0dB can cause clipping of the audio signal.  Running {{ic|alsamixer -c0}} will allow you to see if this is the problem and if so fix it.
 
Setting the PCM volume above 0dB can cause clipping of the audio signal.  Running {{ic|alsamixer -c0}} will allow you to see if this is the problem and if so fix it.
  
===Volume adjustment does not work properly===
+
=== Volume adjustment does not work properly ===
 +
 
 
Check:
 
Check:
 
{{ic|/usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common}}
 
{{ic|/usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common}}
Line 389: Line 543:
 
If the volume does not appear to increment/decrement properly using {{ic|alsamixer}} or {{ic|amixer}}, it may be due to pulseaudio having a larger number of increments (65537 to be exact). Try using larger values when changing volume (e.g. {{ic|amixer set Master 655+}}).
 
If the volume does not appear to increment/decrement properly using {{ic|alsamixer}} or {{ic|amixer}}, it may be due to pulseaudio having a larger number of increments (65537 to be exact). Try using larger values when changing volume (e.g. {{ic|amixer set Master 655+}}).
  
===Volume gets louder every time a new application is started===
+
=== Volume gets louder every time a new application is started ===
 +
 
 
Per default, it seems as if changing the volume in an application sets the global system volume to that level instead of only affecting the respective application. Applications setting their volume on startup will therefore cause the system volume to "jump".
 
Per default, it seems as if changing the volume in an application sets the global system volume to that level instead of only affecting the respective application. Applications setting their volume on startup will therefore cause the system volume to "jump".
  
Fix this by uncommenting the line
+
Fix this by:
flat-volumes = yes
+
{{hc|/etc/pulse/daemon.conf|<nowiki>
and changing it to:
+
flat-volumes = no
flat-volumes = no
+
</nowiki>}}
in
+
/etc/pulse/daemon.conf
+
 
and then restarting PulseAudio by executing
 
and then restarting PulseAudio by executing
  pulseaudio --kill && pulseaudio --start
+
  $ pulseaudio -k && pulseaudio --start
  
 
When Pulse comes back after a few seconds, applications will not alter the global system volume anymore but have their own volume level again.
 
When Pulse comes back after a few seconds, applications will not alter the global system volume anymore but have their own volume level again.
  
{{Note|A previously installed and removed pulseaudio-equalizer may leave behind remnants of the setup in {{Ic|$HOME/.pulse/default.pa}} which can also cause maximized volume trouble. Comment that out as needed.}}
+
{{Note|A previously installed and removed pulseaudio-equalizer may leave behind remnants of the setup in {{ic|~/.pulse/default.pa}} which can also cause maximized volume trouble. Comment that out as needed.}}
  
===No mic on ThinkPad T400/T500/T420===
+
=== No mic on ThinkPad T400/T500/T420 ===
Run
+
 
 +
Run:
 
  alsamixer -c 0
 
  alsamixer -c 0
 
Maximize the volume of/unmute the "Internal Mic".
 
Maximize the volume of/unmute the "Internal Mic".
  
Once you see the device with
+
Once you see the device with:
 
  arecord -l
 
  arecord -l
 
you might still need to adjust the settings. The microphone and the audio jack are duplexed. Set the configuration of the internal audio in pavucontrol to ''Analog Stereo Duplex''.
 
you might still need to adjust the settings. The microphone and the audio jack are duplexed. Set the configuration of the internal audio in pavucontrol to ''Analog Stereo Duplex''.
  
===No mic input on Acer Aspire One===
+
=== No mic input on Acer Aspire One ===
 +
 
 
Install pavucontrol, unlink the microphone channels and turn down the left one to 0.
 
Install pavucontrol, unlink the microphone channels and turn down the left one to 0.
 
Reference: http://getsatisfaction.com/jolicloud/topics/deaf_internal_mic_on_acer_aspire_one#reply_2108048
 
Reference: http://getsatisfaction.com/jolicloud/topics/deaf_internal_mic_on_acer_aspire_one#reply_2108048
  
===Sound output is only mono on M-Audio Audiophile 2496 sound card===
+
=== Sound output is only mono on M-Audio Audiophile 2496 sound card ===
Add the following to /etc/pulseaudio/default.pa:
+
load-module module-alsa-sink sink_name=delta_out device=hw:M2496 format=s24le channels=10 channel_map=left,right,aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7
+
load-module module-alsa-source source_name=delta_in device=hw:M2496 format=s24le channels=12 channel_map=left,right,aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7,aux8,aux9
+
set-default-sink delta_out
+
set-default-source delta_in
+
  
===Static Noise in Microphone Recording===
+
Add the following:
If we are getting static noise in skype, gnome-sound-recorder, arecord, etc.'s recordings then the sound card samplerate is incorrect. That is why there is static noise in linux microphone recordings. To fix this We need to set sample-rate in /etc/pulse/daemon.conf for the sound hardware.
+
{{hc|/etc/pulseaudio/default.pa|<nowiki>
 +
load-module module-alsa-sink sink_name=delta_out device=hw:M2496 format=s24le channels=10 channel_map=left,right,aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7
 +
load-module module-alsa-source source_name=delta_in device=hw:M2496 format=s24le channels=12 channel_map=left,right,aux0,aux1,aux2,aux3,aux4,aux5,aux6,aux7,aux8,aux9
 +
set-default-sink delta_out
 +
set-default-source delta_in
 +
</nowiki>}}
  
====1. Determine soundcards in the system====
+
=== Static noise in microphone recording ===
This requires alsa-utils and related packages to be installed:
+
$  arecord --list-devices
+
  
output:
+
If we are getting static noise in skype, gnome-sound-recorder, arecord, etc.'s recordings then the sound card samplerate is incorrect. That is why there is static noise in linux microphone recordings. To fix this We need to set sample-rate in {{ic|/etc/pulse/daemon.conf}} for the sound hardware.
    **** List of CAPTURE Hardware Devices ****
+
    card 0: Intel [HDA Intel], device 0: ALC888 Analog [ALC888 Analog]
+
      Subdevices: 1/1
+
      Subdevice #0: subdevice #0
+
    card 0: Intel [HDA Intel], device 2: ALC888 Analog [ALC888 Analog]
+
      Subdevices: 1/1
+
      Subdevice #0: subdevice #0
+
  
soundcard is hw:0,0
+
==== Determine soundcards in the system (1/5) ====
  
====2. Determine sampling-rate of the sound card====
+
This requires alsa-utils and related packages to be installed:
  arecord -f dat -r 60000 -D hw:0,0 -d 5 test.wav
+
{{hc|$ arecord --list-devices|
 +
**** List of CAPTURE Hardware Devices ****
 +
card 0: Intel [HDA Intel], device 0: ALC888 Analog [ALC888 Analog]
 +
  Subdevices: 1/1
 +
  Subdevice #0: subdevice #0
 +
card 0: Intel [HDA Intel], device 2: ALC888 Analog [ALC888 Analog]
 +
  Subdevices: 1/1
 +
  Subdevice #0: subdevice #0
 +
}}
  
output:
+
Sound card is {{ic|hw:0,0}}.
  "Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 60000 Hz, Stereo
+
  Warning: rate is not accurate (requested = 60000Hz, '''got = 96000Hz''')
+
  please, try the plug plugin
+
  
observe, the '''got = 96000Hz''', this is the max sample-rate of our card.
+
==== Determine sampling-rate of the sound card (2/5) ====
 +
{{hc|arecord -f dat -r 60000 -D hw:0,0 -d 5 test.wav|
 +
"Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 60000 Hz, Stereo
 +
Warning: rate is not accurate (requested = 60000Hz, '''got = 96000Hz''')
 +
please, try the plug plugin
 +
}}
  
====3. Setting the soundcard's sampling rate into pulse audio configuration====
+
observe, the {{ic|got = 96000Hz}}. This is the max sample-rate of our card.
the default sample-rate in pulseaudio is
+
grep "sample-rate" /etc/pulse/daemon.conf
+
  
output:
+
==== Setting the soundcard's sampling rate into pulse audio configuration (3/5) ====
    ; default-sample-rate = 44100
+
  
It is 44100 and is disabled. Let us set our sound card's settings into pulseaudio configuation file
+
The default sample-rate in pulseaudio:
su -c "sed 's/; default-sample-rate = 44100/default-sample-rate = 96000/g' -i /etc/pulse/daemon.conf"
+
{{hc|$ grep "default-sample-rate" /etc/pulse/daemon.conf|
 +
; default-sample-rate = 44100
 +
}}
  
Let us verify the changes to deamon.conf
+
{ic|44100}} is disabled and needs to be changed to {{ic|96000}}:
  grep "sample-rate" /etc/pulse/daemon.conf  
+
  # sed 's/; default-sample-rate = 44100/default-sample-rate = 96000/g' -i /etc/pulse/daemon.conf
output:
+
 
  default-sample-rate = 96000
+
==== Restart pulseaudio to apply the new settings (4/5) ====
and it is done.
+
 
 +
$ pulseaudio -k
 +
$ pulseaudio --start
  
====4. Restart pulseaudio to apply the new settings====
+
==== Finally check by recording and playing it back (5/5) ====
pulseaudio --kill
+
pulseaudio --start
+
  
====5. Finally check by recording and playing it back====
 
 
Let us record some voice using mic for say 10 seconds. Make sure the mic is not muted and all
 
Let us record some voice using mic for say 10 seconds. Make sure the mic is not muted and all
  arecord -f cd -d 10 test-mic.wav
+
  $ arecord -f cd -d 10 test-mic.wav
  
 
After 10 seconds, let us play the recording...
 
After 10 seconds, let us play the recording...
  aplay test-mic.wav
+
  $ aplay test-mic.wav
  
 
Now hopefully, there is no static noise in microphone recording anymore.
 
Now hopefully, there is no static noise in microphone recording anymore.
  
 
=== My Bluetooth device is paired but does not play any sound ===
 
=== My Bluetooth device is paired but does not play any sound ===
 +
 
[[Bluetooth#My_device_is_paired_but_no_sound_is_played_from_it|See the article in Bluetooth section]]
 
[[Bluetooth#My_device_is_paired_but_no_sound_is_played_from_it|See the article in Bluetooth section]]
  
Starting from PulseAudio 2.99 and bluez 4.101 you should '''avoid''' using Socket interface. Do NOT add
+
Starting from PulseAudio 2.99 and bluez 4.101 you should '''avoid''' using Socket interface. Do NOT use:
[General]
+
{{hc|/etc/bluetooth/audio.conf|<nowiki>
Enable=Socket
+
[General]
to your /etc/bluetooth/audio.conf.
+
Enable=Socket
If you face problems with A2DP and PA 2.99 make sure you have SBC library:
+
</nowiki>}}
pacman -S sbc
+
If you face problems with A2DP and PA 2.99 make sure you have {{Pkg|sbc}} library.
  
 
=== Subwoofer stops working after end of every song  ===
 
=== Subwoofer stops working after end of every song  ===
 +
 
Known issue: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/494099
 
Known issue: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/494099
  
Line 501: Line 657:
  
 
=== Pulseaudio uses wrong microphone ===
 
=== Pulseaudio uses wrong microphone ===
If Pulseaudio uses the wrong microphone, and changing the Input Device with Pavucontrol did not help, take a look at alsamixer. It seems that Pavucontrol does not always set the input source correctly.<br>
+
 
Run:
+
If Pulseaudio uses the wrong microphone, and changing the Input Device with Pavucontrol did not help, take a look at alsamixer. It seems that Pavucontrol does not always set the input source correctly.
  
 
  $ alsamixer
 
  $ alsamixer
  
press F6 and choose your sound card, e.g. HDA Intel. Now press F5 to display all items. Try to find the item: {{ic|Input Source}}. With the up/down arrow keys you are able to change the input source. <br>
+
Press {{ic|F6}} and choose your sound card, e.g. HDA Intel. Now press {{ic|F5}} to display all items. Try to find the item: {{ic|Input Source}}. With the up/down arrow keys you are able to change the input source.
 +
 
 
Now try if the correct microphone is used for recording.
 
Now try if the correct microphone is used for recording.
  
Line 517: Line 674:
  
 
=== No sound below a volume cutoff ===
 
=== No sound below a volume cutoff ===
 +
 
Known issue (won't fix): https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/223133
 
Known issue (won't fix): https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/223133
  
If sound doesn't play when Pulseaudio's volume is set below a certain level, try editing {{ic|/etc/pulse/default.pa}} and changing:
+
If sound doesn't play when Pulseaudio's volume is set below a certain level, try {{ic|1=ignore_dB=1}} in {{ic|/etc/pulse/default.pa}}:
 
{{hc|/etc/pulse/default.pa|<nowiki>
 
{{hc|/etc/pulse/default.pa|<nowiki>
load-module module-udev-detect
+
load-module module-udev-detect ignore_dB=1
 
</nowiki>}}
 
</nowiki>}}
to
+
 
 +
However, be aware that it may cause another bug preventing pulseaudio to unmute speakers when headphones or other audio devices are unplugged.
 +
 
 +
=== Low volume for internal mic ===
 +
 
 +
If you experience low volume on internal notebook microphone, try setting:
 
{{hc|/etc/pulse/default.pa|<nowiki>
 
{{hc|/etc/pulse/default.pa|<nowiki>
load-module module-udev-detect ignore_dB=1
+
set-source-volume 1 300000
 
</nowiki>}}
 
</nowiki>}}
  
==External links==
+
=== Clients alter master output volume (aka volume jumps to 100% after running application) ===
*[http://www.pulseaudio.org/wiki/PerfectSetup http://www.pulseaudio.org/wiki/PerfectSetup] - A good guide to make your configuration perfect
+
 
*[http://www.alsa-project.org/main/index.php/Asoundrc http://www.alsa-project.org/main/index.php/Asoundrc] - Alsa wiki on .asoundrc
+
If changing volume in specific applications changes also master output volume you can try to diasble flat volumes. Set:
*[http://www.pulseaudio.org/ http://www.pulseaudio.org/] - PulseAudio official site
+
{{hc|/etc/pulse/daemon.conf|<nowiki>
*[http://www.pulseaudio.org/wiki/FAQ http://www.pulseaudio.org/wiki/FAQ] - PulseAudio FAQ
+
flat-volumes = no
 +
</nowiki>}}
 +
Then restart Pulseaudio daemon:
 +
# pulseaudio -k
 +
# pulseaudio --start
 +
 
 +
===Realtime scheduling===
 +
If rtkit doesn't work, you can manually set up your system to run PulseAudio with realtime scheduling, which can help performance. To do this, add the following lines to {{ic|/etc/security/limits.conf}}:
 +
@pulse-rt - rtprio 9
 +
@pulse-rt - nice -11
 +
 
 +
Afterwards, you need to add your user to the {{ic|pulse-rt}} group:
 +
# gpasswd -a <user> pulse-rt
 +
 
 +
== See also ==
 +
 
 +
* [http://www.pulseaudio.org/wiki/PerfectSetup http://www.pulseaudio.org/wiki/PerfectSetup] - A good guide to make your configuration perfect
 +
* [http://www.alsa-project.org/main/index.php/Asoundrc http://www.alsa-project.org/main/index.php/Asoundrc] - Alsa wiki on .asoundrc
 +
* [http://www.pulseaudio.org/ http://www.pulseaudio.org/] - PulseAudio official site
 +
* [http://www.pulseaudio.org/wiki/FAQ http://www.pulseaudio.org/wiki/FAQ] - PulseAudio FAQ

Revision as of 00:39, 3 September 2013

PulseAudio is the default sound server that serves as a proxy to sound applications using existing kernel sound components like ALSA or OSS. Since ALSA is included in Arch Linux by default so the most common deployment scenarios include PulseAudio with ALSA.

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary end

Contents

Installation

Running

Warning: If you have per-user copies of configuration files (such as client.conf, daemon.conf or default.pa) in ~/.pulse/, make sure you keep them in sync with changes to the packaged files in /etc/pulse/. Otherwise, PulseAudio may refuse to start due to configuration errors.
Note:
  • Pulseaudio requires D-Bus to function.
  • Most X11 environments start pulseaudio automatically with the X11 session.

In the unlikely event that pulseaudio is not automatically called upon entering X, it can can be started with:

$ pulseaudio --start

PulseAudio can be stopped with:

$ pulseaudio -k

Equalizer

Newer pulseaudio versions have an intergrated 10-band equalizer system. In order to use the equalizer do the following:

Load equalizer sink module

$ pactl load-module module-equalizer-sink

Install and run the gui frontend

Install python2-pyqt and execute:

$ qpaeq
Note: If qpaeq has no effect, install pavucontrol and change "ALSA Playback on" to "FFT based equalizer on ..." while the media player is running.

Load equalizer module on every boot

Edit the file /etc/pulse/default.pa with your favorite editor and append the following lines:

### Load the integrated pulseaudio equalizer module
load-module module-equalizer-sink

Backend Configuration

ALSA

Note: Optional packages are needed only if running x86_64 and wanting to have sound for 32 bit programs (like Wine).

For the applications that do not support PulseAudio and support ALSA it is recommended to install the PulseAudio plugin for ALSA. This package also contains the necessary /etc/asound.conf for configuring ALSA to use PulseAudio.

To prevent applications from using ALSA's OSS emulation and bypassing Pulseaudio (thereby preventing other applications from playing sound), make sure the module snd_pcm_oss is not being loaded at boot. If it is currently loaded (lsmod|grep oss), disable it by executing:

# rmmod snd_pcm_oss

ALSA/dmix without grabbing hardware device

Note: This section describes alternative configuration, which is generally not recommended.

You may want to use ALSA directly in most of your applications and to be able to use other applications, which constantly require PulseAudio at the same time. The following steps allow you to make PulseAudio use dmix instead of grabbing ALSA hardware device.

  • Remove package pulseaudio-alsa, which provides compatibility layer between ALSA applications and PulseAudio. After this your ALSA apps will use ALSA directly without being hooked by Pulse.
  • Edit /etc/pulse/default.pa.
Find and uncomment lines which load backend drivers. Add device parameters as follows. Then find and comment lines which load autodetect modules.
load-module module-alsa-sink device=dmix
load-module module-alsa-source device=dsnoop
# load-module module-udev-detect
# load-module module-detect
  • Optional: If you use kdemultimedia-kmix you may want to control ALSA volume instead of PulseAudio volume:
$ echo export KMIX_PULSEAUDIO_DISABLE=1 > ~/.kde4/env/kmix_disable_pulse.sh
$ chmod +x ~/.kde4/env/kmix_disable_pulse.sh
  • Now, reboot your computer and try running alsa and pulseaudio applications at the same time. They both should produce sound simultaneously.
Use pavucontrol to control PulseAudio volume if needed.


OSS

There are multiple ways of making OSS-only programs play to PulseAudio:

ossp

Install ossp package and start ossp service.

padsp wrapper (part of PulseAudio)

Programs using OSS can work with PulseAudio by starting it with padsp:

$ padsp OSSprogram

A few examples:

$ padsp aumix
$ padsp sox foo.wav -t ossdsp /dev/dsp

You can also add a custom wrapper script like this:

/usr/local/bin/OSSProgram
#!/bin/sh
exec padsp /usr/bin/OSSprogram "$@"

Make sure /usr/local/bin comes before /usr/bin in your PATH.

GStreamer

To make GStreamer use PulseAudio, you need to install gst-plugins-good or gstreamer0.10-good-plugins.

OpenAL

OpenAL Soft should use PulseAudio by default, but can be explicitly configured to do so:
/etc/openal/alsoft.conf
drivers=pulse,alsa

libao

Edit the libao configuration file:

# /etc/libao.conf
default_driver=pulse

Be sure to remove the dev=default option of the alsa driver or adjust it to specify a specific Pulse sink name or number.

Note: You could possibly also keep the libao standard of outputting to the alsa driver and its default device if you install pulseaudio-alsa since the ALSA default device then is PulseAudio.

ESD

PulseAudio is a drop-in replacement for the enlightened sound daemon (ESD). While PulseAudio is running, ESD clients should be able to output to it without configuration.

Desktop environments

General X11

Note: As mentioned previously, PulseAudio is very likely launched automatically via either /etc/X11/xinit/xinitrc.d/pulseaudio or the files in /etc/xdg/autostart/ if users have some DE installed.

Check to see if PulseAudio is running:

$ ps aux | grep pulse
 facade   1794  0.0  0.0 360464  6532 ?        S<l  15:33   0:00 /usr/bin/pulseaudio --start
 facade   1827  0.0  0.0  68888  2608 ?        S    15:33   0:00 /usr/lib/pulse/gconf-helper

If Pulseaudio is not running and users are using X, the following will start PulseAudio with the needed the X11 plugins manually:

$ start-pulseaudio-x11

If you are not running Gnome, KDE or XFCE and your ~/.xinitrc does not source the scripts in /etc/X11/xinit/xinitrc.d (such as is done in the example file /etc/skel/.xinitrc) then you can launch PulseAudio on boot with:

~/.xinitrc
/usr/bin/start-pulseaudio-x11

GNOME

As of GNOME 3, GNOME fully integrates with PulseAudio and no extra configuration is needed.

KDE 3

PulseAudio is not a drop-in replacement for aRts. Users of KDE 3 cannot use PulseAudio. However note, recent versions of PulseAudio may have eliminated the prohibition:

See: http://www.pulseaudio.org/wiki/PerfectSetup KDE 3 uses the artsd sound server by default. However, artsd itself can be configured to use an Esound backend. Edit kcmartsrc (either in /etc/kde or /usr/share/config for global configuration or .kde/share/config to configure only one user) like this:

[Arts]
Arguments=\s-F 10 -S 4096 -a esd -n -s 1 -m artsmessage -c drkonqi -l 3 -f
NetworkTransparent=true
SuspendTime=1

KDE Plasma Workspaces and Qt4

PulseAudio, it will be used by KDE/Qt4 applications. For more information see the KDE page in the PulseAudio wiki.

PulseAudio support has been merged into KMix, the default KDE sound mixer.

If the phonon-gstreamer backend is used for Phonon, GStreamer should also be configured to use PulseAudio by installing gstreamer0.10-good-plugins.

One useful tidbit from that page is to add load-module module-device-manager to /etc/pulse/default.pa.

Additionally, the kdeplasma-applets-veromixAUR is available in the AUR as a KDE alternative to KMix or pavucontrol.

Xfce

Applications running under Xfce can take advantage of PulseAudio. To manage PulseAudio settings you can use pavucontrol.

Applications

Audacious

Audacious natively supports PulseAudio. In order to use it, set Audacious Preferences -> Audio -> Current output plugin to 'PulseAudio Output Plugin'.

Java/OpenJDK 6

Create a wrapper for the java executable using padsp as seen on the Java sound with Pulseaudio page.

Music Player Daemon (MPD)

configure MPD to use PulseAudio. See also MPD/Tips_and_Tricks#MPD_.26_PulseAudio.

MPlayer

MPlayer natively supports PulseAudio output with the "-ao pulse" option. It can also be configured to default to PulseAudio output, in ~/.mplayer/config for per-user, or /etc/mplayer/mplayer.conf for system-wide:

/etc/mplayer/mplayer.conf
ao=pulse

Skype (x86_64 only)

Install lib32-libpulse, otherwise the following error will occur when trying to initiate a call: "Problem with Audio Playback".

Troubleshooting

No sound after install

Muted audio device

If one experiences no audio output via any means while using ALSA, attempt to unmute the sound card. To do this, launch alsamixer and make sure each column has a green 00 under it (this can be toggled by pressing m):

$ alsamixer -c 0

Auto-Mute Mode

Auto-Mute Mode may be enabled. It can be disabled using alsamixer.

See http://superuser.com/questions/431079/how-to-disable-auto-mute-mode for more.

Bad configuration files

If after starting pulseaudio, the system outputs no sound, it may be necessary to delete the contents of ~/.pulse. Pulseaudio will automatically create new configuration files on its next start.

Flash content

Since Adobe Flash does not directly support PulseAudio the recommended way is to configure ALSA to use the virtual PulseAudio soundcard.

Alternatively you may try out libflashsupport-pulseAUR from the AUR.

Note: This may invariably crash the flash plugin.

No cards

If PulseAudio starts, run pacmd list. If no cards are reported, make sure that the ALSA devices are not in use:

$ fuser -v /dev/snd/*
$ fuser -v /dev/dsp

Make sure any applications using the pcm or dsp files are shut down before restarting PulseAudio.

The only device shown is "dummy output"

This may be caused by different reasons, one of them being the .asoundrc file in $HOME is taking precedence over the systemwide /etc/asound.conf.

The user file is modified also by the tool asoundconf or by its graphical variant asoundconf-gtk (the latter is named "Default sound card" in the menu) as soon as it runs. Prevent the effects of .asoundrc altogether by commenting the last line like this:

.asoundrc
# </home/yourusername/.asoundrc.asoundconf>

Maybe some program is monopolizing the audio device:

# fuser -v /dev/snd/*
                     USER       PID  ACCESS COMMAND
/dev/snd/controlC0:  root        931 F....  timidity
                     bob        1195 F....  panel-6-mixer
/dev/snd/controlC1:  bob        1195 F....  panel-6-mixer
                     bob        1215 F....  pulseaudio
/dev/snd/pcmC0D0p:   root        931 F...m  timidity
/dev/snd/seq:        root        931 F....  timidity
/dev/snd/timer:      root        931 f....  timidity

That means timidity blocks pulseaudio from accessing the audio devices. Just killing timidity will make the sound work again.

Another reason is FluidSynth conclicting with pulseaudio as discussed in this thread. The solution is to remove FluidSynth:

# pacman -Rnsc fluidsynth

KDE4

It may be that another output device set as preferred in phonon. Make sure that every setting reflects the preferred output device at the top, and check the playback streams tab in kmix to make sure that applications are using the device for output.

Failed to create sink input: sink is suspended

If you do not have any output sound and receive dozens of errors related to a suspended sink in your journalctl -b log, then backup first and then delete your user-specific pulse folders:

$ rm -r ~/.pulse ~/.pulse-cookie

No HDMI sound output after some time with the monitor turned off

The monitor is connected via HDMI/DisplayPort, and the audio jack is plugged in the headphone jack of the monitor, but pulseaudio insists that it's unplugged:

pactl list sinks
...
hdmi-output-0: HDMI / DisplayPort (priority: 5900, not available)
...

This leads to no sound coming from HDMI output. A workaround for this is to switch to another TTY and back again. This problem has been reported by ATI/Nvidia/Intel users.

Can't update configuration of sound device in pavucontrol

pavucontrol is a handy GUI utility for configuring pulseaudio. Under its 'Configuration' tab, you can select different profiles for each of your sound devices e.g. analogue stereo, digital output (IEC958), HDMI 5.1 Surround etc.

However, you may run into an instance where selecting a different profile for a card results in the pulse daemon crashing and auto restarting without the new selection "sticking". If this occurs, use the other useful GUI tool, paprefs, to check under the "Simultaneous Output" tab for a virtual simultaneous device. If this setting is active (checked), it will prevent you changing any card's profile in pavucontrol. Uncheck this setting, then adjust your profile in pavucontrol prior to re-enabling simultaneous output in paprefs.

Simultaneous output to multiple sound cards / devices

Simultaneous output to two different devices can be very useful. For example, being able to send audio to your A/V receiver via your graphics card's HDMI output, while also sending the same audio through the analogue output of your motherboard's built-in audio. This is much less hassle than it used to be (in this example, we are using GNOME desktop).

Using paprefs, simply select "Add virtual output device for simultaneous output on all local sound cards" from under the "Simultaneous Output" tab. Then, under GNOME's "sound settings", select the simultaneous output you have just created.

If this doesn't work, try adding the following to ~/.asoundrc:

pcm.dsp {
   type plug
   slave.pcm "dmix"
}

Simultaneous output to multiple sinks on the same sound card not working

This can be useful for users who have multiple sound sources and want to play them on different sinks/outputs. An example use-case for this would be if you play music and also voice chat and want to output music to speakers (in this case Digital S/PDIF) and voice to headphones. (Analog)

This is sometimes auto detected by pulseaudio but not always. If you know that your soundcard can output to both Analog and S/PDIF at the same time and pulseaudio does not have this option in it's profiles in pavucontrol, or veromix then you probably need to create a configuration file for your soundcard.


More in detail you need to create a profile-set for your specific soundcard. This is done in two steps mostly.

  • Create udev rule to make pulseaudio choose your pulseaudio configuration file specific to the soundcard.
  • Create the actual configuration.


Create a pulseadio udev rule.

Note: This is only an example for Asus Xonar Essence STX. Read udev to find out the correct values.
Note: Your configuration file should have lower number than the original pulseaudio rule to take effect.
/usr/lib/udev/rules.d/90-pulseaudio-Xonar-STX.rules
ACTION=="change", SUBSYSTEM=="sound", KERNEL=="card*", \
ATTRS{subsystem_vendor}=="0x1043", ATTRS{subsystem_device}=="0x835c", ENV{PULSE_PROFILE_SET}="asus-xonar-essence-stx.conf" 


Create now a configuration file. If you bother you can start from scratch and make if saucy. However you can also use the default configuration file rename it and then add your profile there that you know works. Less pretty but also faster.

To enable multiple sinks for Asus Xonar Essence STX you need only to add this in.

Note: asus-xonar-essence-stx.conf also includes all code/mappings from default.conf.
/usr/share/pulseaudio/alsa-mixer/profile-sets/asus-xonar-essence-stx.conf
[Profile analog-stereo+iec958-stereo]
description = Analog Stereo Duplex + Digital Stereo Output
input-mappings = analog-stereo
output-mappings = analog-stereo iec958-stereo
skip-probe = yes

This will auto-profile your Asus Xonar Essence STX with default profiles and add your own profile so you can have multiple sinks.

You need to create another profile in the configuration file if you want to have the same functionality with AC3 Digital 5.1 output.


See pulseaudio article about profiles

Bluetooth headset replay problems

Some user report huge delays or even no sound when the bluetooth connection does not send any data. This is due to an idle-suspend-module that puts the related sinks/sources automatically into suspend. As this can cause problems with headset, the responsible module can be deactivated.

$ cp /etc/pulse/default.pa ~/.pulse/default.pa
~/.pulse/default.pa
; load-module module-suspend-on-idle
$ pulseaudio -k && pulseaudio --start

More information

Automatically switch to Bluetooth or USB headset

Add the following:

/etc/pulse/default.pa
# automatically switch to newly-connected devices
load-module module-switch-on-connect

Pulse overwrites ALSA settings

Pulseaudio usually overwrites the ALSA settings- for example set with alsamixer- at start up, even when the alsa daemon is loaded. Since there seems to be no other way to restrict this behaviour, a workaround is to restore the alsa settings again after pulseaudio had started. Add the following command to .xinitrc or .bash_profile or any other autostart file:

restore_alsa() {
 while [ -z "$(pidof pulseaudio)" ]; do
  sleep 0.5
 done
 alsactl -f /var/lib/alsa/asound.state restore 
}
restore_alsa &

Prevent Pulse from restarting after being killed

Sometimes you may wish to temporarily disable Pulse. In order to do so you will have to prevent Pulse from restarting after being killed.

$ echo autospawn=no > ~/.pulse/client.conf

Daemon startup failed

Try resetting PulseAudio:

$ rm -rf /tmp/pulse* ~/.pulse*
$ pulseaudio -k
$ pulseaudio --start

If there is no server running but pulseaudio fails to start with an error message "User-configured server at ... refusing to start/autospawn", the issue may be with PulseAudio settings from a previous login. Check to see if there are any stale properties attached to the X11 root window with pax11publish -d, and if there are, remove them with pax11publish -r before trying to start the server. This manual cleanup is always required when using LXDM because it does not restart the X server on logout; see LXDM#PulseAudio.

inotify issue

If the previous fix doesn't work, run the following:

$ pulseaudio -vvvv

If you see an error that looks like this:

E: [pulseaudio] module-udev-detect.c: You apparently ran out of inotify watches, probably because Tracker/Beagle took them all away. I wished people would do their homework first and fix inotify before using it for watching whole directory trees which is something the current inotify is certainly not useful for. Please make sure to drop the Tracker/Beagle guys a line complaining about their broken use of inotify.

Then you have run out of inotify watches.

This can quickly be resolved by running:

$ echo 100000 > /proc/sys/fs/inotify/max_user_watches

To have it permanently changed, add to /etc/sysctl.conf

# Increase inotify max watchs per user
fs.inotify.max_user_watches = 100000

padevchooser

If one cannot launch the PulseAudio Device Chooser, first restart the Avahi daemon (avahi-daemon).

Glitches, skips or crackling

The newer implementation of PulseAudio sound server uses a timer-based audio scheduling instead of the traditional interrupt-driven approach.

Timer-based scheduling may expose issues in some ALSA drivers. On the other hand, other drivers might be glitchy without it on, so check to see what works on your system.

To turn timer-based scheduling off add tsched=0 in /etc/pulse/default.pa:

/etc/pulse/default.pa
load-module module-udev-detect tsched=0

Then restart the PulseAudio server:

$ pulseaudio -k
$ pulseaudio --start

Do the reverse to enable timer-based scheduling, if not already enabled by default.

Please report any such cards to PulseAudio Broken Sound Driver page

Setting the default fragment number and buffer size in Pulseaudio

More Information

Finding out your audio device parameters (1/4)

To find your sound card buffering settings:

$ echo autospawn = no >> ~/.pulse/client.conf
$ pulseaudio -k
$ LANG=C timeout --foreground -k 10 -s kill 10 pulseaudio -vvvv 2>&1 | grep device.buffering -B 10
$ sed -i '$d' ~/.pulse/client.conf

For each sound card detected by Pulseaudio, you will see output similar to this:

I: [pulseaudio] source.c:     alsa.long_card_name = "HDA Intel at 0xfa200000 irq 46"
I: [pulseaudio] source.c:     alsa.driver_name = "snd_hda_intel"
I: [pulseaudio] source.c:     device.bus_path = "pci-0000:00:1b.0"
I: [pulseaudio] source.c:     sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
I: [pulseaudio] source.c:     device.bus = "pci"
I: [pulseaudio] source.c:     device.vendor.id = "8086"
I: [pulseaudio] source.c:     device.vendor.name = "Intel Corporation"
I: [pulseaudio] source.c:     device.product.name = "82801I (ICH9 Family) HD Audio Controller"
I: [pulseaudio] source.c:     device.form_factor = "internal"
I: [pulseaudio] source.c:     device.string = "front:0"
I: [pulseaudio] source.c:     device.buffering.buffer_size = "768000"
I: [pulseaudio] source.c:     device.buffering.fragment_size = "384000"

Take note the buffer_size and fragment_size values for the relevant sound card.

Calculate your fragment size in msecs and number of fragments (2/4)

Pulseaudio's default sampling rate and bit depth are set to 44100Hz @ 16 bits.

With this configuration, the bit rate we need is 44100*16 = 44100 is disabled and needs to be changed to 96000:

# sed 's/; default-sample-rate = 44100/default-sample-rate = 96000/g' -i /etc/pulse/daemon.conf

Restart pulseaudio to apply the new settings (4/5)

$ pulseaudio -k
$ pulseaudio --start

Finally check by recording and playing it back (5/5)

Let us record some voice using mic for say 10 seconds. Make sure the mic is not muted and all

$ arecord -f cd -d 10 test-mic.wav

After 10 seconds, let us play the recording...

$ aplay test-mic.wav

Now hopefully, there is no static noise in microphone recording anymore.

My Bluetooth device is paired but does not play any sound

See the article in Bluetooth section

Starting from PulseAudio 2.99 and bluez 4.101 you should avoid using Socket interface. Do NOT use:

/etc/bluetooth/audio.conf
[General]
Enable=Socket

If you face problems with A2DP and PA 2.99 make sure you have sbc library.

Subwoofer stops working after end of every song

Known issue: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/494099

To fix this, must edit: /etc/pulse/daemon.conf and enable enable-lfe-remixing :

/etc/pulse/daemon.conf
enable-lfe-remixing = yes

Pulseaudio uses wrong microphone

If Pulseaudio uses the wrong microphone, and changing the Input Device with Pavucontrol did not help, take a look at alsamixer. It seems that Pavucontrol does not always set the input source correctly.

$ alsamixer

Press F6 and choose your sound card, e.g. HDA Intel. Now press F5 to display all items. Try to find the item: Input Source. With the up/down arrow keys you are able to change the input source.

Now try if the correct microphone is used for recording.

Choppy Sound with Analog Surround Sound Setup

The low-frequency effects (LFE) channel is not remixed per default. To enable it the following needs to be set in /etc/pulse/daemon.conf :

/etc/pulse/daemon.conf
enable-lfe-remixing = yes

No sound below a volume cutoff

Known issue (won't fix): https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/223133

If sound doesn't play when Pulseaudio's volume is set below a certain level, try ignore_dB=1 in /etc/pulse/default.pa:

/etc/pulse/default.pa
load-module module-udev-detect ignore_dB=1

However, be aware that it may cause another bug preventing pulseaudio to unmute speakers when headphones or other audio devices are unplugged.

Low volume for internal mic

If you experience low volume on internal notebook microphone, try setting:

/etc/pulse/default.pa
set-source-volume 1 300000

Clients alter master output volume (aka volume jumps to 100% after running application)

If changing volume in specific applications changes also master output volume you can try to diasble flat volumes. Set:

/etc/pulse/daemon.conf
flat-volumes = no

Then restart Pulseaudio daemon:

# pulseaudio -k
# pulseaudio --start

Realtime scheduling

If rtkit doesn't work, you can manually set up your system to run PulseAudio with realtime scheduling, which can help performance. To do this, add the following lines to /etc/security/limits.conf:

@pulse-rt - rtprio 9
@pulse-rt - nice -11

Afterwards, you need to add your user to the pulse-rt group:

# gpasswd -a <user> pulse-rt

See also