Page 1 of 1

XGM song change bug, eternal note

Posted: Fri May 05, 2017 1:31 pm
by cero
Looks like there's a bug in XGM that causes one note to play for ever on hardware.

1. Play an XGM song
2. Play a different XGM song that doesn't use all the channels song 1 used
3. The unused channel plays a note for ever

I don't have a small test ROM right now, and I haven't had it happen in emulators either, got a report on hw.

Re: XGM song change bug, eternal note

Posted: Fri May 05, 2017 1:52 pm
by Moon-Watcher
I have experienced the same behavior

Re: XGM song change bug, eternal note

Posted: Fri May 05, 2017 6:55 pm
by Stef
It happens only on real hardware ? it would be nice to have a test rom but just to be sure, maintened notes are the ones from previous xgm music ? did you try to insert a stop command (waiting a frame or 2) before starting the next music ?

Re: XGM song change bug, eternal note

Posted: Sat May 06, 2017 7:43 am
by cero
Yes, the maintaining notes are from the previous song. I didn't try the stop command since the commands inside it look identical to the ones when starting a new song; the current attempted workaround is to start an empty song (all channels silence) before switching to a new song, I don't know yet if that works.

I haven't been able to reproduce in any emulator, but perhaps the accurate (and windows-only) ones would also do it.

Re: XGM song change bug, eternal note

Posted: Sat May 06, 2017 5:54 pm
by Stef
Well i'm a bit surprised as by default all XGM music has a kind of header command to initialize the YM2612 and so turn off all channels. The fact it happens only on real hardware means there is probably a timing issue, maybe the registers are wrote too quickly (key on/off sequence) so they are not correctly interpreted. when you use stop command the XGM driver send a "dummy" music play command which only contains commands to reset / turn off the YM2612 sounds.