Bug 220949 - When the only USB soundcard is disconnected, defunct /dev/dsp0 is left, kernel warnings, programs hang
Summary: When the only USB soundcard is disconnected, defunct /dev/dsp0 is left, kerne...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: 11.0-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-usb mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-23 16:32 UTC by Yuri Victorovich
Modified: 2017-07-25 01:49 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer 2017-07-23 16:32:39 UTC
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)
Comment 1 Hans Petter Selasky freebsd_committer 2017-07-23 19:38:25 UTC
This is a known issue. The solution is not just straight forward, due to mmap() use. See also.

https://reviews.freebsd.org/D11140

--HPS