plugdata icon indicating copy to clipboard operation
plugdata copied to clipboard

PLugdata standalone , midi out huge latency

Open gentleclockdivider opened this issue 2 months ago • 4 comments

On win 10 , midi out in plugdata standalone is unusable Lacenty up to 20'000 milliseconds , that's yes 20 seconds Happens with midi cc data and note on-off data Altough the midi indicators in plugdata show correct behaviour , somethingin win 10 is stalling the midi messages

gentleclockdivider avatar Nov 03 '25 17:11 gentleclockdivider

Having a similar issue on Windows 11 Pro 24H2, x86_64, PlugData v0.9.2. The setup is pretty simple:

  • One device enabled for MIDI In: Novation Launchkey 25 mk. 3 as Port 1
  • One device enabled for output: loopMIDI as Port 1

The patch is also pretty simple, I want program changes to set the channel for future CC messages:

Image
#N canvas 827 239 734 565 12;
#X obj 308 175 pgmin;
#X obj 258 129 ctlin;
#X obj 258 293 ctlout;
#X connect 0 0 2 2;
#X connect 1 0 2 0;
#X connect 1 1 2 1;

This works as expected, but it takes several seconds (varying from ~ 10 - 20s) for messages to propagate to the loopback interface.

Oddities:

  • As the original reporter noted, activity indicators in the patch show activity instantly.
  • The "cadence" of the CC performance is retained - that is, when messages arrive, they have the same timing. A slow sweep of a knob is performed as a slow sweep when it eventually arrives.
  • MIDI History shows both in and out messages instantly.
  • Restarting Windows seemed to reduce the latency, but it's still on the order of 1 - 2s

Expected behaviour: MIDI CC messages propagate to the loopback interface all-but instantly. (Though having since used basic Pd for a similar patch, I see "instantly" is laced with contingencies and caveats)

Thanks!

jbarrett avatar Dec 03 '25 15:12 jbarrett

I'm trying to reproduce this by using loopMIDI (on Windows 11) to send MIDI messages from plugdata to pure-data, and unfortunately they seem to arrive immediately, without any delay.

Am I missing any steps to reproduce this?

timothyschoen avatar Dec 08 '25 16:12 timothyschoen

@timothyschoen No, I think that setup sounds practically identical to mine. I played around with this for a while this evening, to see if there are any additional oddities in my setup - I don't think I'm doign anything unusual.

I also made the same patch in vanilla Pd, and it works just fine - messages arrive immediately. Sorry I can't offer more help - I'll keep thinking and tinkering, will update if anything shows up.

Thanks!

edit Not sure how useful this is, but I recorded MIDI history, loopMIDI monitoring window and vanilla Pd updating a number box as values come in.

https://github.com/user-attachments/assets/faf5c984-753e-4c40-9f3e-cca6a81f93af

jbarrett avatar Dec 08 '25 22:12 jbarrett

@timothyschoen I was futzing around with Audio settings again. wondering how buffer size might interact with this issue. I switched between one of the Windows Audio settings and DirectSound, then the patch started working as expected - messages propagate to the loopback interface instantly.

I switched back to Windows Audio, and again the patch works exactly as expected - messages come through instantly. Restarted the computer, still working just fine. I guess the good news is the issue is resolved in my case, the bad news is I can no longer reproduce and provide any clues to root cause.

jbarrett avatar Dec 09 '25 15:12 jbarrett

@timothyschoen I was futzing around with Audio settings again. wondering how buffer size might interact with this issue. I switched between one of the Windows Audio settings and DirectSound, then the patch started working as expected - messages propagate to the loopback interface instantly.

I switched back to Windows Audio, and again the patch works exactly as expected - messages come through instantly. Restarted the computer, still working just fine. I guess the good news is the issue is resolved in my case, the bad news is I can no longer reproduce and provide any clues to root cause.

Interesting find! It seems there's some sort of other factor here that we still need to figure out...

I'll mess around with my audio settings, maybe that will lead to something

timothyschoen avatar Dec 16 '25 16:12 timothyschoen

This should be fixed with a602e486c9cbd0de02d3d20c032f37b562b203dc

@gentleclockdivider could you confirm this is also fixed for you on the latest nightly builds?

timothyschoen avatar Dec 25 '25 13:12 timothyschoen