Skip to content

USB MIDI SysEx messages are garbled #3465

Closed
@mzero

Description

@mzero

MIDI SysEx messages are sent out the USB MIDI port are garbled.

Example:

import usb_midi

usb_out_port = usb_midi.ports[1]
sys_ex_test_msg = bytes([0xF0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xF0])

usb_out_port.write(sys_ex_test_msg)

The host system should receive an 11 byte MIDI SysEx message.... however it receives:

10:43:23.628    From CircuitPython usb_midi.ports[1]    SysEx       
    F0 01 02 01 01 02 02 01 02 03 01 02 04 01 02 05 01 02 06 01 02 07 01 02 08 01 02 09 01 02 F7

10:43:23.628    From CircuitPython usb_midi.ports[1]    SysEx
    F0 01 02 F7

Code path:

  • usb_midi.ports[1].write() in python calls
  • usb_midi_portout_write in shared-bindings/usb_midi/PortOut.c, which calls
  • common_hal_usb_midi_portout_write in shared-module/usb_midi/PortOut.c, which calls
  • tud_midi_write in lib/shared/tinyusb/src/class/midi/midi_device.h, which calls
  • tud_midi_n_write in lib/shared/tinyusb/src/class/midi/midi_device.c, which is where the bug is!

The bug in tinyusb was recently fixed and committed: hathach/tinyusb#512

This bug will be fixed when a version of tinyusb is pulled into this project that is past that fix. This bug is here to make sure it doesn't get missed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions