FS#1754 - Pause causes continuous disk access

Attached to Project: Rockbox
Opened by Anonymous Submitter - Wednesday, 22 October 2003, 03:01 GMT
Last edited by Daniel Stenberg (bagder) - Friday, 05 December 2003, 09:21 GMT
Task Type Bugs
Category User Interface
Status Closed
Assigned To No-one
Operating System
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Studio 10 w/CVS 20031020.
When I pause a track, the disk access light flickers very
short on-pulses about 4 times per second and disk
continues to spin. This continues until play is resumed
or track is stopped.
Doesn't happen w/CVS 20031013.

This task depends upon

Closed by  Daniel Stenberg (bagder)
Friday, 05 December 2003, 09:21 GMT
Reason for closing:  Fixed
Comment by Anonymous Submitter - Thursday, 23 October 2003, 20:05 GMT

Looks like the problem is in wps.c.

"paused = mpeg_status() & MPEG_STATUS_PAUSE;"

If paused is a bool, this won't work!

I'm not set up to fix this myself.
Comment by Björn Stenberg (zagor) - Thursday, 23 October 2003, 20:42 GMT

Of course it works with a bool. Either the value is 0 (false), or it's !0

Pause works flawlessly, without disk access, for me.

Can anyone else repeat this bug?
Comment by Anonymous Submitter - Thursday, 23 October 2003, 23:14 GMT

Linus fixed it!
Thanks guys...

Comment by Craig Sather (rb_dev) - Friday, 24 October 2003, 05:08 GMT

Thanks Linus,

Although this bug was introduced when my "Car Ignition Auto
Stop function" patch was recently committed, I must point
out that my code worked correctly in the patch as submitted,
but this section of code was "changed and/or optimized"
from what I submitted in my patch when it was turned over
into the CVS, and thus the bug was induced.

BTW, the problem wasn't as stated below because of the
"paused = mpeg_status() & MPEG_STATUS_PAUSE;"

...the problem was the previous line:
" if (paused != (mpeg_status() & MPEG_STATUS_PAUSE))"

...because the right hand side of the compare equals 2 when
we are in pause mode, and the bool variable "paused" on the
left hand side equals 1 when we are in pause mode.

Comment by Craig Sather (rb_dev) - Friday, 24 October 2003, 05:57 GMT

P.S. to my previous comment.

Although the statement "paused = mpeg_status() &
MPEG_STATUS_PAUSE;" will always yield 0 or 1 when compiled
for the Archos target, on the simulator such coding could
cause problems because in uisimulator/win32/stdbool.h we have:
typedef unsigned int bool;

Now the "bool" variable "paused" can have a value of 2, and
someone might assume elsewhere that it is always 1 or 0.