Logo

Home About Community Download Documentation Planet


Troubleshooting

If you would like support on the #pulseaudio freenode irc channel. Start by running the following one-liner as a normal user and posting the generated link to the channel. Follow up with a brief description of your problem.

$ curl https://gitlab.freedesktop.org/pulseaudio/pulseaudio/raw/master/src/utils/pa-info?inline=false | bash | nc termbin.com 9999

View from orbit

-mention somewhere that pulseaudio runs "per user"
In the common case pulseaudio uses alsa to control the sound card(s) of your computer. Most applications use the alsa interface to playback or capture audio.

application<->default_pcm<->pulseaudio<->alsa<->soundcard

Most distros come with alsa configured similar to the following. This configuration overrides the default pcm so that it routes through pulseaudio. The primary benefit of this approach is, alsa applications that use the default pcm work with pulseaudio without even being aware of pulseaudio's existence.

$ cat /usr/share/alsa/pulse-alsa.conf 
# This file is referred to by /usr/share/alsa/pulse.conf to set pulseaudio as
# the default output plugin for applications using alsa when PulseAudio is
# running.

pcm.!default {
    type pulse
    hint {
        show on
        description "Playback/recording through the PulseAudio sound server"
    }
}

ctl.!default {
    type pulse
}

You can verify that the pcm is present and correct with the following command.

$ aplay -L | grep --context=1 ^default
default
    Playback/recording through the PulseAudio sound server

Some applications however use the pulseaudio native interface. Firefox is the most common example.

application<->pulseaudio<->alsa<->soundcard

Baseline test

$ pavucontrol

If pavucontrol shows a blank canvas with some text that starts like this "Connection to PulseAudio failed.", it means that pavucontrol could not connect to your pulseaudio daemon. If pavucontrol shows a a tabbed window click on the playback tab to prepare for the next test.

Now tile pavucontrol and a terminal window on your screen and run the following test.

$ speaker-test --channels=2 --nloops=1 --test=wav --device=default

You should see a playback stream appear on the screen. If you hear "front-left" coming from the left speaker and "front-right" coming from the right speaker you sound stack is all present and correct.

No sound or messed-up sound

Where $messed_up = { choppy, scratchy, torn, glitchy, etc...}

First thing to do is determine if the problem occurs with pure alsa.

$ pactl list sinks | grep -oP "(?<=device.string = \")(.*)(?=\")" | while read in; do pasuspender -- speaker-test --nloops=1 --channels=2 --test=wav --device=$in; done

You should hear "front-left" coming from the left speaker and "front-right" coming from the right speaker. If the same problem occurs with pure alsa then its probably best to seek further support from the alsa folks.

https://www.alsa-project.org/wiki/Main_Page

Is pulseaudio installed?

$ which pulseaudio
/usr/local/bin/pulseaudio

Is Pulseaudio running?

$ ps aux | grep pulseaudio
xxxxxxx+  9255  1.2  0.0 602168  8832 ?        S<l  Aug12  34:15 /usr/local/bin/pulseaudio --start --log-target=syslog
xxxxxxx+ 27742  0.0  0.0  18940   928 pts/0    S+   16:21   0:00 grep --color=auto pulseaudio

Will the pulseaudio service auto-spawn?

$ pactl info
Server String: /run/user/1000/pulse/native
Library Protocol Version: 33
Server Protocol Version: 33
Is Local: yes
Client Index: 138
Tile Size: 65472
User Name: xxxxxxxxxx
Host Name: xxxxxxxxxx
Server Name: pulseaudio
Server Version: 12.99.1-15-gf4c5-dirty
Default Sample Specification: s16le 2ch 44100Hz
Default Channel Map: front-left,front-right
Default Sink: alsa_output.pci-0000_00_1b.0.analog-stereo
Default Source: alsa_output.pci-0000_00_1b.0.analog-stereo.monitor
Cookie: aaaa:aaaa

Pulse is running but I hear no sound

OK, so we know that pulseaudio is running, but when you play something, you don't hear anything. Let's start with the basics:

  • If you have a desktop computer, are your speakers plugged in correctly to the (usually) green socket?
  • Do the speakers still work? (try plugging in your mp3 player to test!).
  • Do you have multiple sound cards, and have you tried the speakers in all of them to make sure you're using the device you think you are? I know the above may be simple and obvious sounding, but please do check this and don't skip this check as it can (and does) happen to the best of us!

OK, so we know sound is physically capable of coming out of our speakers. Now you should run pavucontrol and check under the "Output Devices" tab to see if your sound hardware is listed there. If pulseaudio cannot open the hardware device on startup (e.g. due to the device being "hogged" by some other application), then it will automatically load a "NULL sink" for you. This appears to your applications like everything is working correctly but will silently discard all the audio data. This is done because many applications do not like it when sound hardware is not present in pulseaudio. If you find that the "Output Devices" tab shows only the automatic NULL sink, you need to debug what other applications are using your sound hardware on startup or find out why pulse cannot open your hardware. Running fuser /dev/snd/* may give some clues as to what applications are hogging things, and failing any information from this, you can run pulseaudio -k; pulseaudio -vvv. The lines beginning with E: specifically may give some clues.

Pulse is running and has loaded my devices

OK, so let's test a few things. First things first, make sure you can hear sound output directly to ASLA. The easiest way to do this is with mplayer. Find some music track (e.g. an MP3 or Ogg file) and run mplayer -ao alsa:device=hw=0 yourchosentrack.mp3. This should play your track and bypass pulseaudio completely. If you still hear nothing then the problem is at the level below pulse.

I don't hear any output from sound applications

Open a terminal and try playing a sound with paplay:

$ paplay /usr/share/sounds/generic.wav
$ 

In case you don't see any error message and hear the sound, your applications need to be configured to use PulseAudio. See [Software/PulseAudio/Documentation/User/PerfectSetup#?ThirdPartyApplications the relevant section in Perfect Setup].

If you neither get an error message, nor hear the sound, check volume settings. For pulseaudio, use pavucontrol utlity. For ALSA use alsamixer -c 0.

$ paplay /usr/share/sounds/generic.wav
Connection failure: Connection refused
$ 

This most likely means that your pulseaudio server is not running.

Sound server is not running

Check that it is enabled to be started up in your desktop environment. See relevant sections of Perfect Setup for [Software/PulseAudio/Documentation/User/PerfectSetup#GNOME GNOME] and [Software/PulseAudio/Documentation/User/PerfectSetup#KDE KDE]. Note that your OS distribution may already take care of this via dedicated packages.

Look into logs for reason why might pulseaudio startup have failed:

# grep pulseaudio /var/log/messages

Try to launch pulseaudio manually with verbose output enabled: (the output might be valuable to troubleshoot a potential bug)

$ pulseaudio -vvv

If your output seems like following, you might not have permissions to access the sound device:

D: alsa-util.c: Trying front:0...
ALSA lib conf.c:3949:(snd_config_expand) Unknown parameters 0
ALSA lib pcm.c:2145:(snd_pcm_open_noupdate) Unknown PCM front:0
I: alsa-util.c: Couldn't open PCM device front:0: Invalid argument
D: alsa-util.c: Trying surround40:0...
ALSA lib conf.c:3949:(snd_config_expand) Unknown parameters 0
ALSA lib pcm.c:2145:(snd_pcm_open_noupdate) Unknown PCM surround40:0
I: alsa-util.c: Couldn't open PCM device surround40:0: Invalid argument
D: alsa-util.c: Trying surround41:0...
ALSA lib conf.c:3949:(snd_config_expand) Unknown parameters 0
ALSA lib pcm.c:2145:(snd_pcm_open_noupdate) Unknown PCM surround41:0
I: alsa-util.c: Couldn't open PCM device surround41:0: Invalid argument
D: alsa-util.c: Trying surround50:0...
ALSA lib conf.c:3949:(snd_config_expand) Unknown parameters 0
ALSA lib pcm.c:2145:(snd_pcm_open_noupdate) Unknown PCM surround50:0
I: alsa-util.c: Couldn't open PCM device surround50:0: Invalid argument
D: alsa-util.c: Trying surround51:0...
ALSA lib conf.c:3949:(snd_config_expand) Unknown parameters 0
ALSA lib pcm.c:2145:(snd_pcm_open_noupdate) Unknown PCM surround51:0
I: alsa-util.c: Couldn't open PCM device surround51:0: Invalid argument
D: alsa-util.c: Trying surround71:0...
ALSA lib conf.c:3949:(snd_config_expand) Unknown parameters 0
ALSA lib pcm.c:2145:(snd_pcm_open_noupdate) Unknown PCM surround71:0
I: alsa-util.c: Couldn't open PCM device surround71:0: Invalid argument
D: alsa-util.c: Trying hw:0 as last resort...
ALSA lib pcm_hw.c:1207:(_snd_pcm_hw_open) Invalid value for card
E: alsa-util.c: Error opening PCM device hw:0: No such device
E: module.c: Failed to load  module "module-alsa-sink" (argument: "device_id=0 sink_name=alsa_output.pci_8086_284b_sound_card_0_alsa_playback_0"): initialization failed.

Check the permission with getfacl /dev/snd/*.