Difference between revisions of "Sound troubleshooting"

From Linuxintro
imported>ThorstenStaerk
imported>ThorstenStaerk
(speaker-test)
Line 4: Line 4:
  
 
== If your cables and volume are okay ==
 
== If your cables and volume are okay ==
* make sure your system "sees" a sound device:
+
* Test if your sound card driver and cables are okay; play a test sound:
ls /dev/dsp*
+
  speaker-test
must list a sound card device file, e.g. /dev/dsp or /dev/dsp1.
 
 
 
* 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 ===

Revision as of 09:02, 11 January 2014

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

The Methodology

If your cables and volume are okay

  • Test if your sound card driver and cables are okay; play a test sound:
speaker-test

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

Knoppix

When there is no sound under Knoppix try

/etc/init.d/alsa-utils start