Optimising Processor Usage

Questions and Discussions about G-Stomper
User avatar
riche
Posts: 30
Joined: Fri Jun 02, 2017 10:38 am

Optimising Processor Usage

Postby riche » Fri May 18, 2018 12:10 pm

Moved my questions about occasional crackles here as it does seem to be that I am a little heavy handed in my use of effects...
So I have some questions related to CPU usage...
I use pattern sets for my tracks and experience occasional crackle when moving between Pattern Pad triggers.
as I said on my previous posting on this - the crackle only happens once - the first time I go to a pattern trigger (usually where I have a VA beast part) and then never returns for the current G-Stomper session...
So not really a big problem for now - as I do a quiet sound check and "play out" the crackle before I go live or jam...

I just want to clear up some things in my mind in order to be sure on where I can optimise my use of Pattern sets and effects.
1 - When loading a pattern set does G-Stomper put all parts into RAM - does having more parts use more RAM?
2 - Does the CPU load only come from the current part playing (while all other parts are in RAM waiting to be triggered)?
3 - at the moment I really like applying Moog LP filters - there are 3 places you can do this:
>>>A - Effect SEND (to common 3 effect "unit")
>>>B - Track Effect INSERT (bottom of slider on mixer)
>>>C - SAMPLE track setting - FILTER and MOD - (I quite like using these settings)
>>>>I understand that the most efficient would be using the SEND.
>>>>There are times however that I would like to have different cut-off frequencies and have to use B or C to achieve this.
>>>>Which of B or C would use the least CPU (if any difference at all)?
???
Enough for now ... (thanks)
User avatar
planet-h
Posts: 1129
Joined: Wed Jun 19, 2013 4:46 pm

Re: Optimising Processor Usage

Postby planet-h » Fri May 18, 2018 12:38 pm

Thanks for your message, Riche.

riche wrote:Moved my questions about occasional crackles here as it does seem to be that I am a little heavy handed in my use of effects...
So I have some questions related to CPU usage...
I use pattern sets for my tracks and experience occasional crackle when moving between Pattern Pad triggers.
as I said on my previous posting on this - the crackle only happens once - the first time I go to a pattern trigger (usually where I have a VA beast part) and then never returns for the current G-Stomper session...
So not really a big problem for now - as I do a quiet sound check and "play out" the crackle before I go live or jam...

Thanks for the report here.
What you notice is some remaining part of the "warm-up" latency.
We're already doing a lot to get rid of it, but to get it away completely might be tricky, if not impossible.
I'll look into this and see what I can do.

riche wrote:I just want to clear up some things in my mind in order to be sure on where I can optimise my use of Pattern sets and effects.
1 - When loading a pattern set does G-Stomper put all parts into RAM - does having more parts use more RAM?

At runtime, everything that G-Stomper does is handled in RAM.
In other words, if you load something, it's loaded to the RAM.
The effects are all pre-initialized, so independent on how much of them you use, they always use the same amount of RAM.
Having more and longer patterns with in a pattern set uses slightly more RAM, yes.
Having more and longer audio samples loaded can use massively more RAM, yes.
But does that affect the CPU usage? No, not at all.

riche wrote:2 - Does the CPU load only come from the current part playing (while all other parts are in RAM waiting to be triggered)?

The CPU load comes from many factors:
- The audio processing - currently running part - depending on all the effects, nr of tracks/voices, mixing, etc. (the more is involved/played/activated at the same time the more it demands from the CPU).
- The UI drawing (portrait mode is way more demanding than landscape mode)
- Background processes like MIDI clock generation, real time session recording, file saving/loading, and many others
And in addition... the CPU speed varies over time, depending on the battery charge level, the CPU temperature and a lot of other factors (Android handles that following its own rules, which change with every Android version).

riche wrote:3 - at the moment I really like applying Moog LP filters - there are 3 places you can do this:
A - Effect SEND (to common 3 effect "unit")
B - Track Effect INSERT (bottom of slider on mixer)
C - SAMPLE track setting - FILTER and MOD - (I quite like using these settings)
I understand that the most efficient would be using the SEND.
There are times however that I would like to have different cut-off frequencies and have to use B or C to achieve this.
Which of B or C would use the least CPU (if any difference at all)?
???

First of all, A (send) is only more efficient if it's used by multiple tracks, as it's in fact a group insert (means the tracks are are mixed to one signal before passing the effect).
B and C are basically equal, but C comes with its own assignable LFO and Envelope.
And then there's also a D = The VA-Beast internal filters, which are not only per track, these are per voice and most expensive of all.

Here's a schematic drawing of the mixer/fx setup.
https://www.planet-h.com/gstomperbb/viewtopic.php?f=6&t=589&hilit=drawing#p2046
It doesn't include the track/voice filters, but I'm sure it'll help understanding the details.
User avatar
riche
Posts: 30
Joined: Fri Jun 02, 2017 10:38 am

Re: Optimising Processor Usage

Postby riche » Fri May 18, 2018 9:07 pm

Thanks for all that... Really helps...

When you say:
effects are all pre-initialized, so independent on how much of them you use, they always use the same amount of RAM.
Do you mean all possible effects or all effects used by pattern set - are loaded?

OK so now back to my problem - definitely my Tablet that's not coping...
Something not right with it... Crackles are not only problem.
A new problem now with a new track I am busy with:
When using a sample with low bass sine characteristic the overall sound is gated by the sine bass notes resulting in volume fluctuation :(
This problem goes away if I switch Audio system from Audio Track N to Audio Track Classic - Open SL has lots of little clicks although it has more volume than other 2...
... Not so sure the problems I'm having are CPU load....

Starting to wonder if my OS and its Huawei "skin" are perhaps the real problem here...
I did send you my Tablet spec - as you said in your response then this Tablet has a reasonable CPU and Ram configuration...
I must look into rebuilding on the OS although it is fairly new and I have not loaded much onto it.
For now I have found a compromise setup:
Audio System Classic set to medium latency.
Sample rate - native 48000Hz
LFO - 1/32 (I may push this up)

Wth this I get the crackle only once then it goes away...
User avatar
planet-h
Posts: 1129
Joined: Wed Jun 19, 2013 4:46 pm

Re: Optimising Processor Usage

Postby planet-h » Sat May 19, 2018 8:10 am

riche wrote:When you say:
effects are all pre-initialized, so independent on how much of them you use, they always use the same amount of RAM.
Do you mean all possible effects or all effects used by pattern set - are loaded?

There's only one audio core in G-Stomper.
In fact this means:
Max 24 drum samplers (each with 2 insert effect units + 3 band EQ)
Max 12 VA-Beast synth instances (each with 2 insert effect units + 3 band EQ)
3 send effect units
2 sum effect units
1 master EQ
That's the rough audio backend, comparable to the hardware you have in a hardware setup.
The pattern set is just a container of patterns, and patterns are nothing more than containers of parameters.
When you select a pattern in the pattern set to be played, then its parameters will be applied to the underlying audio core.
Back to your question...

The complete audio core (including all possible effects) is pre-initialized on startup and will always use the same amount of RAM from start to exist of the app.
This is required to have fast access to all the components. Loading them into RAM on demand would be way too slow.
As a matter of course all large buffers (e.g. used by the delays) are pooled and re-used.

A pattern set will be loaded into your RAM when you load it.
Depending on the used samples this demands more or less RAM (longer samples use more RAM).
Also here, sample buffers are all pooled. A sample is always only loaded once into the RAM, even if you use it multiple times in the pattern set.

What effects you use or do not use does not affect the RAM consumption in any way.

riche wrote:OK so now back to my problem - definitely my Tablet that's not coping...
Something not right with it... Crackles are not only problem.
A new problem now with a new track I am busy with:
When using a sample with low bass sine characteristic the overall sound is gated by the sine bass notes resulting in volume fluctuation :(
This problem goes away if I switch Audio system from Audio Track N to Audio Track Classic - Open SL has lots of little clicks although it has more volume than other 2...
... Not so sure the problems I'm having are CPU load....

Audio Track N or not N, does a lot of post processing (while Open SL does no post processing), therefore the result on the speaker might sound different with different audio systems.
But if you export a wav file, it'll always sound the same, as this difference is only in the D/A conversion.
However, what you report sounds a bit like a problem with too high levels.
Especially when working with clean sine waves, it's very important that the levels never get too high, otherwise the soft limiter (which protects from clipping) can destroy such a clean sine wav.
Can you please save such a pattern (not the set, only one pattern) and then send it to me by mail?
You'll find it at /sdcard/gstomper/patterns on your storage.

riche wrote:Starting to wonder if my OS and its Huawei "skin" are perhaps the real problem here...
I did send you my Tablet spec - as you said in your response then this Tablet has a reasonable CPU and Ram configuration...
I must look into rebuilding on the OS although it is fairly new and I have not loaded much onto it.
For now I have found a compromise setup:
Audio System Classic set to medium latency.
Sample rate - native 48000Hz
LFO - 1/32 (I may push this up)

Wth this I get the crackle only once then it goes away...

My recommendation would be:
Sample Rate = 32000Hz (keep in mind, it still remains 32 bit internally, and 16 bit externally)
LFO/Env = 1/16
Best is to try it, and if you're not happy with the quality anymore, then you can still switch back.

Btw. what do you mean with "rebuilding" your OS?
Folkdisco
Posts: 57
Joined: Tue Dec 12, 2017 4:04 pm

Re: Optimising Processor Usage

Postby Folkdisco » Sun May 20, 2018 8:30 pm

My experience... My system audio is 48,000, but I get noticeably more *fun* before things start to break up using 44,100, rather than 48,000. I haven't tried 32,000 as I thought this might be too much compromise. If I ever use unison sounds on the beast, things break up real fast. I get a few issues if I'm not careful, but it's usually timing issues, rather than crackles. Good luck!
User avatar
riche
Posts: 30
Joined: Fri Jun 02, 2017 10:38 am

Re: Optimising Processor Usage

Postby riche » Tue May 22, 2018 8:34 am

Hey Folk disco... Thanks 4 that...
Will also try 44,100...
Have been given some advice from Planet-h too...
Will post a summary of outcome and solution found sometime...
Folkdisco
Posts: 57
Joined: Tue Dec 12, 2017 4:04 pm

Re: Optimising Processor Usage

Postby Folkdisco » Sat May 26, 2018 12:09 am

Yeah, things from Andreas like "triangle waves are a lot more efficient than sine waves for the LFOs". Also, turning off screen animations makes a *big* difference for me. I think with 48k, 44k, 32k... try them and see what happens. I have an android thing called OSmonitor, which can show app processor usage in a drop down from the notification bar, but doesn't do nasty stuff when it's turned off. I am used to things like Cubase and Reaper on Windows, where you can see processor usage. Especially Reaper, which shows usage by different VSTs. All that info is useful. On mobile/tablets, you get more control over processors by rooting your device. But if the thing gets too hot, it'll turn itself down anyway, so it isn't good to push stuff too far. Leave some headroom. Good luck!
User avatar
planet-h
Posts: 1129
Joined: Wed Jun 19, 2013 4:46 pm

Re: Optimising Processor Usage

Postby planet-h » Mon May 28, 2018 12:33 pm

Folkdisco wrote:Yeah, things from Andreas like "triangle waves are a lot more efficient than sine waves for the LFOs".

I do not 100% agree here, as none of the regular waveforms in G-Stomper are calculated in real-time.

All waveforms (except random and random smooth for LFOs and Noise for Oscillators) are pre-calculated wavetables, therefore it generally makes no difference if you're using a sine, triangle, saw, pulse or triple peak wave. This applies to LFOs as well as to Oscillators.

In case of the Oscillators, all triangle, saw and pulse waves are band-limited wavetables, generated by layering multiple sine waves. This is to avoid ghost frequencies when playing high notes, which would result in less than one two samples per wave cycle.

Still, there might, depending on what the LFO waves control, slight differences in the CPU usage.

Folkdisco wrote:But if the thing gets too hot, it'll turn itself down anyway, so it isn't good to push stuff too far. Leave some headroom. Good luck!

Absolutely! If the device is getting too hot, then the Android OS throttles the CPU drastically to avoid damage.
User avatar
riche
Posts: 30
Joined: Fri Jun 02, 2017 10:38 am

Re: Optimising Processor Usage

Postby riche » Mon May 28, 2018 4:40 pm

Audio volume optimising:
Slightly off topic - but all in the quest of optimising G-Stomper. 8-)
Still searching for the optimal settings to use for best results.
Regarding Audio System setting:
I find the volume output of G-Stomper is a very low compared to Playing other audio on both my Phone and tablet :|
On my Tablet if I choose Open SL the output volume is good - but there are Audio clicks fairly often...
So I use Audio Track N on both my devices but really have to push the input gain on a mixer to sound at a reasonable volume....
Any ideas?
User avatar
planet-h
Posts: 1129
Joined: Wed Jun 19, 2013 4:46 pm

Re: Optimising Processor Usage

Postby planet-h » Mon May 28, 2018 5:16 pm

riche wrote:Audio volume optimising:
Slightly off topic - but all in the quest of optimising G-Stomper. 8-)
Still searching for the optimal settings to use for best results.
Regarding Audio System setting:
I find the volume output of G-Stomper is a very low compared to Playing other audio on both my Phone and tablet :|
On my Tablet if I choose Open SL the output volume is good - but there are Audio clicks fairly often...
So I use Audio Track N on both my devices but really have to push the input gain on a mixer to sound at a reasonable volume....
Any ideas?

The reason for that is simple:
If you use an audio player, then the player only has to play one large audio file (sample) at once.
Therefore it just can push it to -0dB at max volume without the risk of clipping, as there won't be any other tracks.

In G-Stomper (as well as in other multi track sequencers) you have many tracks, all mixed together to one output.
If all those tracks would be set to -0dB, then you surely can imagine that massive clipping will occur.
Therefore all levels in GSS are set to 85% by default.
A single synth has in fact an internal level of 85%, then in is routed through the mixer which has again a mixer level of 85%.
These values have been determined as default to avoid accidental clipping.
If you want to rise the levels, just rise the mixer volumes (all at once)
This can easily be done in linked mode:
https://www.planet-h.com/gstomper/docs/html/G-Stomper_UserManual_MixerAndMaster/part9.htm

However, just keep the headroom in mind. If you push it too hard, then you just run into distortion.
Keeping the levels low is one of the keys why GSS sounds better than other apps.

Return to “General Questions and Discussions”

Who is online

Users browsing this forum: No registered users and 0 guests