From owner-freebsd-multimedia@freebsd.org Mon Mar 6 11:36:37 2017 Return-Path: Delivered-To: freebsd-multimedia@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9019BCFBE56 for ; Mon, 6 Mar 2017 11:36:37 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5835F1075 for ; Mon, 6 Mar 2017 11:36:37 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 075F11FE086; Mon, 6 Mar 2017 12:36:05 +0100 (CET) Subject: Re: What is wrong with FreeBSD and USB Support To: Markus Rechberger References: <1aff0983-deb6-2884-472c-bb1e1037275c@selasky.org> <9d940886-5021-7208-fc19-477dcd573c7a@selasky.org> Cc: freebsd-multimedia@freebsd.org From: Hans Petter Selasky Message-ID: <599369d4-5458-a61c-e28d-762c86e65a4b@selasky.org> Date: Mon, 6 Mar 2017 12:35:48 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Mar 2017 11:36:37 -0000 On 03/06/17 12:14, Markus Rechberger wrote: > On Mon, Mar 6, 2017 at 12:04 PM, Hans Petter Selasky wrote: >> Hi, >> >> Issue 2: >> >> Looking at the log you sent I observe the following: >> >>> 11:39:43.395110 usbus1.2 >>> SUBM-BULK-EP=00000081,SPD=HIGH,NFR=10,SLEN=0,IVAL=0 >>> frame[0] READ 0 bytes >>> frame[1] READ 0 bytes >>> frame[2] READ 0 bytes >>> frame[3] READ 0 bytes >>> frame[4] READ 0 bytes >>> frame[5] READ 0 bytes >>> frame[6] READ 0 bytes >>> frame[7] READ 0 bytes >>> frame[8] READ 0 bytes >>> frame[9] READ 0 bytes >>> flags 0x10 >>> status 0x6a023 >>> >>> 11:39:43.395115 usbus1.2 >>> DONE-BULK-EP=00000081,SPD=HIGH,NFR=1,SLEN=0,IVAL=0,ERR=STALLED >>> frame[0] READ 0 bytes >>> flags 0x10 >>> status 0x8a025 >>> >> >> >> The first multi-BULK transfer that STALLs is programmed to only receive >> zero-length USB packets. Is that intentional? >> >> In the case above there is a missing code fragment like this, I suspect: >> >> for (x = 0; x != 10; x++) >> libusb20_tr_set_length(xfer, buffer_size, x); >> Hi, > seems to be intentional. > in the LIBUSB20_START_... section it will do a > libusb20_tr_setup_bulk(xfer, tb, urb->buffer_length, 250); The job submitted above, does not match the footprint of libusb20_tr_setup_bulk(). You have submitted a USB BULK transfer using libusb20_tr_set_total_frames(xfer, 10). Have you mixed USB ISOC and USB BULK? > > that should also set the length (otherwise it shouldn't work at all I guess) This line is correct for single-transfer BULK: libusb20_tr_setup_bulk(xfer, tb, urb->buffer_length, 250); > > The only explanation for that problem is that freebsd is not reading > the data fast enough and lets the chip overflow (=requiring to reset). --HPS