This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#4748 - Automatic Recording Gain Control
Attached to Project:
Rockbox
Opened by Jvo Studer (vinylivo) - Tuesday, 28 February 2006, 15:09 GMT+2
Last edited by Peter D'Hoye (petur) - Monday, 03 April 2006, 12:01 GMT+2
Opened by Jvo Studer (vinylivo) - Tuesday, 28 February 2006, 15:09 GMT+2
Last edited by Peter D'Hoye (petur) - Monday, 03 April 2006, 12:01 GMT+2
|
DetailsThis patch adds automatic gain control (AGC) for recording.
At the moment it works with Mmmm's recording enhancements pack but I included a patch with the agc and the recenhancementpack included. Features: - 6 selectable AGC presets: Off, Safety (clip prevention), Live (slow), DJ-Set (slow), Medium and Voice (fast). - Controls also out of balance and tries to center the levels. The nominal target levels for the presets are: Live -9dB, DJ-Set -5dB, Medium -6dB, Voice -7dB. - Peak level histogram view in 4 modes: high resolution linear or logarithmic histogram, low height linear or logarithmic histogram plus balance meter, disk usage and batter level display. - Shows correct recording status in statusbar. - Issues a warning splash when disk space or battery level gets low. - Stops recording when disk is full (leaving a small 128MB remaining space that the jukebox can continue to work). - Stops recording when battery level is critical for hdd writing to prevent corrupted (or with 0 bytes because FAT entry couldn't be written anymore) files. This is a preliminary release, AGC-Mode is not yet saved in user settings and localization (language) is not yet done. All presets reduce the level by detection of clipping more than a second. The internal timing is 0.5s for now, perhaps I'll increase it to 0.2s later. 'fast' here means an attack time of 2 seconds and a release time of 4 seconds, so this is not a realtime compressor but really a relatively slow gain control system. And the gain control works by increasing/decreasing the input gain in 0.5dB steps. The user can change the gain manually anytime and therefore override the AGC. If AGC-Mode is not set to Off or Safety it will take over control again and head up for the preset target volume. Technical details: Algorithm timing: 0.5 sec Thresholds (upper/lower) [dB]: Live -7/-11, DJ-Set -4/-6, Medium -5/-7, Voice -5/-8 Timing (attack/release/balance) [s]: Live 40/150/60, DJ-Set 24/64/40, Medium 12/32/20, Voice 1.5/4/3 |
This task depends upon
Closed by Peter D'Hoye (petur)
Thursday, 17 August 2006, 13:25 GMT+2
Reason for closing: Accepted
Additional comments about closing: the rest of the REP should be committed separately or resubmitted to the tracker
Thursday, 17 August 2006, 13:25 GMT+2
Reason for closing: Accepted
Additional comments about closing: the rest of the REP should be committed separately or resubmitted to the tracker
The second includes the enhancement pack and AGC.
New features:
- settings are saved.
- localization (english & german)
- limiter versions of presets. allows to set a maximum gain which isn't succeeded. press left when AGC presets highlighted to select limiter presets. timing is the same as 'normal' presets. press down when AGC presets highlighted and a limiter preset is selected to change maximum gain.
- improved precision of peak meter (much lower error in important -12dB to 0dB range, error < 0.2dB).
This patch includes Mmmm's remote support and high size peak meter.
I have no idea how to apply that to my rockbox.....I m very interested since i m a musician and record a lot with my Iriver h320 in live sittuations...Anybody could tip me? thanks a lot and thanks for people developing this great thing!
- now with user font in recording screen if it fits. remote and main can have different fonts and peak-meter sizes depending on space.
- removed the 'limiter' presets and made 'max. AGC gain' enabled always.
- slight rearrangment of battery, disk and balance-meter. also enabled these infos for the higher sized histogram views if there is enough space on the screen.
- seperate saved preset & max. agc gain settings for mic and line-in.
- includes remote support (from Mmmm's patch)
- includes improved power managment (as I was unable to remove it right now, just too busy).
- use patch -p1 to apply to source.
@sebastien: This is for developers only at the moment (you need the development tools installed and compile the source yourself). I'll compile a recent binary for H120 and H320 when I find some time.
Use -p0 to apply
id: LANG_WARNING_BATTERY_LOW
desc: in recording screen
eng: "Battery is low!"
voice:
new:
I would love to test and commit the AGC and other stuff, but I can't do it all in one...
I splitted agc and batt/disk warnings too, so here are the seperate patches. I still try to update the patch every two weeks or so that they remain updated for easier patching lateron.
As the lang file changed, it didn't apply cleanly anymore, so I fixed it for you (AGC patch only)
I'll dive into this...
This is the official patch for the new language format. I moved all graphic changes (like status bar REC symbol etc) to the seperate histogram patch.
And I added a patch which includes AGC and Histogram display because it's not so easy to apply both patches to the source (conflicts because several functions and other stuff are used by both). So use the 'rec_agc_hist_pack' for this.
Patches were done against daily-060408 and use -p1 for patching
I think that there's a small bug in this lastest AGC patch.
When AGC is set to be in a "non-off" state it seems to only be available if your source is set to "mic".
Wouldn't AGC be useful during line-in recording as well?
I understand that it makes no sense to have AGC on when recording from digital, but automatic line-in attenuation would be a good feature too, no?
If you didn't want it during line-in you could always set the AGC to "off".
Please test ;)
(but in a hurry, so please check)
Seems to work for Mic in. This was the case in an earlier build.
Sorry Petur, it's broken. :-(
It's a diff from a version I run here, and I admit I only tested Line-In. But that worked.
Will check tonight...
Using Line input I can monitor and record both channels, but there is no AGC display and when I set the gain high and clip the input none of the levels change even when AGC is set to Safety in the menu.
I am currently 'make'ing a clean build from yesterday's source (20060801) and will report back on the 'dual mono' mic input recording status.
AGC bug still pending, de-activated during Line-Input recording regardless of menu setting. No AGC status disply in WRS when Source=Line-In (someone please corroberate)
Davide-NYC.
PS: thanks for all of the Devs on this project. LLRB (long live Rockbox)
The recording screen code is in need of some serious clean-up. I'm trying to have a look at it. *seeks time*
- moved HAVE_AGC to the config_xxx.h files for smoother multi-target implementation
- small fix in recording screen
I've added display support for digital in for players that support it (although AGC obviously does nothing for digital so on second thoughts maybe we shouldn't display at all in that mode...hmmmm).
Also I've fixed the remote display (and any other screens that are too small to fit all this info on).
Small screens that can't fit in the AGC info/settings now have the bottom line change into the settings line when the cursor is moved down.
- Synced with CVS (again)
- Should incorporate Mmmm's changes
- Removed 2 constants
- Prepared for other targets
Do test...
Built SIM: no errors, build NORMAL: no errors.
Installed on H140, tested mic in and line-in.
Digital in shows no AGC.
Tested with the 300LCD-Joystick remote. (buttons are mis-mapped but are all there)
IMO: Looks good! Woohoo!