View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0009522||ardour||bugs||public||2023-11-01 16:11||2023-11-28 09:30|
|Summary||0009522: Jack MIDI connections between MIDI tracks sometimes not working with pipewire-jack|
|Description||This only happens with pipewire-jack, when running Ardour with the Jack engine. At a certain point, or with enough tracks, inter-track connections suddenly stop working. This has been bugging me for a while, and it *still* happens with the latest Pipewire (0.3.81 at the time of this writing).|
|Steps To Reproduce||Add one MIDI track with no synth, but some MIDI data which gets sent to all the other MIDI tracks. Start adding tracks with synths on them. At some point the track connections stop working (as can be verified with ACE MIDI monitors), even though they are still shown in the patchbay.|
I've tried to come up with a minimal example (attached), but unfortunately the bug isn't 100% reproducible, so it might need a few attempts. The bug3 session usually runs fine on my system, while the bug4 session (which has one extra track) often trips the bug for me, at least after a while.
|Tags||No tags attached.|
ardour-pw-jack-midi-bug3.ardour-session-archive (10,829 bytes)
ardour-pw-jack-midi-bug4.ardour-session-archive (11,227 bytes)
||I've seen similar issues being reported on the forum, but there's really not much information about this issue on the web, so I'm wondering whether anyone else has seen this. It's most likely a pipewire bug, but I'm not sure what's going on there, so any comments about possible causes are appreciated. Maybe it's some kind of weird initialization issue that only manifests itself with pipewire-jack?|
If this does not happen with regular JACK, then this is a pipewire bug.
And if so, there is nothing we can do about on our side.
Can you test if the issue also exists with `jackd` ?
Hmm, why doesn't Mantis send me an email if when a note is added? Sorry for replying so late.
> Can you test if the issue also exists with `jackd` ?
You mean Jack1? Unfortunately, the Ardour package in Arch hasn't been working with that version for a while now. So I'd first have to install Jack1 and then build my own Ardour package against that. I will try that some time.
> If this does not happen with regular JACK, then this is a pipewire bug.
Yes, that's what I suspect as well. :( While PW's Jack module has progressed a lot in the last few releases, the present issue has never gone away. I just thought that I'd report it here and see whether any other Ardour users have been running into it. Maybe I should have posted on the forum instead.
Oh well, I guess I'll report this on the PW tracker and see what happens.
> You mean Jack1?
yes, or jack2.
There is no need to build Ardour again. jack is API and ABI stable.
PS. you should receive an email, check your SPAM folder?
In any case I cannot reproduce this here. Neither with internal backends (Ardour/ALSA) nor with jack2 (jackdmp version 1.9.17).
PS. Perhaps you can trace individual outputs with `jack_midi_dump`.
Yeah, I got the mail this time. :) Maybe I just missed the previous one...
> In any case I cannot reproduce this here. Neither with internal backends (Ardour/ALSA) nor with jack2 (jackdmp version 1.9.17).
It works 100% for me with ALSA and Jack2 (1.9.22) as well, this issue *only* arises with pipewire-jack. So it appears that this is an issue with PW's Jack implementation.
I'll try jack_midi_dump to see whether I can reproduce the issue with it. But it's also clear to see in the track meters; when one of the receiving tracks looses its connection, the meter suddenly drops to 0. So if nothing else I should be able to capture a screencast demonstrating the issue, and report it to the PW team.
There have been other weird issues with Jack MIDI in pipewire-jack in the past, such as Jack transport not working, which have since been sorted out. So there's hope that this one gets sorted out as well eventually. :)
||Anyway, maybe we can keep this ticket open until we get a resolution, or at least until I've reported it upstream? Thanks.|
||Ok, I reported this now at https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3632, let's see whether the PW team can figure out what's going wrong there. (I also added a screencast there which demonstrates the issue.)|
||Here's the link again, so that it's properly formatted: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3632|
Just a quick status update: This is still being worked on.
I've since also tested this on Fedora 39, and I see the same issues there, so this isn't just an issue with the Arch/Manjarow pipewire implementation.
Unfortunately, Wim hasn't been able to reproduce the issue on his system, but looking at pw debugging output, at least we were able to isolate a specific failure to allocate buffers in pipewire as as the apparent root cause.
With the latest pipewire version from git, a possible work-around seems to be to disconnect Ardour from Jack and reconnect, after which the buffer allocation errors go away and the affected session runs normally (most of the time).
||Ok, this is fixed now, it was a race condition in how pipewire-jack processed MIDI data being sent to multiple tracks simultaneously, when Ardour was using multiple threads. Thanks, Wim! So I'm closing this.|
||Fixed upstream, closing.|
|2023-11-01 16:11||aggraef||New Issue|
|2023-11-01 16:11||aggraef||File Added: ardour-pw-jack-midi-bug3.ardour-session-archive|
|2023-11-01 16:11||aggraef||File Added: ardour-pw-jack-midi-bug4.ardour-session-archive|
|2023-11-01 16:16||aggraef||Note Added: 0028290|
|2023-11-01 19:47||x42||Note Added: 0028291|
|2023-11-06 07:44||aggraef||Note Added: 0028299|
|2023-11-07 21:21||x42||Note Added: 0028301|
|2023-11-07 21:22||x42||Note Edited: 0028301|
|2023-11-07 21:24||x42||Note Added: 0028302|
|2023-11-07 21:26||x42||Note Edited: 0028302|
|2023-11-08 06:32||aggraef||Note Added: 0028303|
|2023-11-08 07:02||aggraef||Note Added: 0028304|
|2023-11-08 09:10||aggraef||Note Added: 0028305|
|2023-11-08 09:11||aggraef||Note Added: 0028306|
|2023-11-21 01:11||aggraef||Note Added: 0028344|
|2023-11-22 18:17||aggraef||Note Added: 0028351|
|2023-11-28 09:30||aggraef||Status||new => closed|
|2023-11-28 09:30||aggraef||Resolution||open => fixed|
|2023-11-28 09:30||aggraef||Note Added: 0028367|