• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category
  • Assigned To No-one
  • Operating System
  • Severity Low
  • Priority Very Low
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by undef_d - 2003-08-20
Last edited by linusnielsen - 2004-06-04

FS#1640 - pause recording

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

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).

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)
Closed by  linusnielsen
2004-06-04 11:11
Reason for closing:  Out of Date
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407

Logged In: YES

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

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?

Project Manager

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


Available keyboard shortcuts


Task Details

Task Editing