joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.65k stars 376 forks source link

General Midi music not working #2302

Open qkie895 opened 3 years ago

qkie895 commented 3 years ago

I recently switched from DOSBox 0.74 to the latest stable DOSBox-X, for playing games. For some reason, the midi music is not working on DOSBox-X, whereas it does in the main 0.74. It's not isolated to one game or edition of it. I tried comparing the conf files between both DOSBox versions, and at least, the settings that are present in both are on the same configuration.

I'm on Windows 10, Realtek HD Audio Output as sound card, and midi device is Microsoft GS Software Wavetable Synthesizer featuring Roland Sound Canvas Digital.

qkie895 commented 3 years ago

Hello, Still looking for help on this please

Wengier commented 3 years ago

Thanks for reporting this! In order for us to test it more easily, could you please upload the DOSBox-X config file you are currently using? You can upload it directly here. Thanks!

qkie895 commented 3 years ago

Sure! I'll actually upload my DOSBox-X and also regular 0.74 configs for comparison. But basically, general midi works fine from 0.74, as well as other forks like ECE and Staging. dosbox-x conf.zip dosbox-0.74-2 conf.zip

Wengier commented 3 years ago

@qkie895 Thanks for uploading the config file. With your config file (or the default one) I can hear music using General MIDI, so it is likely a compatibility issue with the "default" MIDI driver (mididevice=default), which uses the "win32" driver on Windows systems like yours. Instead of the "default" driver, can you try a different General MIDI driver such as FluidSynth or MT32 for the mididevice setting and see if the music works in General MIDI mode? For your convenience the following DOSBox-X Windows binary package comes preconfigured with the "fluidsynth" driver and you can try it out:

qkie895 commented 3 years ago

Thanks, I'll give it a try. I also wanted to mention that it's weird that mididevice=default works for me with regular DOSBox, but not DOSBox-X. I'm curious what's causing the difference in that regard.

Wengier commented 3 years ago

@qkie895 Yes, I have been trying to find out what may be the culprit. If other MIDI drivers in DOSBox-X like mididevice=fluidsynth work on your system then it means that there is some compatibility issue with the "default" ("win32" in your case) MIDI driver in DOSBox-X. On the other hand, if other MIDI drivers like FluidSynth and MT32 also do not work on your system then it means the issue is more likely caused by the MIDI handler code itself rather than a specific MIDI driver in DOSBox-X.

qkie895 commented 3 years ago

Ok, so I tried directly changing the mididevice to both fluidsynth and mt32 in my dosbox-x install's config and still no music. With the binary package you attached which has it set up to Fluidsynth, this time the music does indeed play. I do prefer how the game I'm playing sounds with General Midi, though, so I'm wondering if it can be adjusted to play General Midi instead? That would be really great.

Thanks for your help so far!

Wengier commented 3 years ago

@qkie895 When you changed the mididevice to fluidsynth/mt32 in your dosbox-x install's config did you specify a Soundfont (for FluidSynth) or ROM path (for MT32) as well? If you didn't, then the setting will be ignored and fallback to "default". You can see which MIDI device is currently active from the menu ("Sound" => "Show MIDI device configuration"). The fact that the music does indeed play with the binary package I attached means the FluidSynth handler (instead of "win32") does work on your system, so it should be a config issue. In the binary package I did specify a Soundfont (GeneralUser_GS.sf2) for FluidSynth, which may be the reason why it worked. So make sure to specify a Soundfont (for FluidSynth) or ROM path (for MT32) in your dosbox-x install's config, and then General MIDI will hopefully work in your dosbox-x install too (with FluidSynth or MT32 it is still General MIDI, just with a different handler than "default").

rderooy commented 3 years ago

Just a little thing... MT32 is MIDI but not General MIDI. It pre-dates the General MIDI definition.

I actually gave my MT32 away to a friend in 1995 since I was no longer using it. Should have kept it, as they are worth quite a bit these days ;-)

qkie895 commented 3 years ago

@Wengier Ahh, I'm sorry, I used the wrong term for what I was referencing! I meant to say if it can be configured or determined how to get the default/win32 handler working; not "General Midi" (which is what all these options of default, fluidsynth, mt32, etc are).

But you are correct, when I set the Soundfont to GeneralUser_GS.sf2 in my install of DOSBox-X (with the sf2 file copied into the directory), the music then works through Fluidsynth.

qkie895 commented 3 years ago

Still hoping to get help on this...

Wengier commented 3 years ago

@qkie895 So we have determined that the issue is a compatibility issue specific to the "default"/"win32" handler, rather than the MIDI code in general. This is why the other handlers (like FluidSynth and MT32) will work on your PC as well. But the main obstacle for me to fix it is that the handler "default"/"win32" does work on my PC, so I hope I have another PC that can actually reproduce the problem in order to fix it. Meanwhile, DOSBox-X 0.83.11 has just been released, and you can use it configured with any other MIDI handlers to play General MIDI music (they will hopefully sound better than the "default"/"win32" handler anyway), or use the Adlib one (BTW: DOSBox-X supports a few OPL options including the Nuked OPL and the OPL2/3 board ones).

qkie895 commented 3 years ago

Ah, I see. Yeah it's definitely not fun when the issue is inconsistent across different machines. I'll work with what's available for now, but hopefully this thing can be reproduced and resolved.

What about to compare the regular 0.74 and X to compare how Default/Win32 is handled between them? Maybe that will bring up some possibilities.

Wengier commented 3 years ago

@qkie895 By just comparing the "default"/"win32" handler code it appears that the change between DOSBox 0.74 and DOSBox-X is definitely not small. Without an actual machine for me to actually reproduce the problem it will be more difficult to find where the problem is, and at the same time you can always try a different handler that works better for you.