GNOME Bugzilla – Bug 694811
wildmidi: Truncated start when seeking back to zero
Last modified: 2015-01-27 11:41:22 UTC
Created attachment 237557 [details] example of midi file If I run: totem Pixies\ -\ Where\ is\ my\ mind.midi The file is played correctly. Please note that the song starts with 5 hits on the snare drum (this is a drum part). However, if I hit Ctrl+Left to seek to the beginning of the song and play it again, I will only ear 4 hits on the snare drum, the first one is missing. I've tried with another midi file, it seems totem first seeks to second 0, but only starts the playback shortly after, leading to the few first ms of the song to be missing. Reproducibility: always.
Does the same thing happen with: gst-launch-1.0 playbin uri=file:///path/to/midi/file.mid ? Does the same thing happen with the bvw-test sample program shipped in Totem's sources?
Unfortunately I don't think any of the midi decoders have been ported yet. I might take a stab at that later, shouldn't be much work.
I don't have gstreamer 1.0 at hand, my Mageia 2 is using gstreamer-0.10, and Mageia 3 hasn't been released. I may however try with a live Mageia 3 beta 2 if you think that would help. I've tried with gst-launch-0.10 playbin uri=file:///path/to/midi/file.mid , and it always works. I didn't know about bvw-test. I've tried to build it from source, but I get an error when running configure: checking gnome-doc-utils >= 0.20.3... yes ./configure: line 5141: syntax error near unexpected token `0.6.7' ./configure: line 5141: `GOBJECT_INTROSPECTION_CHECK(0.6.7)' It happened on master, so I tried to build the V_3_4_3 tag (that's the version on which I have the problem), but I had the same error. I have limited autotools knowledge, so I'm somewhat blocked.
This is fixed with the GStreamer 1.0 port of wildmidi (though I doubt the problem was in the midi decoder in the first place).
Right, it works the first time it's played, but not after seeking back to the start. As it happens with the test-playback app, reassigning to GStreamer.
We do a seek to sample 0 in wildmidi but it somehow doesn't want to.
We're tracking this bug also upstream here: https://github.com/Mindwerks/wildmidi/issues/100#issuecomment-68614888 There is actually a problem with the MIDI file. It has a huge delta amount at the beginning which is causing the "silence" at the start of the song. This had not occurred with previous versions of WildMIDI because of undetected bugs which have now been fixed. Start of Track Track Size: 8107 Delta: 5376, Accumilated Delta: 5376 Set Patch: chan(9) patch(0) Delta: 0, Accumilated Delta: 5376 Meta Event: Unsupported (4) Meta data (5 bytes): 0x64 0x72 0x75 0x6d 0x73 Delta: 0, Accumilated Delta: 5376 Controller: chan(9) ctrl(7) set(100) Delta: 0, Accumilated Delta: 5376 Set Patch: chan(9) patch(0) Delta: 0, Accumilated Delta: 5376 Note On: chan(9) note(38) vel(77) The delta value is 0xaa 0x00 which when you do ((0xaa & 0x7f) << 7) + (0x00 & 0x7f) you get 5376
Thanks, so I think we can safely close this bug as "not a bug in GStreamer" then? Please re-open if there's still something to be done in GStreamer, thanks!
Yup, it is problem with the MIDI file and also how WildMIDI dealt with the faulty MIDI file. The reset/seek back to 0 should be fixed, but the extra silence at the beginning will not be removed.
The reset/seek back to 0 bug is fixed as of newly released wildmidi-0.3.8.