Archive:Troubleshooting sound

Jump to: navigation, search
Icon-trash.png This article is being considered for deletion!
Reason:

SDB:Audio troubleshooting.

Please do not blank, merge, or move this article, or remove this notice. Refer to this article's discussion page and our deletion policy for more information.

So you want your Linux system to play sound, but it does not? Follow these steps to analyze and solve the problem:

Playback problems

Check your cables

If your cables are correct:

  • make sure your system "sees" a sound device:
ls /dev/dsp

must list /dev/dsp, the sound card device file. In this example we assume it is /dev/dsp.

  • Test if your sound card driver and cables are okay
dd if=/dev/urandom of=/dev/dsp

or

while true; do yes; done | dd of=/dev/dsp

The first command throws random bytes into the sound device, the second one uses the "y" byte. The "y" sound is more pleasant to the ears, but with other soundcards than mine, it might not even be audible.

If you hear a sound

If you hear a sound, your cables and drivers are okay.

If you do not hear a sound

If you do not hear a sound, see if you get an error message.

If you do not get an error message

If you do not get an error message, it can be a driver issue. To find out, delete all sound devices and re-create them:

tweedleburg:~ # rm /dev/dsp*
tweedleburg:~ # udevtrigger

Check again with dd if=/dev/urandom of=/dev/dsp. If you still do neither get an error message nor sound, it is most probably a driver issue. Get yourself a USB soundcard and proceed.

If you get an error message

If you get an error message like this:

tweedleburg:~ # dd if=/dev/urandom of=/dev/dsp
dd: opening `/dev/dsp': Device or resource busy

You should find out what process blocks your sound card. Do this with the command lsof (list open files):

tweedleburg:~ # lsof | grep dsp              
mplayer   18251       root    4w      CHR              14,35               14320 /dev/dsp2

You see, mplayer is blocking /dev/dsp2, you third soundcard. Now find out what soundcard you are using:

tweedleburg:~ # ll /dev/dsp*
lrwxrwxrwx 1 root root       9 Jun 21 10:38 /dev/dsp -> /dev/dsp2
crw-rw---- 1 root audio 14, 19 Jun 21 10:36 /dev/dsp1
crw-rw---- 1 root audio 14, 35 Jun 21 10:36 /dev/dsp2

/dev/dsp points to /dev/dsp2, so the soundcard you are using is blocked by mplayer. So, kill mplayer if you are sure that is what you want:

killall mplayer

recording problems

If you have problems recording sound, attach a microphone to your input box, then open a console and enter

dd if=/dev/dsp of=audio.raw

Say something into the microphone. Stop by pressing CTRL_C. Play your recording by entering

dd if=audio.raw of=/dev/dsp