When listing ports with aplaymidi/arecordmidi, show only
ports that understand MIDI messages, i.e., that have the
SND_SEQ_PORT_TYPE_MIDI_GENERIC flag set.
snd_seq_port_info_set_client(pinfo, client);
snd_seq_port_info_set_port(pinfo, -1);
while (snd_seq_query_next_port(seq, pinfo) >= 0) {
+ /* port must understand MIDI messages */
+ if (!(snd_seq_port_info_get_type(pinfo)
+ & SND_SEQ_PORT_TYPE_MIDI_GENERIC))
+ continue;
/* we need both WRITE and SUBS_WRITE */
if ((snd_seq_port_info_get_capability(pinfo)
& (SND_SEQ_PORT_CAP_WRITE | SND_SEQ_PORT_CAP_SUBS_WRITE))
snd_seq_port_info_set_client(pinfo, client);
snd_seq_port_info_set_port(pinfo, -1);
while (snd_seq_query_next_port(seq, pinfo) >= 0) {
+ /* port must understand MIDI messages */
+ if (!(snd_seq_port_info_get_type(pinfo)
+ & SND_SEQ_PORT_TYPE_MIDI_GENERIC))
+ continue;
/* we need both READ and SUBS_READ */
if ((snd_seq_port_info_get_capability(pinfo)
& (SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ))