Troubleshooting sound problems

From LQWiki
(Redirected from Sound troubleShooting)
Jump to navigation Jump to search

To find the source of your sound problems, you should clarify the most basic sound system issues first. So, go on in the order of this article.

Playing sound

Test physically

Test if the sound works. Circumvent any mixer. Just write directly to the sound device /dev/dsp (use CTRL-C to stop the sound):

cat /dev/urandom >/dev/dsp

If you do not hear a sound

If you get an error message

If you get an error message, find out your distribution.

SUSE

On SUSE Linux, you must initialize the sound system after Linux installation. Do it with the command

yast2 sound

Delete the existing sound card. It stays there. Edit it and do an advanced setup. Play a test sound. You must be able to hear the test sound.

If you do not get an error message

If you cannot hear a sound, check

  • is your user allowed to play sound
  • did you load the correct sound driver (hwinfo --sound will tell you the driver activation command)
  • are your speakers connected, working and have the volume turned up?
  • does restarting the sound daemon help:
/etc/init.d/alsasound restart

If you hear a sound

If you hear a sound, but your sound problem persists, we have to check at application level. For example I once used xawTv on a system where /dev/dsp was connected to the speakers. However, it did not play sound. Removing all sound cards but one from my computer solved the problem. So, there may be programs that use a sound card other than /dev/dsp as the primary one. My recommendation is to only have one soundcard. This is difficult if you, for example, have a webcam attached with an integrated soundcard for recording sound. So, pay attention how many soundcards you really have.

Mozilla Flash-Player Plug-In

Removing all soundcards but one helped.

xawtv

Removing all soundcards but one helped.

KDE

KDE does not use /dev/dsp as default audio device, but lets you set it with the program

systemsettings

mplayer

mplayer does not use /dev/dsp as default audio device, but lets you set it within the settings menu.

If you get an error message

What application is blocking the sound card?

If you get an error that says another application is blocking the sound card, you can check to see what process is responsible. This can look like the following:

tweedleburg:~ # lsof | grep -E "dsp|snd"   
mplayer   19861       root    4w      CHR               14,3              104564 /dev/dsp

"lsof" is the command that lists open files (including special files like devices). The grep is to isolate connections to /dev/dsp, /dev/dsp1, /dev/snd, etc. In this example, mplayer, process id 19861, is blocking the device /dev/dsp, your sound card. You can kill it with the command

killall mplayer 

This error is symptomatic of programs that use the old Open Sound System. Newer applications that use the ESound daemon or the new Advanced Linux Sound Architecture should be able to emit sounds at the same time as other new applications.

Application

Audacity

KDE Auto-Suspend

Problem

When we installed Audacity and tried to play sounds, sometimes it would play and sometimes it would not. Most of the time it would not.

Solution

We found that the KDE Sound System has exclusive access to the device for a set period of seconds (I think the default was 20) until the Auto-Suspend feature kicked in. The problem was solved by lowering the Auto-Suspend time to 5 seconds; now the problem only happens when we quickly start Audacity again and again on several small files (Lowering the Auto-Suspend threshold may provide a solution.). This problem may have been remedied in newer versions of KDE or Audacity. See also http://userbase.kde.org/Sound_Problems.

Recording Sound

If you have problems recording sound, first try it without any mixer or other problem sources:

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

Say something and abort by pressing CTRL_C. Play your recording with the command

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

If you hear your voice, at least the drivers are okay. Then start working with the mixer:

alsamixer

Change to Switches to 100% and set "Input Source" to "Front Mic" instead of "Mic".