• Status Closed
  • Percent Complete
  • Task Type Bugs
  • Category Music playback
  • Assigned To No-one
  • Operating System Iriver H100 series
  • Severity Medium
  • Priority Very Low
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by gh - 2006-05-07

FS#5311 - MIDI :freeze when "header chunk size invalid"

I’m using the CVS build which is right after the commit from 7 May 07:27.
I have put the recommended sound patches, and the MIDI works on most files.
However, I have a problem with that MIDI file : When loading it, it displays “Header Chunk size invalid.” and then freezes, after what i have to reset the H120.

Closed by  linusnielsen
2006-05-08 12:00
Reason for closing:  Fixed

Aah, okay. Thank you. The freezing is a bug that needs to be fixed.
I have checked out the file and it is not regular MIDI. It should have an extension .rmi, and the header on it is in fact 'RIFF' instead the standard 'MTHD'. I hope to add support for this soon; as far as I can remember, .rmi (RIFF) is just a wrapper around a standard MIDI file, which should be the data within the RIFF data block.


00000000 52 49 46 46 1C 10 00 00 52 4D 49 44 64 61 74 61 RIFF….RMIDdata
00000010 0F 10 00 00 4D 54 68 64 00 00 00 06 00 01 00 03 ….MThd…….

Right now I have to go work on a class project but I will look into this within the next few days.


The two things should be fixed in CVS. That file now should play and the loader should gracefully bail out if it sees something weird. As for the actual RIFF header, this is where I am a little confused. They say RIFF is Microsoft's way of prepending a 12-byte header to a MIDI file and calling the result "Windows MIDI". But all in all, there are actually 16 bytes of stuff following the 'RIFF'… so, 20 bytes total. I guess 12 bytes of stuff besides the 'RIFF' and its length field. Who knows? Right now the progra, skips 16 bytes worth of junk and sees a valid MThd header. Let me know if you have other files that refuse to play.


gh commented on 2006-05-08 11:55

The bug is solved, thanks !


Available keyboard shortcuts


Task Details

Task Editing