Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Nov 2014 16:27:31 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r274918 - head/sys/dev/sound/usb
Message-ID:  <201411231627.sANGRV9P051030@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Sun Nov 23 16:27:31 2014
New Revision: 274918
URL: https://svnweb.freebsd.org/changeset/base/274918

Log:
  Don't use the synchronization endpoint unless referenced by the
  isochronous endpoint descriptor used for the data transfers, hence the
  synchronization feature might not be supposed to be supported [yet].
  This makes seamless playback synced with the USB HOST clock work with
  the DN32-USB module for Midas audio systems and possibly other similar
  products from Klark Teknik.
  
  MFC after:	1 week

Modified:
  head/sys/dev/sound/usb/uaudio.c

Modified: head/sys/dev/sound/usb/uaudio.c
==============================================================================
--- head/sys/dev/sound/usb/uaudio.c	Sun Nov 23 15:38:06 2014	(r274917)
+++ head/sys/dev/sound/usb/uaudio.c	Sun Nov 23 16:27:31 2014	(r274918)
@@ -189,6 +189,7 @@ struct uaudio_chan_alt {
 	uint8_t	iface_index;
 	uint8_t	iface_alt_index;
 	uint8_t channels;
+	uint8_t enable_sync;
 };
 
 struct uaudio_chan {
@@ -1798,6 +1799,14 @@ uaudio_chan_fill_info_sub(struct uaudio_
 		chan_alt->iface_index = curidx;
 		chan_alt->iface_alt_index = alt_index;
 
+		if (UEP_HAS_SYNCADDR(ed1) && ed1->bSynchAddress != 0) {
+			DPRINTF("Sync endpoint will be used, if present\n");
+			chan_alt->enable_sync = 1;
+		} else {
+			DPRINTF("Sync endpoint will not be used\n");
+			chan_alt->enable_sync = 0;
+		}
+
 		usbd_set_parent_iface(sc->sc_udev, curidx,
 		    sc->sc_mixer_iface_index);
 
@@ -2074,8 +2083,10 @@ tr_transferred:
 		chn_intr(ch->pcm_ch);
 
 		/* start SYNC transfer, if any */
-		if ((ch->last_sync_time++ & 7) == 0)
-			usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]);
+		if (ch->usb_alt[ch->cur_alt].enable_sync != 0) {
+			if ((ch->last_sync_time++ & 7) == 0)
+				usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]);
+		}
 
 	case USB_ST_SETUP:
 		mfl = usbd_xfer_max_framelen(xfer);



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