Sound troubleshooting
So you want your Linux system to play sound, but it does not? Follow these steps to analyze and maybe solve the problem:
Contents
If your cables and volume are okay
- 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