hathach / tinyusb

An open source cross-platform USB stack for embedded system
https://www.tinyusb.org
MIT License
4.66k stars 996 forks source link

Device Manufacturer / Product strings are truncated for some devices when certain (other) devices are connected #2651

Open cbrunschen opened 1 month ago

cbrunschen commented 1 month ago

Operating System

MacOS

Board

Waveshare RP2040-Zero

Firmware

Custom firmware, representative sample that reproduces the issue at https://github.com/cbrunschen/tinyusb_rp2040_print_device_strings/ , with latest tinyusb as of the time of writing (

tinyusb% git status
On branch master
Your branch is up to date with 'origin/master'.

)

What happened ?

When I have multiple HID devices connected, and one of them is my Microsoft Sidewinder Force Feedback 2 joystick, then the Manufacturer and Product (and when present, Serial number) strings seem to be truncated, containing only a few initial characters.

I discovered this while working on a different project where I definitely need to have multiple HID devices connected (via one or more hubs). This does not see to be triggered by the number of devices (I have other devices of which I can connect several all at the same time and they all behave well), but only when specific devices are connected.

How to reproduce ?

  1. Compile the firmware in https://github.com/cbrunschen/tinyusb_rp2040_print_device_strings/ with the latest tinyusb alongside it, and upload it to an RP2040 board
  2. Connect a USB hub and at least two HID devices (joysticks or similar), one of which is one of those that triggers the issue such as the Microsoft Sidewinder Force Feedback 2
  3. Retrieve Manufacturer and Product strings from the connected USB devices

Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)

3 logs so far:

Screenshots

No response

I have checked existing issues, dicussion and documentation

cbrunschen commented 1 month ago

I should add that the Microsoft Sidewinder Force Feedback 2 is not the only device that triggers this behaviour, but it is the device that I have at home that does so, and was also the first device with which I encountered this behaviour.

The other context where I've observed this is when I've had connected, at the same time:

  1. Thrustmaster T.16000M joystick
  2. JustSoaring GliderSim Pro Joystick and pedals
  3. JustSoaring GliderSim Pro Flight Controls

I did not think to check whether it's one or the other or both of the JustSoaring GliderSim Pro devices that triggers this behaviour, but I can make an attempt next time I'm there.