AllenNeuralDynamics / AllenNeuralDynamics/harp.device.quac

Playing N > 1 FilePlayer File *Subsets* may fail

Abierto
#100 0 comentarios 0 reacciones 0 asignados Ver en GitHub
firmware
Lenguaje dominante
C#
Estrellas
0
Forks
0
Merge medio
2 d 14 h
PR fusionados (30 d)
8

Descripción

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.