munt / munt

A multi-platform software synthesiser emulating pre-GM MIDI devices such as the Roland MT-32, CM-32L, CM-64 and LAPC-I. In no way endorsed by or affiliated with Roland Corp.

Home Page:http://munt.sourceforge.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mt32emu_alsadrv: MIDI port doesn't set SND_SEQ_PORT_TYPE_MIDI_GENERIC

realnc opened this issue · comments

In a project of mine, I detect available MIDI ports by testing for the SND_SEQ_PORT_TYPE_MIDI_GENERIC flag:

https://github.com/realnc/dosbox-core/blob/c106dc49b1a15ed1b04717e3e5a29b39ea9ac9cd/libretro/midi_alsa.cpp#L40

This makes sure that non-MIDI ports won't get listed as choices to output MIDI to. Like the "System Timer" port.

However, when running mt32d, the MT-32 ports get registered with ALSA but they don't have the SND_SEQ_PORT_TYPE_MIDI_GENERIC flag set. So they get skipped.

That flag is documented as "This port understands MIDI." So I believe mt32d should set that flag on the ports it creates.

For now, I can hard-code a workaround for ports named MT-32. But I think the proper fix is for the ports to actually have the SND_SEQ_PORT_TYPE_MIDI_GENERIC flag set, since they do understand MIDI messages.

Edit:
I can also test for SND_SEQ_PORT_TYPE_MIDI_GM/GS/XG/MT32/GM2, which the driver correctly sets. But I believe SND_SEQ_PORT_TYPE_MIDI_GENERIC is a catch-all for all of these for when an application doesn't actually care about which MIDI standard the port supports and all it cares about it whether MIDI can be sent to it or not.

I believe, this is a valid point, and IIRC something like that has been raised for mt32emu-qt as well. This is what the latter advertises:

		SND_SEQ_PORT_TYPE_MIDI_GENERIC |
		SND_SEQ_PORT_TYPE_MIDI_MT32 |
		SND_SEQ_PORT_TYPE_SYNTHESIZER

Let's get both things in-sync.