FS#10086 - 5G iPod WM8758 codec sample rate setting
Opened by Boris Gjenero (dreamlayers) - Wednesday, 01 April 2009, 19:17 GMT
Last edited by Boris Gjenero (dreamlayers) - Tuesday, 07 April 2009, 16:34 GMT
Currently, the only sample rate supported on the 5G iPod is 44100 Hz. This patch adds support for all other rates which can be supported both by Rockbox and the codec. Supported rates are:
48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000
The patch is based on the WM8983 datasheet, because the WM8758 datasheet is unavailable. The WM8983 supports sample rates between 8 and 48 kHz. It would be easy to compute settings for 96000, 88200 and 64000, but I think it's best to not overclock the codec.
This is patch was inspired by problems with Doom sounds: http://forums.rockbox.org/index.php?topic=21111.0 . With this patch, a compile-time check makes Doom use 11025 instead of 44100 and then sounds work properly. However, there may be another underlying issue which needs to be looked at: sound from plugins may underrun too easily. In test_sampr, merely scrolling through a list causes underruns.
This does absolutely nothing for standard audio playback. There doesn't seem to be any sample rate changing support there, and so software resamples to 44100 if necessary.
The same process which sets playback sample rates also sets recording sample rates. I have enabled use of all of the new sample rates for recording. I haven't been able to test this however, because I don't have a line in adapter. Playback sample rate changing may be tested via the test_sampr plugin. To build it, add test_sampr.c it to apps/plugins/SOURCES.
Tuesday, 07 April 2009, 16:34 GMT
Reason for closing: Accepted
Additional comments about closing: Committed in r20635