CPU optimization issues in S1: why and what can be done
Posted: Tue Jan 09, 2018 3:17 pm
Hi dear family. I posted this on Facebook but thought it was a better idea to post it here.
I would like to talk about the famous "CPU optimization issues in Studio One" that lots of users talk about. I did some investigations and would like to submit my "findings" to the dev team in order to acknowledge (or refute, or at least explain) what I witness and see if it can help for further improvements regarding multi-core CPU usage in S1.
It's quite long so I did it in several parts. S1 users bear with me, it's a bit geeky but very interesting in my opinion.
PART 1 – The CPU optimization issue
That subject bothers me a lot. I mean a lot. I have a crazy silly CPU configuration (a dual E5-2680v2, overclocked @3.44 GHz, with a total of 20 cores/40 threads), but still when mixing on Studio One I pretty much run into a bottleneck rapidly as soon as I have an "above usual" count of plugins.
What do I mean? I mean the CPU maxes out on the Performance Bar in S1 and I start to have dropouts. I cannot stand having dropouts, actually nobody does. But here's the thing: when I open the Windows' Performance Monitor (I'm on Windows 10 x64) I can see that *globally* my CPU is absolutely not maxed out, it's about at 20-30% usage. What?
So what's wrong? Many of you now know that Studio One's CPU gauge doesn't show your *global* CPU usage, but the usage of the *CORE* that utilizes the most CPU (which makes the CPU gauges in different DAWs absolutely not comparable, but that's not my point here). Now that means that actually I have one (or several) cores that are maxed out; and it happens that indeed Windows' Performance Monitor is showing a 20-30% global CPU usage but with one core at 100% or so. And for all the mixing projects that I encountered dropouts on, there always is ONE CORE that is at 100%. And the other cores are very low in usage, like between a couple % to 50%. Come on? There's all this crazy amount of free CPU to play with, and just ONE CORE is messing things up?
That raises a few (respectful) questions:
I wanted to investigate in order to have an answer. At least a beginning of answer, that I wanted to share with you and maybe discuss with the Studio One staff in order to get some improvements regarding multicore CPU handling.
PART 2 – My hypothesis
The first clue I had during my understanding quest, is that I was sure that it had to do with the way Studio One handles BUSES. Do the test: if you're running the same situation as me (you have a S1 CPU gauge at 100% and dropouts, and your Perf. Monitor shows that only one core is at 100%): select all your tracks/Buses/FX Channels and route them directly to the Master (basically you are bypassing the "bus function" in Studio One, making things all "flat") => normally you will witness a MASSIVE drop in the CPU gauge, while having exactly the same amount of plugins switched on.
It seems indeed to have to do with buses. And my computer programming background helped me quite a bit here. My understanding of buses made me kind of have a vision of how things could be implemented under the hood. When you have several tracks, that have some FX plugins on them, and that are routed to a bus that also has FX plugins on it, the bus has to wait for the processing on ALL the tracks to be finished before doing its own processing. Basic stuff right? So it has to do with synchronization. For each Bus and FX Channel you have to have a conductor/a manager that makes sure to synchronize the processing of their “children”; and if you have buses routed to buses, there must be some kind of “super-conductor” that must synchronize theses conductors, and the more Buses and Sends you have, the more complex the synchronization becomes.
My hypothesis is this one: all of this synchronization/or at least most of this synchronization happens *in one single Thread*, particularly the “super-conductor” of all conductors – The Master Bus – which is the last synchronization happening before routing the Audio stream to Audio driver, and which is the most complex. This would explain why I witness each time a single core at 100% and, consequently, dropouts. And it would also explain why there is a massive drop in CPU usage on that core when I route every track/Bus/FX Channel directly to the Master, i.e. when basically I bypass all the bus synchronization process (except the Master Bus of course, which has not so much work to do when doing so).
PART 3 – Some facts
Now look at that pictures attached to this post. They are from Process Explorer, a free tool by Sysinternals that I launched before launching Studio One and opening a “problematic” mixing session (note : I did it with a couple sessions and I always get the same results).
PART 4 – Let’s discuss
Now I do not want to second guess what is exactly happening under the hood; I did some synchronization stuff in the past but not enough in the Windows environment to understand fully and interpret what I witness in Process Explorer. The thing I am pretty sure about, is that the “poor CPU optimization” in Studio One that lots of users mention and that I encounter often on big projects, is due to Bus and Synchronization management. There seems to be one Thread doing too much work, raising the utilization of the Core it is running on towards 100% while there are plenty other cores barely utilized. That is for sure a very undesirable bottleneck, that probably our beloved people in Hamburg could investigate on?
I am sure there is something to do about it. Maybe it would require redesigning some things, but in my opinion if the load could be spread more evenly amongst the CPU Cores, it would be worth the hassle and it would push Studio One to the very next level where our beloved DAW pretty much would be incriticable (uncriticizable?) on the CPU optimization subject. It would rule and give the example to the other DAWs (yes I know, Reaper seams to be performing well, but I don't know Reaper, I can't say much).
I know this is a tough subject. I just cannot imagine how complex the synchronization under the hood must be, with delay compensation, Mix FX and all that, it must be a nightmare, but could it be the dev team investigate into that?
I do think it is a subject our community does care a lot about -- and it is a subject that non Studio One users are also watching. The reputation and image of Studio One is greatly involved here.
What about you my fellow Studio One mates? What do you think about those "findings"? Has any of you investigated deeper into the subject and got interesting info to discuss?
Sorry for that long read. Sorry also for my bad English and my typos, although I tried to be as clear and clean as possible. Cheers! Let me know what you think.
Take care.
Soup' (my signature is up-to-date)
I would like to talk about the famous "CPU optimization issues in Studio One" that lots of users talk about. I did some investigations and would like to submit my "findings" to the dev team in order to acknowledge (or refute, or at least explain) what I witness and see if it can help for further improvements regarding multi-core CPU usage in S1.
It's quite long so I did it in several parts. S1 users bear with me, it's a bit geeky but very interesting in my opinion.
PART 1 – The CPU optimization issue
That subject bothers me a lot. I mean a lot. I have a crazy silly CPU configuration (a dual E5-2680v2, overclocked @3.44 GHz, with a total of 20 cores/40 threads), but still when mixing on Studio One I pretty much run into a bottleneck rapidly as soon as I have an "above usual" count of plugins.
What do I mean? I mean the CPU maxes out on the Performance Bar in S1 and I start to have dropouts. I cannot stand having dropouts, actually nobody does. But here's the thing: when I open the Windows' Performance Monitor (I'm on Windows 10 x64) I can see that *globally* my CPU is absolutely not maxed out, it's about at 20-30% usage. What?
So what's wrong? Many of you now know that Studio One's CPU gauge doesn't show your *global* CPU usage, but the usage of the *CORE* that utilizes the most CPU (which makes the CPU gauges in different DAWs absolutely not comparable, but that's not my point here). Now that means that actually I have one (or several) cores that are maxed out; and it happens that indeed Windows' Performance Monitor is showing a 20-30% global CPU usage but with one core at 100% or so. And for all the mixing projects that I encountered dropouts on, there always is ONE CORE that is at 100%. And the other cores are very low in usage, like between a couple % to 50%. Come on? There's all this crazy amount of free CPU to play with, and just ONE CORE is messing things up?
That raises a few (respectful) questions:
- 1 core at 100% + all the others at 20-30% on average: how can Studio One not use these other cores judiciously?
- Why having multicore CPUs if Studio One cannot take advantage of them?
- And also the one that intrigues me the most: how does it happen that each time I'm experiencing a maxed out CPU gauge and dropouts, there's always *one* and only one single core that is maxed out?
I wanted to investigate in order to have an answer. At least a beginning of answer, that I wanted to share with you and maybe discuss with the Studio One staff in order to get some improvements regarding multicore CPU handling.
PART 2 – My hypothesis
The first clue I had during my understanding quest, is that I was sure that it had to do with the way Studio One handles BUSES. Do the test: if you're running the same situation as me (you have a S1 CPU gauge at 100% and dropouts, and your Perf. Monitor shows that only one core is at 100%): select all your tracks/Buses/FX Channels and route them directly to the Master (basically you are bypassing the "bus function" in Studio One, making things all "flat") => normally you will witness a MASSIVE drop in the CPU gauge, while having exactly the same amount of plugins switched on.
It seems indeed to have to do with buses. And my computer programming background helped me quite a bit here. My understanding of buses made me kind of have a vision of how things could be implemented under the hood. When you have several tracks, that have some FX plugins on them, and that are routed to a bus that also has FX plugins on it, the bus has to wait for the processing on ALL the tracks to be finished before doing its own processing. Basic stuff right? So it has to do with synchronization. For each Bus and FX Channel you have to have a conductor/a manager that makes sure to synchronize the processing of their “children”; and if you have buses routed to buses, there must be some kind of “super-conductor” that must synchronize theses conductors, and the more Buses and Sends you have, the more complex the synchronization becomes.
My hypothesis is this one: all of this synchronization/or at least most of this synchronization happens *in one single Thread*, particularly the “super-conductor” of all conductors – The Master Bus – which is the last synchronization happening before routing the Audio stream to Audio driver, and which is the most complex. This would explain why I witness each time a single core at 100% and, consequently, dropouts. And it would also explain why there is a massive drop in CPU usage on that core when I route every track/Bus/FX Channel directly to the Master, i.e. when basically I bypass all the bus synchronization process (except the Master Bus of course, which has not so much work to do when doing so).
PART 3 – Some facts
Now look at that pictures attached to this post. They are from Process Explorer, a free tool by Sysinternals that I launched before launching Studio One and opening a “problematic” mixing session (note : I did it with a couple sessions and I always get the same results).
- On the first picture you can see that the most CPU demanding Thread in Studio One (running my problematic song) is the one related to the Audio driver (RDAS1117.DLL is the driver of my audio card). Its amount of CPU is huge! From my understanding this is the thread streaming audio to the driver, maybe it’s the parent synchronization thread – the “super conductor” I was talking about earlier. This thread is doing A LOT.
Look at the red circle at the bottom, it says “Ideal Processor: 2” > this corresponds to what I see in the Perf. Monitor: it is indeed my Core #2 that is maxed out, reaching 100% CPU utilization, and this thread is responsible for that.
Now we want to know: what is this thread doing? Well, Process Explorer gives us some clues. - Look at the second picture (that I sliced in order to accommodate the overly restricted image size rules in the forum, but anyways): it is the detailed call stack of that thread. You can see that there is some synchronization going on, and that some processing is going on (Virtual Tape Machines from Slate Digital in this case). See that? Now when I click the Refresh button, the stack stays the same but this time another FX plugin is being processed. I clicked Refresh dozens of times and each time a different plugin is being processed *** AND THE MAIN THING IS THIS ONE: those are not only the plugins that I have on my Master Bus, those are plugins that I have on tracks, buses, sub-buses and FX channels! That one single thread is really doing A LOT.
PART 4 – Let’s discuss
Now I do not want to second guess what is exactly happening under the hood; I did some synchronization stuff in the past but not enough in the Windows environment to understand fully and interpret what I witness in Process Explorer. The thing I am pretty sure about, is that the “poor CPU optimization” in Studio One that lots of users mention and that I encounter often on big projects, is due to Bus and Synchronization management. There seems to be one Thread doing too much work, raising the utilization of the Core it is running on towards 100% while there are plenty other cores barely utilized. That is for sure a very undesirable bottleneck, that probably our beloved people in Hamburg could investigate on?
I am sure there is something to do about it. Maybe it would require redesigning some things, but in my opinion if the load could be spread more evenly amongst the CPU Cores, it would be worth the hassle and it would push Studio One to the very next level where our beloved DAW pretty much would be incriticable (uncriticizable?) on the CPU optimization subject. It would rule and give the example to the other DAWs (yes I know, Reaper seams to be performing well, but I don't know Reaper, I can't say much).
I know this is a tough subject. I just cannot imagine how complex the synchronization under the hood must be, with delay compensation, Mix FX and all that, it must be a nightmare, but could it be the dev team investigate into that?
I do think it is a subject our community does care a lot about -- and it is a subject that non Studio One users are also watching. The reputation and image of Studio One is greatly involved here.
What about you my fellow Studio One mates? What do you think about those "findings"? Has any of you investigated deeper into the subject and got interesting info to discuss?
Sorry for that long read. Sorry also for my bad English and my typos, although I tried to be as clear and clean as possible. Cheers! Let me know what you think.
Take care.
Soup' (my signature is up-to-date)