Multithreading Support Question

Started by cmdy, April 05, 2022, 18:44:27

Previous topic - Next topic

cmdy

I've been using OpenMPT pretty much exclusively with all of my VSTs (Kontakt and its associated instrument editor, specifically) and once I start implementing enough instruments + my mastering plugin things can get pretty nasty. When I'm not liveplaying I usually set the latency to the max 250 ms, but even then, with simultaneous effects going on playback will inevitably stutter after enough are triggered. I know I can always lower the sample rate but I would ideally like to avoid that. I also realize that using several dozen instruments simultaneously is pretty intensive in itself, so my best option would probably be to just. Get better components lol.


My question is, would getting a processor with more cores be more efficient or would I be better off trying to find a processor with better single-threaded performance? I'm also unsure how much of this is dependent on OpenMPT and how much is dependent on VSTs like Kontakt, so if I'm barking up the wrong tree feel free to let me know.

I'm currently using a Ryzen 5 3600 which I know is pretty mid. I was looking at either a 3900x or maybe a 5800x to upgrade to, depending on what would better deal with the issue. Any insight is appreciated. Also, all of my VSTs and OpenMPT are loaded off of a pretty capable NVMe drive.

Thanks.

Saga Musix

For OpenMPT itself, raw single-threaded performance is the most important. It never hurts having more cores available, of course, because that means non-audio stuff can be spread better and it's more likely that one core can be fully utilized for rendering. Plugins may employ their own multithreaded processing, so that's one more reason why having a few more cores can never hurt.
For what it's worth, I'm running OpenMPT on a Ryzen 7 2700 and I can use many plugins in a song without any latency issues. A latency setting of 250ms is a lot, but without knowing what kind of CPU that is on and what kind of plugins are exactly involved it's hard to guess if it's appropriate or not. A song with around 50 plugins plays just fine for me even at ~6ms latency (using ASIO), though if I force them to use the plugin bridge, it will result in crackling. Doubling the latency fixes that, but that's still just 12ms of latency. Generally, avoiding tons of bridged plugins is important for good rendering performance.

It's probably difficult to use this as a benchmark because it uses a couple of commercial plugins, but this plays fine for me with the aforementioned settings and uses about 50 plugins (definitely not the most expensive ones in terms of CPU usage, though): https://sagamusix.de/download/plug_and_play/
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

cmdy

#2
First off, thank you for the quick and thorough reply.

The plugin bridge has always been nebulous to me but I am fairly certain(?) I'm not using it with any VSTs currently. All plugins that I use are 64-bit and I am using the 64-bit version of OpenMPT. Although I could be misinterpreting how the plugin bridge works.

The song I'm working on right now has 90+ instances of Kontakt and a few other VSTs. Kontakt in particular can get pretty bogged down with Event FX. Reverb and pass filters seems to hit playback the hardest, and adding timing envelopes to those as well, things have the potential to get out of hand pretty quickly. I'm not sure how much of an effect that many instances can have when only 30-40 are playing at a time, as it seems to really only have an effect when the more taxing instruments are playing.

Some instruments, especially in the more egregious Kontakt libraries, can have a pretty nutty amount of effects going on all at once before I get the desired sound and thus are probably taking up WAY more resources than a plugin might normally. My use-case for OpenMPT might be a little specific in that regard lol. But this might also mean that I should be looking towards Kontakt support. For what it's worth, Kontakt does have a multithreading option, and I've allowed it to allocate every thread I have, and the stuttering
and this is the exact moment where a light bulb turned on and I realized that disabling multithreading support on Kontakt might alleviate the issue entirely. I even set the latency all the way down to 10ms. No more stuttering on playback.

It seems having differing settings when it comes to the processor between Kontakt and OpenMPT was what caused the issue for me. Looks like I've been saved from buying a new processor. Or maybe I've just lost the justification for buying a new one lol.

Thank you for your help! Hopefully my experience here will help somebody else down the road dealing with a similar issue.

Saga Musix

Nice to hear. More threads means more inter-thread communication and coordination, so that could very well explain why disabling that option improved things so much for you. In the end, using less cores can be faster than spreading all the work across cores and waiting for them all to be done with their little part.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.