FS#2957 - RFC pcmbuffer rework

Attached to Project: Rockbox
Opened by Brandon Low (lostlogic) - Sunday, 29 January 2006, 05:37 GMT
Last edited by Brandon Low (lostlogic) - Tuesday, 07 February 2006, 22:01 GMT
Task Type Patches
Status Closed
Assigned To No-one
Operating System
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


This is the first part of a general rework of the
swcodec system that I'm working on.

The eventual goals and whatnot are all on the wiki

I'm looking for comments about this proposed new
pcmbuffer organization using two linked lists of buffer
descriptors, loose (instead of strict) buffer hunk
definition, and less locking.

This code is still buggy. The #if(0)'d assembly
freezes hard at the end of tracks, and skipping between
tracks when the buffer fill is in progress, but the
target track is not currently in buffer freezes soft
(holding stop still kills it).

Comments or advice with the direction of this work are
most welcome.
This task depends upon

Closed by  Brandon Low (lostlogic)
Tuesday, 07 February 2006, 22:01 GMT
Reason for closing:  Accepted
Additional comments about closing:  Logged In: YES

in CVS
Comment by Brandon Low (lostlogic) - Sunday, 29 January 2006, 05:46 GMT

Updated the patch slightly just changed some TODOs that were
done for ones that still need to be done.

Also, I haven't tested crossfade, nor voice at all with
these changes, Paul_the_Nerd on IRC tested voice and said it
had issues after a few samples. Haven't tested rockboy,
have tested metronome.
Comment by Brandon Low (lostlogic) - Tuesday, 31 January 2006, 14:15 GMT

Whee, skipping a version!
V5 breaks even more cases of skipping, but is higher
performance than V3. I hope to fix skipping in all cases
this week.
Comment by Linus Nielsen Feltzing (linusnielsen) - Wednesday, 01 February 2006, 07:58 GMT

Why assembly code? Is the timing really that critical?
Comment by Brandon Low (lostlogic) - Wednesday, 01 February 2006, 14:01 GMT

It's called approximately every 1/5 of a second, and called
on the interrupt handler. Seems to me that interrupt
handlers need to be as short as possible.

By using assembly, I can keep it confined to the scratch
registers and specifically optimize the typical path.

For most of the critical functions throughout the pcmbuf,
I'm able to reorganize C code to get about the same compiled
code as I would write, but on this function GCC was being
particularly stubborn.

I'll do some performance comparisons before I finish this
project to make sure it's worth it. From what I saw before
I started this agressive reworking, optimizing the callback
has a statistically significant performance impact.
Comment by Brandon Low (lostlogic) - Monday, 06 February 2006, 03:08 GMT

Here's a new version that works great on Hxx0 but breaks on
iPod on skip / stop.

Also breaks after a few voice clips on Hxx0, I'm working on
that one.

(Version numbering restarted because I dropped a bunch of
the playback.c changes in favor of smaller pieces of work)
Comment by Brandon Low (lostlogic) - Monday, 06 February 2006, 20:21 GMT

The new version 4 fixes voice and down pitch, and should
improve performance on low bitrate files.
Comment by Brandon Low (lostlogic) - Tuesday, 07 February 2006, 22:01 GMT

in CVS