This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#7213 - Align audio data reading in the playback engine to even addresses
|
DetailsIn the current playback system after reading an odd
length audio (mp3) file all following ata reads for the next audio file have to deal with unaligned read buffers. This reduces the file reading speed on many (all?) targets. I could solve this issue with following lines in playback.c: /* rc is the actual amount read */ rc = read(current_fd, &filebuf[buf_widx], copy_n); /* align audio filesize, faster ata reading (even address) */ if(rc > 0) rc = (rc + 1) & ~1; This align looks a little bit dangerous, so I am not sure, wether it works for all audio input formats. |
This task depends upon
Closed by Björn Stenberg (zagor)
Reason for closing: Fixed
Additional comments about closing: Closing all feature requests.
Reason for closing: Fixed
Additional comments about closing: Closing all feature requests.
While working on PP502x ATA DMA in
FS#9708I noticed another alignment issue. What matters is not alignment of the reading position, but alignment of sector boundaries. For example, a read starting at file offset 3 is unaligned when the buffer is at address 0 and it is aligned when the buffer is at address 3 or 7. This can happen with ID3v1 in MP3 files. For example if an MP3 file has an odd sized ID3v1 at the start, the entire file will be read unaligned. The buffer_align patch atFS#9708performs this alignment. PP502x DMA requires word alignment (divisible by 4), so that is the kind of alignment done by that patch. I don't know if it is safe for all codecs in all situations.Alignment also depends on sizeof(struct memory_handle). If that was odd, file data would start at an odd address. However sizeof(struct memory_handle) is not odd.
Aligned and unaligned disk transfer rates may be compared at: http://www.rockbox.org/twiki/bin/view/Main/DiskSpeed