This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#8206 - Resuming playback from end of song after power on confuses playback
Attached to Project:
Rockbox
Opened by Richard Sweeney (riksweeney) - Wednesday, 21 November 2007, 20:31 GMT+1
Last edited by Nils Wallménius (nls) - Wednesday, 12 November 2008, 15:56 GMT+1
Opened by Richard Sweeney (riksweeney) - Wednesday, 21 November 2007, 20:31 GMT+1
Last edited by Nils Wallménius (nls) - Wednesday, 12 November 2008, 15:56 GMT+1
|
DetailsResuming playback of a song that is a few seconds from ending after the player has been powered on confuses the playback.
The simplest way to reproduce this behaviour is to do the following (this works in the simulator too). Select a song to play and let it play almost to the very end, make sure that another song is in the playlist to be played afterwards. A few seconds before the end of the song, stop the playback and then shutdown Rockbox. Start up Rockbox and resume playback. The playback will continue from half to three quarters of the way through the following song on the playlist. This appears to be buffer related as fast forwarding to the end of the song, shutting down and resuming will not produce this behaviour. |
This task depends upon
FS#2687... I think the problem is that you shut down the player in the middle of a track transition.What I did notice though, is that in apps/playback.c, changing
return &prevtrack_id3;
to
return &curtrack_id3;
on line 525 fix this problem, but the WPS information changes prematurely. I only noticed this because I'd been tinkering with the source code...
audio_current_track() does this, as do the calls to playlist_update_resume_info(). However, when resuming we have an offset passed in to audio_play which is assumed to be based on the "codec track". I can't think of a way for audio_play() to convert a "WPS offset" into a "codec offset", which would be more correct.
Perhaps instead we should base the resume point on the "codec track/offset"?
One other point - shouldn't codec_get_file_pos() should use the "codec track" (i.e not rely on audio_current_track(), maybe just curtrack_id3 would do)?
I did code a solution by passing in the transition state into playlist_update_resume_info, but it was messy and hacky. I guess I could add another variable to the mp3entry structure and then tell playlist_update_resume_info in playlist.c to use the previous, rather than the current index of the playlist when saving the resume info.
Something like:
int playlist_update_resume_info(const struct mp3entry* id3)
...
global_status.resume_index = id3->transition == 1 ? playlist->index - 1 : playlist->index;
global_status.resume_offset = id3->offset;
status_save();
...
Bit of a mess though
That sound you hear is a can of worms being opened. ;)
I'll have a look into making the variable global instead.
I haven't checked if it solves the actual issue described by this task, but I think it will.
FS#6215.The reason I think I might be seeing this problem is because after listening to a podcast, I will typically stop playback while the host is making his closing remarks, a few seconds before the end of the file. Then I delete the podcast via rockbox and power off. On power on, rockbox tries to resume the podcast and hangs.
-------------------from
FS#6215:I see this frequently with podcasts- I will listen to one, delete it via rockbox, and on the next power-up it hangs when trying to resume the file. It looks like it is selecting the next file, but resuming at the position of the last (deleted) file. In the case of podcasts, the new file might be significantly shorter than the previous, maybe trying to resume far enough after the end of a file causes a hang?
The only way I've found to fix this once it occurs is to delete the playlist control file from a PC connection (reset doesn't help).
Player is a H320. I've seen this problem on multiple builds over the last 3-4 months. Currently running r15989-080103.