FS#6119 - Simplify playback to fix rebuffering problems

Attached to Project: Rockbox
Opened by Steve Bavin (pondlife) - Wednesday, 04 October 2006, 17:35 GMT
Last edited by Steve Bavin (pondlife) - Wednesday, 11 October 2006, 09:25 GMT
Task Type Patches
Category Music playback
Status Closed
Assigned To Steve Bavin (pondlife)
Operating System All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


For safety's sake, I'll upload patches for my latest playback.c tinkering - this is aiming to resolve  FS#6117  and  FS#5906 .

First one - adds track indexes to the audio thread debug screen, ensures that filebufused can't wrap below 0 and removes a test based on audio_track_count() which seems unnecessary.

THIS IS NOT READY TO BE COMMITTED YET! But feel free to test or comment - especially if you're having the problem.

(Edit - removed out of date patch)
This task depends upon

Closed by  Steve Bavin (pondlife)
Tuesday, 17 October 2006, 06:14 GMT
Reason for closing:  Out of Date
Additional comments about closing:  Superceded by #6199
Comment by Steve Bavin (pondlife) - Wednesday, 11 October 2006, 08:29 GMT
OK, here's an all new playback.c. This scraps some unneeded variables:
- buf_ridx (calculated from ci.curpos)
- filebufused (calculated from ci.curpos)
- cur_ti (aliased based on track_ridx)
This resolves

It also introduces the following known problems (to be worked out):
- Rewinding into a non-buffered section results in a quick burst of the wrong track (or maybe noise) being played.
- The existing problem where the WPS doesn't update in the last few seconds (during PCM flush) appears to be worse.
- The reported song position sometimes exceeds the song length at the end of a track (rounding?)

Please test and report back, and I'll carry on whenever I get time.
Comment by Steve Bavin (pondlife) - Wednesday, 11 October 2006, 15:07 GMT
Three more known problems:
- Rebuffering can cause the current track to be skipped, playback moves to next track for no apparent reason.
- Pressing stop, then play misses a bit and results in the WPS display position and playback position being out of sync.
- Resuming after power off/on often starts the track from 0:00, rather than midway through.
It's not shaping up too well, is it? ;-(
Comment by Václav Brožík (pabouk) - Wednesday, 11 October 2006, 15:19 GMT
- The reported song position sometimes exceeds the song length at the end of a track (rounding?)

This problem is in the CVS too at least for MP3s. In addition Rockbox "corrects" the displayed song position to the track length when the last second (approximately) is played.