mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-12 14:29:28 +00:00
Stop USB audio transfers early so that any audio applications
will time out and close opened /dev/dspX.Y device(s), if any. This is a workaround because we cannot unregister PCM devices while the audio character device is in use. Add a missing inclusion guard. MFC after: 1 weeks
This commit is contained in:
parent
2e14174893
commit
a6ed493726
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=228484
@ -765,7 +765,15 @@ uaudio_detach(device_t dev)
|
||||
{
|
||||
struct uaudio_softc *sc = device_get_softc(dev);
|
||||
|
||||
if (bus_generic_detach(dev)) {
|
||||
/*
|
||||
* Stop USB transfers early so that any audio applications
|
||||
* will time out and close opened /dev/dspX.Y device(s), if
|
||||
* any.
|
||||
*/
|
||||
uaudio_chan_stop(&sc->sc_play_chan);
|
||||
uaudio_chan_stop(&sc->sc_rec_chan);
|
||||
|
||||
if (bus_generic_detach(dev) != 0) {
|
||||
DPRINTF("detach failed!\n");
|
||||
}
|
||||
sbuf_delete(&sc->sc_sndstat);
|
||||
|
@ -27,6 +27,9 @@
|
||||
|
||||
/* prototypes from "uaudio.c" used by "uaudio_pcm.c" */
|
||||
|
||||
#ifndef _UAUDIO_H_
|
||||
#define _UAUDIO_H_
|
||||
|
||||
struct uaudio_chan;
|
||||
struct uaudio_softc;
|
||||
struct snd_dbuf;
|
||||
@ -63,3 +66,5 @@ extern uint32_t uaudio_mixer_setrecsrc(struct uaudio_softc *sc, uint32_t src);
|
||||
int uaudio_get_vendor(device_t dev);
|
||||
int uaudio_get_product(device_t dev);
|
||||
int uaudio_get_release(device_t dev);
|
||||
|
||||
#endif /* _UAUDIO_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user