High CPU usage on Windows when UI is visible
vvrbanc opened this issue · comments
When ADL/OPNplug UI is visible and a long note is playing in a DAW, cpu usage goes up to 80-100% of a single core.
Seems to be related to the ADL/OPNplug UI's MIDI keyboard display. If the part of the window with the midi keyboard is moved off the bottom of the screen, the cpu usage drops back to normal.
Same behavior with both VST and LV2 versions of ADLplug and OPNplug on Windows.
Linux versions do not exhibit this behavior.
Reproduced in 2 different DAWs on Win10: Reaper and LMMS. In Reaper it is especially annoying because it freezes the position cursor.
Steps to reproduce:
- create a midi track with a single long sustained note in a DAW program on Windows and assign the ADLplug instrument to it.
- while the ADLplug UI is visible, start playing the track and observe the CPU usage.
- cpu usage drops if the part of the ADLplug UI window with the midi keyboard is moved off the bottom of the screen
I am guessing that it is repainting/redrawing too quickly in a tight loop.
Reproduced on Renoise 3.3.2 on Windows as well.
There is a suspicion on that, but atm I don't have the windows environment to test it unfortunately.
At least to me, this never happened back when I tested.
But I might have a potential quick fix, I'll give that an attempt.
What are the characteristics of the system? CPU/GPU
i5-3570K, 16GB, GTX 1060 3GB for me.
A patch is in, but the binaries have troubled to rebuild for windows since the juce 6 upgrade.
It takes a little more work to get the things fully back on track.
Please check with the minGW build out of this revision if you don't mind.
https://ci.appveyor.com/project/jpcima/adlplug/builds/40450641
Hi,
Thank you for taking the time to look into this.
I tried the LV2 versions from the CI link above and I don't see any difference in CPU usage.
It's jumping between cores but one is always at 100%, with significant amount in kernel time.
FWIW the cpu is ryzen 3700x and gpu is rtx 3070.
Right I can reproduce at least that there's a LOT of repaint requests that occur during the note playback, using Reaper. I'll see if I can get to the origin of this.
Most probably fixed by new commit 041935e
build here https://ci.appveyor.com/project/jpcima/adlplug/builds/40452338
Yeah, I've been using the release VST3 version and switching between that and this VST2 build is like night and day.
It was not a good idea to build VST3 to start, it created misbehavior with program changes.
So I've turned it off; but this particular problem has nothing to do with VST2 vs VST3.
It's OK to close this issue?
So I've turned it off; but this particular problem has nothing to do with VST2 vs VST3.
That's what I figured.
It's OK to close this issue?
Looks like it to me. 👍