Rockbox mail archiveSubject: Read errors (was:Power Save feature kills playlist playback)
From: Björn Stenberg (bjorn_at_haxx.se)
Mike Holden wrote:
Yes, the code treats read errors atomically, i.e. any error means the entire request failed and must be retried. This is a design decision. The result buffer is only valid if the return code >= 0.
You are right that there is a bug in that the next successful read() call will not return those head bytes that were copied by the previous, failed, call. But this will result in up to 511 bytes missing from the file, which will produce a short "blip" in the playback, not freeze it.
> There is also another problem, which I believe is probably in the
Yes, that is possible. Errors can occur at any of the requested sectors.
> We are assuming we have read it all
Not if there is an error. On error, we assume nothing has been read and submit the complete read request again.
If the disk says "OK" when in fact there was an error, then the disk is faulty and there is not much we can do about that.
> Is there anybody here who understands what is going on with this
I wrote all disk code.
> It would be good to get this bug nailed before 2.0 goes out
I agree. My problem, as stated before, is that I *never* get this and thus it's very difficult for me to do any form of testing.
I would like everyone who has this problem to be careful to separate between "black freeze" and "red freeze". I.e. is the red light on or off when this happens? If the light is on, it's a problem in the ata driver code. If the light is off, it's a problem in the file or even mpeg code.
Page was last modified "Jan 10 2012" The Rockbox Crew