Rockbox Technical Forums

Support and General Use => Recording => Topic started by: Vchat20 on January 09, 2008, 04:45:08 AM

Title: Low Recording samplerate in rockbox?
Post by: Vchat20 on January 09, 2008, 04:45:08 AM
I've got a sansa c240 here that I have recently put rockbox on and so far am HIGHLY pleased with. The rockbox firmware just adds so much more functionality on top of the stock firmware and it improves day by day.

But the one miff I have, and I dunno if it's player specific or something across the board on all players running rockbox, is that the only available samplerate on this thing appears to be 22khz under stereo. At least under the original firmware, this device was capable of something like 32khz stereo or 16khz mono in a PCM wav container. Recording off FM, the 22khz limit cuts off a noticable chunk of the audible spectrum.

Any chance of this limit being lifted? Or, in the very least, anyone know of a way to patch this in? I'm fairly knowledgeable as far as compiling and making real tiny/easy mods here and there. I have already done this to add a few patches listed on this site to the player and making a custom compiled build. But the scouring I have done in the source, I can't seem to find any noticable location that specifies this limit. So anyone who's more versed in the rockbox source who can help here, it'd be highly appreciated. Thanks. :)
Title: Re: Low Recording samplerate in rockbox?
Post by: Llorean on January 09, 2008, 11:21:25 AM
Are you sure it did 32khz stereo in the OF? The 22khz limit is actually a limit instituted by the hardware itself in the e200.

We have recording at 44khz just fine on other hardware, that's actually capable of it.
Title: Re: Low Recording samplerate in rockbox?
Post by: pixelma on January 09, 2008, 04:57:38 PM
He said
(...) something like 32khz stereo or 16khz mono in a PCM wav container.
...wouldn't it make more sense if it was meant the other way round, because 16kHz stereo would equal 32kHz mono in amount of data, right? If this is the case, Rockbox would even do a better job.  But enough of speculation I'll test this out as soon as I got some more files removed from the internal memory of my c250... because the original firmware wouldn't let me record on it otherwise (even though there would be enough space on my plugged in microSD, something one could make use of in Rockbox ;)).

Edit: Tested a radio and a voice recording in the original firmware - radio gives me a 16kHz stereo - and voice a 16kHz mono wave file...
Title: Re: Low Recording samplerate in rockbox?
Post by: Vchat20 on January 10, 2008, 05:00:28 AM
Actually, I take back the previous 'guesstimation' in my original post. On the OF the maximum I get is a 16khz, 16-bit, stereo PCM wave file. In rockbox, I get a 22khz, 16 bit, stereo file regardless of encoder.

Llorean: This is a c240 I have here actually. I'm not sure what hardware differences there are between the two, just wanted to clarify though.

And pixelma: I still have not determined a full understandable explanation for the difference either. All I know is that in just about every known case I have run across, any stated samplerates at least in software usually refers to the samplerate for a 2 channel file regardless of whether the file is 1 or 2 channels. So a 22khz file would instead be a mere 11khz per channel and so on. My phone only supports 8khz, 16-bit, mono wave files for ringtones and everytime I resample stuff in cooledit pro, even though I resample to 8khz, the single viewed channel in the spectrum viewer mode only tops at 4khz.

Anyways, I appreciate the answers. Was mainly curious if it was a hardware limit or a software bug. It'd certainly be interesting though if it could be somehow tricked or at least reconfigured to recording in software if the cpu is powerful enough for the job. Because I have recorded enough between of the built in recorder and off the line out patched into the computer and there is certainly a noticable increase in frequency response in pure FM radio mode, no player-side recording.
Title: Re: Low Recording samplerate in rockbox?
Post by: petur on January 10, 2008, 07:51:06 AM
My phone only supports 8khz, 16-bit, mono wave files for ringtones and everytime I resample stuff in cooledit pro, even though I resample to 8khz, the single viewed channel in the spectrum viewer mode only tops at 4khz.

That sounds totally reasonable... If you sample at 8kHz, the highest frequency possible is 4kHz or half the sampling frequency.
Title: Re: Low Recording samplerate in rockbox?
Post by: Multiplex on January 10, 2008, 07:56:10 AM
Quote
even though I resample to 8khz, the single viewed channel in the spectrum viewer mode only tops at 4khz.
That would be the Nyquist Frequency http://en.wikipedia.org/wiki/Nyquist_frequency if you sample at a frequency X the highest frequency you can record is X/2 - so the maxmum frequency a Human can hear is about 20kHz so CDs have a sample rate of about double that - 44.1kHz (I can't rememebr the reason for that exact choice)

This may explain why you have confusion over the stero - it's not double because there are two channels it's double because of Nyquist.
Title: Re: Low Recording samplerate in rockbox?
Post by: Llorean on January 10, 2008, 12:40:01 PM
I believe the c200 and e200 series have identical audio hardware, which is why I stated that it's that way on the e200.