After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 673970 - rgvolume does'nt apply gain using fallback-gain (without Track and Album tags)
rgvolume does'nt apply gain using fallback-gain (without Track and Album tags)
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-04-12 08:16 UTC by anthony
Modified: 2018-11-03 14:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rgvolume does'nt apply gain using fallback-gain (without Track and Album tags) (862 bytes, patch)
2012-04-12 08:16 UTC, anthony
needs-work Details | Review

Description anthony 2012-04-12 08:16:50 UTC
Created attachment 211909 [details] [review]
rgvolume does'nt apply gain using fallback-gain (without Track and Album tags)

When trying to apply the advised gain (that is the result of rganalysis) by using the fallback-gain property (no ReplayGain tags), the result gain is always near 0 and no normalization is being applied.

The reason is that in this case, the plugin assumes a peak value of 1.0, which makes the clipping prevention mecanism prevent any normalization (because gain + linear_to_db(peak) is always > headroom, in fact in our case here, linear_to_db(1.0) is 0 every time), so as long as the gain is positive, the result gain will always be reduced.

To sum up, the anti-clipping mecanism is counter-productive when the media has no ReplayGain tags: assuming a peak of 1.0 means that the track has full volume, therefore normalization cannot be safely applied (according to the anti-clipping feature).

I propose a patch to change peak value from 1.0 to 0.000001 (linear_to_db(0.000001) = -120, which equals to the maximum appliable gain, i.e. pre-amp + fallback-gain), so that in the case of using fallback-gain, the gain will always be applied.
Comment 1 Edward Hervey 2018-05-05 14:53:20 UTC
Thanks,

  Better late than never :)


commit 36e49fd6f872f0b3f33083107a55fb7f671a47d0 (HEAD -> master, origin/master, origin/HEAD)
Author: Anthony Violo <anthony.violo@ubicast.eu>
Date:   Thu Apr 12 09:53:24 2012 +0200

    BugFix : Change peak value to normalize audio file with fallback gain
    
    https://bugzilla.gnome.org/show_bug.cgi?id=673970
Comment 2 Edward Hervey 2018-05-09 07:38:04 UTC
Actually this makes the rgvolume unit test fail. Not 100% sure if it's the test to blame or not.

Running suite(s): rgvolume
87%: Checks: 8, Failures: 1, Errors: 0
elements/rgvolume.c:312:F:general:test_fallback_gain:0: Applied gain is 6.00 dB, expected 0.00 dB
Check suite rgvolume ran in 0.045s (tests failed: 1)
FAIL elements/rgvolume (exit status: 1)
Comment 3 Tim-Philipp Müller 2018-05-13 17:37:03 UTC
Anthony, any chance you could have a look at that?
Comment 4 Tim-Philipp Müller 2018-05-15 09:41:31 UTC
Reverted until someone has time to investigate. Broke the tests.

commit d5d6e6cfdd4030052bc0b8dfc85739614a80a714 (HEAD -> master)
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Tue May 15 10:35:09 2018 +0100

    Revert "BugFix : Change peak value to normalize audio file with fallback gain"
    
    This reverts commit 36e49fd6f872f0b3f33083107a55fb7f671a47d0.
    
    Breaks unit test, someone needs to investigate if it's the
    patch's fault or if the test needs adjusting/updating.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=673970
Comment 5 GStreamer system administrator 2018-11-03 14:46:15 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/61.