Rockbox

Tasklist

FS#7747 - (limited) replaygain for archos recorder

Attached to Project: Rockbox
Opened by Christian Marg (einhirn) - Monday, 10 September 2007, 17:30 GMT
Last edited by Frank Gevaerts (fg) - Saturday, 04 June 2011, 22:26 GMT
Task Type Patches
Category Music playback
Status Closed
Assigned To No-one
Operating System Archos Recorder
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

I've hacked up (limited) replaygain support for my archos recorder using the MAS digital volume control matrix.

Limits:
- The overall (Track/Albumgain and Preamp) maximum "gain" is about +18dB
- The "Prevent Clipping" option does nothing

Cause for the limits:
The MAS DVCM can only be used to attenuate, so there shouldn't be any clipping to prevent. Also, to simulate gain, I have set the +0dB (don't apply replaygain) mark to -18dB...

I'm not sure if the Settings are correctly applied on Boot - the code says "they should", but I couldn't verify it.

To do:
- The replaygain settings of the new track are applied when it's about to be sent to the MAS, not when the MAS will actually play it. So there could be a split second (depending on the mp3 bitrate) at the end of the current track played with replaygain settings of the next track.
- The analog amp in the recorder should have +5.95dB gain available somewhere, that would improve the chance to compensate for the "new 0dB" point.
This task depends upon

Closed by  Frank Gevaerts (fg)
Saturday, 04 June 2011, 22:26 GMT
Reason for closing:  Out of Date
Comment by Christian Marg (einhirn) - Tuesday, 11 September 2007, 21:06 GMT
Ok, I fixed the issue with the loading of the sound settings - the attached diff is complete with the fix for said issue.
Comment by Christian Marg (einhirn) - Saturday, 15 September 2007, 01:15 GMT
Removed "noclip" code since it won't ever make sense.
Removed "Language file updates" - the updates removed a restriction on language files for the Noclip option.
Reworked preprocessor directives so that this replaygain support is only built on hw-codec-platforms
Modified the application of replaygain to use 64-Bit Multiplication less often. I've replaced it with Bitshifts and Binary operations where I could.
Comment by Christian Marg (einhirn) - Sunday, 16 September 2007, 15:33 GMT
Moved back to using 64-Bit multiplication because I wasn't able to produce the correct values via bitwise operations.
Comment by Christian Marg (einhirn) - Wednesday, 12 December 2007, 00:09 GMT
updated diff to apply to SVN Revision 15913.

Found out, that the new MAS Replaygain settings are usually applied some fractions of a second into the _next_ track, so that switching from a silent track to a loud track will play a little bit of the Loud piece at a great volume and then lower the volume to the replaygain set value...

For my part the analog amp doesn't need to be cranked up, I can manage with what it does...
Comment by Christian Marg (einhirn) - Wednesday, 30 January 2008, 00:39 GMT
Updated to apply to SVN Revision 16182.

As amiconn states in http://www.rockbox.org/irc/reader.pl?date=20080130 the audible delay in applying replaygain settings probably occurs when a track change happens during rebuffering. In that case the MPEG-thread is busy with bit-swapping the data for the MAS - the bit-swapping can take up to ~65ms, add other delays and you have the audible volume change happening maybe 100-200ms into the new track.

I'll experiment with pushing the analog output, but clipping is possible with it - I'd like to avoid that...
Comment by Christian Marg (einhirn) - Saturday, 16 February 2008, 00:27 GMT
Just another update - I found that with replaygain5.diff the volume would not be the perceived "correct" one in some cases. This is because it only updates on the "track change" event - but there are some other events that should trigger "update_replaygain()", e.g. when resuming playback from stop or off...

Since I've yet to experiment with analog output and still have to see if replaygain gets updated correctly in "all" cases, this probably won't be the last comment here.
Comment by Christian Marg (einhirn) - Monday, 19 May 2008, 02:00 GMT
Checked in on my Patch after about 1200 SVN revisions... What a mess :/ Will have to rewrite large parts, because the structure of firmware/sound.c has changed a lot. Am planning to do that - but it will take some time.

Loading...