Troubleshooting

Device or resource busy

Playing sounds from multiple applications simultaneously is not necessarily trivial: for example, when each application chose a different sample rate, one of the streams will have to be either dropped or resampled, which can have noticeable effects on both performance and audio quality.

Partly for this reason, it is common for 'low level' (OSS/ALSA) audio layers to allow only 1 application access to the sound card at a time. Mixing should be done in a 'higher level' like JACK.

When you get 'Device or resource busy' errors when connecting to your sound card, it is likely that some application has taken full control over the 'lower level' interface to the sound card. To determine which application is holding the sound card, you can use 'fuser' on the audio device nodes /dev/dsp and /dev/snd/*:

In the following example, there are 3 applications using the sound layer: alsamixer and timidity are connected to the mixer control and the sequencer, respectively. Those should not cause problems. mpg123, however, is talking to the sound card directly though the OSS compatibility layer. That is our culprit. The /dev/snd/pcm* devices (not in use here) can also block the sound card.

 arnouten@bird:~$ sudo fuser /dev/snd/*
 /dev/snd/controlC0:  10449
 /dev/snd/seq:         4429
 arnouten@bird:~$ sudo fuser /dev/dsp 
 /dev/dsp:            14111
 arnouten@bird:~$ ps aux | grep 10449
 arnouten 10449  0.0  0.0   3544  1508 pts/3    S+   Sep05   0:00 alsamixer
 arnouten@bird:~$ ps aux | grep 4429
 root      4429  0.0  0.0  14500   228 ?        S    Sep03   0:00 /usr/bin/timidity -Os -iAD
 arnouten@bird:~$ ps aux | grep 14111
 arnouten 14111  1.1  0.0  11180  1360 pts/5    S+   12:01   0:00 mpg123 AcousticonTheme.mp3
 arnouten@bird:~$