tinyusb icon indicating copy to clipboard operation
tinyusb copied to clipboard

MIDI class compliant driver not loaded ("device not supported") for Line6 Pod Go (and HX Stomp) USB devices.

Open doughadfield opened this issue 5 months ago • 5 comments

Operating System

Others

Commit SHA

latest git pull on pico-sdk v 2.1.1

Board

RPi pico (RP2040) - pico-sdk 2.1.1 on vscode pico plugin

Firmware

when used in the midi2usbhost project (https://github.com/rppicomidi/midi2usbhost) simple MIDI devices like the Korg NanoKontrol2 are discovered correctly, but Line6 Pod Go is not discovered. usb descriptor and debug output from tinyUSB lib attached below.

What happened ?

when used in the midi2usbhost project (https://github.com/rppicomidi/midi2usbhost) simple MIDI devices like the Korg NanoKontrol2 are discovered correctly, but Line6 Pod Go is not discovered. usb descriptor and debug output from tinyUSB lib attached below.

This is the usb descriptor for the POD Go (dumped on a linux machine): podgo-descriptor.txt

This is the serial log output when debug level set to 2: line6podgo_log.txt

For comparison, this is the log from the same system when a Korg NanoKONTROL2 is plugged in: midi2usbhost_log_nanocontrol2.txt

How to reproduce ?

update vscode and pico-sdk plugin (to latest - 2.1.1) cd to .pico-sdk/sdk/2.1.1/lib/tinyusb run "git checkout master" then "git pull" to ensure tinyusb code is latest run "git clone --recurse-submodules https://github.com/rppicomidi/midi2usbhost.git" import midi2usbhost folder into vscode using the pico-sdk "import" function compile project flash project to pico board

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

line6podgo_log.txt

Screenshots

No response

I have checked existing issues, dicussion and documentation

  • [x] I confirm I have checked existing issues, dicussion and documentation.

doughadfield avatar Jul 03 '25 15:07 doughadfield

When a device it supports both Audio Streaming and MIDI Streaming, the TinyUSB driver expect it to publish descriptors like this:

  1. Audio Control
  2. MIDI Streaming
  3. Audio Streaming Lines 225-228 of the TinyUSB MIDI Host driver stops parsing the descriptor if the the MIDI Streaming descriptor does not immediately follow the Audio Control descriptor.

The POD Go device descriptor attached to this issue publishes descriptors like this:

  1. Audio Control
  2. Audio Streaming
  3. MIDI Streaming That is the reason the code does not recognize the MIDI interface on the POD Go.

A solution to this issue can be found in the usb_midi_host driver's midih_open() function after the audio control interface is detected:

    // This driver does not support audio streaming. However, if this is the audio control interface
    // there might be a MIDI interface following it. Search through every descriptor until a MIDI
    // interface is found or the end of the descriptor is found
    while (len_parsed < max_len && (desc_itf->bInterfaceClass != TUSB_CLASS_AUDIO || desc_itf->bInterfaceSubClass != AUDIO_SUBCLASS_MIDI_STREAMING))
    {
      len_parsed += desc_itf->bLength;
      p_desc = tu_desc_next(p_desc);
      desc_itf = (tusb_desc_interface_t const *)p_desc;
    }

That will skip over the Audio Streaming-related descriptors until it reaches the MIDI descriptor. Because there is no TinyUSB Host Audio Streaming driver, I prefer that solution.

rppicomidi avatar Jul 03 '25 17:07 rppicomidi

@rppicomidi I miss that in previous PR, do you mind to make a new one. Thank you

hathach avatar Jul 04 '25 02:07 hathach

@hathach I have sent a patch to @doughadfield to try. If it fixes the issue, then I will submit the patch as a pull request.

rppicomidi avatar Jul 06 '25 00:07 rppicomidi

Sadly, @doughadfield's device did not enumerate for a different issue. However, I the pull request I submitted should fix compatibility with other guitar effects units that support full speed USB host devices.

rppicomidi avatar Jul 22 '25 23:07 rppicomidi

re-opened (previously auto closed by github)

hathach avatar Aug 07 '25 07:08 hathach