Jump to content

Issue with Amlogic USB bulk transfers


PhracturedBlue

Recommended Posts

I have a ToupTek MU300 USB2 camera that I was trying to get working with my LePotato.

The camera does not have native kernel support, but the manufacturer provides an SDK with a pre-compiled lib for x86/arm, and additionally I have a kernel module which works on X86/X64 with this camera as well as userspace libusb based code to access the camera.

 

The camera is very sensitive to having buffers available during bulk transfer, otherwise the image will be corrupted.  Generally synchronous bulk transfer is not fast enough, and requires multiple buffers supplied in asynchronous mode.

 

On x86-64 and Rpi3/4, everything works as expected.  I can grab images via the vendor supplied SDK as well as with my libusb based code (and on x86-64 the kernel module...which is untested on RPi).

 

However on the amlogic boards I have, the exact same code results in corrupted image frames being returned.  The camera responds properly to control messages, and I do get data via bulk transfer, but the packets are not uniformly sized as they should be, and data is missing (converting the raw data to an image shows broken line alignment, indicating missing data)

 

What I've tried:

  • Tested 5.9.14 and 4.19 kernels
  • Tested armhf and aarch64
  • Tested LePotato and ODroid-C4
  • Tested Kernerl-module, libusb, binary SDK
  • Tested synchronous and asynchronous bulk transfers
  • Tested with powered USB hub as well as directly plugged into SBC
  • Tested with conservative and performance governors

 

In all the above cases the camera performs the same way, yet there are no issues on RPi3, RPi4 or X86-64.  I'm not sure what other options I might have to debug.  I'm guessing it is something related to the USB stack, but it must be subtle, since I've seen no issues with other USB devices.  I have looked at the traces in wireshark, and there is nothing obvious (besides that the bulk transfers are not uniformly the correct size)

 

Does anyone have any ideas for other ways I may continue debug?

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines