2013/1/24 Xiaofan Chen <xiaof...@gmail.com>:
> On Thu, Jan 24, 2013 at 10:30 PM, Xiaofan Chen <xiaof...@gmail.com> wrote:
>> On Thu, Jan 24, 2013 at 6:27 PM, Wander Lairson Costa
>> <wander.lair...@gmail.com> wrote:
>>> If you look the code for the Benchmark firmware, you will see that for
>>> OUT bulk and interrupt transfers, the code calls a GetLength function
>>> to know how many bytes it received, but for isochronous transfers, it
>>> always assume it received "packet size" bytes.
>>>
>>
>> I believe this is a simplified design for the isochronous OUT transfer.
>> Technically it may receive less bytes than the wMaxPacketSize
>> of the ISOC OUT Endpoint.
>>
>> This may have something to do with limitation of libusb0.sys'
>> isochronous capability as well. It is not as good as libusbK.sys.
>>  libusb-win32 currently only supports fixed user-defined ISOC
>> packet size per transfer.
>>
>
> libusbK does have more advanced ISOC API.
> http://libusbk.sourceforge.net/UsbK3/group__isok.html
>
> Thiis may be more in line with libusbx's isochronous
> API. So in the future, it may be possible to add isochronous
> support to libusbx's Windows backend.
> http://libusbx.sourceforge.net/api-1.0/group__asyncio.html
>

I have been playing with (my modified version) benchmark firmware
regarding this question. After I change it to use the mBDT_GetLength
to get the number of bytes transfered (diff bellow), it now always
transmit only 16 bytes per packet when the number of bytes is 16 or
more:

wander@zeus:isochronous-test (master)$ ./iso-test -n 15
Packet 0 requested to transfer 15 bytes, transfered 15 bytes.
Packet 0 failed to transfer: status = 6.
wander@zeus:isochronous-test (master)$ ./iso-test -n 16
Packet 0 requested to transfer 16 bytes, transfered 16 bytes.
Packet 0 requested to transfer 16 bytes, transfered 16 bytes.
wander@zeus:isochronous-test (master)$ ./iso-test -n 32
Packet 0 requested to transfer 32 bytes, transfered 32 bytes.
Packet 0 requested to transfer 32 bytes, transfered 16 bytes.
wander@zeus:isochronous-test (master)$ ./iso-test -n 20
Packet 0 requested to transfer 20 bytes, transfered 20 bytes.
Packet 0 requested to transfer 20 bytes, transfered 16 bytes.
wander@zeus:isochronous-test (master)$

Despite the fact libusb says it transmitted 32 bytes, mBDT_GetLength
reports that only 16 were actually read.

Diff:

diff --git a/USB_Device_Benchmark/Firmware/Benchmark.c
b/USB_Device_Benchmark/Firmware/Benchmark.c
index fafcbab..8e893c5 100644
--- a/USB_Device_Benchmark/Firmware/Benchmark.c
+++ b/USB_Device_Benchmark/Firmware/Benchmark.c
@@ -544,11 +544,11 @@ void doBenchmarkLoop_INTF0(void)
                 #endif
                 break;
             case 2:
-                #if INTF0_ALT2 == EP_ISO
+                /*#if INTF0_ALT2 == EP_ISO
                     Length = USBGEN_EP_SIZE_INTF0_ALT2;
-                #else
+                #else*/
                     Length = mBDT_GetLength(pBdtRxEp1);
-                #endif
+                //#endif
                 break;
             }
         #else


-- 
Best Regards,
Wander Lairson Costa

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to