Opened 10 years ago

Closed 10 years ago

Last modified 22 months ago

#5337 closed defect (fixed)

SCI: MIDI glitches on unpause/load

Reported by: lordhoto Owned by: bluegr
Priority: normal Component: Engine: SCI
Keywords: MIDI Cc:
Game: King's Quest 6


ScummVM trunk r52567 Linux/amd64 g++ 4.4.4

Happens with: King's Quest 6 German Floppy "1.000" (according to VERSION file) King's Quest 6 CD "1.000.00G" (according to VERSION file) King's Quest 5 CD "1.036" (according to VERSION file) I suspect it happens with all SCI games though.

After a song is unpaused there are many MIDI events, including note on/off events, pumped through to the MIDI synth. That results in ugly sound output and sometimes delays. I can reproduce that with both my sound card's wavetable synth and my MT-32.

I attached some savegames to reproduce this (be sure to select a MIDI synth!):

1) kq5cd.000: Just load the save game and you will hear some strange notes directly.

2) kq6ger.005 / kq6cd.015 Use the flute on the flowers. After some seconds of music playback (5 should be enough) move the mouse to the interface at the top, wait a second and move the mouse into the game screen again. You will hear some strange sounds now too. (For some more award sound just move the mouse cursor to the interface and back quite a few times in a row after the music played a bit)

3) kq6cd.003 Just load the game. You will hear around 9 seconds of strange music and after that the music is distorted (just leave and enter the scene again, it will sound differently). Note aside: I was not able to reproduce a savegame which is broken like this. Also when you load it with AdLib it will be approximately the same delay but without any sound output.

Another way to reproduce this is to walk into a scene where music is playing. Wait a bit so the tune is not near the beginning anymore. Then open the menu and either open up the save or load dialog, which will pause the music, and close those again. There will always be a few notes being turned on and off again. This makes it look like we do output all notes while seeking through the MIDI data, but that's just a guess from my side.

I could not reproduce any of this behavior with KQ6 German under DOSBox. It might also effect AdLib, but since there is no sound output for the problematic parts, I am not sure.

Ticket imported from: #3059948. Ticket imported from: bugs/5337.

Attachments (4)

kq5cd.000 (35.7 KB ) - added by lordhoto 10 years ago.
KQ5 CD save (first test case)
kq6ger.005 (45.0 KB ) - added by lordhoto 10 years ago.
KQ6 German floppy (second test case)
kq6cd.015 (41.4 KB ) - added by lordhoto 10 years ago.
KQ6 CD save (second test case)
kq6cd.003 (40.8 KB ) - added by lordhoto 10 years ago.
KQ5 CD save (third test case)

Download all attachments as: .zip

Change History (11)

by lordhoto, 10 years ago

Attachment: kq5cd.000 added

KQ5 CD save (first test case)

by lordhoto, 10 years ago

Attachment: kq6ger.005 added

KQ6 German floppy (second test case)

by lordhoto, 10 years ago

Attachment: kq6cd.015 added

KQ6 CD save (second test case)

by lordhoto, 10 years ago

Attachment: kq6cd.003 added

KQ5 CD save (third test case)

comment:1 by m-kiewitz, 10 years ago

this is not SCI specific. We are using common MidiParser::jumpToTick. Also the problems were already known.

Somewhat duplicate of #3034974

comment:2 by lordhoto, 10 years ago

It might be true that the code isn't inside SCI which causes this, still it seems to happen for all SCI versions, thus the "SCI" prefix. Also I know that for SCUMM (where you can reproduce such a MIDI event pumping by skipping the MI2 intro for example) this also happens in the original engine, thus SCI is the only engine left "affected" by this. I guess the main problem here is that the MidiParser code is pretty much SCUMM specific in that regard and that would in turn make this a SCI "only" bug again in my eyes. Also it doesn't look like other engines use seeking, so no other engine should be affected.

Anyway Walter asked me to report this.

I can't reproduce #3034974 with the attached save right now, so I can't compare whether what he calls "flat" matches the problem with the music in my third test case (which I actually only added so it is mentioned somewhere too), it at least certainly doesn't have the long delay.

comment:3 by bluegr, 10 years ago

Owner: set to bluegr

comment:4 by bluegr, 10 years ago

These issues should all be fixed with r54460

Can you please try again?

comment:5 by bluegr, 10 years ago

After speaking with LordHoto, and replaying all 3 cases, the issue is solved indeed. Closing

comment:6 by bluegr, 10 years ago

Resolution: fixed
Status: newclosed

comment:7 by digitall, 22 months ago

Component: Engine: SCI
Game: King's Quest 6
Keywords: MIDI added
Note: See TracTickets for help on using tickets.