Rockbox Technical Forums

Support and General Use => Recording => Topic started by: C1u31355 on September 05, 2006, 12:22:57 PM

Title: (Is MP3 always using AGC?) FIXED!!
Post by: C1u31355 on September 05, 2006, 12:22:57 PM
First, great respect and thanks  to rockbox. I would never have gotten my H120 if Rockbox hadn't made the thing useful.

I've been using .wav to record, but thought I would try the new mp3.

I downloaded the 0902 build and tried recording with mp3 at 320 kbps. With Line-in as the source, I plugged a dinky microphone into a battery module and spoke a little bit.

On playback, it was quiet of course, but although I had AGC off, the speech was accompanied by hiss--as if it was boosting the speech--with silence in between words. Words were also cut off entirely at a certain threshold, like a noise gate. So it was either voice-with-hiss, with words clipped off, or silence.

.wav recording had neither the hiss nor the sudden contrasts, and I hadn't changed the AGC setting.

Is it possible the mp3 recording is automatically adding AGC? Or is this a compression artifact, even at such a high bitrate?

Title: Re: Is MP3 always using AGC?
Post by: Mmmm on September 06, 2006, 03:22:08 AM
Well, it's not AGC...all that does is change the gain (which you can see by looking at the gain indicators) and if it was off it wouldn't be on anyway :). It must be compression artifacts... I haven't tried Mp3 yet so I don't know how good it is...
Title: Re: Is MP3 always using AGC?
Post by: Toni on September 06, 2006, 02:58:21 PM
Can you please make a short wav recording and compress this wav into mp3 using the mp3 encoder plugin? If the mp3 file shows the same artifacts as in the direct mp3 recording then I can investigate the reason if you make the wav available. I have only a 56k modem, so a real small wav file would be nice.
Title: Re: Is MP3 always using AGC?
Post by: C1u31355 on September 08, 2006, 12:02:58 AM
Sorry about the delay on this. First I'm going to download a newer build and do some testing, and if the problem is still there, I'll upload some little files Thanks.
Title: Re: Is MP3 always using AGC?
Post by: Toni on September 08, 2006, 11:58:52 AM
I think I now know the reason for the bad quality here. The improvements on the mp3 encoder went into the encoder plugin but not into the mp3 codec. I will write a patch soon, to make these improvements available also to the mp3 encoder codec.
Title: Re: Is MP3 always using AGC?
Post by: Wolf on September 09, 2006, 09:00:23 AM
Toni,
Can't the plugin just be a "launcher" and run the same codec module used on the recording section? (that way any improvement on the codec are automatically reflected in all places).
Thanks for this nice piece of code, Wolf.

Title: Re: Is MP3 always using AGC?
Post by: Llorean on September 09, 2006, 02:47:11 PM
What he's talking about is that there's a plugin called wav2mp3, which can be run on individual WAV files. That was improved, but because the codec recording patch is older than it, it didn't get the improvements made to it.

At least that's my guess.

Now that we've got recording codecs, what we need is a transcode interface, where you can pick a WAV file (or lossless file), choose "Encode" and pick an output format, for if you record something in wavpack and then later decide you need it in MP3 for space. Then we can drop the wav2 plugins.
Title: Re: Is MP3 always using AGC?
Post by: C1u31355 on September 09, 2006, 05:09:03 PM
I don't seem to have the wav2mp3 plugin on my unit. But I emailed Toni a couple of quick samples of mp3 320 recording and .wav.

Title: Re: Is MP3 always using AGC?
Post by: Llorean on September 09, 2006, 05:11:23 PM
Actually, it's called mp3_encoder, my mistake. There's also wav2wv.
Title: Re: Is MP3 always using AGC?
Post by: Toni on September 10, 2006, 03:43:32 AM
C1u31355
Thanks for sending the sound snippets.
I verified, that the bad quality is a result of the 'old' mp3 encoder codec. With the help of preglow my patch http://www.rockbox.org/tracker/task/5959 of the encoder codec update got submitted really quickly. So in latest builds this issue has been solved.
Title: Re: Is MP3 always using AGC? FIXED!!!!
Post by: C1u31355 on September 10, 2006, 05:10:11 PM
Thank you so much for fixing this so quickly! If only the human mind evolved as fast as Rockbox does....