Bug found with OpenMSX perhaps. Input required.

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

User avatar
Tinytimrob
Engineer
Engineer
Posts: 29
Joined: 05 Sep 2009 15:03
Location: Wolverhampton, UK
Contact:

Re: Bug found with OpenMSX perhaps. Input required.

Post by Tinytimrob »

Indeed, but the first second or so of the track is cut off as a result.
Owen
Engineer
Engineer
Posts: 70
Joined: 23 Aug 2004 15:22

Re: Bug found with OpenMSX perhaps. Input required.

Post 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.
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: Bug found with OpenMSX perhaps. Input required.

Post 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
Attachments
midi_gm_reset.diff
patch -p1
(1.65 KiB) Downloaded 99 times
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: Bug found with OpenMSX perhaps. Input required.

Post 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
User avatar
Tinytimrob
Engineer
Engineer
Posts: 29
Joined: 05 Sep 2009 15:03
Location: Wolverhampton, UK
Contact:

Re: Bug found with OpenMSX perhaps. Input required.

Post 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.
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: Bug found with OpenMSX perhaps. Input required.

Post 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.
User avatar
Tinytimrob
Engineer
Engineer
Posts: 29
Joined: 05 Sep 2009 15:03
Location: Wolverhampton, UK
Contact:

Re: Bug found with OpenMSX perhaps. Input required.

Post by Tinytimrob »

Just compiled r20134 and the bug is finally gone.

The effort you put in to resolve this issue was much appreciated.
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: Bug found with OpenMSX perhaps. Input required.

Post 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.
bootmii
Engineer
Engineer
Posts: 8
Joined: 26 Nov 2012 03:34

Re: Bug found with OpenMSX perhaps. Input required.

Post 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.
User avatar
jfs
Tycoon
Tycoon
Posts: 1750
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Bug found with OpenMSX perhaps. Input required.

Post 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.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Amazon [Bot] and 14 guests