Ticket #31 (closed defect: fixed)
Opened 3 years ago
Last modified 2 years ago
Darwin: interrupt and isochronous transfers don't timeout
| Reported by: | mikef | Owned by: | hjelmn |
|---|---|---|---|
| Milestone: | Component: | libusb-1.0 | |
| Keywords: | Cc: | ||
| Blocked By: | Blocks: |
Description
I created the following patch that fixes the issue discussed here:
I messed something up and my response ended up here:
Attachments
Change History
Changed 3 years ago by mikef
comment:1 Changed 3 years ago by mikef
Original patch (0001-Fixed-io.c-and-sync.c-so-that-libusb-timeouts-are-ha.patch) had the possibilty of affecting the external API.
Developed alternate patch: 0001-Removed-the-USBI_OS_HANDLES_TIMEOUT-assumption-and-c.patch
comment:2 Changed 3 years ago by hjelmn
- Owner set to hjelmn
- Status changed from new to accepted
This bug should be fixed in the next release. I didn't want to remove the USBI_OS_HANDLES_TIMEOUT assumption so I changed the granularity so libusb will known to abort interrupt and isochronous timeouts since the os does not support timeouts on these endpoints.
comment:3 Changed 3 years ago by hjelmn
- Summary changed from [Patch] Darwin: Interrupt transfers don't timeout to Darwin: interrupt and isochronous transfers don't timeout
comment:4 Changed 3 years ago by ludovicrousseau
Is the bug (supposed to be) fixed in git now?
I tried with a version up-to-date (latest commit 116d34f608b02f4e14668450b158acf5db726f95) and libusb_handle_events() does not handle/report a timeout on Mac OS X for an interrupt end point.
comment:5 Changed 3 years ago by ludovicrousseau
In fact libusb_handle_events() does timeout but every 60 seconds only. This is the default timeout defined in libusb_handle_events().
So the timeout set in libusb_fill_bulk_transfer() is not used :-(
comment:6 Changed 3 years ago by ludovicrousseau
Simple (temporary) patch:
-10-13 16:02:34.000000000 +0200
+++ configure.ac 2010-10-13 15:55:44.000000000 +0200
@@ -54,7 +54,7 @@ case $host in
AC_DEFINE(OS_DARWIN, [], [Darwin backend])
AC_SUBST(OS_DARWIN)
AC_DEFINE([THREADS_POSIX], [], [Use Posix Threads])
- AC_DEFINE(USBI_OS_HANDLES_TIMEOUT, [], [Backend handles timeout])
+ #AC_DEFINE(USBI_OS_HANDLES_TIMEOUT, [], [Backend handles timeout])
AC_MSG_RESULT([Darwin/MacOS X])
backend="darwin"
threads="posix"
comment:7 Changed 3 years ago by hjelmn
The fix has been sent in to the mailing list but not applied. Take a look and give them a try.
comment:8 Changed 3 years ago by ludovicrousseau
Another patch is available at http://libusb.6.n5.nabble.com/PATCH-darwin-2-4-Darwin-Fix-isoch-interrupt-timeouts-tt3200715.html#a3200715 but not yet committed to git.
comment:9 Changed 2 years ago by Nathan Hjelm <hjelmn@…>
- Resolution set to fixed
- Status changed from accepted to closed
Patch to io.c and sync.c