Raspberry Pi USB Transfer
Posted: Thu Jul 04, 2013 10:49 pm
Hello everyone,
I am working on writing my own userspace USB driver for an old webcam I have Creative PD1100, I have built the driver using "libusb" and it works fine on ubuntu and Mac.
However when I try to run the driver on the PI and read data ISOCHRONOUSLY from the camera, it seems by sniffing the data it is working correctly, Also, in the driver packets are being sent and their sizes seems logical and the status of the transfer is success but libusb allocated buffer is never written to and it always return zeroes.
My guess is that the reason for the problem is that the allocated buffer is not contiguous as mandated here:
[Pointer to the buffer to be used when sending data to the device (for an OUT urb) or when receiving data from the device (for an IN urb). In order for the host controller to properly access this buffer, it must be created with a call to kmalloc, not on the stack or statically.] Source: http://www.makelinux.net/ldd3/chp-13-sect-3
-----------------------
To offer contiguous allocation I should use kmalloc but that is out of my knowledge and requires kernel programming, is there another solution, am I even thinking in the right direction?
I have found a similar issue on this forum:
http://www.raspberrypi.org/phpBB3//view ... 7&p=124424
Thanks for your help!
I am working on writing my own userspace USB driver for an old webcam I have Creative PD1100, I have built the driver using "libusb" and it works fine on ubuntu and Mac.
However when I try to run the driver on the PI and read data ISOCHRONOUSLY from the camera, it seems by sniffing the data it is working correctly, Also, in the driver packets are being sent and their sizes seems logical and the status of the transfer is success but libusb allocated buffer is never written to and it always return zeroes.
My guess is that the reason for the problem is that the allocated buffer is not contiguous as mandated here:
[Pointer to the buffer to be used when sending data to the device (for an OUT urb) or when receiving data from the device (for an IN urb). In order for the host controller to properly access this buffer, it must be created with a call to kmalloc, not on the stack or statically.] Source: http://www.makelinux.net/ldd3/chp-13-sect-3
-----------------------
To offer contiguous allocation I should use kmalloc but that is out of my knowledge and requires kernel programming, is there another solution, am I even thinking in the right direction?
I have found a similar issue on this forum:
http://www.raspberrypi.org/phpBB3//view ... 7&p=124424
Thanks for your help!