Difference between revisions of "PulseAudio/Troubleshooting"

From ArchWiki
Jump to navigation Jump to search
(Structure reorganized for better readability and maintainability. Possibly needs some work on content quality, double and old entries.)
Line 1: Line 1:
[[Category:Sound]]
+
== Volume ==
[[Category:Audio/Video]]
 
[[it:PulseAudio/Troubleshooting]]
 
  
See [[PulseAudio]] for the main article.
+
Here you will find some hints on volume issues and why you may can't hear anything.
 
 
== No sound after installation ==
 
 
 
=== 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 {{ic|00}} under it (this can be toggled by pressing {{ic|m}}):
 
$ alsamixer -c 0
 
 
 
{{Note|alsamixer will not tell you which output device is set as the default. One possible cause of no sound after install is that PulseAudio detects the wrong output device as a default. Install {{Pkg|pavucontrol}} and check if there is any output on the pavucontrol panel when playing a ''.wav'' file.}}
 
  
 
=== Auto-Mute Mode ===
 
=== Auto-Mute Mode ===
Line 22: Line 11:
 
To save your current settings as the default options, run {{ic|alsactl store}} as root.
 
To save your current settings as the default options, run {{ic|alsactl store}} as root.
  
=== Bad configuration files ===
+
=== Muted audio device ===
  
After starting PulseAudio, if the system outputs no sound, it may be necessary to delete the contents of {{ic|~/.config/pulse}} and/or {{ic|~/.pulse}}. PulseAudio will automatically create new configuration files on its next start.
+
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 {{ic|00}} under it (this can be toggled by pressing {{ic|m}}):
 +
$ alsamixer -c 0
  
=== Flash content ===
+
{{Note|alsamixer will not tell you which output device is set as the default. One possible cause of no sound after install is that PulseAudio detects the wrong output device as a default. Install {{Pkg|pavucontrol}} and check if there is any output on the pavucontrol panel when playing a ''.wav'' file.}}
  
Since Adobe Flash does not directly support PulseAudio, the recommended way is to [[PulseAudio#ALSA|configure ALSA to use the virtual PulseAudio sound card]].
+
=== Volume adjustment does not work properly ===
  
Alternatively you may try out {{AUR|libflashsupport-pulse}} from the [[AUR]].
+
Check:
{{Note|This may invariably crash the Flash plugin.}}
+
{{ic|/usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common}}
  
If you find audio from flash is being laggy, you might like to have flash access ALSA directly. This fixes this problem in some cases. To do this, [[#ALSA/dmix without grabbing hardware device|configure PulseAudio to use dmix]].
+
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+}}).
  
=== No cards ===
+
=== Per-application volumes change when the Master volume is adjusted ===
  
If PulseAudio starts, run {{ic|pacmd list}}. If no cards are reported, make sure that the ALSA devices are not in use:
+
This is because PulseAudio uses flat volumes by default, instead of relative volumes, relative to an absolute master volume. If this is found to be inconvenient, asinine, or otherwise undesireable, relative volumes can be enabled by disabling flat volumes in the PulseAudio daemon's configuration file:
  
$ fuser -v /dev/snd/*
+
{{hc|/etc/pulse/daemon.conf or ~/.config/pulse/daemon.conf|<nowiki>
$ fuser -v /dev/dsp
+
flat-volumes = no
 +
</nowiki>}}
  
Make sure any applications using the pcm or dsp files are shut down before restarting PulseAudio.
+
and then restarting PulseAudio by executing
  
=== The only device shown is "dummy output" or newly connected cards aren't detected ===
+
$ pulseaudio -k
 +
$ pulseaudio --start
  
This may be caused by settings in {{ic|~/.asoundrc}} overriding the system wide settings in {{ic|/etc/asound.conf}}. This can be prevented by commenting out the last line of {{ic|~/.asoundrc}} like so:
+
=== Volume gets louder every time a new application is started ===
  
{{hc|~/.asoundrc|
+
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".
# </home/''yourusername''/.asoundrc.asoundconf>
 
}}
 
  
Maybe some program is monopolizing the audio device:
+
Fix this by disabling flat volumes, as demonstrated in the previous section. When Pulse comes back after a few seconds, applications will not alter the global system volume anymore but have their own volume level again.
  
{{hc|# fuser -v /dev/snd/*|
+
{{Note|A previously installed and removed pulseaudio-equalizer may leave behind remnants of the setup in {{ic|~/.config/pulse/default.pa}} or {{ic|~/.pulse/default.pa}} which can also cause maximized volume trouble. Comment that out as needed.}}
                    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.
+
=== Sound output is only mono on M-Audio Audiophile 2496 sound card ===
  
If it doesn't help or you see nothing in the output, deleting the {{Pkg|timidity++}} package and restarting your system will help to get rid of the "dummy output".
+
Add the following:
  
Another reason is [[FluidSynth]] conflicting with PulseAudio as discussed in [https://bbs.archlinux.org/viewtopic.php?id=154002 this thread]. One solution is to remove the package {{Pkg|fluidsynth}}.
+
{{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>}}
  
Alternatively you could modify the ''fluidsynth'' configuration file {{ic|/etc/conf.d/fluidsynth}} and change the driver to PulseAudio, then restart ''fluidsynth'' and PulseAudio:
+
=== No sound below a volume cutoff ===
  
{{hc|/etc/conf.d/fluidsynth|
+
Known issue (won't fix): https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/223133
output=SYNTHOPTS="-is -a pulseaudio -m alsa_seq -r 48000"
 
}}
 
  
=== No HDMI 5/7.1 Selection for Device ===
+
If sound does not play when PulseAudio's volume is set below a certain level, try setting {{ic|1=ignore_dB=1}} in {{ic|/etc/pulse/default.pa}}:
 +
{{hc|/etc/pulse/default.pa|<nowiki>
 +
load-module module-udev-detect ignore_dB=1
 +
</nowiki>}}
  
If you are unable to select 5/7.1 channel output for a working HDMI device, then turning off "stream device reading" in {{ic|/etc/pulse/default.pa}} might help.  
+
However, be aware that it may cause another bug preventing PulseAudio to unmute speakers when headphones or other audio devices are unplugged.
  
See [[#Fallback device is not respected]].
+
=== Low volume for internal microphone ===
  
=== KDE Plasma Workspaces ===
+
If you experience low volume on internal notebook microphone, try setting:
 +
{{hc|/etc/pulse/default.pa|<nowiki>
 +
set-source-volume 1 300000
 +
</nowiki>}}
  
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.
+
=== Clients alter master output volume (a.k.a. volume jumps to 100% after running application) ===
  
To see your default audio device, you can run:
+
If changing the volume in specific applications or simply running an application changes the master output volume this is likely due to flat volumes mode of pulseaudio. Before disabling it, KDE users should try lowering their system notifications volume in ''System Settings -> Application and System Notifications -> Manage Notifications'' under the ''Player Settings'' tab to something reasonable. Changing the ''Event Sounds'' volume in KMix or another volume mixer application will not help here. This should make the flat-volumes mode work out as intended, if it does not work, some other application is likely requesting 100% volume when its playing something. If all else fails, you can try to disable flat-volumes:
  
pactl stat
+
{{hc|/etc/pulse/daemon.conf|<nowiki>
 +
flat-volumes = no
 +
</nowiki>}}
  
To see available audio devices:
+
Then restart PulseAudio daemon:
  
  pactl list
+
  # pulseaudio -k
 +
# pulseaudio --start
  
To set your default audio device, use "pacmd" or add to {{ic|/etc/pulse/default.pa}}:
+
=== No sound after resume from suspend ===
  
  set-default-sink alsa_output.analog-stereo
+
If audio generally works, but stops after resume from suspend, try "reloading" PulseAudio by executing:
 +
  $ /usr/bin/pasuspender /bin/true
  
=== Failed to create sink input: sink is suspended ===
+
This is better than completely killing and restarting it ({{ic|pulseaudio -k}} followed by {{ic|pulseaudio --start}}), because it doesn't break already running applications.
  
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:
+
If the above fixes your problem, you may wish to automate it, by creating a systemd service file.
  
$ rm -r ~/.pulse ~/.pulse-cookie ~/.config/pulse
+
1. Create the template service file in {{ic|/etc/systemd/system/resume-fix-pulseaudio@.service}}:
  
== Starting an application interrupts other app's sound ==
+
[Unit]
 +
Description=Fix PulseAudio after resume from suspend
 +
After=suspend.target
 +
 +
[Service]
 +
User=%I
 +
Type=oneshot
 +
Environment="XDG_RUNTIME_DIR=/run/user/%U"
 +
ExecStart=/usr/bin/pasuspender /bin/true
 +
 +
[Install]
 +
WantedBy=suspend.target
  
If you have trouble with some applications (eg. Teamspeak, Mumble) interrupting sound output of already running applications (eg. Deadbeaf), you can solve this by commenting out the line {{ic|load-module module-role-cork}} in {{ic|/etc/pulse/default.pa}} like shown below:
+
2. Enable it for your user account
  
{{hc|/etc/pulse/default.pa|
+
# systemctl enable resume-fix-pulseaudio@YOUR_USERNAME_HERE.service
### Cork music/video streams when a phone stream is active
 
# load-module module-role-cork
 
}}
 
  
Then restart pulseaudo by using your normal user account with
+
3. Reload systemd
 
pulseaudio -k
 
pulseaudio --start
 
  
== No HDMI sound output after some time with the monitor turned off ==
+
# systemctl --system daemon-reload
  
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 is unplugged:
+
=== ALSA channels mute when headphones are plugged/unplugged improperly ===
  
{{hc|pactl list sinks|
+
If when you unplug your headphones or plug them in the audio remains muted in alsamixer on the wrong channel due to it being set to 0%, you may be able to fix it by opening {{ic|/etc/pulse/default.pa}} and commenting out the line:
...
 
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 VT and back again. If that doesn't work, try: turn off your monitor, switch to another VT, turn on your monitor, and switch back. This problem has been reported by ATI/Nvidia/Intel users.
+
load-module module-switch-on-port-available
  
== Enable Echo/Noise-Cancelation ==
 
  
Arch doesn't load the Pulseaudio Echo-Cancelation module by default, therefore, we have to add it in {{ic|/etc/pulse/default.pa}}. First you can test if the module is present with {{ic|pacmd}} and entering {{ic|list-modules}}. If you can't find a line showing {{ic|name: <module-echo-cancel>}} you have to add
 
  
{{hc|/etc/pulse/default.pa|
+
== Microphone ==
load-module module-echo-cancel
 
}}
 
  
then restart Pulseaudio
+
=== PulseAudio uses wrong microphone ===
  
pulseaudio -k
+
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.
pulseaudio --start
 
  
and check if the module is activated by starting {{ic|pavucontrol}}. Under {{ic|Recoding}} the input device should show {{ic|Echo-Cancel Source Stream from"}}
+
$ alsamixer
  
== Can't update configuration of sound device in pavucontrol ==
+
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.
  
{{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.
+
Now try if the correct microphone is used for recording.
  
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.
+
=== No microphone on ThinkPad T400/T500/T420 ===
  
== Simultaneous output to multiple sound cards / devices ==
+
Run:
  
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).
+
alsamixer -c 0
  
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.
+
Unmute and maximize the volume of the "Internal Mic".
  
If this doesn't work, try adding the following to {{ic|~/.asoundrc}}:
+
Once you see the device with:
  
  pcm.dsp {
+
  arecord -l
    type plug
 
    slave.pcm "dmix"
 
}
 
  
{{Tip|Simultaneous output can also be achieved manually using alsamixer. Disable "auto mute" item, then unmute other output sources you want to hear and increase their volume.}}
+
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''.
  
== Simultaneous output to multiple sinks on the same sound card not working==
+
=== No microphone input on Acer Aspire One ===
  
This can be useful for users who have multiple sound sources and want to play them on different sinks/outputs.  
+
Install pavucontrol, unlink the microphone channels and turn down the left one to 0.
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)
+
Reference: http://getsatisfaction.com/jolicloud/topics/deaf_internal_mic_on_acer_aspire_one#reply_2108048
  
This is sometimes auto detected by PulseAudio but not always. If you know that your sound card 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 sound card.
+
=== Static noise in microphone recording ===
  
More in detail you need to create a profile-set for your specific sound card.
+
If we are getting static noise in Skype, gnome-sound-recorder, arecord, etc.'s recordings, then the sound card sample rate is incorrect. That is why there is static noise in Linux microphone recordings. To fix this, we need to set the sampling rate in {{ic|/etc/pulse/daemon.conf}} for the sound hardware.
This is done in two steps mostly.
 
* Create udev rule to make PulseAudio choose your PulseAudio configuration file specific to the sound card.
 
* Create the actual configuration.
 
  
Create a pulseadio udev rule.
+
==== Determine sound cards in the system (1/5) ====
  
{{Note|This is only an example for Asus Xonar Essence STX.
+
This requires {{Pkg|alsa-utils}} and related packages to be installed:
Read [[udev]] to find out the correct values.}}
+
{{hc|$ arecord --list-devices|
 
+
**** List of CAPTURE Hardware Devices ****
{{Note|Your configuration file should have lower number than the original PulseAudio rule to take effect.}}
+
card 0: Intel [HDA Intel], device 0: ALC888 Analog [ALC888 Analog]
 
+
  Subdevices: 1/1
{{hc|/usr/lib/udev/rules.d/90-pulseaudio-Xonar-STX.rules|
+
  Subdevice #0: subdevice #0
ACTION&#61;&#61;"change", SUBSYSTEM&#61;&#61;"sound", KERNEL&#61;&#61;"card*", \
+
card 0: Intel [HDA Intel], device 2: ALC888 Analog [ALC888 Analog]
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"
+
  Subdevices: 1/1
 +
  Subdevice #0: subdevice #0
 
}}
 
}}
  
Now, create a configuration file. If you bother, you can start from scratch and make it 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.
+
Sound card is {{ic|hw:0,0}}.
  
To enable multiple sinks for Asus Xonar Essence STX you need only to add this in.
+
==== Determine sampling rate of the sound card (2/5) ====
  
{{Note|{{ic|asus-xonar-essence-stx.conf}} also includes all code/mappings from {{ic|default.conf}}.}}
+
{{hc|1=arecord -f dat -r 60000 -D hw:0,0 -d 5 test.wav|2=
 
+
"Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 60000 Hz, Stereo
{{hc|/usr/share/pulseaudio/alsa-mixer/profile-sets/asus-xonar-essence-stx.conf|
+
Warning: rate is not accurate (requested = 60000Hz, '''got = 96000Hz''')
[Profile analog-stereo+iec958-stereo]
+
please, try the plug plugin
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.
+
observe, the {{ic|1=got = 96000Hz}}. This is the maximum sampling rate of our card.
  
You need to create another profile in the configuration file if you want to have the same functionality with AC3 Digital 5.1 output.
+
==== Setting the sound card's sampling rate into PulseAudio configuration (3/5) ====
  
[https://www.freedesktop.org/wiki/Software/PulseAudio/Backends/ALSA/Profiles/ See PulseAudio article about profiles]
+
The default sampling rate in PulseAudio:
 
+
{{hc|1=$ grep "default-sample-rate" /etc/pulse/daemon.conf|2=
== Disable Bluetooth support ==
+
; default-sample-rate = 44100
 
 
If you do not use Bluetooth, you may experience the following error in your journal:
 
 
 
bluez5-util.c: GetManagedObjects() failed: org.freedesktop.DBus.Error.ServiceUnknown: The name org.bluez was not provided by any .service files
 
 
 
To disable Bluetooth support in PulseAudio, make sure that the following lines are commented out in the configuration file in use ({{ic|~/.config/pulse/default.pa}} or {{ic|/etc/pulse/default.pa}}):
 
 
 
{{hc|~/.config/pulse/default.pa|
 
### Automatically load driver modules for Bluetooth hardware
 
#.ifexists module-bluetooth-policy.so
 
#load-module module-bluetooth-policy
 
#.endif
 
 
 
#.ifexists module-bluetooth-discover.so
 
#load-module module-bluetooth-discover
 
#.endif
 
 
}}
 
}}
  
== Bluetooth headset replay problems ==
+
{{ic|44100}} is disabled and needs to be changed to {{ic|96000}}:
 +
# sed 's/; default-sample-rate = 44100/default-sample-rate = 96000/g' -i /etc/pulse/daemon.conf
  
Some user [https://bbs.archlinux.org/viewtopic.php?id=117420 reports] huge delays or even no sound when the Bluetooth connection does not send any data. This is due to the {{ic|module-suspend-on-idle}} module, which automatically suspends sinks/sources on idle. As this can cause problems with headset, the responsible module can be deactivated.
+
==== Restart PulseAudio to apply the new settings (4/5) ====
  
To disable loading of the {{ic|module-suspend-on-idle}} module, comment out the following line in the configuration file in use ({{ic|~/.config/pulse/default.pa}} or {{ic|/etc/pulse/default.pa}}):
+
$ pulseaudio -k
 +
$ pulseaudio --start
  
{{hc|~/.config/pulse/default.pa|
+
==== Finally check by recording and playing it back (5/5) ====
### Automatically suspend sinks/sources that become idle for too long
 
#load-module module-suspend-on-idle
 
}}
 
  
Finally restart PulseAudio to apply the changes.
+
Let us record some voice using a microphone for, say, 10 seconds. Make sure the microphone is not muted and all
  
== Automatically switch to Bluetooth or USB headset ==
+
$ arecord -f cd -d 10 test-mic.wav
  
Add the following:
+
After 10 seconds, let us play the recording...
{{hc|/etc/pulse/default.pa|
 
# automatically switch to newly-connected devices
 
load-module module-switch-on-connect
 
}}
 
  
== Pulse overwrites ALSA settings ==
+
$ aplay test-mic.wav
  
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 has started. Add the following command to {{ic|.xinitrc}} or {{ic|.bash_profile}} or any other [[Autostarting|autostart]] file:
+
Now hopefully, there is no static noise in microphone recording anymore.
  
restore_alsa() {
+
=== No microphone on Steam or Skype with enable-remixing = no ===
  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 ==
+
When you set {{ic|1=enable-remixing = no}} on {{ic|/etc/pulse/daemon.conf}} you may find that your microphone has stopped working on certain applications like Skype or Steam. This happens because these applications capture the microphone as mono only and because remixing is disabled, Pulseaudio will no longer remix your stereo microphone to mono.
  
Sometimes you may wish to temporarily disable Pulse. In order to do so you will have to prevent Pulse from restarting after being killed.
+
To fix this you need to tell Pulseaudio to do this for you:
  
{{hc|~/.config/pulse/client.conf|2=
+
1. Find the name of the source
# Disable autospawning the PulseAudio daemon
 
autospawn = no
 
}}
 
  
== Daemon startup failed ==
+
# pacmd list-sources
  
Try resetting PulseAudio:
+
Example output edited for brevity, the name you need is in bold:
$ rm -rf /tmp/pulse* ~/.pulse* ~/.config/pulse
 
$ pulseaudio -k
 
$ pulseaudio --start
 
  
* Check that options for sinks are set up correctly.
+
    index: 2
 +
        name: <'''alsa_input.pci-0000_00_14.2.analog-stereo'''>
 +
        driver: <module-alsa-card.c>
 +
        flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
  
* If you configured in default.pa to load and use the OSS modules then check with {{Pkg|lsof}} that {{ic|/dev/dsp}} device is not used by another application.
+
2. Add a remap rule to {{ic|/etc/pulse/default.pa}}, use the name you found with the previous command, here we will use '''alsa_input.pci-0000_00_14.2.analog-stereo''' as an example:
  
* LXDE may have a problem with closing all applications after the user logged out to fix it look [[LXDM#Incorrect logout handling|Incorrect logout handling]].
+
{{hc|/etc/pulse/default.pa|<nowiki>
 +
### Remap microphone to mono
 +
load-module module-remap-source master=alsa_input.pci-0000_00_14.2.analog-stereo master_channel_map=front-left,front-right channels=2 channel_map=mono,mono
 +
</nowiki>}}
  
* Set a preferred working resample method. Use {{ic|pulseaudio --dump-resample-methods}} to see a list with all available resample methods you can use.
+
3. Restart Pulseaudio
  
* To get details about currently appeared unfixed errors or just get status of daemon use commands like {{ic|pax11publish -d}} and {{ic|pulseaudio -v}} where {{ic|v}} option can be used multiple time to set verbosity of log output equal to the {{ic|1=--log-level[=LEVEL]}} option where LEVEL is from 0 to 4. See the [[PulseAudio#Outputs by PulseAudio error status check utilities|Outputs by PulseAudio error status check utilities]] section.
+
# pulseaudio -k
  
See also man pages for [http://linux.die.net/man/1/pax11publish pax11publish] and [http://linux.die.net/man/1/pulseaudio pulseaudio] for more details.
+
{{Note|Pulseaudio may fail to start if you don't exit a program that was using was using the microphone (ex. if you tested on Steam before modifying the file), in which case you should exit the application and manually start Pulseaudio}}
  
=== Outputs by PulseAudio error status check utilities ===
+
# pulseaudio --start
  
If the {{ic|pax11publish -d}} shows error like:
 
  
N: [pulseaudio] main.c: User-configured server at "user", refusing to start/autospawn.
 
  
then run {{ic|pax11publish -r}} command then could be also good to logout and login again. This manual cleanup is always required when using LXDM because it does not restart the X server on logout; see [[LXDM#PulseAudio]].
+
== Audio Quality ==
  
If the {{ic|pulseaudio -vvvv}} command shows error like:
+
=== Enable Echo/Noise-Cancelation ===
  
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.
+
Arch doesn't load the Pulseaudio Echo-Cancelation module by default, therefore, we have to add it in {{ic|/etc/pulse/default.pa}}. First you can test if the module is present with {{ic|pacmd}} and entering {{ic|list-modules}}. If you can't find a line showing {{ic|name: <module-echo-cancel>}} you have to add
  
This can be resolved temporary by:
+
{{hc|/etc/pulse/default.pa|
$ echo 100000 > /proc/sys/fs/inotify/max_user_watches
+
load-module module-echo-cancel
 +
}}
  
For permanent use save settings in the ''99-sysctl.conf'' file:
+
then restart Pulseaudio
  
{{hc|/etc/sysctl.d/99-sysctl.conf|2=
+
pulseaudio -k
# Increase inotify max watchs per user
+
pulseaudio --start
fs.inotify.max_user_watches = 100000}}
 
  
{{Warning|It may cause much bigger consumption of memory by kernel.}}
+
and check if the module is activated by starting {{ic|pavucontrol}}. Under {{ic|Recoding}} the input device should show {{ic|Echo-Cancel Source Stream from"}}
 
 
'''See also'''
 
 
 
* [http://www.linuxinsight.com/proc_sys_fs_inotify.html proc_sys_fs_inotify] and [http://lwn.net/Articles/604686/ dnotify, inotify]- more details about ''inotify/max_user_watches''
 
* [http://stackoverflow.com/questions/535768/what-is-a-reasonable-amount-of-inotify-watches-with-linux?answertab=votes#tab-top reasonable amount of inotify watches with Linux]
 
* [http://linux.die.net/man/7/inotify inotify] - man page
 
  
== Glitches, skips or crackling ==
+
=== Glitches, skips or crackling ===
  
 
The newer implementation of the PulseAudio sound server uses timer-based audio scheduling instead of the traditional, interrupt-driven approach.  
 
The newer implementation of the PulseAudio sound server uses timer-based audio scheduling instead of the traditional, interrupt-driven approach.  
Line 342: Line 288:
 
Please report any such cards to [http://www.freedesktop.org/wiki/Software/PulseAudio/Backends/ALSA/BrokenDrivers/ PulseAudio Broken Sound Driver page]
 
Please report any such cards to [http://www.freedesktop.org/wiki/Software/PulseAudio/Backends/ALSA/BrokenDrivers/ 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 ===
  
 
{{Poor writing|Copied from Linux mint topic with few additions}}
 
{{Poor writing|Copied from Linux mint topic with few additions}}
  
=== Finding out your audio device parameters (1/4) ===
+
==== Finding out your audio device parameters (1/4) ====
  
 
To find your sound card buffering settings:
 
To find your sound card buffering settings:
Line 370: Line 316:
 
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.
  
=== Calculate your fragment size in msecs and number of fragments (2/4) ===
+
==== Calculate your fragment size in msecs and number of fragments (2/4) ====
  
 
PulseAudio's default sampling rate and bit depth are set to {{ic|44100Hz}} @ {{ic|16 bits}}.
 
PulseAudio's default sampling rate and bit depth are set to {{ic|44100Hz}} @ {{ic|16 bits}}.
Line 381: Line 327:
 
  device.buffering.fragment_size = "384000" => 384000/1411200 = 0.272108843537s = 272 msecs
 
  device.buffering.fragment_size = "384000" => 384000/1411200 = 0.272108843537s = 272 msecs
  
=== Modify PulseAudio's configuration file (3/4) ===
+
==== Modify PulseAudio's configuration file (3/4) ====
  
 
{{hc|/etc/pulse/daemon.conf|<nowiki>
 
{{hc|/etc/pulse/daemon.conf|<nowiki>
Line 396: Line 342:
 
</nowiki>}}
 
</nowiki>}}
  
=== Restart the PulseAudio daemon (4/4) ===
+
==== Restart the PulseAudio daemon (4/4) ====
  
 
  $ pulseaudio -k
 
  $ pulseaudio -k
Line 403: Line 349:
 
For more information, see: [http://forums.linuxmint.com/viewtopic.php?f=42&t=44862 Linux Mint topic]
 
For more information, see: [http://forums.linuxmint.com/viewtopic.php?f=42&t=44862 Linux Mint topic]
  
== Laggy sound ==
+
=== 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 {{ic|/etc/pulse/daemon.conf}} :
 +
{{hc|/etc/pulse/daemon.conf|<nowiki>
 +
enable-lfe-remixing = yes
 +
</nowiki>}}
 +
 
 +
 
 +
=== Laggy sound ===
  
 
This issue is due to incorrect buffer sizes. First verify that the variables {{ic|default-fragments}} and {{ic|default-fragment-size-msec}} are not being set to non default values in the file {{ic|/etc/pulse/daemon.conf}}. If the issue is still present, try setting them to the following values:
 
This issue is due to incorrect buffer sizes. First verify that the variables {{ic|default-fragments}} and {{ic|default-fragment-size-msec}} are not being set to non default values in the file {{ic|/etc/pulse/daemon.conf}}. If the issue is still present, try setting them to the following values:
Line 412: Line 366:
 
}}
 
}}
  
== Choppy/distorted sound ==
+
=== Choppy/distorted sound ===
 
This can result from an incorrectly set sample rate. Try the following setting:
 
This can result from an incorrectly set sample rate. Try the following setting:
  
Line 433: Line 387:
 
and restart the PulseAudio server. See also [[#No sound below a volume cutoff]].
 
and restart the PulseAudio server. See also [[#No sound below a volume cutoff]].
  
== Volume adjustment does not work properly ==
 
  
Check:
 
{{ic|/usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common}}
 
  
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+}}).
+
== Hardware and Cards ==
 +
 
 +
=== 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 is 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 VT and back again. If that doesn't work, try: turn off your monitor, switch to another VT, turn on your monitor, and switch back. This problem has been reported by ATI/Nvidia/Intel users.
 +
 
 +
=== No cards ===
 +
 
 +
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/dsp
 +
 
 +
Make sure any applications using the pcm or dsp files are shut down before restarting PulseAudio.
 +
 
 +
=== Starting an application interrupts other app's sound ===
 +
 
 +
If you have trouble with some applications (eg. Teamspeak, Mumble) interrupting sound output of already running applications (eg. Deadbeaf), you can solve this by commenting out the line {{ic|load-module module-role-cork}} in {{ic|/etc/pulse/default.pa}} like shown below:
 +
 
 +
{{hc|/etc/pulse/default.pa|
 +
### Cork music/video streams when a phone stream is active
 +
# load-module module-role-cork
 +
}}
 +
 
 +
Then restart pulseaudo by using your normal user account with
 +
 +
pulseaudio -k
 +
pulseaudio --start
 +
 
 +
=== The only device shown is "dummy output" or newly connected cards aren't detected ===
 +
 
 +
This may be caused by settings in {{ic|~/.asoundrc}} overriding the system wide settings in {{ic|/etc/asound.conf}}. This can be prevented by commenting out the last line of {{ic|~/.asoundrc}} like so:
 +
 
 +
{{hc|~/.asoundrc|
 +
# </home/''yourusername''/.asoundrc.asoundconf>
 +
}}
 +
 
 +
Maybe some program is monopolizing the audio device:
 +
 
 +
{{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
 +
}}
  
== Per-application volumes change when the Master volume is adjusted ==
+
That means timidity blocks PulseAudio from accessing the audio devices. Just killing timidity will make the sound work again.
  
This is because PulseAudio uses flat volumes by default, instead of relative volumes, relative to an absolute master volume. If this is found to be inconvenient, asinine, or otherwise undesireable, relative volumes can be enabled by disabling flat volumes in the PulseAudio daemon's configuration file:
+
If it doesn't help or you see nothing in the output, deleting the {{Pkg|timidity++}} package and restarting your system will help to get rid of the "dummy output".
  
{{hc|/etc/pulse/daemon.conf or ~/.config/pulse/daemon.conf|<nowiki>
+
Another reason is [[FluidSynth]] conflicting with PulseAudio as discussed in [https://bbs.archlinux.org/viewtopic.php?id=154002 this thread]. One solution is to remove the package {{Pkg|fluidsynth}}.
flat-volumes = no
 
</nowiki>}}
 
  
and then restarting PulseAudio by executing
+
Alternatively you could modify the ''fluidsynth'' configuration file {{ic|/etc/conf.d/fluidsynth}} and change the driver to PulseAudio, then restart ''fluidsynth'' and PulseAudio:
  
$ pulseaudio -k
+
{{hc|/etc/conf.d/fluidsynth|
$ pulseaudio --start
+
output=SYNTHOPTS="-is -a pulseaudio -m alsa_seq -r 48000"
 +
}}
  
== Volume gets louder every time a new application is started ==
+
=== No HDMI 5/7.1 Selection for Device ===
  
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".
+
If you are unable to select 5/7.1 channel output for a working HDMI device, then turning off "stream device reading" in {{ic|/etc/pulse/default.pa}} might help.  
  
Fix this by disabling flat volumes, as demonstrated in the previous section. When Pulse comes back after a few seconds, applications will not alter the global system volume anymore but have their own volume level again.
+
See [[#Fallback device is not respected]].
  
{{Note|A previously installed and removed pulseaudio-equalizer may leave behind remnants of the setup in {{ic|~/.config/pulse/default.pa}} or {{ic|~/.pulse/default.pa}} which can also cause maximized volume trouble. Comment that out as needed.}}
+
=== Failed to create sink input: sink is suspended ===
  
== No microphone on ThinkPad T400/T500/T420 ==
+
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:
  
Run:
+
$ rm -r ~/.pulse ~/.pulse-cookie ~/.config/pulse
  
alsamixer -c 0
+
=== Simultaneous output to multiple sound cards / devices ===
  
Unmute and maximize the volume of the "Internal Mic".
+
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).
  
Once you see the device with:
+
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.
  
arecord -l
+
If this doesn't work, try adding the following to {{ic|~/.asoundrc}}:
  
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''.
+
pcm.dsp {
 +
    type plug
 +
    slave.pcm "dmix"
 +
}
  
== No microphone input on Acer Aspire One ==
+
{{Tip|Simultaneous output can also be achieved manually using alsamixer. Disable "auto mute" item, then unmute other output sources you want to hear and increase their volume.}}
  
Install pavucontrol, unlink the microphone channels and turn down the left one to 0.
+
=== Simultaneous output to multiple sinks on the same sound card not working ===
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 ==
+
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)
  
Add the following:
+
This is sometimes auto detected by PulseAudio but not always. If you know that your sound card 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 sound card.
  
{{hc|/etc/pulseaudio/default.pa|<nowiki>
+
More in detail you need to create a profile-set for your specific sound card.
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
+
This is done in two steps mostly.
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
+
* Create udev rule to make PulseAudio choose your PulseAudio configuration file specific to the sound card.
set-default-sink delta_out
+
* Create the actual configuration.
set-default-source delta_in
 
</nowiki>}}
 
  
== Static noise in microphone recording ==
+
Create a pulseadio udev rule.
  
If we are getting static noise in Skype, gnome-sound-recorder, arecord, etc.'s recordings, then the sound card sample rate is incorrect. That is why there is static noise in Linux microphone recordings. To fix this, we need to set the sampling rate in {{ic|/etc/pulse/daemon.conf}} for the sound hardware.
+
{{Note|This is only an example for Asus Xonar Essence STX.
 +
Read [[udev]] to find out the correct values.}}
  
=== Determine sound cards in the system (1/5) ===
+
{{Note|Your configuration file should have lower number than the original PulseAudio rule to take effect.}}
  
This requires {{Pkg|alsa-utils}} and related packages to be installed:
+
{{hc|/usr/lib/udev/rules.d/90-pulseaudio-Xonar-STX.rules|
{{hc|$ arecord --list-devices|
+
ACTION&#61;&#61;"change", SUBSYSTEM&#61;&#61;"sound", KERNEL&#61;&#61;"card*", \
**** List of CAPTURE Hardware Devices ****
+
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"
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
 
 
}}
 
}}
  
Sound card is {{ic|hw:0,0}}.
+
Now, create a configuration file. If you bother, you can start from scratch and make it 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.
  
=== Determine sampling rate of the sound card (2/5) ===
+
{{Note|{{ic|asus-xonar-essence-stx.conf}} also includes all code/mappings from {{ic|default.conf}}.}}
  
{{hc|1=arecord -f dat -r 60000 -D hw:0,0 -d 5 test.wav|2=
+
{{hc|/usr/share/pulseaudio/alsa-mixer/profile-sets/asus-xonar-essence-stx.conf|
"Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 60000 Hz, Stereo
+
[Profile analog-stereo+iec958-stereo]
Warning: rate is not accurate (requested = 60000Hz, '''got = 96000Hz''')
+
description &#61; Analog Stereo Duplex + Digital Stereo Output
please, try the plug plugin
+
input-mappings &#61; analog-stereo
 +
output-mappings &#61; analog-stereo iec958-stereo
 +
skip-probe &#61; yes
 
}}
 
}}
  
observe, the {{ic|1=got = 96000Hz}}. This is the maximum sampling rate of our card.
+
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 ==
 +
 
 +
=== Disable Bluetooth support ===
 +
 
 +
If you do not use Bluetooth, you may experience the following error in your journal:
  
=== Setting the sound card's sampling rate into PulseAudio configuration (3/5) ===
+
bluez5-util.c: GetManagedObjects() failed: org.freedesktop.DBus.Error.ServiceUnknown: The name org.bluez was not provided by any .service files
  
The default sampling rate in PulseAudio:
+
To disable Bluetooth support in PulseAudio, make sure that the following lines are commented out in the configuration file in use ({{ic|~/.config/pulse/default.pa}} or {{ic|/etc/pulse/default.pa}}):
{{hc|1=$ grep "default-sample-rate" /etc/pulse/daemon.conf|2=
 
; default-sample-rate = 44100
 
}}
 
  
{{ic|44100}} is disabled and needs to be changed to {{ic|96000}}:
+
{{hc|~/.config/pulse/default.pa|
# sed 's/; default-sample-rate = 44100/default-sample-rate = 96000/g' -i /etc/pulse/daemon.conf
+
### Automatically load driver modules for Bluetooth hardware
 +
#.ifexists module-bluetooth-policy.so
 +
#load-module module-bluetooth-policy
 +
#.endif
  
=== Restart PulseAudio to apply the new settings (4/5) ===
+
#.ifexists module-bluetooth-discover.so
 +
#load-module module-bluetooth-discover
 +
#.endif
 +
}}
  
$ pulseaudio -k
+
=== Bluetooth headset replay problems ===
$ pulseaudio --start
 
  
=== Finally check by recording and playing it back (5/5) ===
+
Some user [https://bbs.archlinux.org/viewtopic.php?id=117420 reports] huge delays or even no sound when the Bluetooth connection does not send any data. This is due to the {{ic|module-suspend-on-idle}} module, which automatically suspends sinks/sources on idle. As this can cause problems with headset, the responsible module can be deactivated.
  
Let us record some voice using a microphone for, say, 10 seconds. Make sure the microphone is not muted and all
+
To disable loading of the {{ic|module-suspend-on-idle}} module, comment out the following line in the configuration file in use ({{ic|~/.config/pulse/default.pa}} or {{ic|/etc/pulse/default.pa}}):
  
$ arecord -f cd -d 10 test-mic.wav
+
{{hc|~/.config/pulse/default.pa|
 +
### Automatically suspend sinks/sources that become idle for too long
 +
#load-module module-suspend-on-idle
 +
}}
  
After 10 seconds, let us play the recording...
+
Finally restart PulseAudio to apply the changes.
  
$ aplay test-mic.wav
+
=== Automatically switch to Bluetooth or USB headset ===
  
Now hopefully, there is no static noise in microphone recording anymore.
+
Add the following:
 +
{{hc|/etc/pulse/default.pa|
 +
# automatically switch to newly-connected devices
 +
load-module module-switch-on-connect
 +
}}
  
== 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]]
Line 560: Line 587:
 
If you face problems with A2DP and PA 2.99 make sure you have {{Pkg|sbc}} library.
 
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 ==
 
  
Known issue: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/494099
 
  
To fix this, must edit: {{ic|/etc/pulse/daemon.conf}} and enable {{ic|enable-lfe-remixing}} :
+
== Applications ==
{{hc|/etc/pulse/daemon.conf|<nowiki>
+
 
enable-lfe-remixing = yes
+
=== Flash content ===
</nowiki>}}
 
  
== PulseAudio uses wrong microphone ==
+
Since Adobe Flash does not directly support PulseAudio, the recommended way is to [[PulseAudio#ALSA|configure ALSA to use the virtual PulseAudio sound card]].
  
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.
+
Alternatively you may try out {{AUR|libflashsupport-pulse}} from the [[AUR]].
 +
{{Note|This may invariably crash the Flash plugin.}}
  
$ alsamixer
+
If you find audio from flash is being laggy, you might like to have flash access ALSA directly. This fixes this problem in some cases. To do this, [[#ALSA/dmix without grabbing hardware device|configure PulseAudio to use dmix]].
  
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.
 
  
== Choppy sound with analog surround sound setup ==
+
== Other Issues ==
  
The low-frequency effects (LFE) channel is not remixed per default. To enable it the following needs to be set in {{ic|/etc/pulse/daemon.conf}} :
+
=== Bad configuration files ===
{{hc|/etc/pulse/daemon.conf|<nowiki>
 
enable-lfe-remixing = yes
 
</nowiki>}}
 
  
== Unable to select surround configuration other than "Surround 4.0" ==
+
After starting PulseAudio, if the system outputs no sound, it may be necessary to delete the contents of {{ic|~/.config/pulse}} and/or {{ic|~/.pulse}}. PulseAudio will automatically create new configuration files on its next start.
  
If you're unable to set 5.1 surround output in pavucontrol because it only shows "Analog Surround 4.0 Output", open the ALSA mixer and change the output configuration there to 6 channels. Then restart pulseaudio, and pavucontrol will list many more options.
+
=== Can't update configuration of sound device in pavucontrol ===
  
== No sound below a volume cutoff ==
+
{{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.
  
Known issue (won't fix): https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/223133
+
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.
  
If sound does not play when PulseAudio's volume is set below a certain level, try setting {{ic|1=ignore_dB=1}} in {{ic|/etc/pulse/default.pa}}:
+
=== Failed to create sink input: sink is suspended ===
{{hc|/etc/pulse/default.pa|<nowiki>
 
load-module module-udev-detect ignore_dB=1
 
</nowiki>}}
 
  
However, be aware that it may cause another bug preventing PulseAudio to unmute speakers when headphones or other audio devices are unplugged.
+
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:
  
== Low volume for internal microphone ==
+
$ rm -r ~/.pulse ~/.pulse-cookie ~/.config/pulse
  
If you experience low volume on internal notebook microphone, try setting:
+
=== Pulse overwrites ALSA settings ===
{{hc|/etc/pulse/default.pa|<nowiki>
 
set-source-volume 1 300000
 
</nowiki>}}
 
  
== Clients alter master output volume (a.k.a. volume jumps to 100% after running application) ==
+
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 has started. Add the following command to {{ic|.xinitrc}} or {{ic|.bash_profile}} or any other [[Autostarting|autostart]] file:
  
If changing the volume in specific applications or simply running an application changes the master output volume this is likely due to flat volumes mode of pulseaudio. Before disabling it, KDE users should try lowering their system notifications volume in ''System Settings -> Application and System Notifications -> Manage Notifications'' under the ''Player Settings'' tab to something reasonable. Changing the ''Event Sounds'' volume in KMix or another volume mixer application will not help here. This should make the flat-volumes mode work out as intended, if it does not work, some other application is likely requesting 100% volume when its playing something. If all else fails, you can try to disable flat-volumes:
+
restore_alsa() {
 +
  while [ -z "$(pidof pulseaudio)" ]; do
 +
  sleep 0.5
 +
  done
 +
  alsactl -f /var/lib/alsa/asound.state restore
 +
}
 +
restore_alsa &
  
{{hc|/etc/pulse/daemon.conf|<nowiki>
+
=== Prevent Pulse from restarting after being killed ===
flat-volumes = no
 
</nowiki>}}
 
  
Then restart PulseAudio daemon:
+
Sometimes you may wish to temporarily disable Pulse. In order to do so you will have to prevent Pulse from restarting after being killed.
  
# pulseaudio -k
+
{{hc|~/.config/pulse/client.conf|2=
# pulseaudio --start
+
# Disable autospawning the PulseAudio daemon
 +
autospawn = no
 +
}}
  
==Realtime scheduling==
+
=== Daemon startup failed ===
  
If rtkit does not work, you can manually set up your system to run PulseAudio with real-time scheduling, which can help performance. To do this, add the following lines to {{ic|/etc/security/limits.conf}}:
+
Try resetting PulseAudio:
 +
$ rm -rf /tmp/pulse* ~/.pulse* ~/.config/pulse
 +
$ pulseaudio -k
 +
$ pulseaudio --start
  
@pulse-rt - rtprio 9
+
* Check that options for sinks are set up correctly.
@pulse-rt - nice -11
 
  
Afterwards, you need to add your user to the {{ic|pulse-rt}} group:
+
* If you configured in default.pa to load and use the OSS modules then check with {{Pkg|lsof}} that {{ic|/dev/dsp}} device is not used by another application.
  
# gpasswd -a <user> pulse-rt
+
* LXDE may have a problem with closing all applications after the user logged out to fix it look [[LXDM#Incorrect logout handling|Incorrect logout handling]].
  
== No sound after resume from suspend ==
+
* Set a preferred working resample method. Use {{ic|pulseaudio --dump-resample-methods}} to see a list with all available resample methods you can use.
  
If audio generally works, but stops after resume from suspend, try "reloading" PulseAudio by executing:
+
* To get details about currently appeared unfixed errors or just get status of daemon use commands like {{ic|pax11publish -d}} and {{ic|pulseaudio -v}} where {{ic|v}} option can be used multiple time to set verbosity of log output equal to the {{ic|1=--log-level[=LEVEL]}} option where LEVEL is from 0 to 4. See the [[PulseAudio#Outputs by PulseAudio error status check utilities|Outputs by PulseAudio error status check utilities]] section.
$ /usr/bin/pasuspender /bin/true
 
  
This is better than completely killing and restarting it ({{ic|pulseaudio -k}} followed by {{ic|pulseaudio --start}}), because it doesn't break already running applications.
+
See also man pages for [http://linux.die.net/man/1/pax11publish pax11publish] and [http://linux.die.net/man/1/pulseaudio pulseaudio] for more details.
  
If the above fixes your problem, you may wish to automate it, by creating a systemd service file.
+
==== Outputs by PulseAudio error status check utilities ====
  
1. Create the template service file in {{ic|/etc/systemd/system/resume-fix-pulseaudio@.service}}:
+
If the {{ic|pax11publish -d}} shows error like:
  
  [Unit]
+
  N: [pulseaudio] main.c: User-configured server at "user", refusing to start/autospawn.
Description=Fix PulseAudio after resume from suspend
 
After=suspend.target
 
 
[Service]
 
User=%I
 
Type=oneshot
 
Environment="XDG_RUNTIME_DIR=/run/user/%U"
 
ExecStart=/usr/bin/pasuspender /bin/true
 
 
[Install]
 
WantedBy=suspend.target
 
  
2. Enable it for your user account
+
then run {{ic|pax11publish -r}} command then could be also good to logout and login again. This manual cleanup is always required when using LXDM because it does not restart the X server on logout; see [[LXDM#PulseAudio]].
  
# systemctl enable resume-fix-pulseaudio@YOUR_USERNAME_HERE.service
+
If the {{ic|pulseaudio -vvvv}} command shows error like:
  
3. Reload systemd
+
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.
  
  # systemctl --system daemon-reload
+
This can be resolved temporary by:
 +
  $ echo 100000 > /proc/sys/fs/inotify/max_user_watches
  
== ALSA channels mute when headphones are plugged/unplugged improperly ==
+
For permanent use save settings in the ''99-sysctl.conf'' file:
  
If when you unplug your headphones or plug them in the audio remains muted in alsamixer on the wrong channel due to it being set to 0%, you may be able to fix it by opening {{ic|/etc/pulse/default.pa}} and commenting out the line:
+
{{hc|/etc/sysctl.d/99-sysctl.conf|2=
 +
# Increase inotify max watchs per user
 +
fs.inotify.max_user_watches = 100000}}
  
load-module module-switch-on-port-available
+
{{Warning|It may cause much bigger consumption of memory by kernel.}}
  
== pactl "invalid option" error with negative percentage arguments ==
+
'''See also'''
  
{{ic|pactl}} commands that take negative percentage arguments will fail with an 'invalid option' error. Use the standard shell '--' pseudo argument
+
* [http://www.linuxinsight.com/proc_sys_fs_inotify.html proc_sys_fs_inotify] and [http://lwn.net/Articles/604686/ dnotify, inotify]- more details about ''inotify/max_user_watches''
to disable argument parsing before the negative argument. ''e.g.'' {{ic|pactl set-sink-volume 1 -- -5%}}.
+
* [http://stackoverflow.com/questions/535768/what-is-a-reasonable-amount-of-inotify-watches-with-linux?answertab=votes#tab-top reasonable amount of inotify watches with Linux]
 +
* [http://linux.die.net/man/7/inotify inotify] - man page
  
== Daemon already running ==
+
=== Daemon already running ===
  
 
On some systems, PulseAudio may be started multiple times. journalctl will report:
 
On some systems, PulseAudio may be started multiple times. journalctl will report:
Line 689: Line 703:
 
Also check user autostart files and directories, such as [[xinitrc]], {{ic|~/.config/autostart/}} etc.
 
Also check user autostart files and directories, such as [[xinitrc]], {{ic|~/.config/autostart/}} etc.
  
== Fallback device is not respected ==
+
=== Subwoofer stops working after end of every song ===
  
PulseAudio does not have a true default device. Instead it uses a [http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/DefaultDevice/ "fallback"], which only applies to new sound streams. This means previously run applications are not affected by the newly set fallback device.
+
Known issue: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/494099
  
{{Pkg|gnome-control-center}}, {{Pkg|mate-media-pulseaudio}} and {{AUR|paswitch}} handle this gracefully. Alternatively:
+
To fix this, must edit: {{ic|/etc/pulse/daemon.conf}} and enable {{ic|enable-lfe-remixing}} :
 +
{{hc|/etc/pulse/daemon.conf|<nowiki>
 +
enable-lfe-remixing = yes
 +
</nowiki>}}
  
1. Move the old streams in {{Pkg|pavucontrol}} manually to the new sound card.
+
=== Unable to select surround configuration other than "Surround 4.0" ===
  
2. Stop Pulse, erase the "stream-volumes" in {{ic|~/.config/pulse}} and/or {{ic|~/.pulse}} and restart Pulse. This also resets application volumes.
+
If you're unable to set 5.1 surround output in pavucontrol because it only shows "Analog Surround 4.0 Output", open the ALSA mixer and change the output configuration there to 6 channels. Then restart pulseaudio, and pavucontrol will list many more options.
  
3. Disable stream device reading. This may be not wanted when using different soundcards with different applications.
+
=== Realtime scheduling ===
  
{{hc|/etc/pulse/default.pa|<nowiki>
+
If rtkit does not work, you can manually set up your system to run PulseAudio with real-time scheduling, which can help performance. To do this, add the following lines to {{ic|/etc/security/limits.conf}}:
load-module module-stream-restore restore_device=false
 
</nowiki>}}
 
  
== No microphone on Steam or Skype with enable-remixing = no ==
+
@pulse-rt - rtprio 9
 +
@pulse-rt - nice -11
  
When you set {{ic|1=enable-remixing = no}} on {{ic|/etc/pulse/daemon.conf}} you may find that your microphone has stopped working on certain applications like Skype or Steam. This happens because these applications capture the microphone as mono only and because remixing is disabled, Pulseaudio will no longer remix your stereo microphone to mono.
+
Afterwards, you need to add your user to the {{ic|pulse-rt}} group:
  
To fix this you need to tell Pulseaudio to do this for you:
+
# gpasswd -a <user> pulse-rt
  
1. Find the name of the source
+
=== pactl "invalid option" error with negative percentage arguments ===
  
# pacmd list-sources
+
{{ic|pactl}} commands that take negative percentage arguments will fail with an 'invalid option' error. Use the standard shell '--' pseudo argument
 +
to disable argument parsing before the negative argument. ''e.g.'' {{ic|pactl set-sink-volume 1 -- -5%}}.
  
Example output edited for brevity, the name you need is in bold:
+
=== Fallback device is not respected ===
  
    index: 2
+
PulseAudio does not have a true default device. Instead it uses a [http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/DefaultDevice/ "fallback"], which only applies to new sound streams. This means previously run applications are not affected by the newly set fallback device.
        name: <'''alsa_input.pci-0000_00_14.2.analog-stereo'''>
 
        driver: <module-alsa-card.c>
 
        flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
 
  
2. Add a remap rule to {{ic|/etc/pulse/default.pa}}, use the name you found with the previous command, here we will use '''alsa_input.pci-0000_00_14.2.analog-stereo''' as an example:
+
{{Pkg|gnome-control-center}}, {{Pkg|mate-media-pulseaudio}} and {{AUR|paswitch}} handle this gracefully. Alternatively:  
  
{{hc|/etc/pulse/default.pa|<nowiki>
+
1. Move the old streams in {{Pkg|pavucontrol}} manually to the new sound card.
### Remap microphone to mono
 
load-module module-remap-source master=alsa_input.pci-0000_00_14.2.analog-stereo master_channel_map=front-left,front-right channels=2 channel_map=mono,mono
 
</nowiki>}}
 
  
3. Restart Pulseaudio
+
2. Stop Pulse, erase the "stream-volumes" in {{ic|~/.config/pulse}} and/or {{ic|~/.pulse}} and restart Pulse. This also resets application volumes.
  
# pulseaudio -k
+
3. Disable stream device reading. This may be not wanted when using different soundcards with different applications.
  
{{Note|Pulseaudio may fail to start if you don't exit a program that was using was using the microphone (ex. if you tested on Steam before modifying the file), in which case you should exit the application and manually start Pulseaudio}}
+
{{hc|/etc/pulse/default.pa|<nowiki>
 
+
load-module module-stream-restore restore_device=false
# pulseaudio --start
+
</nowiki>}}

Revision as of 15:50, 5 December 2014

Contents

Volume

Here you will find some hints on volume issues and why you may can't hear anything.

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.

To save your current settings as the default options, run alsactl store as root.

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
Note: alsamixer will not tell you which output device is set as the default. One possible cause of no sound after install is that PulseAudio detects the wrong output device as a default. Install pavucontrol and check if there is any output on the pavucontrol panel when playing a .wav file.

Volume adjustment does not work properly

Check: /usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common

If the volume does not appear to increment/decrement properly using alsamixer or 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. amixer set Master 655+).

Per-application volumes change when the Master volume is adjusted

This is because PulseAudio uses flat volumes by default, instead of relative volumes, relative to an absolute master volume. If this is found to be inconvenient, asinine, or otherwise undesireable, relative volumes can be enabled by disabling flat volumes in the PulseAudio daemon's configuration file:

/etc/pulse/daemon.conf or ~/.config/pulse/daemon.conf
flat-volumes = no

and then restarting PulseAudio by executing

$ pulseaudio -k
$ pulseaudio --start

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".

Fix this by disabling flat volumes, as demonstrated in the previous section. 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 ~/.config/pulse/default.pa or ~/.pulse/default.pa which can also cause maximized volume trouble. Comment that out as needed.

Sound output is only mono on M-Audio Audiophile 2496 sound card

Add the following:

/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

No sound below a volume cutoff

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

If sound does not play when PulseAudio's volume is set below a certain level, try setting 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 microphone

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 (a.k.a. volume jumps to 100% after running application)

If changing the volume in specific applications or simply running an application changes the master output volume this is likely due to flat volumes mode of pulseaudio. Before disabling it, KDE users should try lowering their system notifications volume in System Settings -> Application and System Notifications -> Manage Notifications under the Player Settings tab to something reasonable. Changing the Event Sounds volume in KMix or another volume mixer application will not help here. This should make the flat-volumes mode work out as intended, if it does not work, some other application is likely requesting 100% volume when its playing something. If all else fails, you can try to disable flat-volumes:

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

Then restart PulseAudio daemon:

# pulseaudio -k
# pulseaudio --start

No sound after resume from suspend

If audio generally works, but stops after resume from suspend, try "reloading" PulseAudio by executing:

$ /usr/bin/pasuspender /bin/true

This is better than completely killing and restarting it (pulseaudio -k followed by pulseaudio --start), because it doesn't break already running applications.

If the above fixes your problem, you may wish to automate it, by creating a systemd service file.

1. Create the template service file in /etc/systemd/system/resume-fix-pulseaudio@.service:

[Unit]
Description=Fix PulseAudio after resume from suspend
After=suspend.target

[Service]
User=%I
Type=oneshot
Environment="XDG_RUNTIME_DIR=/run/user/%U"
ExecStart=/usr/bin/pasuspender /bin/true

[Install]
WantedBy=suspend.target

2. Enable it for your user account

# systemctl enable resume-fix-pulseaudio@YOUR_USERNAME_HERE.service

3. Reload systemd

# systemctl --system daemon-reload

ALSA channels mute when headphones are plugged/unplugged improperly

If when you unplug your headphones or plug them in the audio remains muted in alsamixer on the wrong channel due to it being set to 0%, you may be able to fix it by opening /etc/pulse/default.pa and commenting out the line:

load-module module-switch-on-port-available


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.

$ 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.

No microphone on ThinkPad T400/T500/T420

Run:

alsamixer -c 0

Unmute and maximize the volume of the "Internal Mic".

Once you see the device with:

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.

No microphone input on Acer Aspire One

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

Static noise in microphone recording

If we are getting static noise in Skype, gnome-sound-recorder, arecord, etc.'s recordings, then the sound card sample rate is incorrect. That is why there is static noise in Linux microphone recordings. To fix this, we need to set the sampling rate in /etc/pulse/daemon.conf for the sound hardware.

Determine sound cards in the system (1/5)

This requires alsa-utils and related packages to be installed:

$ 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

Sound card is hw:0,0.

Determine sampling rate of the sound card (2/5)

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

observe, the got = 96000Hz. This is the maximum sampling rate of our card.

Setting the sound card's sampling rate into PulseAudio configuration (3/5)

The default sampling rate in PulseAudio:

$ grep "default-sample-rate" /etc/pulse/daemon.conf
; default-sample-rate = 44100

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 a microphone for, say, 10 seconds. Make sure the microphone 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.

No microphone on Steam or Skype with enable-remixing = no

When you set enable-remixing = no on /etc/pulse/daemon.conf you may find that your microphone has stopped working on certain applications like Skype or Steam. This happens because these applications capture the microphone as mono only and because remixing is disabled, Pulseaudio will no longer remix your stereo microphone to mono.

To fix this you need to tell Pulseaudio to do this for you:

1. Find the name of the source

# pacmd list-sources

Example output edited for brevity, the name you need is in bold:

   index: 2
       name: <alsa_input.pci-0000_00_14.2.analog-stereo>
       driver: <module-alsa-card.c>
       flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY

2. Add a remap rule to /etc/pulse/default.pa, use the name you found with the previous command, here we will use alsa_input.pci-0000_00_14.2.analog-stereo as an example:

/etc/pulse/default.pa
### Remap microphone to mono
load-module module-remap-source master=alsa_input.pci-0000_00_14.2.analog-stereo master_channel_map=front-left,front-right channels=2 channel_map=mono,mono

3. Restart Pulseaudio

# pulseaudio -k
Note: Pulseaudio may fail to start if you don't exit a program that was using was using the microphone (ex. if you tested on Steam before modifying the file), in which case you should exit the application and manually start Pulseaudio
# pulseaudio --start


Audio Quality

Enable Echo/Noise-Cancelation

Arch doesn't load the Pulseaudio Echo-Cancelation module by default, therefore, we have to add it in /etc/pulse/default.pa. First you can test if the module is present with pacmd and entering list-modules. If you can't find a line showing name: <module-echo-cancel> you have to add

/etc/pulse/default.pa
load-module module-echo-cancel

then restart Pulseaudio

pulseaudio -k
pulseaudio --start

and check if the module is activated by starting pavucontrol. Under Recoding the input device should show Echo-Cancel Source Stream from"

Glitches, skips or crackling

The newer implementation of the PulseAudio sound server uses 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.

If you are using Intel's IOMMU and experience glitches and/or skips, add intel_iommu=igfx_off to your kernel command line.

Please report any such cards to PulseAudio Broken Sound Driver page

Setting the default fragment number and buffer size in PulseAudio

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements. See Help:Style for reference.Tango-edit-clear.png

Reason: Copied from Linux mint topic with few additions (Discuss in Talk:PulseAudio/Troubleshooting#)

Finding out your audio device parameters (1/4)

To find your sound card buffering settings:

$ echo autospawn = no >> ~/.config/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' ~/.config/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 = 705600 bits per second. That's 1411200 bps for stereo.

Let's take a look at the parameters we have found in the previous step:

device.buffering.buffer_size = "768000" => 768000/1411200 = 0.544217687075s = 544 msecs
device.buffering.fragment_size = "384000" => 384000/1411200 = 0.272108843537s = 272 msecs

Modify PulseAudio's configuration file (3/4)

/etc/pulse/daemon.conf
; default-fragments = X
; default-fragment-size-msec = Y

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:

/etc/pulse/daemon.conf
; default-fragments = '''2'''
; default-fragment-size-msec = '''272'''

Restart the PulseAudio daemon (4/4)

$ pulseaudio -k
$ pulseaudio --start

For more information, see: Linux Mint topic

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


Laggy sound

This issue is due to incorrect buffer sizes. First verify that the variables default-fragments and default-fragment-size-msec are not being set to non default values in the file /etc/pulse/daemon.conf. If the issue is still present, try setting them to the following values:

/etc/pulse/daemon.conf
default-fragments = 5
default-fragment-size-msec = 2

Choppy/distorted sound

This can result from an incorrectly set sample rate. Try the following setting:

/etc/pulse/daemon.conf
default-sample-rate = 48000

and restart the PulseAudio server.

If one experiences choppy sound in applications using OpenAL, change the sample rate in /etc/openal/alsoft.conf:

/etc/openal/alsoft.conf
frequency = 48000

Setting the PCM volume above 0 dB can cause clipping. Running alsamixer will allow you to see if this is the problem and if so fix it. Note that ALSA may not correctly export the dB information to PulseAudio. Try the following:

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

and restart the PulseAudio server. See also #No sound below a volume cutoff.


Hardware and Cards

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 is 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 VT and back again. If that doesn't work, try: turn off your monitor, switch to another VT, turn on your monitor, and switch back. This problem has been reported by ATI/Nvidia/Intel users.

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.

Starting an application interrupts other app's sound

If you have trouble with some applications (eg. Teamspeak, Mumble) interrupting sound output of already running applications (eg. Deadbeaf), you can solve this by commenting out the line load-module module-role-cork in /etc/pulse/default.pa like shown below:

/etc/pulse/default.pa
### Cork music/video streams when a phone stream is active
# load-module module-role-cork

Then restart pulseaudo by using your normal user account with

pulseaudio -k
pulseaudio --start

The only device shown is "dummy output" or newly connected cards aren't detected

This may be caused by settings in ~/.asoundrc overriding the system wide settings in /etc/asound.conf. This can be prevented by commenting out the last line of ~/.asoundrc like so:

~/.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.

If it doesn't help or you see nothing in the output, deleting the timidity++ package and restarting your system will help to get rid of the "dummy output".

Another reason is FluidSynth conflicting with PulseAudio as discussed in this thread. One solution is to remove the package fluidsynth.

Alternatively you could modify the fluidsynth configuration file /etc/conf.d/fluidsynth and change the driver to PulseAudio, then restart fluidsynth and PulseAudio:

/etc/conf.d/fluidsynth
SYNTHOPTS="-is -a pulseaudio -m alsa_seq -r 48000"

No HDMI 5/7.1 Selection for Device

If you are unable to select 5/7.1 channel output for a working HDMI device, then turning off "stream device reading" in /etc/pulse/default.pa might help.

See #Fallback device is not respected.

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 ~/.config/pulse

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"
}
Tip: Simultaneous output can also be achieved manually using alsamixer. Disable "auto mute" item, then unmute other output sources you want to hear and increase their volume.

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 sound card 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 sound card.

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

  • Create udev rule to make PulseAudio choose your PulseAudio configuration file specific to the sound card.
  • 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" 

Now, create a configuration file. If you bother, you can start from scratch and make it 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

Disable Bluetooth support

If you do not use Bluetooth, you may experience the following error in your journal:

bluez5-util.c: GetManagedObjects() failed: org.freedesktop.DBus.Error.ServiceUnknown: The name org.bluez was not provided by any .service files

To disable Bluetooth support in PulseAudio, make sure that the following lines are commented out in the configuration file in use (~/.config/pulse/default.pa or /etc/pulse/default.pa):

~/.config/pulse/default.pa
### Automatically load driver modules for Bluetooth hardware
#.ifexists module-bluetooth-policy.so
#load-module module-bluetooth-policy
#.endif

#.ifexists module-bluetooth-discover.so
#load-module module-bluetooth-discover
#.endif

Bluetooth headset replay problems

Some user reports huge delays or even no sound when the Bluetooth connection does not send any data. This is due to the module-suspend-on-idle module, which automatically suspends sinks/sources on idle. As this can cause problems with headset, the responsible module can be deactivated.

To disable loading of the module-suspend-on-idle module, comment out the following line in the configuration file in use (~/.config/pulse/default.pa or /etc/pulse/default.pa):

~/.config/pulse/default.pa
### Automatically suspend sinks/sources that become idle for too long
#load-module module-suspend-on-idle

Finally restart PulseAudio to apply the changes.

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

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.


Applications

Flash content

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

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

Note: This may invariably crash the Flash plugin.

If you find audio from flash is being laggy, you might like to have flash access ALSA directly. This fixes this problem in some cases. To do this, configure PulseAudio to use dmix.


Other Issues

Bad configuration files

After starting PulseAudio, if the system outputs no sound, it may be necessary to delete the contents of ~/.config/pulse and/or ~/.pulse. PulseAudio will automatically create new configuration files on its next start.

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.

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 ~/.config/pulse

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 has 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.

~/.config/pulse/client.conf
# Disable autospawning the PulseAudio daemon
autospawn = no

Daemon startup failed

Try resetting PulseAudio:

$ rm -rf /tmp/pulse* ~/.pulse* ~/.config/pulse
$ pulseaudio -k
$ pulseaudio --start
  • Check that options for sinks are set up correctly.
  • If you configured in default.pa to load and use the OSS modules then check with lsof that /dev/dsp device is not used by another application.
  • Set a preferred working resample method. Use pulseaudio --dump-resample-methods to see a list with all available resample methods you can use.
  • To get details about currently appeared unfixed errors or just get status of daemon use commands like pax11publish -d and pulseaudio -v where v option can be used multiple time to set verbosity of log output equal to the --log-level[=LEVEL] option where LEVEL is from 0 to 4. See the Outputs by PulseAudio error status check utilities section.

See also man pages for pax11publish and pulseaudio for more details.

Outputs by PulseAudio error status check utilities

If the pax11publish -d shows error like:

N: [pulseaudio] main.c: User-configured server at "user", refusing to start/autospawn.

then run pax11publish -r command then could be also good to logout and login again. This manual cleanup is always required when using LXDM because it does not restart the X server on logout; see LXDM#PulseAudio.

If the pulseaudio -vvvv command shows error like:

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.

This can be resolved temporary by:

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

For permanent use save settings in the 99-sysctl.conf file:

/etc/sysctl.d/99-sysctl.conf
# Increase inotify max watchs per user
fs.inotify.max_user_watches = 100000
Warning: It may cause much bigger consumption of memory by kernel.

See also

Daemon already running

On some systems, PulseAudio may be started multiple times. journalctl will report:

[pulseaudio] pid.c: Daemon already running.

Make sure to use only one method of autostarting applications. pulseaudio includes these files:

  • /etc/X11/xinit/xinitrc.d/pulseaudio
  • /etc/xdg/autostart/pulseaudio.desktop
  • /etc/xdg/autostart/pulseaudio-kde.desktop

Also check user autostart files and directories, such as xinitrc, ~/.config/autostart/ etc.

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

Unable to select surround configuration other than "Surround 4.0"

If you're unable to set 5.1 surround output in pavucontrol because it only shows "Analog Surround 4.0 Output", open the ALSA mixer and change the output configuration there to 6 channels. Then restart pulseaudio, and pavucontrol will list many more options.

Realtime scheduling

If rtkit does not work, you can manually set up your system to run PulseAudio with real-time 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

pactl "invalid option" error with negative percentage arguments

pactl commands that take negative percentage arguments will fail with an 'invalid option' error. Use the standard shell '--' pseudo argument to disable argument parsing before the negative argument. e.g. pactl set-sink-volume 1 -- -5%.

Fallback device is not respected

PulseAudio does not have a true default device. Instead it uses a "fallback", which only applies to new sound streams. This means previously run applications are not affected by the newly set fallback device.

gnome-control-center, mate-media-pulseaudio and paswitchAUR handle this gracefully. Alternatively:

1. Move the old streams in pavucontrol manually to the new sound card.

2. Stop Pulse, erase the "stream-volumes" in ~/.config/pulse and/or ~/.pulse and restart Pulse. This also resets application volumes.

3. Disable stream device reading. This may be not wanted when using different soundcards with different applications.

/etc/pulse/default.pa
load-module module-stream-restore restore_device=false