From owner-freebsd-multimedia@freebsd.org Mon Mar 6 10:37:24 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 7226BCFAAC7 for ; Mon, 6 Mar 2017 10:37:24 +0000 (UTC) (envelope-from mrechberger@gmail.com) Received: from mail-qk0-x244.google.com (mail-qk0-x244.google.com [IPv6:2607:f8b0:400d:c09::244]) (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 2D4C81F0F for ; Mon, 6 Mar 2017 10:37:24 +0000 (UTC) (envelope-from mrechberger@gmail.com) Received: by mail-qk0-x244.google.com with SMTP id n141so19160935qke.3 for ; Mon, 06 Mar 2017 02:37:24 -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=tAm/94F5LA5omGWwGK70WF203UcVQnEcXr+SuRPFGc0=; b=HepZcbahteXQLg5XBy6hl6Y66KEAAbRR6kw4kU1gPmQ6it+gOiFjE3J98nLvlpkMt9 1qUEF5UkR1xa/EwINJI3FqoClcy1Yhawx8cuZuc4vsqnXJWiCIeaWaY5XrMWRhKMdsHt 5oBSFJ5nR/Ba1WBfPW0PV8H5XNbfq+rDAurU65zRVCjmqfTgk3siNbwEo5ZD+fO2nCTr B2MCU4MwKcCfsbBy3w/ZQ8WzgLgLL1yP3XLT+Bh1Fp4lmjgjvLfQH0sK7EUnSTcF7sBc 3TwVjggonM2XlFjz2xV4+l98fEnFRPUogr3PLF1yvAJikp5IukS/BP+hLUoW4Fyc+2/h ntlA== 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=tAm/94F5LA5omGWwGK70WF203UcVQnEcXr+SuRPFGc0=; b=ZE5rtDe5x5oQRCE114UaFk6kix10S+oDXNAZ9a2wWNuRB6+J79K0ZMIfWQDMlkxNTL CDrAsMsHKORlryxAL0U9ihjEh4E4VD5yoU5UpuJz5Q+OOeBF14casipgjD3qvIibJNmF NwbSOfjShsNrog9KMQ53EQ3WRa3wOaxbS5y01RBdDiaEDvH94UNsHDmIiljoSDyGsfEN q+f+0n932Jhvwg0LzpFt2X+G949LEsF/TgBOKR6xDmZH6sqiEjAIe2kS219S9sv3XuR+ mtGux/ETNRQIxWIR0cWGZNxu0a/9KwXi3ikMnNcWyImTHa3MMkJ39xm4Ll2t0vvDTE8U yU4A== X-Gm-Message-State: AMke39lJ0jM8kT50qWLRRWslI/YeNG4ZdJvdWC+6xanSR9kWi1HZb7fm4CJWN0NXn8AemngOxIyGArAHAFKwew== X-Received: by 10.200.52.135 with SMTP id w7mr15556372qtb.136.1488796643371; Mon, 06 Mar 2017 02:37:23 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.174.114 with HTTP; Mon, 6 Mar 2017 02:37:22 -0800 (PST) In-Reply-To: <17db8b5b-9983-2ead-5c1d-960022afb1f6@selasky.org> References: <17db8b5b-9983-2ead-5c1d-960022afb1f6@selasky.org> From: Markus Rechberger Date: Mon, 6 Mar 2017 11:37:22 +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 10:37:24 -0000 On Mon, Mar 6, 2017 at 11:30 AM, Hans Petter Selasky wrote: > 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. Are you sure? As from some of my signal analyzer dumps I do think that all those systems support multiple transfers within one completion event. I always request multiple frames within one request on those systems and they complete at once. And they only complete once all the buffers are filled. > > >> This is about resolving an active bug and misconception of the freebsd >> userspace usb API usage. >> Some hardware just need a lower latency. > > > --HPS