VOGONS

Common searches


First post, by NewRisingSun

User metadata
Rank Oldbie
Rank
Oldbie

I have installed BASSMIDI for General MIDI and the recent MUNT release for Roland MT-32 emulation. After installing, "Microsoft GS Wavetable Synth" became MIDI device 0, "MT-32 Synth Emulator" became device 1, and "BASSMIDI Driver" became device 2 when using DosBox' "mixer /listmidi" command. I then set up the "midiconfig=" setting in my game-specific DosBox config files accordingly.

Suddenly however, the device numbering changed, with BASSMIDI becoming 0, Microsoft GS becoming 1, and MT-32 becoming 2. Before I update all my config files accordingly, I would like to know how and why that happens to prevent it from happening again. This strange order does not seem to come from the registry's HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32, as "midi1" is set to "wdmaud.drv", "midi2" is set to "mt32emu.dll", and "midi3" is set to "bassmidi\bassmididrv.dll", which is exactly the original order. So where's Windows (or DosBox?) getting this strange device order all of a sudden?

I am using Windows 7 SP1 64-bit with DosBox 0.74.

Reply 1 of 4, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Subkeys for HKCU\Software\Microsoft\ActiveMovie\devenum\{4EFE2452-168A-11D1-BC76-00C04FB9453B} are MIDI out devices, and their MidiOutId value appears to be how they are enumerated.

Reply 3 of 4, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I have a soundcard driver with the alias "midi1" in the registry, but it represents *four* MIDI out devices, so it doesn't seem those aliases could be used for enumerating the devices. The keys I mentioned list all of the MIDI out devices, and on my system their MidiOutId matched the order listed by MIXER /LISTMIDI in DOSBox. However, I tried manually renumbering the IDs and restarting Windows but DOSBox still shows the same order, so apparently WINMM orders by something else, and maybe sets the MidiOutId values based on whatever that is.

FWIW, this is the mixer.cpp code that lists the devices, with the WINMM functions involved:

    void ListMidi(){
#if defined (WIN32)
unsigned int total = midiOutGetNumDevs();
for(unsigned int i=0;i<total;i++) {
MIDIOUTCAPS mididev;
midiOutGetDevCaps(i, &mididev, sizeof(MIDIOUTCAPS));
WriteOut("%2d\t \"%s\"\n",i,mididev.szPname);
}
#endif
return;
};

Reply 4 of 4, by robertmo

User metadata
Rank l33t++
Rank
l33t++
NewRisingSun wrote:

I would like to know how and why that happens to prevent it from happening again.

if you choose different default midi device in windows it goes to 0. (actually whole group goes up so for example for bassmidi that has two devices bassmidiA and B -> A goes to 0, b goes to 1 no matter whether you choose a or b)
To prevent it from changing don't change it in windows 😀

it may also be good to make a list of order of devices you used for dosbox cfg, so that you can always recreate the order

a better solution (mostly for frontends) would be if dosbox allowed selecting midi device by it's name too