Changes between Initial Version and Version 1 of faq/pulse-debug

Dec 4, 2012, 9:02:32 AM (9 years ago)
Jamie McClelland



  • faq/pulse-debug

    v1 v1  
     1= Debugging Pulse Audio =
     3Audio on linux can be challenging because there are many pieces involved.
     5Here are some tips on testing them out one by one.
     7These tips expect you to be running pulseaudio on a Debian Wheezy machine (amd64).
     9== Installing packages ==
     11Minimally, you should have the following pulseaduio packages installed:
     14apt-get install libpulse-mainloop-glib0:amd64 libpulse0:amd64 pulseaudio pulseaudio-module-x11 pulseaudio-utils
     17== pavucontrol ==
     19Next, familiarize yourself with the pulseaudio VU graphical application for controlling pulseaudio levels. You can launch by typing:
     25The "Configuration" tab is a good place to start. You should see a drop down menu to choose the Profile you would like to use.
     27The profiles available depends on your hardware. My laptop has several analog audio stereo devices:
     29 * Built-in mic
     30 * Built-in speakers
     31 * One combo speaker/mic jack
     33In addition, I have an HDMI port, which is a one-way port (it can send out audio, but cannot recieve audio) for digital audio.
     35So, I have a long list of profiles that allow me to mix and match between my various input and output options.
     37Since I only use my built-in mic and speakers and my analog mini mic/speaker combo jack on my laptop (I've never plugged anything into my HDMI jack), the profile that works for me is called "Analog Stereo Duplex."
     39Note: when I plug in headphones, the built-in speaker and mic automatically turns off. Not sure where or how this works...
     41For this tutorial, I'm assuming you have chosen the "Analog Stereo Duplex" profile.
     43== Testing output ==
     45Next, click on the "Output Devices" tab. From the "Show" drop down, select "All Output devices." When I do this, I see a Port drop down that lists one option called "Analog Output."
     47I can manually adjust the Front Left/Front Right volume controls. And, I can see a VU meter (that is blank when nothing is playing).
     49Before testing with complex audio applications, ensure you can hear sound via the simple paplay command line tool.
     51Find a sound file on your computer (if you don't know where to look, try /usr/share/sounds - if you dig deep enough, you should find a .wav or .ogg file).
     53Try playing that sound from the command line:
     56paplay /usr/share/sounds/gnome/default/alerts/sonar.ogg
     59You should see the VU meter react and hear the sound.
     61If you don't hear anything, you'll need to fix this problem before moving on. Try unplugging your computer speakers/head phone to test the built-in speakers. Or, try a different headphone set.
     63Remember - if you have a hardware problem it's much easier to debug using these simple tips than to get bogged down in trouble shooting a complex audio program or running around in circles installing different programs to see if they will work better.
     65== Testing Input ==
     67Next, click on the "Input Devices" tab. From the "Show" drop down, select "All Except Monitors." When I do this, I see a Port drop down that lists one option called "Analog input."
     69I can manually adjust the Front Left/Front Right volume controls. And, I can see a VU meter that is active as I watch it. Try tapping your mic or speaking and you should see it move.
     71If you don't see it move - debug before moving on to more complex steps. Try plugging in a mic (or a different mic). You might try unplugging your mic and testing your built-in mic.
     73Assuming everything works up to now... try recording a sound and playing it back:
     76parec test.wav
     79Say a few words, then hit ctl-c to cancel.
     81Then, play it back with:
     84pacat test.wav
     87If you can hear what you said - congratulations - you have your base pulseaudio system working.
     89== More debugging ==
     91Most applications on wheezy that I've tried, support pulseaudio, but you may need to configure them to use it. Search the configuration screens of your application to ensure they are properly set to use pulseaudio.
     93pulseaudio runs as a daemon - but it is not recommended to start it as system startup. Your /etc/default/pulseaudio file should contain: PULSEAUDIO_SYSTEM_START=0
     95Applications that need pulseaudio will start and run pulseaudio as your user. On my machine:
     980 jamie@animal:~$ ps -eFH | egrep [p]ulseaudio
     99jamie    20576     1  0 79777  8496   1 Nov25 ?        00:29:23   /usr/bin/pulseaudio --start --log-target=syslog
     1000 jamie@animal:~$
     103You can always kill the daemon and it will restart on it's own. If you see more than one daemon running you may have problems and should try killing them all to see if that helps.
     105pulseaudio has many options, which you can get a sense of from reading the files in /etc/pulse.
     107If you want to customize them, you should not mess with system.conf (only needed if you run pulseaudio system-wide). daemon.conf and seem to both apply to the daemon. I've modified my daemon by copying /etc/pulse/ to ~/.pulse/ and editing it. You can do the same with /etc/pulse/client.conf to change the behavior of clients that connect to the daemon.
     109pulseaudio comes with some additional command line utilities which can be used for further debugging.
     111`pactl` allows you to query the running pulseaudio daemon.
     113For basic information about the running daemon:
     1160  jamie@animal:~$ pactl info
     117Server String: /tmp/pulse-jL9Rjit86brT/native
     118Library Protocol Version: 26
     119Server Protocol Version: 26
     120Is Local: yes
     121Client Index: 92
     122Tile Size: 65472
     123User Name: jamie
     124Host Name: animal
     125Server Name: pulseaudio
     126Server Version: 2.0
     127Default Sample Specification: s16le 2ch 44100Hz
     128Default Channel Map: front-left,front-right
     129Default Sink: alsa_output.pci-0000_00_1b.0.analog-stereo
     130Default Source: alsa_input.pci-0000_00_1b.0.analog-stereo
     131Cookie: 1759:ceb7
     1320 jamie@animal:~$
     135Note that pulseaudio refers to "Sink" when referring to what we would usually think of as an output device and "Source" for input devices.
     137Another way of querying and controlling the running daemon is with the `pacmd` tool.
     139If you type `pacmd` into your terminal you will be dropped into a shell. Type `help` to see a list of commands you can run.