Page 3 of 3

Re: Bug found with OpenMSX perhaps. Input required.

Posted: 06 Jul 2010 20:50
by Tinytimrob
Indeed, but the first second or so of the track is cut off as a result.

Re: Bug found with OpenMSX perhaps. Input required.

Posted: 07 Jul 2010 14:22
by Owen
planetmaker wrote:This seems to be some kind of driver issue which is experienced only on certain windows installations - which obviously interpret things not as they're intended in some cases.

Pure speculation: some drivers don't reset the per-music-title settings as they are supposed to do so by some specs. And it works with the media player as it sends defaults settings before starting a new song and sending its configuration... but I have no clue about music device drivers and can't test it myself on windows.
All of the sound systems listed are either AC97 or Intel HD Audio devices - which have no MIDI support (They're basically glorified PCM DACs and don't even have hardware mixers). This means that the bug resides within Microsoft's software synthesizer, or DirectMusic's interaction with said synthesizer, or OpenTTD's interaction with DirectMusic, rather than within any hardware driver.

Re: Bug found with OpenMSX perhaps. Input required.

Posted: 07 Jul 2010 14:29
by Michi_cc
Some testing seems to point to a problem with busy_schedule.mid. Just playing the theme and then busy_schedule.mid and the theme again results in the distortions. I have no idea why though, as the MIDI file itself doesn't seem to contain anything unusual (as far as I can see without being a MIDI export).

I've attached a patch that makes sure a GM reset is sent before every title is played, which we should be doing in theory anyway. BUT it's actually not helping for this specific problem, which means that I'm out of ideas here. Bear in mind that DirectMusic is declared as deprecated and unsupported by Microsoft, so maybe there just isn't anything for us to fix.

-- Michael Lutz

Re: Bug found with OpenMSX perhaps. Input required.

Posted: 07 Jul 2010 16:58
by FooBar
Michi_cc wrote:Some testing seems to point to a problem with busy_schedule.mid. Just playing the theme and then busy_schedule.mid and the theme again results in the distortions.
There are more songs with that problem. I made a list here: http://dev.openttdcoop.org/issues/1078

Re: Bug found with OpenMSX perhaps. Input required.

Posted: 09 Jul 2010 22:52
by Tinytimrob
Not sure if this helps, but I installed Midi Yoke and Timidity++ on one of the computers, setting them as the default playback driver, and now Windows Media Player has exactly the same issue playing these MIDI files. If I select "system reset" from within Timidity++ the problem goes away again until playing a problematic MIDI again.

As previously stated, Modern Motion causes the issue for me too, in addition to those MIDIs stated in bug 1078 reported by foobar (I haven't tested them all yet, but Busy Schedule definitely causes the problem)

I therefore assume it is almost definitely a DirectMusic bug and not really a bug with OTTD as such. Still needs fixing really.

Re: Bug found with OpenMSX perhaps. Input required.

Posted: 10 Jul 2010 09:33
by FooBar
A workaround to the problem was committed to trunk last night.

First solution tried was similar to the reset command you suggested, but that resulted in a game freeze of about 2 seconds between each song.
The current workaround is to not use dmusic as default music player (but -mwin32 instead). As a consequence, there now is a small pause (but no freeze) between songs. The problem of -mwin32 'eating' something off the start of a song has been fixed.

I don't know if the developers are still looking for a solution to this small pause, but at least the music is played correctly once again.

Re: Bug found with OpenMSX perhaps. Input required.

Posted: 13 Jul 2010 10:31
by Tinytimrob
Just compiled r20134 and the bug is finally gone.

The effort you put in to resolve this issue was much appreciated.

Re: Bug found with OpenMSX perhaps. Input required.

Posted: 13 Jul 2010 10:43
by Rubidium
Tinytimrob wrote:Just compiled r20134 and the bug is finally gone.
The problem is that this solution crashes OpenTTD in some cases with some (don't know which) songs of OpenMSX.

Re: Bug found with OpenMSX perhaps. Input required.

Posted: 22 Jan 2023 06:14
by bootmii
This issue still persists 11 years later. One of "Ultimate Run" or "5 4 3 2 .. Gone", I am not sure which, causes issues with "Keep on Rolling". Necroing in the hopes that every OpenMSX song must either use the startup pitch bend scale or end with a GM reset, or perhaps "OpenTTD Journey" and "Keep on Rolling" start with one.

Re: Bug found with OpenMSX perhaps. Input required.

Posted: 22 Jan 2023 10:03
by jfs
bootmii wrote: 22 Jan 2023 06:14 This issue still persists 11 years later. One of "Ultimate Run" or "5 4 3 2 .. Gone", I am not sure which, causes issues with "Keep on Rolling". Necroing in the hopes that every OpenMSX song must either use the startup pitch bend scale or end with a GM reset, or perhaps "OpenTTD Journey" and "Keep on Rolling" start with one.
Which music driver are you using with OpenTTD?
Some years ago the Win32 and DirectMusic drivers were rewritten and they send a GM system reset before each track now, specifically to avoid problems with pitch bend range controllers etc. bleeding over.