Jump to content

Album gain not being applied with Opus files


chardish

Recommended Posts

Poweramp build number: v3-build-874-arm64-play
Device: Pixel 3a
Android version: 10
No custom ROM
 
I cannot get album gain to be applied when playing an Opus file. Only the track gain is applied, no matter what I select in the audio settings screen.
 
Here is the output of opusinfo aka.opus:
New logical stream (#1, serial: ea3c018d): type opus
Encoded with Lavf58.45.100
User comments section follows...
        ALBUM=SAWAYAMA
        ALBUM ARTIST=Rina Sawayama
        ALBUMARTIST=Rina Sawayama
        ARTIST=Rina Sawayama
        DISCC=1
        DISCNUMBER=1
        DISCTOTAL=1
        ENCODER_OPTIONS=--vbr --bitrate 160
        MUSICBRAINZ_ALBUMID=114a0177-7bac-4d3f-aa1a-d1abc9e536b1
        MUSICBRAINZ_RELEASEGROUPID=972644cd-431d-4001-8913-0b59b975cfbc
        R128_ALBUM_GAIN=-50
        R128_TRACK_GAIN=-4096
        TITLE=Akasaka Sad
        TOTALDISCS=1
        TOTALTRACKS=14
        TRACKC=14
        TRACKTOTAL=14
        DATE=2020
        TRACKNUMBER=5
        encoder=Lavf58.45.100
Opus stream 1:
        Pre-skip: 312
        Playback gain: 0 dB
        Channels: 2
        Original sample rate: 48000 Hz
        Packet duration:   20.0ms (max),   20.0ms (avg),   20.0ms (min)
        Page duration:   1000.0ms (max),  910.9ms (avg),   20.0ms (min)
        Total data length: 217080 bytes (overhead: 0.9%)
        Playback length: 0m:10.013s
        Average bitrate: 173.4 kbit/s, w/o overhead: 171.9 kbit/s
Logical stream 1 ended

Note that it only says the encoder is lavf58.45.100 because I losslessly cut it with ffmpeg so that it would be under 0.49 Mb and I could attach it here. The file was originally encoded using opusenc.

As you can see, R128_ALBUM_GAIN is -50 and R128_TRACK_GAIN is -4096. If Poweramp correctly applied this gain I would expect to see a significant volume difference when I switch from Source: Album to Source: Track in audio settings.

However, I don't see any change. In fact, the song is fairly low in volume which leads me to believe that Poweramp is ignoring the album gain tag and only applying the track gain.

aka.opus

Link to comment
Share on other sites

Quote

(a question, does track gain work for you? Poweramp doesn't apply enough gain for me)

Of those two Opus samples, Tone low is far quieter than Tone high. I'm not sure if that's correct or not 😄.

EDIT: same experience using foobar2000 mobile

 

Personally I don't enable Opus header gain ever. It's simply a hack to try to make Opus files work with players that haven't implemented Replaygain yet, but it makes it harder for developers to implement Replaygain because they have to make sure they aren't applying gain twice (once from the header and again from the tags). In foobar2000 I always make sure Advanced > Tagging > Opus > Header gain is set to null. And whenever I encode I make sure to do it from FLAC files that aren't tagged with Replaygain, otherwise the encoder will write the gain into the header.

Link to comment
Share on other sites

1 minute ago, chardish said:

Of those two Opus samples, Tone low is far quieter than Tone high. I'm not sure if that's correct or not 😄.

No, it's not correct, but @maxmp just said he couldn't reproduce with these test files (which leads me to believe he didn't compare the two Opus files somehow). Do you think maybe it's the header gain's fault?

 

Also +1, I want Opus album gain support.

Link to comment
Share on other sites

It's the header gain. I disabled it like you said you did and now everything works. I encoded from foobar2000.

Now I need to find a way to make it work from Linux though, from the terminal. I get to encode my music into 80GBs of Opus music, again. And I'm gonna have to resize the embedded artwork, again, because otherwise Poweramp gets angry and crashes while scanning.

EDIT: Wait, fb2k can just remove header gain and then scan the files again. Nice.

Link to comment
Share on other sites

8 hours ago, null said:

EDIT: Wait, fb2k can just remove header gain and then scan the files again. Nice.

And it can do it as a batch task if you simply load the overall folder. I did all of my albums a few months ago so I know everything is now consistent (overwrote any old values). Took a little while to process, but I don't think it was more than an hour or so for 10,000+ files.

Andre

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...