I have a USB webcam that is also a soundcard with only a microphone, and no speaker. When there are no other audio devices, disconnecting this USB webcam causes system dysfunction.
There are a lot of repeating messages in log:
> Jul 23 09:14:21 yv kernel: pcm0: unregister: mixer busy
> Jul 23 09:14:21 yv kernel: pcm0: Waiting for sound application to exit!
> Jul 23 09:14:23 yv kernel: pcm0: unregister: mixer busy
> Jul 23 09:14:23 yv kernel: pcm0: Waiting for sound application to exit!
Programs that have this device open hanged and became unkillable with kill -9.
'kldunload snd_uaudio.ko' also hangs in unkillable state.
USB is hot-pluggable. Device is supposed to disappear and reappear without any long-term effects.
IMO, /dev/dspN should disappear when device is removed. Programs that have it opened should behave gracefully. They should only get errors from it and not hang.
USB webcam: HD Pro Webcam C920 (vendor 0x046d, product 0x6860)
This is a known issue. The solution is not just straight forward, due to mmap() use. See also.