Complicated SideEffects (Ugly, Strange)
How to reproduce:
voala, from nothing there is created +2dB at low frequency (in my case it was -1dB/0dB because of limiter set to -3dB gain limit). When limiter is turn off, AutoGain work correctly. If Silence Detection is enabled, limiter can be enabled and it's working correctly.
Video:
(I let playing muted video in Chrome, can be any app with muted audio, which still let pipeline open)
In output it really was "trying" to play low frequency, my subwoofer was creating ugly vibration without sound, it was only moving cone under 10Hz, when I put hand on subwoofer I feel it.
4.6.8
p. s. it's also creating crackling at start of getting audio data to pulseeffect input pipeline, if limiter is enabled. I think, there is problem with clearing noise data in memory, which is used as buffer for PA and PulseEffects
When silence detection is disabled the autogain will keep working for all momentary values. It does not matter how low they can be. In some cases all you have is low level noise and they will be amplified as result.
Yeah, but it happend only with limiter before AutoGain, so is limiter creating noise, or is there some problem with buffer cleaning? I think, there should still be some "silence detect" on lowest values... for example -100dB level, and everything under this value should be classified as "unwanted noise", it can fix this problem and crackling as well, so instead totally turn of silence detect, it should only change mode from based on relative value to based on static low level value (-100dB). But primary I want to know what is creating that low level noise at these low frequencies, if it's limiter, then it should be fixed (propably should create new issue on Calf-studio's repo).
In your tests with detect silence off the autogain gain went as high as 500 (almost 54 dB). I wonder if at this point the noise is coming from rounding errors that are inherent to floating point operations. But they could also be being caused by Pulseaudio. Chrome is playing silence but in the moment you play the test signal Pulseaudio will have to put one more thing in our custom sink PulseEffects(apps) and this flow of silent buffers will have to be interrupted for a short moment. Among a few things Pulseaudio has to mix each player audio buffer and maybe resampling one of them. This could cause noises that will be played at some point in the future. It will depend on the amount of buffering done in each processing stage.
For example remember we have a block size and a buffer setting. If you have a high values in each of them it will take some time until all that was there is played. So when you turn on the limiter the noise could be coming not from it but from an old buffer that was already in PE just waiting its turn to be played.
We could check for a unwanted noise level. But we have to decide if the value used will be in loudness units or in the typical decibel scale. The momentary value you see is in loudness units. The input and output level meters in each plugin use the typical dB level.
I think, it's better to base it on typical dB level. -100dB is good value for limit. I think, it shouldn't affect quality of audio, but it will remove low level unwanted noise.
Low level check added to the master branch
Most helpful comment
Low level check added to the master branch