From owner-freebsd-multimedia@freebsd.org Mon Mar 6 10:31:22 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 EFE88CFA84E for ; Mon, 6 Mar 2017 10:31:22 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 B8BE2194D for ; Mon, 6 Mar 2017 10:31:22 +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 3810D1FE086; Mon, 6 Mar 2017 11:30:44 +0100 (CET) Subject: Re: What is wrong with FreeBSD and USB Support To: Markus Rechberger , freebsd-multimedia@freebsd.org References: From: Hans Petter Selasky Message-ID: <17db8b5b-9983-2ead-5c1d-960022afb1f6@selasky.org> Date: Mon, 6 Mar 2017 11:30:26 +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 10:31:23 -0000 On 03/06/17 09:53, Markus Rechberger wrote: > Just to clarify this issue it's hardware and software related. > > In the linux libusb20 wrapper there's some code in it in the bulk > callback function > > libusb20_tr_submit(xfer) > if (xfer == xfer0) > xfer = xfer1 > else > xfer = xfer0 > > libusb20_tr_start(xfer) > > why should someone toggle the other transfer and not the same one that > is returning or required to set up? Hi, This is to be able to setup double-buffering of USB transfers. > I would like to set up multiple requests at the same time and not only > 2 of them (since 2 of them are not fast enough in our case). Do do this correctly for a BULK endpoint, allocate two USB transfers, and then subdivide these two using the FreeBSD USB frames feature. Divide 1x USB transfers into 32x frames which then equals 32 transfers in one completion event. Linux/MacOS/Windows doesn't have this feature and instead they allow setting up a bunch of wMaxPacketSize sized jobs which then in turn generate an enormous completion event traffic, which is not very intelligent. > This is about resolving an active bug and misconception of the freebsd > userspace usb API usage. > Some hardware just need a lower latency. --HPS