This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#10115 - playback of FLAC files on iRiver iHP-120 and H320 pauses periodically
Attached to Project:
Rockbox
Opened by Mark Nipper (nipsy) - Thursday, 09 April 2009, 16:57 GMT+2
Last edited by Boris Gjenero (dreamlayers) - Friday, 08 May 2009, 06:45 GMT+2
Opened by Mark Nipper (nipsy) - Thursday, 09 April 2009, 16:57 GMT+2
Last edited by Boris Gjenero (dreamlayers) - Friday, 08 May 2009, 06:45 GMT+2
|
DetailsThis has happened a decent number of times on both players when playing back FLAC files. Unfortunately, it's not consistent either. I've had a song pause for a few seconds during playback in a spot, rewind after the song finishes, and the next time through it plays through the entire song with no stutters. I got my H320 first, but within a few songs of using my iHP-120 I also just got, this problem happened.
I searched elsewhere and didn't see any mention of this. I'm not sure if it's a general Rockbox issue across players or specific to the iRiver players. Let me know if I can do anything to try to help debug this. I thought it also might have been just the hard drives in the units delaying playback while they were trying to spin up or some such, but I'm not sure how much Rockbox is caching during playback and what the drive activity looks like during normal usage. It's worth mentioning that no other plugins were running at the time of these incidents. I've got a minimal installation on both players. |
This task depends upon
Closed by Boris Gjenero (dreamlayers)
Friday, 08 May 2009, 06:45 GMT+2
Reason for closing: Fixed
Additional comments about closing: Fixed in r20747
Friday, 08 May 2009, 06:45 GMT+2
Reason for closing: Fixed
Additional comments about closing: Fixed in r20747
I found that option under Settings -> Playback Settings. It's just a list of times. Is there a default setting? Mine just starts at the top of the list which is 5 seconds. And what is the risk of using the largest value (10 minutes) if any? Will I exhaust the player of memory? If there is no risk, shouldn't the default just always be 10 minutes?
Mark: the reason it's not set to 10 minutes is that the bigger you set it, the more often the player has to read data from disk, which eats battery.
I was just playing an MP3/CUE album on my 5G 30GB iPod running r20715, and I had a pause near a transition between tracks in the CUE file. The hold switch was on and the LCD was sleeping. I immediately went to the buffering debug screen. The buffer was about 2/3 full, so it probably wasn't being filled when the pause happened. When I went back and listened to the transition a second time, there was no pause.
1) The anti-skip buffer setting is ignored. It leads to an audio_set_buffer_margin() call in apps/playback.c, which assigns the value to "static size_t buffer_margin". However, that variable is never used. I think it should be used in set_filebuf_watermark(). So, the buffer margin is always just disk spinup time rounded down to the nearest second, plus one second.
2) In set_filebuf_watermark(), I don't like "size_t bytes = id3->bitrate * (1000/8) * seconds;". Sure, the math is correct, but what about when you have a VBR file, and the part at the end of the buffer is at a higher than average bitrate.
You can go to "System -> Debug (Keep Out) -> View buffering thread" to see how the watermark is low and unaffected by the anti-skip setting. There I also watched how MP3 data runs out and the PCM buffer starts getting low as the drive starts to fill the buffer.
I'm attaching a simple patch which uses buffer_margin in the set_filebuf_watermark() calculations. It doesn't do anything about issue 2. Any suggestions regarding that?
Edit: Looking at changes in
FS#9703, http://svn.rockbox.org/viewvc.cgi/trunk/apps/playback.c?r1=19685&r2=19743 , I am reminded of another issue: the watermark can be bigger than the buffer. I'm now playing a FLAC file on my iPod with 32 megs RAM, and the anti-skip buffer is set to 10 minutes. The watermark is 44 megs, and the hard drive is constantly spinning to keep the buffer full. Everything seems to work, so I guess this could be considered a feature and not a bug. Any comments?(In my last comment I was probably wrong about there not being a spinup at that point. There wasn't a full buffer of MP3 data left at that point, so the buffer wouldn't have been full after being filled. I also looked at the CUE code and it seems that it couldn't have caused the problem, especially while the LCD is sleeping.)
The regular watermark should be high enough to avoid pauses even without the anti skip buffer setting when the disk can read normally.
I think use_buffer_margin-v2.patch should be committed. I will do that in a day or two if nobody gives any reason against it. If anyone wants to commit it sooner, go ahead.