AllenNeuralDynamics / AllenNeuralDynamics/harp.device.quac
Playing N > 1 FilePlayer File *Subsets* may fail
- Ngôn ngữ chính
- C#
- Star
- 0
- Fork
- 0
- Merge trung bình
- 2 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 8
Mô tả
Playing multiple iterations of a *subset* of a FilePlayer Waveform may fail because it may need to loop back and read a non-multiple-of-512-bytes from the card.
This only happens if we read a subset of the full file (ie: the first 1 second of a 5 second waveform, etc.).
The reason is that the SD card library reads fastest when reading full sectors (512-bytes) from the card. If we do not read a multiple of 512 bytes, we may or may not be able to make the deadline before the double buffers switch. Currently, there is no error checking to indicate that there is a deadline failure.
Thankfully, this isn't going to happen frequently in most use cases since most users will opt to play the full file.
One fix is to internally buffer the SDCard `transfer_source_chunk` function so that read requests that are not multiples of 512 bytes are rounded up to the nearest 512 and cached internal to the FilePlayer. Since we don't have to worry about reading to the end of the card, this isn't actually that complicated to implement.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.