Page 1 of 4

Asking for replaygain support

PostPosted: Wed Sep 17, 2014 12:16 pm
by gorman
While looking to solve a couple of other problems here: viewtopic.php?f=2&t=14712 I discovered that Subsonic with the FFMPEG transcoding line I use is copying over to the transcoded files the replaygain tags used in the original files.

Since the difference in replaygain values due to transcoding should be negligible, I think it would be great if D-Sub was capable of interpreting and applying these replaygain values.

The standard is described here: http://wiki.hydrogenaud.io/index.php?ti ... cification

The correct implementation would see the player using album replaygain values when playing back consecutive tracks of the same album (by tags, I guess), while applying the track replaygain values when playing back mixed tracks from different albums. This is how Squeezebox has handled it for a long time and it's really efficient.

Thanks for reading.

Re: Asking for replaygain support

PostPosted: Wed Sep 17, 2014 10:27 pm
by daneren2005
Replaygain is probably the oldest non fulfilled request I have. To be honest, I still am not entirely sure as to how to implement it, as I'm not much of an audio buff. I just use the standard system API's to do everything. On of these days I will have to just sit down and spend the time to figure it out.

Re: Asking for replaygain support

PostPosted: Fri Sep 19, 2014 4:33 am
by Reith
Long-time user of DSub, just poking my head in to say I would also love ReplayGain support as I use it on all my music.

I don't know a lot about coding, but you could look into another open source player like Vanilla Music (https://github.com/adrian-bl/vanilla) to see how it implements it.

Re: Asking for replaygain support

PostPosted: Fri Sep 19, 2014 6:04 am
by daneren2005
Actually, that does help. I will take a look at how it is implemented there. Thank you.

Re: Asking for replaygain support

PostPosted: Sat Sep 20, 2014 1:52 pm
by gorman
The developer for Vanilla does several things right in implementing RG.

Actually, he pretty much does a by the book implementation. Track gain, album gain, pre-amp value, gain value for songs with no RG info.

He just misses the "smart gain" option that one can find in Squeezebox players, the one I described in the opening post. But it's a really good start.

Thanks for looking into this, much appreciated.

Re: Asking for replaygain support

PostPosted: Sun Sep 21, 2014 11:10 pm
by daneren2005
Here is a test apk with the basic logic implemented. Can you guys test it for me maybe? Or provide me with an account on your server and a list of a good set of files to test for this? Everything I try doesn't seem to have the tags :(

https://www.dropbox.com/s/6p72izbk7aaam ... 9.apk?dl=0

Re: Asking for replaygain support

PostPosted: Mon Sep 22, 2014 9:33 pm
by Reith
Wow, that was fast!

I'll test it out. Did you add RG-related options anywhere or is it just a basic setup to make sure it works properly first?

/e: It sounds like it's working, but it's difficult to tell without being able to do direct comparisons by switching RG on and off. I'm listening to a classical song I listened to last night and it sounds like it was boosted a bit. Let me know if you want a login to my server if you want to test things directly.

Re: Asking for replaygain support

PostPosted: Mon Sep 22, 2014 9:52 pm
by daneren2005
That was just a basic test without any sort of switch. I will do a proper version with it toggleable as well as fix some stuff in the next couple of days. The initial version was just a copy paste from that project, I need to add in all of DSub's specific logic as well (ex: maps playing will lower the volume to 20% then put it back up to a full 100% instead of the correct replaygain value). And yes, if you can either PM or email me a temp username/password + a good example set of songs to test directly with, it would be appreciated :D

Re: Asking for replaygain support

PostPosted: Wed Sep 24, 2014 3:58 am
by daneren2005
Ok, here is another version of apk (it is the same link, but the file has been updated). Changes are that now it is optional (in settings under Playback). Album tags are used if you are playing all songs where the album matches, or track tags are used if they are not similar to how it was asked for in the first post. I have the couple of issues I was aware of. I need feedback such as is this normalizing the volume correctly, etc.

https://www.dropbox.com/s/6p72izbk7aaam ... 9.apk?dl=0

Re: Asking for replaygain support

PostPosted: Wed Sep 24, 2014 7:34 am
by Reith
Just tested that latest apk out and I feel confident saying volume normalization is working, but changing the ReplayGain option (to enable or disable it) doesn't seem to apply until you close and reopen DSub.

Re: Asking for replaygain support

PostPosted: Wed Sep 24, 2014 12:19 pm
by daneren2005
You actually only need to switch to another song, but that is a fairly simple fix. In the next or release version it is already fixed to change as soon as you toggle it.

Re: Asking for replaygain support

PostPosted: Wed Sep 24, 2014 2:33 pm
by gorman
Installing the updated version now. I'm now going out, but I'll be in the car and trying this out. I'll report back.

Let me just say that this is really, really cool to be happening. :D

Re: Asking for replaygain support

PostPosted: Wed Sep 24, 2014 5:30 pm
by gorman
It seems to be working but... does it disable the equalizer or am I mistaken?

Re: Asking for replaygain support

PostPosted: Wed Sep 24, 2014 5:54 pm
by daneren2005
It does not disable the EQ. It only calls setVolume which should have no bearing on the EQ functionality.

Re: Asking for replaygain support

PostPosted: Wed Sep 24, 2014 7:46 pm
by gorman
I tried activating the EQ to raise the master level. It seemed to have no effect.