From owner-freebsd-multimedia@freebsd.org Mon Mar 6 05:50:09 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 CF94ECFC5F1 for ; Mon, 6 Mar 2017 05:50:09 +0000 (UTC) (envelope-from mrechberger@gmail.com) Received: from mail-qk0-x235.google.com (mail-qk0-x235.google.com [IPv6:2607:f8b0:400d:c09::235]) (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 8D5511299 for ; Mon, 6 Mar 2017 05:50:09 +0000 (UTC) (envelope-from mrechberger@gmail.com) Received: by mail-qk0-x235.google.com with SMTP id 1so137559144qkl.3 for ; Sun, 05 Mar 2017 21:50:09 -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; bh=6nVmMLh9+VEmApjY+Wdy2QA8N2nAvJtgnXpflL9VLf4=; b=PWkBmx8JzojHWdc6LqyT3ChEgZJ8RraayAFcd6qNOSwdnivW66vi2Rv06brHY12/VC ooMtNFWPxWYaYkQLgw55GbsNazsUt6GPUQAjajS6PeBwKYCc8o17Tnpn3u3bm42lDtUZ UeCQHsxPDQvaydaZ2Ng3ZC5hRa543KLuYzD7jCc+Qgp1EFeXLvGKMUd0ICShxjmYiEit MmJjFDQHAOoYxAf//AVVxwtgCmW9IdXGmQpMEVS0P/9cdQwHCxggkB+ioP4QYpvI8kNk N+9YAmnewCLyjemJv0TnwjFkw31LjfyM8aEeUeel5e1aMBiEHhUIh6KVEgVoCQUKkCvP wDyA== 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; bh=6nVmMLh9+VEmApjY+Wdy2QA8N2nAvJtgnXpflL9VLf4=; b=W6fsUAZiy8Csm6rRVADj8aFy/StUPQRubUPv488ya9K8IX9HDWE9Tlb/xMbKCJKSyw NaPbuF5kJmkctBG2TENmhU1MDgreOogpYToFA6CNkPbbkv7VhAeJ6xD3eICbgNbr2LJ/ eXIB4RVz1Q+O04qj1eBUW/sSGhjTYH7/FjrcYYZR0yrlGOIdjWu/tPcQSH485XRnzPf+ z8aCy0bUp9n6JmOyLeOfq0CQiOMje5lJkU920kaBtBkzfTlSh6WCpWn2efFxsjDNXtle kYvL8Kq/E9DKUPucBSaHBhvQs3KtJ7pnY33NP7/w3Co8LPUgTIvERXvEkaY9oRu+Sssc XT4A== X-Gm-Message-State: AMke39mykTesAUTsC3w16IPRApsnVFBjN8Sln01UMulRGRvDDoxaewfxmAt7bnqZMj4l3dvhBEUGbMotFNGvCA== X-Received: by 10.55.47.4 with SMTP id v4mr13698288qkh.77.1488779408553; Sun, 05 Mar 2017 21:50:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.174.114 with HTTP; Sun, 5 Mar 2017 21:50:08 -0800 (PST) In-Reply-To: References: From: Markus Rechberger Date: Mon, 6 Mar 2017 06:50:08 +0100 Message-ID: Subject: Re: What is wrong with FreeBSD and USB Support To: freebsd-multimedia@freebsd.org, Hans Petter Selasky 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 05:50:09 -0000 Hi, I got one step further it turns out that the problem is indeed the FreeBSD Stack, the latency is terrible causing an overflow on the chipside. Once that happens the transfer has to be restarted (which requires to toggle a register). Is there any way to do low latency transfers with FreeBSD? Markus On Mon, Mar 6, 2017 at 6:19 AM, Markus Rechberger wrote: > Hi, > > I have been trying to port a driver to freebsd for a day now and the > result is quite negative. > > So my feedback about libusb20 and the FreeBSD USB Kernel Stack: > > 1. the documentation is not clear how to set up asynchronous bulk > transfers (please explain the architecture of this API) > > 2. the errors returned by libusb20 (and probably from the kernel) are > not detailed enough (in certain cases I'm able to get libusb20 unknown > error, to my understanding every error should have some meaning). > > 3. the FreeBSD USB Stack messes around with the transfer itself > damaging the entire result (eg resulting in stalled USB bulk > transfers). > > 4. The FreeBSD data transfer implementation itself is a disaster, I'm > able to transfer data at a rate of 2 MB/sec, anything higher results > in a stalled usb transfer?! > > 5. USB Control messages are 100% slower than with other operating > systems (eg. it took 14 seconds to load a driver with FreeBSD while it > only takes 7 seconds on other systems). > > Since I have been using USB stacks with Linux, Mac and some other > systems I can say that FreeBSD has the most irritating implementation > of all. > > So finally I wonder what is wrong with FreeBSD's USB support? > > Best Regards, > Markus