diff options
| author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2013-05-18 07:03:06 +0000 |
|---|---|---|
| committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2013-05-18 07:03:06 +0000 |
| commit | 33da3daa40e5a45e0cf161046d769bddfaf31a6a (patch) | |
| tree | e568b3cce866d0b9481a16f20d17b820aec5bc6e /sys/dev/sound | |
| parent | 21278efe5b95af5ad735da9ab7f474feefe22953 (diff) | |
Notes
Diffstat (limited to 'sys/dev/sound')
| -rw-r--r-- | sys/dev/sound/usb/uaudio.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index 63e9f438d9e1..f778afa68e05 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -868,6 +868,7 @@ uaudio_attach(device_t dev) struct usb_attach_arg *uaa = device_get_ivars(dev); struct uaudio_softc *sc = device_get_softc(dev); struct usb_interface_descriptor *id; + usb_error_t err; device_t child; sc->sc_play_chan.priv_sc = sc; @@ -925,6 +926,19 @@ uaudio_attach(device_t dev) if (sc->sc_play_chan.num_alt > 0) { uint8_t x; + + /* + * Need to set a default alternate interface, else + * some USB audio devices might go into an infinte + * re-enumeration loop: + */ + err = usbd_set_alt_interface_index(sc->sc_udev, + sc->sc_play_chan.usb_alt[0].iface_index, + sc->sc_play_chan.usb_alt[0].iface_alt_index); + if (err) { + DPRINTF("setting of alternate index failed: %s!\n", + usbd_errstr(err)); + } for (x = 0; x != sc->sc_play_chan.num_alt; x++) { device_printf(dev, "Play: %d Hz, %d ch, %s format, " "2x8ms buffer.\n", @@ -938,6 +952,19 @@ uaudio_attach(device_t dev) if (sc->sc_rec_chan.num_alt > 0) { uint8_t x; + + /* + * Need to set a default alternate interface, else + * some USB audio devices might go into an infinte + * re-enumeration loop: + */ + err = usbd_set_alt_interface_index(sc->sc_udev, + sc->sc_rec_chan.usb_alt[0].iface_index, + sc->sc_rec_chan.usb_alt[0].iface_alt_index); + if (err) { + DPRINTF("setting of alternate index failed: %s!\n", + usbd_errstr(err)); + } for (x = 0; x != sc->sc_rec_chan.num_alt; x++) { device_printf(dev, "Record: %d Hz, %d ch, %s format, " "2x8ms buffer.\n", |
