Author Topic: CPU load when monitoring "more" parameter values per strip  (Read 6101 times)

Offline Klaus

  • Newbie
  • *
  • Posts: 19
CPU load when monitoring "more" parameter values per strip
« on: April 07, 2017, 10:11:03 PM »
Hi Alexey,

it's been a while, hope all is well!

My little studio has been pretty busy in the last couple of month and working with your plug-in made many things so much easier and improved my workflow without a doubt!


Now I'm testing a new preset for my X-Touch Compact and run into an issue, but I'm not sure if it's something unavoidable i.e. expected behaviour or if it can be solved by optimizing my preset.

In this preset I use all 16 encoders to control the Sends Volume of one strip/track including visual feedback with Parameter Value Monitor.

It seems to be that monitoring a "lot" of parameters per strip (in this case 16 Sends plus one Volume Fader) increases CPU load to a state where SONAR's GUI becomes very sluggish, moving faders or turning encoders shows jumping movements instead of smoothness in SONAR.

Here's a short animated gif which shows the increase in CPU load when a track with 16 Sends is selected and the dropping CPU load when a track without any sends is selected.

It should also show the stuttering fader movements, hopefully you can see it (gif's fps = 30).

SONAR's audio engine is turned off/not running!




Additionally, moving an open plug-in window or e.g. AZ Controller's UI is also sluggish or stuttering/jumping when the selected track is the one with the 16 Sends but normal and smooth when the selected track has no sends = less monitored parameters.

What I tried so far is reducing Parameter Value Monitor from Ultra to Normal and that reduced the load a bit but even setting it to Slow didn't reduced the sluggishness to a workable degree.

I've tested this preset on two different computers (Win 7 and Win 10) with comparable results:

Tested with AZ Controller b357 and SONAR 23.3 r0 b51,
i7 2600K, AMD GPU 6670 (older driver) - Windows 10 and
i5 4690, AMD GPU 7950 (recent driver) - Windows 7.


So, maybe it's just not possible for my systems to handle this or maybe (here's hope  ;) ) I can tweak some settings with your help.

Thanks and all the best,
Klaus

Offline Camilo Melo

  • Newbie
  • *
  • Posts: 9
Re: CPU load when monitoring "more" parameter values per strip
« Reply #1 on: April 08, 2017, 12:50:22 AM »
Good evening! I have the same problem here. It seems worst with send pans control. Sonar GUI becomes very slugish.

Offline azslow3

  • Administrator
  • Hero Member
  • *****
  • Posts: 1701
Re: CPU load when monitoring "more" parameter values per strip
« Reply #2 on: April 08, 2017, 09:54:31 AM »
You are right, I have the speed problem there.

Thank you for reporting and please give me at least some days to fix it.

PS. The number of monitors is AZ Controller is not problematic by itself. The code is rather fast, f.e. I have just tested that 300 track volume monitors produce not significant impact on my very old system (Sonar 24 track template with turned on audio engine saturate my CPU...). I was checking up to 3000 monitors when originally testing the monitoring code.

The problem is that Sonar give no easy way to check something is changed, so I have to use tricky procedures. It seems like some calls I use are slow on Sonar side.
With strait strip parameters, Dynamic ACT and even with FX parameters things looks good. ProChannel is still acceptable. With Sends current schema is unacceptably slow.

There is no strait forward fix, but I am almost sure I can optimize down to acceptable level.


On preset side there is not much you can do. If you are still using separate "Name" and "Value" monitors for the same parameter, there is a way you can "merge" them into just "Value" monitor by using "Mon. par. not changed" function in the feedback section. That reduce "slow" code by half, but the result is not better then changing both monitors speed from Ultra to Fast. As you have already checked that improve the load a bit but it is not working solution.

Offline Klaus

  • Newbie
  • *
  • Posts: 19
Re: CPU load when monitoring "more" parameter values per strip
« Reply #3 on: April 08, 2017, 06:58:35 PM »
Thank you, Alexey, for you quick reply!


PS. The number of monitors is AZ Controller is not problematic by itself. The code is rather fast, f.e. I have just tested that 300 track volume monitors produce not significant impact on my very old system (Sonar 24 track template with turned on audio engine saturate my CPU...). I was checking up to 3000 monitors when originally testing the monitoring code.


Ah, that makes sense now, because the preset I used in the example above included 16 Buttons to enable/disable the sends (forgot to mention that), at first with Parameter Value Monitor set then without monitoring (LEDs on/off).

I expected the latter would reduce the CPU load but it didn't.

But removing all 16 buttons for "Send enable/disable" entirely from the preset did reduce the CPU load.

Many thanks for considering to try an improvement, much appreciated! Always!

Please take all the time you need or want, no hurry at all!

All the best,
Klaus




Offline azslow3

  • Administrator
  • Hero Member
  • *****
  • Posts: 1701
Re: CPU load when monitoring "more" parameter values per strip
« Reply #4 on: April 10, 2017, 04:34:43 PM »
Can you try the latest test version: http://www.azslow.com/index.php?action=downloads;sa=downfile&id=28 ?

It happened that one of Sonar calls I can not avoid by logic is extremely "expensive". But I have optimized away some other calls, let me know if that improves situation with your preset.

Offline Klaus

  • Newbie
  • *
  • Posts: 19
Re: CPU load when monitoring "more" parameter values per strip
« Reply #5 on: April 11, 2017, 07:41:33 PM »
Thank you, that was fast!

Your changes made a big improvement, now I can use the encoders for Sends and that's great!

I have to stay with Parameter Value Monitor set to Normal or Slow, but that's fine; the slightly slower refreshing of the enoder LEDs doesn't bother me.

If I set them to Fast, the sluggishness is a bit too high to work with but since I can use the lower settings now, I'm glad!

BTW, I use only Parameter Value Monitor without Parameter Name Monitor.


Now, adjusting all my Sends by grabbing a knob is really comfortable and fast!

Again, thank you so much!


All the best,

Klaus

Offline azslow3

  • Administrator
  • Hero Member
  • *****
  • Posts: 1701
Re: CPU load when monitoring "more" parameter values per strip
« Reply #6 on: April 11, 2017, 08:53:37 PM »
Thank you for reporting back.

Can you attach the preset you are using? I am a bit curious what can produce such big effect there when using Fast or Ultra.
So far I was testing with 500 (!) monitors for Send  in Ultra mode. That makes things significantly slower (even in i7 with X2 under Linux...). But 6-10 monitors should not saturate your system, till I have overseen something else. And that is possible: one single Sonar call for Track volume is more then 100 times faster then (the same from my side) call for Send target. There can be other such "slow" calls which you hit in your configuration.

Offline Klaus

  • Newbie
  • *
  • Posts: 19
Re: CPU load when monitoring "more" parameter values per strip
« Reply #7 on: April 12, 2017, 12:24:37 AM »
Sure, and I'm actually glad you asked! ;)

I've attached two presets:

1. "Heavy":
Selecting a track with 16 Sends increases CPU load by appr. 17 % compared to selecting a track with no Sends (SONAR's audio engine off).

2. "Normal":
The preset I work with now. CPU load increase is only about 1-3 % (on tracks with/without Sends).

I made more changes between these presets than changing from Ultra to Normal for Parameter Value (so they probably aren't easy comparable and I can't remember all details unfortunately), although most changes are different actions for Buttons, but:

The difference regarding CPU load between these presets is more than the difference between using azctrl_b357 and now using azctrl_b359, so I think it's highly possible that I made some significant mistakes in preset "Heavy".

(bear with me when looking into my presets; I'm just happy when I can get things working but for making it efficiant or "right" - phew, my knowledge about using your plug-in doesn't go that far by now, unfortunately  ;)).

The presets are a combination of two devices, X-Touch Compact is Slave.

All the best,

Klaus

Offline azslow3

  • Administrator
  • Hero Member
  • *****
  • Posts: 1701
Re: CPU load when monitoring "more" parameter values per strip
« Reply #8 on: April 12, 2017, 04:19:28 PM »
Thanks Klaus,

Please download b360. In my tests Heavy show 1-3% between a track with/without sends. I completely optimized away SEND_OUTPUT call (till Sonar report topology change...).

Please note that when you measure CPU performance, do this with AZ Controller interface closed. When open, it continuously scan current Dynamic ACT plug-in for changes. Depending from plug-in, that can add 1-30% load (some plug-ins have 1000s of parameters...).

Offline Klaus

  • Newbie
  • *
  • Posts: 19
Re: CPU load when monitoring "more" parameter values per strip
« Reply #9 on: April 13, 2017, 06:44:03 PM »
Hi Alexey,

Wow! Amazing!

Using azctrl_b360 reduced the CPU load (audio engine off) from 17% to 0%. Zero! :)

And I've set Parameter Value back to Ultra: Still Zero %

You are a brilliant programmer!!

Thank you so much again for your work and for your help, it is really, really appreciated!

All the best und schöne Feiertage!

Klaus

Offline azslow3

  • Administrator
  • Hero Member
  • *****
  • Posts: 1701
Re: CPU load when monitoring "more" parameter values per strip
« Reply #10 on: April 14, 2017, 12:08:32 AM »
Thank you for confirming it is working. I will have to test more to include this optimization into release, I do not want repeat the mistake when I was a child (from my mother's words, I was like 9 years old):
"Mama! I am now solving all excises as the first in the whole class! The teacher had only one remark, that in addition to solve problems fast I have to learn how to solve them right..."  :)


Offline Camilo Melo

  • Newbie
  • *
  • Posts: 9
Re: CPU load when monitoring "more" parameter values per strip
« Reply #11 on: April 14, 2017, 02:52:06 AM »

good evening! I would like to add that with b360 the performance improved here as well. Thank you, Alexey, for the beautiful work. I think I was one of the first users of your plugin and I have no words to thank you enough.

Offline azslow3

  • Administrator
  • Hero Member
  • *****
  • Posts: 1701
Re: CPU load when monitoring "more" parameter values per strip
« Reply #12 on: April 14, 2017, 09:13:05 AM »
good evening! I would like to add that with b360 the performance improved here as well. Thank you, Alexey, for the beautiful work. I think I was one of the first users of your plugin and I have no words to thank you enough.
Thanks! And your are right, 2014 this "club" was small  ;)