Aplay: Device Or Resource Busy

In Use

Went to check the sound setup on a Debian box and the sound app would not play. I kept getting the following error message:

aplay: audio open error: Device or resource busy

To extract info on the application hogging the sound device, do:

lsof | grep snd

This displayed:

xmms2d  31732  patrick   7u    CHR  116,9  0t0  3885 /dev/snd/controlC0

I could see evidence of the app that was blocking access. I had nothing obvious running, so I killed the process.

killall xmms2d

Then checked again.

lsof | grep snd

Nothing. Its clear.