AllenNeuralDynamics / AllenNeuralDynamics/harp.device.quac

Playing N > 1 FilePlayer File *Subsets* may fail

Offen
#100 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
firmware
Vorherrschende Sprache
C#
Sterne
0
Forks
0
Ø Merge
2 T. 14 Std.
Gemergte PRs (30 T.)
8

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.