Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Issue with Amlogic USB bulk transfers

Featured Replies

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?

 

  • Author

I don't think the usb_storage module is involved in libusb bulk transfers?  I did try playing around with CPU affinity for the USB interrupts, but it didn't change anything.

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.