Re: LibUsbK Isochronous Write C# example

Stephen B <[email protected]>
Newsgroups gmane.comp.lib.libusb.devel.windows
Message-ID <CAKPi28qiuktD6vwLhbqgexNky4-VYEX32S8T+hTCub0vhkLtzw@mail.gmail.com>
Hello,

Right, I was using the WinUSB driver. Replaced it and error 50 is solved
but now I get error 997 (Overlapped I/O operation is in progress) after the
write operation.
This is the DebugView log output:
00000001 0.00000000 [DriverEntry](libusbK.sys) v3.0.7.0 built-on: Apr 27
2014 10:22:29
00000002 0.00078391 (libusbK.sys)[Registry_ReadAllDeviceKeys] Found 1
DeviceInterfaceGUIDs strings.
00000003 0.00079931 (libusbK.sys)[Registry_ReadAllDeviceKeys]
DeviceIdleEnabled=1
00000004 0.00081051 (libusbK.sys)[Registry_ReadAllDeviceKeys]
DeviceIdleIgnoreWakeEnable=0
00000005 0.00082031 (libusbK.sys)[Registry_ReadAllDeviceKeys]
UserSetDeviceIdleEnabled=0
00000006 0.00082917 (libusbK.sys)[Registry_ReadAllDeviceKeys]
DefaultIdleState=0
00000007 0.00083897 (libusbK.sys)[Registry_ReadAllDeviceKeys]
DefaultIdleTimeout=5000
00000008 0.00084877 (libusbK.sys)[Registry_ReadAllDeviceKeys]
SystemWakeEnabled=0
00000009 0.00090663 (libusbK.sys)[Device_OnAdd] [dev-id=#1]
SymbolicLink=\DosDevices\libusb0-0255
00000010 0.00110821 (libusbK.sys)[Device_OnAdd] [dev-id=#1] assigned
DeviceInterfaceGUID {DE984606-810A-8A58-82DD-3568CB9B776F}.
00000011 0.00275162 (libusbK.sys)[Device_Create] DeviceSpeed=High
RemoteWakeCapable=False SelfPowered=False
00000012 0.00276701 (libusbK.sys)[Device_Configure] Using single interface
configuration..
00000013 0.00309784 (libusbK.sys)[Pipe_InitContext] pipeID=00h Creating
pipe queue.
00000014 0.00311371 (libusbK.sys)[Pipe_InitContext] pipeID=00h queue
starting..
00000015 0.00314217 (libusbK.sys)[Device_OnD0Entry] Active. D4 -> D0
00000016 6.82585812 [4192]
00000017 6.82591820 [4192] AllK required contiguous memory = 534200 (64bit)
00000018 6.82594538 [4192]   8 HotK Handles: HandleSize 2112 PoolSize 16912
(bytes)
00000019 6.82597113 [4192]   64 LstK Handles: HandleSize 64 PoolSize 4112
(bytes)
00000020 6.82599640 [4192]   1024 LstInfoK Handles: HandleSize 64 PoolSize
65552 (bytes)
00000021 6.82602358 [4192]   64 UsbK Handles: HandleSize 96 PoolSize 6160
(bytes)
00000022 6.82604837 [4192]   32 DevK Handles: HandleSize 112 PoolSize 3600
(bytes)
00000023 6.82607317 [4192]   4096 OvlK Handles: HandleSize 104 PoolSize
426000 (bytes)
00000024 6.82609797 [4192]   64 OvlPoolK Handles: HandleSize 96 PoolSize
6160 (bytes)
00000025 6.82612276 [4192]   32 StmK Handles: HandleSize 176 PoolSize 5648
(bytes)
00000026 6.82614470 [4192]
00000027 6.82617807 [4192] Dynamically allocated as needed:
00000028 6.82620192 [4192]  KLST_DEVINFO = 2596 bytes each
00000029 6.82862473 [4192] (libusbK.dll)[l_EnumKey_Guids] Skipping
USB\ROOT_HUB\4&22692171&0..
00000030 6.82866192 [4192] (libusbK.dll)[l_EnumKey_Guids] Skipping
USB\ROOT_HUB\4&2C0CBE2A&0..
00000031 6.82870102 [4192] (libusbK.dll)[l_EnumKey_Guids] Skipping
USB\ROOT_HUB\4&2EA0F109&0..
00000032 6.82873869 [4192] (libusbK.dll)[l_EnumKey_Guids] Skipping
USB\ROOT_HUB\4&8756F75&0..
00000033 6.82877636 [4192] (libusbK.dll)[l_EnumKey_Guids] Skipping
USB\ROOT_HUB\4&BB39B4E&0..
00000034 6.82881403 [4192] (libusbK.dll)[l_EnumKey_Guids] Skipping
USB\ROOT_HUB20\4&36D5FDB7&0..
00000035 6.82885361 [4192] (libusbK.dll)[l_EnumKey_Guids] Skipping
USB\ROOT_HUB20\4&7B02F80&0..
00000036 6.84401226 [4192] LstK Init: handle 0x000000001B72EE58
00000037 6.88146448 (libusbK.sys)[Device_OnFileCreate] begins
00000038 6.88147306 (libusbK.sys)[Device_OnFileCreate] Process ID=4192
00000039 6.88148260 (libusbK.sys)[Device_OnFileCreate] ends
00000040 6.88162613 (libusbK.sys)[XferCtrl] bmDir=DeviceToHost(1)
bmType=Standard(0) bmRecipient=Device(0) bmReserved=000 bRequest=6 wIndex=0
wValue=512 wLength=0
00000041 6.88164711 (libusbK.sys)[XferCtrl] bmDir=DeviceToHost(1)
bmType=Standard(0) bmRecipient=Device(0) bmReserved=000 bRequest=6 wIndex=0
wValue=512 wLength=0
00000042 6.88214540 [4192] (libusbK.dll)[k_Init_Version] libusbK.sys
v3.0.7.0
00000043 6.88220263 [4192] UsbK Init: handle 0x000000001B73FE78
00000044 6.88879156 (libusbK.sys)[Interface_SetAltSetting] selected alt
setting index 1 on interface number 0
00000045 6.88880396 (libusbK.sys)[Interface_InitContext] configured Read
pipe: PipeID=81h MaximumPacketSize=64 MaximumTransferSize=262144
PipeType=Interrupt
00000046 6.88881016 (libusbK.sys)[Interface_InitContext] configured Write
pipe: PipeID=02h MaximumPacketSize=64 MaximumTransferSize=262144
PipeType=Interrupt
00000047 6.88881588 (libusbK.sys)[Interface_InitContext] configured Read
pipe: PipeID=83h MaximumPacketSize=512 MaximumTransferSize=2097152
PipeType=Bulk
00000048 6.88882160 (libusbK.sys)[Interface_InitContext] configured Write
pipe: PipeID=04h MaximumPacketSize=512 MaximumTransferSize=2097152
PipeType=Bulk
00000049 6.88882971 (libusbK.sys)[Interface_InitContext] configured Read
pipe: PipeID=85h MaximumPacketSize=128 MaximumTransferSize=131072
PipeType=Isochronous
00000050 6.88883543 (libusbK.sys)[Interface_InitContext] configured Write
pipe: PipeID=06h MaximumPacketSize=128 MaximumTransferSize=131072
PipeType=Isochronous
00000051 6.88883972 (libusbK.sys)[Pipe_InitContext] pipeID=81h Creating
pipe queue.
00000052 6.88884449 (libusbK.sys)[Pipe_InitQueueConfig] Configuring
sequential queue..
00000053 6.88885784 (libusbK.sys)[Pipe_InitContext] pipeID=81h queue
starting..
00000054 6.88886356 (libusbK.sys)[Pipe_InitContext] pipeID=02h Creating
pipe queue.
00000055 6.88886690 (libusbK.sys)[Pipe_InitQueueConfig] Configuring
sequential queue..
00000056 6.88887310 (libusbK.sys)[Pipe_InitContext] pipeID=02h queue
starting..
00000057 6.88887644 (libusbK.sys)[Pipe_InitContext] pipeID=83h Creating
pipe queue.
00000058 6.88888025 (libusbK.sys)[Pipe_InitQueueConfig] Configuring
sequential queue..
00000059 6.88888645 (libusbK.sys)[Pipe_InitContext] pipeID=83h queue
starting..
00000060 6.88889027 (libusbK.sys)[Pipe_InitContext] pipeID=04h Creating
pipe queue.
00000061 6.88889408 (libusbK.sys)[Pipe_InitQueueConfig] Configuring
sequential queue..
00000062 6.88889933 (libusbK.sys)[Pipe_InitContext] pipeID=04h queue
starting..
00000063 6.88890314 (libusbK.sys)[Pipe_InitContext] pipeID=85h Creating
pipe queue.
00000064 6.88890648 (libusbK.sys)[Pipe_InitQueueConfig] Configuring
parallel queue..
00000065 6.88891411 (libusbK.sys)[Pipe_InitContext] pipeID=85h queue
starting..
00000066 6.88891745 (libusbK.sys)[Pipe_InitContext] pipeID=06h Creating
pipe queue.
00000067 6.88892078 (libusbK.sys)[Pipe_InitQueueConfig] Configuring
parallel queue..
00000068 6.88892603 (libusbK.sys)[Pipe_InitContext] pipeID=06h queue
starting..
00000069 6.89122868 [4192] LstK Dispose: Freed Handle:000000001B72EE58h
Explicit:True
00000070 9.90101719 [4192] IsoK Init: handle 0x000000001B6BFD00
00000071 9.90591049 [4192] OvlK Init: handle 0x000000001B7AA4A8
00000072 9.90827751 (libusbK.sys)[Pipe_Reset] pipeID=06h
00000073 9.91009617 [ERR](libusbK.sys)[XferIsoEx] Last packet offset
references data that is out-of-range. IsoPacket[16].Offset=2048
00000074 9.91096878 [4192] [ERR](libusbK.dll)[OvlK_Wait] Unknown
OverlappedK failure. errorCode=000006F8h
00000075 9.91620255 [4192] UsbK Dispose: Freed Handle:000000001B73FE78h
Explicit:True
00000076 9.92062855 [4192] IsoK Dispose: Freed Handle:000000001B6BFD00h
Explicit:True
00000077 9.92470455 (libusbK.sys)[Interface_ReleaseAll] releasing all
interfaces bound to file object 0x51c5350
00000078 9.92471409 (libusbK.sys)[Device_OnFileClose]
OpenedFileHandleCount=0
00000079 9.92485809 [4192] OvlK Dispose: Freed Handle:000000001B7AA4A8h
Explicit:True

I see something is out of range, so I tried reducing the number of packets
per transfer, but no luck. I think I need to solve the 997 error first. I
wonder what's causing it?

Kind regards,
Stephen


2014-08-25 23:34 GMT+02:00 Travis <[email protected]>:

> Greetings,
>
> Ensure that you have installed the "libusbK.sys" driver with your device
> and not the WinUSB driver.  However, if this was the problem then I
> would not expect the read iso example to work either.
>
> If that doesn't help, you can also install the debug version of the
> library and driver and use DebugView to see the messages. For
> instruction on this there are several posts in the archives.
>
> Regards,
> Travis
>
> On 8/25/2014 2:55 PM, Stephen B wrote:
> > Hello,
> >
> > I am trying to write isochronous data to my USB device. I tried
> > the xfer-iso c example but had no luck to compile it, and preferably I
> > want to use C# anyway. So I looked at the C# examples and found
> > Read.Isochronous. This compiles and works, but unfortunately there is
> > no Write example.
> >
> > I tried to create it myself using the c example and
> > the Read.Isochronous example, but with no luck yet. When writing, the
> > following line always returns error 50 (the request is not supported):
> > usb.IsoWritePipe(pipeInfo.PipeId, dataBuffer, dataBuffer.Length,
> > ovlkHandle, Iso.Handle);
> >
> > I also can't find any iso out packets with USBPcap.
> >
> > Does anyone have any idea what's causing this? I have attached my code
> > along with a descriptor report of my device. There are 5 unnecessary
> > endpoints from my base firmware code, but I decided to keep them in
> > for now to prevent causing more bugs, as my device has worked and
> > transferred iso data with libusb in the past.
> >
> > Thanks in advance for any help!
> >
> > Kind regards,
> > Stephen
> >
> >
> >
> ------------------------------------------------------------------------------
> > Slashdot TV.
> > Video for Nerds.  Stuff that matters.
> > http://tv.slashdot.org/
> >
> >
> > _______________________________________________
> > Libusb-win32-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>
>
>
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> Libusb-win32-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
>

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/

_______________________________________________
Libusb-win32-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.