Weird PC MIDI event indexes received in Ardour from Axiom 49

Hey,

I’ve been facing this weird bug where my MIDI keyboard fader buttons are recognized with the wrong program value in Ardour. I’m fairly certain it used to work in the past, so this is possibly caused by an upgrade, but I’m uncertain as to what (possibly Pipewire?).

Trying to debug me led me to aseqdump. When pressing the buttons F1 to F3 one by one this is what ALSA sees (and I presume Pipewire sees the same thing, it would be a very weird bug otherwise):

$ aseqdump -p 24:0
Waiting for data. Press Ctrl+C to end.
Source  Event                  Ch  Data
  0:1   Port subscribed            145:0 -> 129:0
 24:0   Control change          0, controller 0, value 0
 24:0   Control change          0, controller 32, value 0
 24:0   Program change          0, program 0
 24:0   Control change          0, controller 0, value 0
 24:0   Control change          0, controller 32, value 0
 24:0   Program change          0, program 1
 24:0   Control change          0, controller 0, value 0
 24:0   Control change          0, controller 32, value 0
 24:0   Program change          0, program 2

This is what Ardour sees when pressing the same 3 buttons in sequence:

image

Not being very familiar with MIDI events I’m somewhat baffled as to why the buttons would send a CC message before the PC message and not after, but otherwise the indexes look normal in ALSA. However, it looks as if Ardour is seeing index >> 1 instead of the actual index (all the other fader buttons have the same behavior as the first 3 I showed above).

I also tried resetting the keyboard to factory settings without any effect

Any idea?


OS is Linux 6.14.2, Ardour 8.12.0, Pipewire 1.4.2.

CCs #0 and #32 are Bank Select MSB and LSB respectively. I.e. they change between different banks of programs on the receiving device. Thatswhy they have to be sent before Program Changes.

NB: Some devices only react to CC#0, some only to #32, some to both and some to None (i.e. they only have one bank), so you can configure some controllers whether they send CC #0 or #32, both or None before Program Changes.

I tried to replicate the behaviour you saw, but wasn’t able to. I used a Python script to send the events seen in your aseqdump output to Ardour and the MIDI Tracer showed them all correctly, including the correct program change numbers.

I’m using traditional JACK with a2jmidi, though.

Thank you, that makes a lot more sense! I haven’t found yet a good detailed explanation on what kind of behavior are typically seen for MIDI keyboards…

I tried using jack_midi_dump (from the jack-example-tools package) and it sounds like this might be caused by Pipewire:

$ jack_midi_dump 
 902: c0 00
 797: c0 00
 890: c0 01

Weirdly the output ate the CC0/32 events and just show these truncated PC events.

Will report this to Pipewire upstream and see how that goes! (EDIT: Truncated MIDI events in pipewire-jack (#4664) · Issues · PipeWire / pipewire · GitLab)