Closed PoroCYon closed 3 months ago
After triage with the user's code, it was discovered that the ARM7 was telling the ARM9 to write past the MP3 streaming buffer's maximum length, overwriting the 1-3 bytes past it - which just so happened to be related to the file structure.
I'm having this situation where, using
fread()
(for a file stored on NitroFS), the first call (reading 487 bytes) returns successfully, but subsequent calls end up with an invalid file handle state: the return value is zero (which normally indicates either EOF or an error, cf. here and here), butfeof()
andferror()
both return zero as well.Some context: I'm porting my old code from devkitARM, this includes an MP3 streaming and playback engine. Decoding the audio stream happens on the ARM7, but the file I/O calls are done on the ARM9 (because that's how it's done with dkA). FIFO communications are done to synchronize everything:
Interestingly, other file accesses (for e.g. reading 3D models) seem to work, but it's the MP3 file I/O that's not working here. Since it involves IPC FIFO stuff, I tried checking if changing/forcing DLDI mode changes much, but it doesn't affect the result at all. So I'm not sure what's causing this, hence this issue.