Rockbox

Tasklist

FS#1640 - pause recording

Attached to Project: Rockbox
Opened by Eric Hood (undef_d) - Wednesday, 20 August 2003, 12:50 GMT
Last edited by Linus Nielsen Feltzing (linusnielsen) - Friday, 04 June 2004, 11:11 GMT
Task Type Patches
Category
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

Details

this quick stab at implementing a pause button may use
a poor method, but the results seem to work fine for my
purposes. note that i only got my FMR a few days ago
and i only spent a few hours familiarizing myself with the
rockbox code, so i suspect there is a much better way.
in any case i wanted very much to use this device as a
memo recorder and i was in a hurry to get results.

in recording.c
pressing play while recording sets a paused flag. if stop
is pressed while paused the recording is stopped and if
play is pressed the recording is resumed

in mpeg.c
i do not understand the code dealing with programming
the MAS. in the loop where the recording data is read
into buffer, the buffer byte pointer is not allowed to
increment if paused. therefore once paused the bytes
read immediately after and until unpaused are simply
never allowed into the buffer, but the MAS continues to
record.

in order to ensure that the resulting mp3 file reports the
correct length even if paused during recording, it is
necessary to subtract the number of frames the MAS
recorded but were never read. this is done by asking
the num frames recorded at the start of pause and upon
resume and then doing some computation.

in order to ensure that the on screen time display shows
the correct time, we record the tick tick upon pressing
record and tick time upon resuming, sum the total tick
time during which we were paused and subtract this
from the time recorded (which is longer b/c it does not
count pause time).

BUG
because i immediately stop reading bytes, the mp3 data
is probably not a complete frame. anyway i usually hear
a pop at pause points, but since it's is good enough for
my purposes i don't plan to figure out how to fix this.

Thanks to all of you for the Rockbox project,
You've all made this piece of c**p worth something.
: - )
   patch3 (232.2 KiB)
This task depends upon

Closed by  Linus Nielsen Feltzing (linusnielsen)
Friday, 04 June 2004, 11:11 GMT
Reason for closing:  Out of Date
Additional comments about closing:  Logged In: YES
user_id=259137

Thanks a lot, but we have now done it "the right way",
without corrupt frames etc.
Comment by Kee Hinckley (khinckley) - Wednesday, 24 September 2003, 13:25 GMT

I wonder if the frame issue is why my code to do a stop and start
(to create a new file) is losing data. Any ideas?
Comment by Linus Nielsen Feltzing (linusnielsen) - Friday, 04 June 2004, 11:11 GMT

Thanks a lot, but we have now done it "the right way",
without corrupt frames etc.

Loading...