Rockbox

Tasklist

FS#6106 - Major SWCODEC Recording Update

Attached to Project: Rockbox
Opened by Michael Sevakis (MikeS) - Monday, 02 October 2006, 10:23 GMT
Task Type Patches
Category Recording
Status Closed
Assigned To Michael Sevakis (MikeS)
Operating System All players
Severity Low
Priority High
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Adds new functionality to recording for SWCODEC:
1) Adds samplerate support for all codecs
2) Adds samplerate playback and record support for Coldfire
3) Select for recording format
4) Individual encoder menus where applicable
5) Delayed file creation (up to 16 in waiting) with the option to start each new file immediately if desired.
6) More advanced encoder framework
7) Means to specify samplerates for targets with minimal changes to other code
8) A plugin to check samplerate switching on playback (maybe include this in CVS as a dev plugin?)

IMPORTANT:
What I really really really need checked here is sample rate switching for uda1380 (iRiver). I know it works on the x5 just fine. The plugin is called sampr_test and will start by playing an A at 44100Hz. Changing the selection should change the pitch in proportion to the sample rate (octaves) if things are working. There should be no strange artifacts when doing this (some clicks maybe but x5 is seamless).

88.2kHz monitoring during recording on the x5 does not work and this recording rate will not be included if this issue cannot be resolved though recording itself at 88.2 does in fact work fine on x5.

There are finer issues to be worked out but not for stability...just fine tuning really and then syncing upcoming iPod recording with this which I will help with.

In summation:
I'm basically looking for iRiver owners to try this and report back about the sample rates. For x5 it's a go. Others can be check to be sure there are no I'll effects from the changes though nothing should really majorly change for anything other than x5 and iRiver.

Thanks in advance to all who take the time to test and comment but bear in mind I'm not looking for feature requests at the moment as that will be better to work on with this in CVS first. There are things I'd like to add myself. :)

This task depends upon

Closed by  Michael Sevakis (MikeS)
Monday, 06 November 2006, 23:40 GMT
Reason for closing:  Accepted
Additional comments about closing:  Changes are committed now
Comment by Davide (Davide-NYC) - Tuesday, 03 October 2006, 06:19 GMT
I am reporting that selecting 11kHz samplerate freezes my iRiver H140. This happens from the plugin and the recording menu.

All else seems to be working correctly! I recorded 60 audio files from the internal mic. After transferring them to my PC foobar2000 tells me that it's all working properly. Except samplerate = 11kHz of course.

Very very cool work Mike!
Comment by Stephane Doyon (sdoyon) - Saturday, 07 October 2006, 01:13 GMT
I tried this patch on my IAUDIO X5L 30GB, and had some difficulties:
-Voice menus not talking anymore,
-Disk did not spin down,
-When I went to the record screen and tried to start a recording, it
said my disk was full... but there's 16G free on there...

That was built with some CVS from around Oct 3-4-5 (sorry), and no other patch.
I hope you can make something of this.

I'm new to Rockbox, got my player only this week, so please forgive me
if I'm missing something obvious. Did this depend on some other patch perhaps?

thx
Comment by Michael Sevakis (MikeS) - Saturday, 07 October 2006, 03:06 GMT
Stephane:

More details would help. This sounds like a WavPack problem that has since been fixed. There was a problem where the unused data was't being cleared at the start and overflow for high rates. I don't know how your X5L could really act any differently than my x5 60GB so I figure you'd have to experience similar problems under similar conditions.

Recording assumes any error that is reported during recording is a disk full problem. This is no longer the case with codec recording. The error was likely due to the encoder flooding the flushing thread and corrupting the data when the buffer overflowed. This is checked for and data is dropped in that case but it never gets full anymore even with 88.2 WavPack. (WavPack encodes better than it plays back :)

Voice menus are shut down during recording BTW but do come back on. It would not be good to swap out the encoder to play voice when encoding since it would increase the likely hood of data loss.
Comment by Peter D'Hoye (petur) - Saturday, 07 October 2006, 22:18 GMT
does voice work during pre-rec?

The reason I ask is that we have several blind users, and having a voiced recording screen has long been a request that was implemented several months ago - seems the encoding framework killed that.

pre-recording in uncompressed buffer still seems the logical thing to do, you can still disable voice when actually recording

btw, do post your updated patch....
Comment by Michael Sevakis (MikeS) - Sunday, 08 October 2006, 04:08 GMT
There's been talk about using a built in codec for voice (speex?) and getting rid of swapping between voice and encoder would aid that. I will soon experiment with allowing the swapping since it hasn't really been tried out. Having to have an encoder catch up from up to 30s behind is a bit of scary thought esp at 88.2 or 96kHz and esp. if doing WavPack. :)

There will be full duplex enabled so playing back something else during recording will be possible mainly for writing DSP plugings. Some seeds are planted for that in the next version of the patch.

I'll post the patch real soon. I changed it to not entirely reset every chunk header after use since that shouldn't be needed but have to be sure everything is working alright. I also changed the manner in which the iRiver pcm sample rate switching is configured and hopefully the whole list will work *praying*. I'm looking for a good deal an H1x0 ATM so I can test the SPDIF and UDA myself to speed up things when changing code around.
Comment by Michael Sevakis (MikeS) - Sunday, 08 October 2006, 17:49 GMT
Details, details:
- Changed the iRiver sample rate code so hopefull it will all work now.
- Did some other updates that should add stabiliy to the stream splitting...not every case was covered before.
- Added thread boosting when very full and spinup-time sensitive watermark for flushing data.
- Added seeds for full duplex audio to pcm_playback.c which pcm_record.c uses for samplrate and source switching.
- Added lots of logf if you like to watch that on remote so you can see if it's indeed doing what I claim :)
- Added asynchronous stops so UI doesn't do dead after when stopping
- Added thread_get_priority and thread_set_priority returns old priority (need that for prio boost)
- More tweaking to wavpack_enc
- Simplified audio format declaration in id3.c. No array left in metadata.c and all are together for easy maintenence.
- Moved encoder decs and datatypes to enc_base.h including the function decs. for encorder only pcm_record apis.
- Samplerate arrays in pcm_sampr.h and pcm_sampr.c are automatically generated with a few flags in your config*.h
- encoders should be able to work on little endian devices as well
- no more cfg file for the encoders so no disk spinup when changing formats
- Much more important minutae...
Comment by Michael Sevakis (MikeS) - Sunday, 08 October 2006, 17:51 GMT
BTW:

Should probably reset your settings to make sure because I don't know if it's synced with the config block version anymore. I'll do that just before a commit.

Full update! Not just main binary!
Comment by Peter D'Hoye (petur) - Sunday, 08 October 2006, 22:02 GMT
unless I'm doing something wrong, this patch doesn apply cleanly against current CVS
Comment by Michael Sevakis (MikeS) - Monday, 09 October 2006, 04:40 GMT
That's strange. I update just before creating it. I'll try again.
Comment by Michael Sevakis (MikeS) - Monday, 09 October 2006, 05:55 GMT
The problem was that I have my editor set the turn tabs into four spaces and there are apparently some files in CVS that are using tabs and these diffs got in the patch. When I cleaned out the lines starting with "?", the tabs in the patch were of course turned into spaces and it wouldn't patch anymore of couse. I think the -l option ignores whitespace changes. This one is a diff with everything left as cvs diff produced it and works fine with up to the minute CVS.
Comment by Peter D'Hoye (petur) - Monday, 09 October 2006, 06:25 GMT
much better, thanks

I'll try to load it on my h340 before leaving for work so I can test there a bit
Comment by Michael Sevakis (MikeS) - Monday, 09 October 2006, 06:33 GMT
Man do a quick test with the sampr_test plugin because the sound chip configuration on the iRivers was totally changed and I can't test it myself. It's a major anxiety point about it atm. :0
Comment by Michael Sevakis (MikeS) - Monday, 09 October 2006, 06:44 GMT
I say that cause it might not even play if I have it wrong. :)
Comment by Peter D'Hoye (petur) - Monday, 09 October 2006, 07:10 GMT
indeed

W A R N I N G: this patch breaks playback on iriver h1x0 and h3x0!!!

;)

sure was a quiet ride to work on the bike...
Comment by Michael Sevakis (MikeS) - Monday, 09 October 2006, 12:54 GMT
Should definitely fix the playback problem. LinusN helped sort that out. Maybe the recording will get audio now. There was an exception leaving the recording screen when he was testing but we'll see.
Comment by Michael Sevakis (MikeS) - Friday, 13 October 2006, 12:59 GMT
Just a resync of version 2.2 with current CVS.
Comment by Michael Sevakis (MikeS) - Monday, 16 October 2006, 23:36 GMT
Another resync to CVS
Comment by Michael Sevakis (MikeS) - Friday, 20 October 2006, 00:31 GMT
My chick s#1t solution to the slave mode monitoring problem on iRivers. :)
The chip should be setup like currently when recording except the unneeded (right) ADC is turned off when using mic.

I'll put up a patch for debugging recording in slave mode when a commit happens.

Loading...