Reverb module CPU problem (on raspberry pi)

Found a bug? Post it here.
Post Reply
TheMonopluralist
Posts: 51
Joined: Tue Jul 04, 2017 12:40 am

Reverb module CPU problem (on raspberry pi)

Post by TheMonopluralist » Sun Dec 24, 2017 2:41 am

So, I noticed a behaviour that is a problem - the "Reverb" module uses a lot of CPU percentage after being used.

Replicable on my system as follows:
-Create new project
-Add module "Reverb" (don't need to connect to output)
-Add module for input (e.g. analog generator)
-Show CPU Usage / Module List
-Trigger a single note
... On my system the reverb module CPU usage starts to jump, settling after the note is finished to somewhere between about 8% to 14% most of the time, but ALSO spikes up to much higher usage (sometimes right up to 100%) at seemingly irregular moments.

I could probably handle a 14% CPU hit to be able to use the reverb module (assuming it didn't jump to a ridiculously high percentage when in use), but these "random" spikes make it basically impossible to have it in a chain because I never know when it would be likely to max out the CPU. It's a pity at the moment, as I really like the sound of it and think it adds an awful lot when used well.

User avatar
NightRadio
Site Admin
Posts: 3008
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Reverb module CPU problem (on raspberry pi)

Post by NightRadio » Sun Jan 21, 2018 7:02 pm

Sorry for the late reply...
What is your RPi model?

TheMonopluralist
Posts: 51
Joined: Tue Jul 04, 2017 12:40 am

Re: Reverb module CPU problem (on raspberry pi)

Post by TheMonopluralist » Mon Jan 22, 2018 3:39 am

It is a raspberry pi 3. It seems to occur only after some sound is run through the reverb module. I have tested after e.g. 10 minutes or so and it was still the case. I haven't really got the pi out much recently, but was playing and seemed to notice something similar happen with the chorus module but haven't got round to testing it. I'll test again with both over the next few days, and try and make sure that it isn't some weird mistake I've made.

I only used the CPU values as reported by sunvox in its GUI, so I don't know if there is something to do with the way they are calculated being the cause and the genuine CPU usage is actually less. As you can imagine, running anything to do with real time creative audio on the raspberry pi is fraught with difficulties, and risk of drop-outs, etc, unless being very careful. Does sunvox only use one core, by the way?

User avatar
NightRadio
Site Admin
Posts: 3008
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Reverb module CPU problem (on raspberry pi)

Post by NightRadio » Mon Jan 22, 2018 6:03 pm

It is a raspberry pi 3.
Here is my config:
  • Raspberry Pi 2 Model B v1.2 (it has the same CPU as RPi 3);
  • Raspbian Stretch;
  • no external sound card; i like the internal Lo-Fi output :)
  • "softrender" option in the SunVox config (~/.config/SunVox/sunvox_config.ini);
  • OpenGL desktop is disabled in the raspi-config -> Advanced Options; if you want to enable OpenGL driver - please don't forget to remove the "softrender" option from the SunVox config (described above);
  • /boot/config.txt:
    • hdmi_ignore_edid_audio=1 (ignore audio through HDMI);
    • disable_audio_dither=1 (for better audio quality from the 3.5mm audio jack);
  • SunVox audio: Driver=ALSA; Output=hw:0,0; Buffer=1024; Sample rate=44100.
Everything works fine, without sound stuttering.

I reproduced your test (Generator+Reverb+some short note) from the first message. It works similar - I get a load of about 8%-14% too. Sometimes 20%-30%. But not higher. Maybe some additional conditions are required.

I guess where these unpredictable outbursts come from. Most likely, the reason is the denormal numbers. This is a big problem on some processors: when the sound fades out and becomes very quiet (in Reverb, for example), very small denormal numbers appear, but the processing of such numbers is several times longer.
There is special option to disable such numbers, but I'm not yet sure if this is necessary, because it depends on the type of CPU.
I need to read the Cortex-A53 manual carefully...

Does sunvox only use one core, by the way?
One core for sound and another for graphics.

Post Reply