Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Mar 2012 18:41:41 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r232878 - stable/8/sys/dev/sound/usb
Message-ID:  <201203121841.q2CIffF2079888@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Mon Mar 12 18:41:41 2012
New Revision: 232878
URL: http://svn.freebsd.org/changeset/base/232878

Log:
  MFC r228485 and r228484:
  Stop USB audio transfers early so that any audio applications
  will time out and close opened /dev/dspX.Y device(s), if
  any.

Modified:
  stable/8/sys/dev/sound/usb/uaudio.c
  stable/8/sys/dev/sound/usb/uaudio.h
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/dev/sound/usb/uaudio.c
==============================================================================
--- stable/8/sys/dev/sound/usb/uaudio.c	Mon Mar 12 18:38:40 2012	(r232877)
+++ stable/8/sys/dev/sound/usb/uaudio.c	Mon Mar 12 18:41:41 2012	(r232878)
@@ -765,7 +765,17 @@ 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.
+	 */
+	if (sc->sc_play_chan.valid)
+		usbd_transfer_unsetup(sc->sc_play_chan.xfer, UAUDIO_NCHANBUFS);
+	if (sc->sc_rec_chan.valid)
+		usbd_transfer_unsetup(sc->sc_rec_chan.xfer, UAUDIO_NCHANBUFS);
+
+	if (bus_generic_detach(dev) != 0) {
 		DPRINTF("detach failed!\n");
 	}
 	sbuf_delete(&sc->sc_sndstat);

Modified: stable/8/sys/dev/sound/usb/uaudio.h
==============================================================================
--- stable/8/sys/dev/sound/usb/uaudio.h	Mon Mar 12 18:38:40 2012	(r232877)
+++ stable/8/sys/dev/sound/usb/uaudio.h	Mon Mar 12 18:41:41 2012	(r232878)
@@ -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(s
 int	uaudio_get_vendor(device_t dev);
 int	uaudio_get_product(device_t dev);
 int	uaudio_get_release(device_t dev);
+
+#endif			/* _UAUDIO_H_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203121841.q2CIffF2079888>