Re: win32 - ISO USB2.0 transfers (helpful hint)
jonesjuice0 <aaron <at> sonistic.com>
2011-06-04 19:51:40 GMT
Tim,
Thanks for your reply. I tried the changes you recommended and
.
.
.
audio_out_block audio_out[OUT_FRAMES][32]; // output data blocks
void* audio_out_context[OUT_FRAMES][32]; // context for iso async output
transfers
// initialize isochronous asynchronous request types
int i;
for(i=0;i<OUT_FRAMES;i++){
ret = usb_isochronous_setup_async(handle,
&audio_out_context[i][0], EP_ISOC_OUT, EP_ISOC_OUT_MPSIZE * 32);
if(ret != 0){
printf("Error: failed to setup isochronous output
transfer %d error code: %d\n",i,ret);
res = USB_ISOC_OUT_ERROR;
goto done;
}
}
for(i=0;i<OUT_FRAMES;i++){
ret = usb_submit_async(audio_out_context[i], (char*) <b>// THIS LINE
&audio_out[i][0], EP_ISOC_OUT_MPSIZE * 32);
if(ret != 0){
printf("Error: submit isochronous output transfer %d
error code: %d\n",i,ret);
res = USB_ISOC_OUT_ERROR;
goto done;
}
}
.
.
.
Generates an invalid handle error and exits on the first loop iteration. Presumably, this is because audio_out_context[0] is a pointer to an array of type <void*> only audio_out_context[0..7][0] actually contain a pointers to an initialized context. I changed the line to
.
.
.
ret = usb_submit_async(audio_out_context[i][0], (char*)&audio_out[i][0], EP_ISOC_OUT_MPSIZE * 32);
.
.
.
And now get the same error that I had before
libusb0-sys:[transfer] [iso-write #2162] EP02h packet-size=2432 length=2432 reset-status=00000000h
libusb0-sys:err [transfer_complete] sequence 2162: transfer failed: status: 0xc000000d, urb-status: 0x80000300
libusb0-sys:[transfer] [iso-write #2163] EP02h packet-size=2432 length=2432 reset-status=00000000h
libusb0-sys:err [transfer_complete] sequence 2163: transfer failed: status: 0xc000000d, urb-status: 0x80000300
libusb0-sys:[transfer] [iso-write #2164] EP02h packet-size=2432 length=2432 reset-status=00000000h
libusb0-sys:err [transfer_complete] sequence 2164: transfer failed: status: 0xc000000d, urb-status: 0x80000300
libusb0-sys:[transfer] [iso-write #2165] EP02h packet-size=2432 length=2432 reset-status=00000000h
libusb0-sys:err [transfer_complete] sequence 2165: transfer failed: status: 0xc000000d, urb-status: 0x80000300
libusb0-sys:[transfer] [iso-write #2166] EP02h packet-size=2432 length=2432 reset-status=00000000h
libusb0-sys:err [transfer_complete] sequence 2166: transfer failed: status: 0xc000000d, urb-status: 0x80000300
libusb0-sys:[transfer] [iso-write #2167] EP02h packet-size=2432 length=2432 reset-status=00000000h
libusb0-sys:err [transfer_complete] sequence 2167: transfer failed: status: 0xc000000d, urb-status: 0x80000300
libusb0-sys:[transfer] [iso-write #2168] EP02h packet-size=2432 length=2432 reset-status=00000000h
libusb0-sys:err [transfer_complete] sequence 2168: transfer failed: status: 0xc000000d, urb-status: 0x80000300
libusb0-sys:[transfer] [iso-write #2169] EP02h packet-size=2432 length=2432 reset-status=00000000h
libusb0-sys:err [transfer_complete] sequence 2169: transfer failed: status: 0xc000000d, urb-status: 0x80000300
I'm curious as to why you recommend this particular change. Does it involve increasing the URB size? I noticed some of your previous posts referred to modifications you implemented to the libusb-win32 library to make the async iso transfers work better. From that thread and others, I get the impression that libusb-win32's async support for isochronous transfers is somewhat limited, but from the modest amount of documentation available, have not been able to determine exactly what the limitations are. Unfortunately the license (LGPL) prevents me from making or using mods for my application, so I'm hoping to determine what the limitations of the current release version are without pouring through the source code. My goal is to stream audio data to and from the device using the endpoints list
ed below. I can tolerate say 50ms latency on the input and the occasional packet loss. Any info on this or other suggestions you have would be much appreciated.
EP_AUDIO_IN
bEndpointAddress: 0x82
bmAttributes: 0x0d
wMaxPacketSize: 524
bInterval: 5
bRefresh: 0
bSynchAddress: 0
EP_AUDIO_OUT
bEndpointAddress: 0x02
bmAttributes: 0x0d
wMaxPacketSize: 76
bInterval: 1
bRefresh: 0
bSynchAddress: 0
Thanks again for the response,
~Aaron
View this message in context:
Re: win32 - ISO USB2.0 transfers (helpful hint)
Sent from the
LibUSB Dev - Win32 mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today.
http://p.sf.net/sfu/quest-dev2dev2
_______________________________________________
Libusb-win32-devel mailing list
Libusb-win32-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel