Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Jun 2010 21:13:36 +0000 (UTC)
From:      Andrew Thompson <thompsa@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r209450 - head/sys/dev/sound/usb
Message-ID:  <201006222113.o5MLDaIf059973@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: thompsa
Date: Tue Jun 22 21:13:36 2010
New Revision: 209450
URL: http://svn.freebsd.org/changeset/base/209450

Log:
  Reduce MIDI input buffer size to one USB packet, hence some USB devices don't
  properly short terminate their transfers. This fixes a problem where input
  appears several seconds late.
  
  Reported by:	Alexander Yerenkow
  Submitted by:	Hans Petter Selasky

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

Modified: head/sys/dev/sound/usb/uaudio.c
==============================================================================
--- head/sys/dev/sound/usb/uaudio.c	Tue Jun 22 21:13:35 2010	(r209449)
+++ head/sys/dev/sound/usb/uaudio.c	Tue Jun 22 21:13:36 2010	(r209450)
@@ -507,8 +507,8 @@ static const struct usb_config
 		.type = UE_BULK,
 		.endpoint = UE_ADDR_ANY,
 		.direction = UE_DIR_IN,
-		.bufsize = UMIDI_BULK_SIZE,
-		.flags = {.pipe_bof = 1,.short_xfer_ok = 1,},
+		.bufsize = 4,	/* bytes */
+		.flags = {.pipe_bof = 1,.short_xfer_ok = 1,.proxy_buffer = 1,},
 		.callback = &umidi_bulk_read_callback,
 	},
 
@@ -3366,10 +3366,6 @@ umidi_bulk_read_callback(struct usb_xfer
 
 		DPRINTF("actlen=%d bytes\n", actlen);
 
-		if (actlen == 0) {
-			/* should not happen */
-			goto tr_error;
-		}
 		pos = 0;
 		pc = usbd_xfer_get_frame(xfer, 0);
 
@@ -3404,8 +3400,6 @@ umidi_bulk_read_callback(struct usb_xfer
 		return;
 
 	default:
-tr_error:
-
 		DPRINTF("error=%s\n", usbd_errstr(error));
 
 		if (error != USB_ERR_CANCELLED) {



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