MIDI events not captured consistently

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

Post Reply
qwerkyJoe
Posts: 2
Joined: Wed Mar 04, 2020 3:25 pm

MIDI events not captured consistently

Post by qwerkyJoe »

Hi, this is my first forum post here :D .

So I recently bought a MIDI keyboard, M-Audio Axiom Air Mini 32 to be exact. I've been using Linux for music production in the past few months, and so far everything has been working great. The DAW I am using is Ardour 5.12, the OS is Ubuntu 18.04 LTS, and of course I'm using the JACK Audio Connection Kit, configured with QjackCtl.

There were no issues detecting my MIDI keyboard (via a2jmidid -e) when plugged in to my PC, and could easily route its MIDI outputs to a track in Ardour. It is able to play some notes and produce sounds, but it is terribly inconsistent. To elaborate, sometimes the notes I pressed remained sustained even though I had let go of it, and sometimes no sound is produced by pressing the keys. I tried to debug it using the MIDI Tracer window in Ardour.

Here is a simple example of the problem where the notes are unable to produce any sound, but only the NoteOff MIDI event was captured, as shown by the MIDI Tracer:

Code: Select all

01:19:57.626674         NoteOff chn  1 3c 40
01:19:58.573086         NoteOff chn  1 3c 40
01:19:59.200016         NoteOff chn  1 3c 40
01:19:59.769077         NoteOff chn  1 3c 40
01:20:00.477378         NoteOff chn  1 3c 40
01:20:02.637171         NoteOff chn  1 3c 40
01:20:03.217745         NoteOff chn  1 3c 40
01:20:03.862186         NoteOff chn  1 3c 40
01:20:04.384747         NoteOff chn  1 3c 40
Starting from the left is the timestamp of the event, the event name itself, the MIDI channel, which note that emitted it and finally the velocity. In this case, I am pressing the same note. Another similar occurence would be only the NoteOn events were captured and the sounds would just cascade!!

I thought it was just an Ardour issue, but the problem also persists when I tried it on LMMS, as well as standalone softsynths like Zynfusion. Then, my next thought was the keyboard itself was the issue. But to make sure of that, I tested it on my Windows partition, and much to my disappointment, it worked perfectly fine in it!!

If it worked fine on Windows but not on Linux, then I guess the problem lies on my Linux configuration. Another thing I tried was changing the Frames/Period and the Periods/Buffer setting in JACK, as well as the MIDI Driver (none, raw, seq), via Qjackctl, but doesn't solve the issue. I've googled and surf the net, hoping to find anyone that had a similar issue as mine, but it was to no avail.

I really hope somebody in this forum had faced this issue before, and could help me solve it. Here is a summary of my system, and other info that maybe of help:

Code: Select all

Linux OS: Ubuntu 18.04 LTS
DAW: Ardour 5.12

Jack Settings
----------------
Driver: alsa
Realtime?: yes
Sample Rate: 44100Hz
Frames/Period: 256
Periods/Buffer: 2
MIDI Driver: None
I've had a good time so far making use of free, open-sourced tools to produce music. But this MIDI issue is baffling :( . I know MIDI works just fine in Linux, but something is wrong and I don't know what it is...
folderol
Established Member
Posts: 2069
Joined: Mon Sep 28, 2015 8:06 pm
Location: Here, of course!
Has thanked: 224 times
Been thanked: 400 times
Contact:

Re: MIDI events not captured consistently

Post by folderol »

Are you plugging it into a USB2 port or a USB3 one?
Some USB2 ports are underpowered, and can dip the supply just enough to mess up MIDI without showing any obvious issue - took me weeks to pin that one down :(
I get this with an Akai MPKmini plugged into a Raspberry Pi 4

On the other hand, I've found some USB3 firmware implementations don't play nice when you plug in a USB2 device
Sometimes you just can't win!
The Yoshimi guy {apparently now an 'elderly'}
qwerkyJoe
Posts: 2
Joined: Wed Mar 04, 2020 3:25 pm

Re: MIDI events not captured consistently

Post by qwerkyJoe »

The keyboard is powered by a USB2 cable that is provided by them, and I plugged it into a USB3 port. My laptop also has a USB2 port, but it couldn't even detect my keyboard when I plugged into it for some reason :? . Anyway, if that was the issue, then I think it wouldn't had worked well on my Windows too right? But on the contrary, it did (with the right driver installed for it, of course).
merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: MIDI events not captured consistently

Post by merlyn »

It's not going to work if you have MIDI Driver : None in JACK.

You can use jack_midi_dump to see what MIDI messages JACK is picking up.
Post Reply