Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bugs
  • Category Operating System/Drivers
  • Assigned To No-one
  • Operating System Another
  • Severity Low
  • Priority Very Low
  • Reported Version Release 3.6
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by bertrik - 2010-07-03
Last edited by bertrik - 2010-11-01

FS#11453 - AMSv2: power down fails sometimes when wake-up alarm timer set

When using the wake-up alarm on AMSv2 players, the power-off often does not work when an wake-up alarm time has been set. A typical symptom is that on power-down the display shows “shutting down”, dims a bit, but never actually shuts down.

I can reliably reproduce this on my sansa clip+ as follows:
* Set an alarm to wake up in 2 minutes after the current time
* Power off the player and wait until players wakes up
* Set back the current time by 2 minutes and set the alarm again.
* Power off the player → it hangs while showing “shutting down” with the display slightly dimmed.

Attached patch fixes it for me completely (although funman still reports problems even with this patch)

Closed by  bertrik
2010-11-01 19:01
Reason for closing:  Fixed
Additional comments about closing:  

The idea of alarm2.diff has been committed as SVN r28435. Seems to be completely fixed now, please re-open if you see a shutdown-for-wakeup problem.

Attached patch is a bit cleaned up. It introduces two local functions wakeup_read and wakeup_write that read/write the wakeup register making sure that the read/write sequence is cannot be interrupted.

This works flawless here on my clip+ so far, I haven’t seen any failed power-downs and the player wakes up at the proper time.

Attached patch cleans it up a little more by moving all of the alarm data into a struct that is encoded/written by the alarm_write function and read/decoded by the alarm_read function.

I’ve committed patch wakeup3.patch as SVN r27447 and I’m leaving this task open for a while in case the problem hasn’t been solved completely

I tested on Fuse2 with SVN > SVN r27447 and work fine. Before always faills me.

I can often reproduce the “shutting down”-symptom on my clip+ r27662 as follows:
* set an alarm time
* record something (5 seconds or longer)
* stop recording and
* power off immediately

On my clip+ it seems now that either having played back something or having recorded something causes the power-down for wakeup to fail. The AS3543 datasheet shows MCLK as a possible wake-up source, so maybe MCLK is somehow preventing the power-down. MCLK is a clock used in playback and recording.

This proof-of-concept patch seems to fix the case with shutdown after recording for me. It writes to CGU_AUDIO to configure the MCLK just before going into powerdown-for-wakeup, so this supports my suspicion that it’s related to MCLK. The value written to CGU_AUDIO is the one that I see on my clip+ before having recorded or played back anything.

If you repeat the
* set-alarm-time
* playback something
* stop and
* powerdown-for-wakeup
procedure 3-4 times, it will often fail.

bertrik you are right that MCLK prevent the power-down. But in the CGU_AUDIO Register the disable of I2SO_MCLK (bit 11 = 0) sometimes fails. So I enabled bit 11 and pllb_fout (bit 1) . Then I powered down PLLB in CGU_PLLBSUP by bit 3. Works fine.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing