* uaudio_chan_open()

Call uaudio_set_speed() if and only if the selected Audio Streaming
interface supports multiple sampling rates.
  Address PR#27237
This commit is contained in:
kent 2004-10-29 17:12:53 +00:00
parent acac7b4b51
commit 2027395f9c
1 changed files with 13 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: uaudio.c,v 1.89 2004/10/29 16:42:47 kent Exp $ */
/* $NetBSD: uaudio.c,v 1.90 2004/10/29 17:12:53 kent Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.89 2004/10/29 16:42:47 kent Exp $");
__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.90 2004/10/29 17:12:53 kent Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -2517,15 +2517,17 @@ uaudio_chan_open(struct uaudio_softc *sc, struct chan *ch)
if (err)
return (err);
/* Some devices do not support this request, so ignore errors. */
#ifdef UAUDIO_DEBUG
err = uaudio_set_speed(sc, endpt, ch->sample_rate);
if (err)
DPRINTF(("uaudio_chan_open: set_speed failed err=%s\n",
usbd_errstr(err)));
#else
(void)uaudio_set_speed(sc, endpt, ch->sample_rate);
#endif
/*
* If just one sampling rate is supported,
* no need to call uaudio_set_speed().
* Roland SD-90 freezes by a SAMPLING_FREQ_CONTROL request.
*/
if (as->asf1desc->bSamFreqType != 1) {
err = uaudio_set_speed(sc, endpt, ch->sample_rate);
if (err)
DPRINTF(("uaudio_chan_open: set_speed failed err=%s\n",
usbd_errstr(err)));
}
ch->pipe = 0;
ch->sync_pipe = 0;