From owner-freebsd-usb@FreeBSD.ORG Fri Oct 19 18:15:22 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EDCE7A24 for ; Fri, 19 Oct 2012 18:15:22 +0000 (UTC) (envelope-from peerst@gmail.com) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) by mx1.freebsd.org (Postfix) with ESMTP id AF1708FC18 for ; Fri, 19 Oct 2012 18:15:22 +0000 (UTC) Received: by mail-ie0-f182.google.com with SMTP id k10so1454138iea.13 for ; Fri, 19 Oct 2012 11:15:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=2df1ab4G+NNUqv2PuT/E47q73SENtub5Eso3IUHiqGI=; b=bVCSvbAwJSWGGwVyjk9e4v0FPlHggqz3UyUoMY9lnS13VCZlQB5iGzvD0MXX8cTe+X 9S1w/4H0+iQd3dN9bmwjJR76t8Ru5SzkxyWLkkwtbL7+OPHBlg6SDDjQsZCrYvJ61r44 LDxdez/4yZow7oBExGl4ZJ97bcrardZbNdI6X7QAgCQrw3UVTnp2ODH3l6uNpEy6bK/O MaAyg5IBjfs6BVIIT6yT9ZETsOSliyYYYH5ekfSZ3Z1iY4pIB2NpGzOtLxS3lH6PdOwk tVZkPiz3/I/aNd64P1G8OQWL/4bdZYD2o6ZLWVSncTelnu1o0KXAp1T0bXnxuovM3HlT hLiA== MIME-Version: 1.0 Received: by 10.50.40.225 with SMTP id a1mr3208317igl.7.1350670522192; Fri, 19 Oct 2012 11:15:22 -0700 (PDT) Received: by 10.64.167.137 with HTTP; Fri, 19 Oct 2012 11:15:22 -0700 (PDT) In-Reply-To: References: Date: Fri, 19 Oct 2012 20:15:22 +0200 Message-ID: Subject: Re: USB transfers stuck in kernel/libusb not sent out until next transfer is submitted From: Peer Stritzinger To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-usb X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Oct 2012 18:15:23 -0000 On Fri, Oct 19, 2012 at 11:51 AM, Hans Petter Selasky wrote: > > I see you are using 8.0 and I think that doesn't have usbdump. Yep unfortunately. > Try fetching libusb sources from 8-stable and just make the stream open > routine return a failure, if it doesn't build. Ok, I'll try. > Yes, there has been some issues fixes in this area (which involve some small > kernel patches sys/dev/usb/usb_generic.c), mostly if you start and stop > transfers rapidly. I never start/stop transfers. Just submit one async bulk transfer after the other. Is there a limit how many transfers are allowed to be pending? Or a old bug that is triggered by bursts of small transfers? > Also make sure that you don't mix synchronous and asynchronous transfers and > that only synchronous transfer is executed at a time. I.E. no multithreading > with synchronous transfers on the same USB device. Then you need to do it > asynchronously if you need background reading. No synchronous transfers at all. No multithreading, I just have loop that polls stdin/stdout and the usb fds. Reading transfers from stdin and writing completed IN transfers to stdout. On the other end of stdin/stdout is a Erlang system that does all the other protocol levels. -- Peer > > > > --HPS > > > -----Original message----- > From: Hans Petter Selasky > Sent: Fri 19-10-2012 11:44 > Subject: Re: USB transfers stuck in kernel/libusb not sent out until next > transfer is submitted > To: peerst@gmail.com; > > Hi, > > > > You should check using usbdump if the USB transfer is actually submitted. If > it is submitted, then it is most likely a problem with the USB device, that > it is NAK'ing on the endpoint. Are you short terminating properly for FULL > speed? Else it is a problem in libusb and/or the application. > > > > usbdump -i usbusX -f Y -vvv -s 65536 > > > > --HPS