From owner-freebsd-multimedia@freebsd.org Mon Mar 6 11:14:13 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 C02EFCFB906 for ; Mon, 6 Mar 2017 11:14:13 +0000 (UTC) (envelope-from mrechberger@gmail.com) Received: from mail-qk0-x22d.google.com (mail-qk0-x22d.google.com [IPv6:2607:f8b0:400d:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7951516CF for ; Mon, 6 Mar 2017 11:14:13 +0000 (UTC) (envelope-from mrechberger@gmail.com) Received: by mail-qk0-x22d.google.com with SMTP id p64so28727687qke.1 for ; Mon, 06 Mar 2017 03:14:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Ai0oj2C/9aieTHHKPT2djplwyIA3GQgsFoXlJH6t/I0=; b=c/CrxSWq/dV1pCgV/537f/4f9gJ4/VvtOIpd0FfDON3+enl2gkmVk4+L98c6rxsG+O 7lEwSSm15oSrOIbjrwYTB+nLP0DD5mHa4qGgT+gKThRZwvHx0IA318RKnbBPYSa2G6st 4JVOk+5uneT0YUHRbMUGJE7nXHm84x9NHdywfGWSLRwgoeVIuDhoOUjzx85YDNo9gO3F i9CgRCi/jlCQNqSw5h++6Uq+KRCF0dx3kix99MZ1+9bP1kV1njh+3eVDFPmIkByeyq2U wzDziqxhYhGOiIvobH0bFM7s8d/AdSv2nny3nY2K+wIKd37oTM/Q7wjFeijXttgpt1/9 fpMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Ai0oj2C/9aieTHHKPT2djplwyIA3GQgsFoXlJH6t/I0=; b=BkHtfEfBBEdp1YPrsYm1D/bGGfFq0ZS/RgmahKm1X5O3GiLedwcqh0jmdufUtmURH4 Gr6WVfh8pxWXwnAfl2ZcPTr3FsRFyJroHuIh6xrhLWem8vnS9/HmcHmt6CF81NOwnSt/ 70qYsjqxmJv7an8hnYHdmorbADWYierw/jTUpQ4F49VrBCriVXNPB7PSRSimfRPUPvM4 BhnHz7PMDojqKOgOKwoE8uVeVrpE2o908dvb5b9VJSu1S2zc3DkxVyk7rhaFws64Bpif j1sA2TjTgGLXQOaZS1sQb2UqBXjfSUAmd3RHx+G1J57RYKNt/eun4wuQ9Mc/FTgwVtSu O70A== X-Gm-Message-State: AMke39mge8JpKaWG4wLrEPcyOYV/zxdHNBUlQ1uwToiH1rrZQsq2a/AGUTmohH1D+xdywYDKLf9NFip7XGuNvg== X-Received: by 10.55.44.197 with SMTP id s188mr14048847qkh.131.1488798852713; Mon, 06 Mar 2017 03:14:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.174.114 with HTTP; Mon, 6 Mar 2017 03:14:12 -0800 (PST) In-Reply-To: <9d940886-5021-7208-fc19-477dcd573c7a@selasky.org> References: <1aff0983-deb6-2884-472c-bb1e1037275c@selasky.org> <9d940886-5021-7208-fc19-477dcd573c7a@selasky.org> From: Markus Rechberger Date: Mon, 6 Mar 2017 12:14:12 +0100 Message-ID: Subject: Re: What is wrong with FreeBSD and USB Support To: Hans Petter Selasky Cc: freebsd-multimedia@freebsd.org Content-Type: text/plain; charset=UTF-8 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:14:13 -0000 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); > seems to be intentional. in the LIBUSB20_START_... section it will do a libusb20_tr_setup_bulk(xfer, tb, urb->buffer_length, 250); that should also set the length (otherwise it shouldn't work at all I guess) The only explanation for that problem is that freebsd is not reading the data fast enough and lets the chip overflow (=requiring to reset). I don't think that this can be solved with libusb20, I really think this is a USB stack kernel problem. Markus