MiniDexed icon indicating copy to clipboard operation
MiniDexed copied to clipboard

Changing performances with rotary encoder crashes in USB Gadget Mode

Open probonopd opened this issue 7 months ago • 7 comments

On a Raspberry Pi Zero 2 with a 0.96" OLED via i2c and no i2s DAC:

  • Installed MiniDexed_2023-12-05-e5b2656
  • Enabled USB Gadget Mode
  • Set sound output to HDMI
  • Attached Pi to host computer (in this case, a Raspberry Pi 5) via the original Raspberry Pi USB Keyboard and Hub
  • Using REAPER, played a MIDI song out to the MiniDexed USB Gadget port. Works beautifully
  • Using the rotary encoder, loaded performance "Concert D" while the MIDI was playing. No issues so far
  • Same for "The Grand", "Rock Piano", "Cinematic", "Piano + Pad", "SimpleM.CP-70", "Phil's CP-70", "mDX-Ballade". No issues so far
  • When I select "Legend'83" it crashes and I hear a looping sound.

I can reproduce this. It is the 9th time I try to load a performance that I get the crash.

When the crash happens, dmesg on the host PC says

sound midiC0D0: rawmidi drain error (avail = 3353, buffer_size = 4096)

(Note: This does not happen when I don't use USB Gadget Mode but attach a MIDI controller instead. Then I can load performances more often than 8 times both with the rotary encoder and via MIDI without the crash.)

Additional information:

  • The freeze only happens when the device is connected to a host PC in USB gadget mode
  • The freeze also happens when I am not playing a MIDI at the same time
  • The freeze does not happen when USB gadget mode is disabled (even if powered via the same USB port at the same host PC)
  • The freeze does not always happen exactly at the 9th performance, it seems to be more like a ~1/10th probability of a freeze on every performance change

probonopd avatar Dec 06 '23 17:12 probonopd