Re: [Libusbx-devel] Isochronous test problem

2013-01-26 Thread Wander Lairson Costa
2013/1/24 Xiaofan Chen :
> On Thu, Jan 24, 2013 at 10:30 PM, Xiaofan Chen  wrote:
>> On Thu, Jan 24, 2013 at 6:27 PM, Wander Lairson Costa
>>  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


Re: [Libusbx-devel] Isochronous test problem

2013-01-26 Thread Xiaofan Chen
On Sat, Jan 26, 2013 at 8:41 PM, Wander Lairson Costa
 wrote:
> 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:
>
> Despite the fact libusb says it transmitted 32 bytes, mBDT_GetLength
> reports that only 16 were actually read.

I will need to take a look at the firmware again. I admit I have not
touched much about the Microchip stack over the past several
years. And this is even more true for the isochronous transfer.
The last time I really deeply look into isochronous transfer was
back in 2007 where a few of us struggled to get a simple isoc
transfer example working on both the firmware side and more so on
the host side.
http://www.microchip.com/forums/m270049.aspx


-- 
Xiaofan

--
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