[prev in list] [next in list] [prev in thread] [next in thread]
List: libusb-devel
Subject: Re: [libusb] Handle events of an isochronous transfer OUT
From: Tim Roberts <timr () probo ! com>
Date: 2016-07-03 19:12:30
Message-ID: 82889AA9-F827-452F-BCE3-AEA0FE13B414 () probo ! com
[Download RAW message or body]
On Jul 2, 2016, at 11:13 AM, Matías Araujo <matiasaraujo88@gmail.com> wrote:
>
> Hi, I want to implement an USB isochronous transfer OUT using libusb for a
> multi-threading application. I'm thinking on the design and I have some
> doubts:
>
> 1.a) How should I use the libusb_handle_events function if I need to fill
> the buffer for every transfer in real time?
Yes. Well, you probably want to fill and submit two transfers to begin with, so the \
buffer never has a chance to run dry. When you get notified of a completion, you \
refill it and resubmit it.
> 1.b) Is it OK to do the filling of the new buffer for the transfer in the
> callback function? so once a transfer has finished I can send the next one
> with the new buffer.
Yes, that's what it takes.
> 1.c) Should I use an libusb_handle_events_completed and when the transfer is
> completed fill a new transfer and submit it.
Isn't that what you just said?
> 2) Will it be right to not use libusb_handle_events and just fill the
> transfer and submit it?. I think my implementation will something like this:
What you showed is an infinite loop with no pacing. Such a loop will flood the \
kernel with requests until it runs out of memory. You need to pace things so you \
keep the list of pending requests at a relatively constant size. For that, you have \
to use the events callback. —
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
libusb-devel mailing list
libusb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic