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

Samu
Traffic Manager
Traffic Manager
Posts: 236
Joined: 17 Apr 2007 14:28

Re: Bug found with OpenMSX perhaps. Input required.

Post by Samu »

what about the other 2 tracks from OpenMSX pack? What can we do about it? Are you able to edit .mid files?
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 »

I narrowed down the problem to "Modern Motion", so I'm going to try removing it completely from my obm file and see if the 'darkness' goes away.

Edit: I downloaded the latest nightly r75 and removed Modern Motion and the 'darkness' as it were still remains. I am now completely baffled by this bug and believe it is likely that the bug is being caused by MULTIPLE TRACKS, the two we already identified (Smooth Groove and Modern Motion) must have something specific about them that cause this issue to occur, the same thing likely being present in other tracks.

Tomorrow I'll patch my OpenTTD to the latest nightly - I'm starting to think it's an OpenTTD bug. If that doesn't fix it then I'll try to get rid of the issue completely by eliminating problem tracks.

And planetmaker - in r75 the tracks TT SONG and TT SONG II are also in the selection as "Unidentified Flying Scotsman" and "Chugga Chugga Cha-Ching", you have them duplicated.
Samu
Traffic Manager
Traffic Manager
Posts: 236
Joined: 17 Apr 2007 14:28

Re: Bug found with OpenMSX perhaps. Input required.

Post by Samu »

driver versus hardware! Who's right?
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Bug found with OpenMSX perhaps. Input required.

Post by Eddi »

Tinytimrob wrote: Tomorrow I'll patch my OpenTTD to the latest nightly - I'm starting to think it's an OpenTTD bug. If that doesn't fix it then I'll try to get rid of the issue completely by eliminating problem tracks.
it's fairly unlikely to be an openttd bug, as openttd doesn't actually play the files, it does not contain a midi player at all.
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 »

Building the latest nightly of OpenTTD from trunk did not solve the issue.

My immediate theory is that it could be a bug with the way OpenTTD makes use of DirectMusic, which could explain why only a minority of people seem to have the problem.

Below is a new recording of what happens to the OpenMSX title music on my computer, immediately after the "darkness" bug has occured:
http://media.thegineverblock.com/opentt ... sx-bug.mp3

By listening to this you can clearly hear the music no longer sounds correct.

The fastest and easiest method I can use to reproduce the problem is as follows:
- Set the music to OpenMSX if not already selected and restart OpenTTD
- Start a new game
- Go into the Jazz Jukebox and skip through the tracks one at a time using the >> button until you reach the title music again
- The music has bugged up

This bug also happens if you let each track play all the way through (rather than skipping through them), it's just that it takes ages to do that, making identification of the issue time consuming.

Happens for me with all versions of OpenMSX that I have, including the latest one (at the time of this post the recording I made was using OpenMSX nightly r80 dated 05 July 2010)

If you cannot reproduce this and feel it might be an issue with OpenTTD itself (perhaps with the compile environment?), you can download my patchpack from http://www.tt-forums.net/viewtopic.php?f=33&t=49111, I compiled this a few days ago and the bug definitely occurs with that version.
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 »

I don't hear any difference between what you recorded and the intro that's played immediately after the start of OpenTTD now when having cycled through the list. Also no difference when I play the midi file in Media Player.

Have you tried a vanilla OpenTTD that you didn't compile yourself?
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 »

I have the same issue with the downloadable version of OpenTTD Win32 v1.0.2 from http://www.openttd.org/en/download-stable

Here's a small recorded segment of the title music, played twice, starting firstly with the original version and followed immediately by the distorted one. Surely you can hear it now.
http://media.thegineverblock.com/opentt ... -bug-2.mp3
jawsper
Engineer
Engineer
Posts: 20
Joined: 08 Jun 2004 00:02
Location: Netherlands

Re: Bug found with OpenMSX perhaps. Input required.

Post by jawsper »

I think you might have an issue with the way your computer plays the midi file, because what you call distortion I would call the midi pitch bender being messed up. Can you play the midi file in a separate program and see if that has the same issue?
Patch: change finances window grouping
Patch: Tracking viewport

Warning: Unexpected end of file reached.
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 »

The issue only occurs from within OpenTTD (the MIDI plays fine in Windows Media Player) and I can reproduce it on all six computers that are in my house using the steps I posted above, all of varying ages with different sound chipsets and drivers.
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 »

Tinytimrob wrote:Surely you can hear it now.
I hear what you mean.
Now that I know what to listen for, the same thing happens here when I follow your listen-cyclethroughlist-listenagain instructions.

Doesn't happen when I play the songs in Media Player (in random order, cannot be bothered to put them in the same order) and then cycle through the list.

I wonder if OpenTTD somehow caches the music files...
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 »

I'm happy someone else has now managed to confirm this happens. It is getting really annoying :(

I'm personally placing the blame on OpenTTD/DirectMusic and not OpenMSX, since the MIDIs play perfectly fine outside of the game without issue. Where to start in terms of finding a solution is another matter entirely.

I think the issue is that the music player isn't resetting before it plays each track, so if for example, track X enables a specific pitch bend in one of the MIDI tracks and then doesn't disable it again afterwards, OpenTTD isn't issuing the disable command either, so the pitch bend command from the previous track affects later ones played.

If you could add some sort of 'global reset' before playing each track, I think that would resolve the issue.
jawsper
Engineer
Engineer
Posts: 20
Joined: 08 Jun 2004 00:02
Location: Netherlands

Re: Bug found with OpenMSX perhaps. Input required.

Post by jawsper »

I can't reproduce the issue myself, can you post what windows version and directx version you're using? (I guess many different ones on the 6 different computers.) I'm on Win7 x64 with DX11 and built-in realtek HD audio sound card.
Patch: change finances window grouping
Patch: Tracking viewport

Warning: Unexpected end of file reached.
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 »

I have as follows, in order of newest to oldest:

- My main computer running Windows 7 Ultimate 64-bit, DirectX 11, Realtek ALC889A HD audio
- My brother's computer running Windows Vista Home Premium 32-bit, DirectX 10, also with ALC889A
- My dad's computer running Windows XP Home, DirectX 9.0c, this time with ALC882
- An old computer running Windows XP Pro, DirectX 9.0c, it has a VIA AC'97 sound chip of some kind
- An old computer running Windows XP Pro, DirectX 9.0c, it has a C-Media AC'97 sound chip
- An old computer running Windows XP Pro, DirectX 9.0c, not sure on the sound chip here without turning it on and checking

All of these reproduce the issue.

I'm also confident that the issue happened on my friend's new computer, he has Windows 7 64-bit, DX11 and the ALC888 chip.
Last edited by Tinytimrob on 06 Jul 2010 09:58, edited 1 time in total.
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 »

As I could reproduce it, I'll add mine to the list:
Win7 Pro 32 bit, Conexant HD SmartAudio 221
I cannot find which midi table I'm using, but I'm sure it's Microsoft's default.
jawsper
Engineer
Engineer
Posts: 20
Joined: 08 Jun 2004 00:02
Location: Netherlands

Re: Bug found with OpenMSX perhaps. Input required.

Post by jawsper »

Laptop with win7 x64, DX11, soundcard something HD audio (it's a Sony Vaio), doesn't have the issue.
On my laptop I ran r19990(modified) with OpenMSX just downloaded from BaNaNaS.

A very very weird issue this is!
Patch: change finances window grouping
Patch: Tracking viewport

Warning: Unexpected end of file reached.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Bug found with OpenMSX perhaps. Input required.

Post by planetmaker »

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.
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 »

First thing to find out is whether the problem is MIDI playback in general or the way it is played.

Open your openttd.cfg with a text editor and search for the line "musicdriver =". Normally it should be empty. First try "musicdriver = dmusic", which should be the default, and check if that has the problem. After that, try with "musicdriver = win32" and check again. If only one of the two drivers has the issue, it's likely an OpenTTD bug. If not, it's either the windows driver or the MIDI files itself.

-- Michael Lutz
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: Bug found with OpenMSX perhaps. Input required.

Post by Rubidium »

Just to cross reference the OpenMSX tracker: http://dev.openttdcoop.org/issues/1078

In other words: it happens only with dmusic.
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 »

Confirmed, the bug does not occur with win32, only dmusic.

Win32 has a different problem for me (the first second or so of each track is silent) but I'm not fussed about that as long as the dmusic issue gets fixed.
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 »

With win32, the track isn't really silent, it just takes longer to load. Happens here as well.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 8 guests