When testing line-in as part of aura#285 (closed), I had the feeling the gain is a little bit low. So this might be fixed with proper gain staging or it is related to this ticket, since the loudness is also low when scheduling (Tank normalized) audio files. Or thinking the opposite way: Fallback gain could be to high. To be investigated.
I have also experienced this before in my testing and can confirm this. I always assumed the fallback gain was too high because of the audio quality of fallback during testing. Definitely needs to be investigated, I'll gladly do some testing for you @Loxbie if you need me to.
this bug was also observed by Dion of Radio Proton after installing the latest release. Maybe you can get in touch with him if you want to investigate this further?
I have no clue on why the loudness of the different sources (fallback, in_queue, in_stream, ...) does not match. I disabled all amplify and replaygain related settings that I could find, still no difference.
I do have a fix/workaround: We can use liquidsoaps normalize function on the main output. @david do you think this is desirable for the radios? Please have a look at the small changes I made. If we decide to solve this issue with my proposed solution, I would add a few settings to the engine-core.yaml config in order to control the normalize settings.
I think this workaround won't be acceptable by radio stations, since the Liquidsoap documentation states the following regarding the normalize operator:
If you want to have a constant average volume on an audio stream, you can use the normalize operator. However, this operator cannot guess the volume of the whole stream, and can be “surprised” by rapid changes of the volume. This can lead to a volume that is too low, too high, oscillates. In some cases, dynamic normalization also creates saturation.
That's why it sounds more like a "last-resort workaround" to me.
In order to find the actual cause of the loudness difference you could try something like this simple test case:
# Create a fallback and file source actually pointing to the same audio filefile_source=...fallback_source=...main_source=fallback(id="fallback-source",[file_source,fallback_source])output.alsa(id="lineout",device="default",main_source)
Now try to switch between main and fallback source. Do you hear any difference in loudness? If this is not the same, then there is some basic bug in Liquidsoap. If it is working on the other hand, you can see what other operations are done on top in Engine Core. In that case one of them is causing the amplitude reduction of our main channels.
David Trattnigchanged title from Fallback channel loudness to high in contrast to other channels to Channel loudness to low in contrast to other fallback channel audio
changed title from Fallback channel loudness to high in contrast to other channels to Channel loudness to low in contrast to other fallback channel audio