2012/7/13 Spencer Hardin <spencer.c.har...@gmail.com>: > I'm working with a soundcard and I'm trying to implement the isochronous > write function (libusb-win32 backend). It's not pretty, but here's what I > have so far. >
I haven't gone into details of libusb-win32 async API yet, so take my comments with care... :) > > # def iso_write(self, dev_handle, ep, intf, data, timeout): > # pass > # int usb_isochronous_setup_async(usb_dev_handle *dev, void **context, > unsigned char ep, int pktsize); > # int usb_submit_async(void *context, char *bytes, int size); > @methodtrace(_logger) > def iso_write(self, dev_handle, ep, intf, data, epsize,timeout): > r0 = c_void_p() > request0 = pointer(r0) > data_cnt0=0 > > address, buffersize = data.buffer_info() > buffersize *= data.itemsize > #setup works > print _lib.usb_isochronous_setup_async(dev_handle,request0, ep,epsize) I think request0 argument should be replace byref(r0) > #submit fails > return int(_check(_lib.usb_submit_async(r0, > cast(address, c_char_p), > buffersize))) > for x in range(0,10): > data_cnt0 = _lib.usb_reap_async(request0,5000) I think request0 should be r0 here... > _lib.usb_submit_async(r0, > cast(address, c_char_p), > buffersize) > print data_cnt0 > > This produces the following error. > USBError: [Errno None] libusb0-dll:err [submit-async] submitting request > failed, win error: The parameter is incorrect. > > It looks like it's in reference to the cast(address,c_char_p) parameter, > Could it be the pointer? > Given a raw look on the cast, I can't anything wrong with the cast. > Any ideas as to what I'm doing wrong here? > Is there publicly available experimental code for libusb-win32 iso_write? > There is no iso for libusb-win32 yet, at most you have an experimental implementation of iso_write for libusb1 backend, located at the 'iso' branch. -- Best Regards, Wander Lairson Costa ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ pyusb-users mailing list pyusb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyusb-users