On Wednesday 12 September 2007 14:00, IOhannes M
zmoelnig wrote:
> however i have found no way to find out, which clients are real midi
> devices and which are not.
If your alsa-lib is new enough, you can try to check for
SND_SEQ_PORT_TYPE_HARDWARE.
Chris Cannam wrote:
A user application therefore couldn't rely on the
alsalib version number
when trying to decide whether a client numbered 16 to 63 was system or
hardware.
And there's userspace drivers for Bluetooth and Firewire.
I assume it must be intended that ALSA applications
treat these numbers as
meaningless opaque identifiers; otherwise they wouldn't have been changed so
lightly.
Indeed.
But I don't see any alternative if you want to do
autoconnection
(even under user control). Many people here will argue that autoconnection
is a bad idea in itself.
On my old SB-compatible card, opening the MIDI port will disable the
PCM device (or fail if the PCM is opened).
And what would the purpose be of automatically connecting to all
those ports, when there's more than one?
$ aplaymidi -l
Port Client name Port name
14:0 Midi Through Midi Through Port-0
14:1 Midi Through Midi Through Port-1
20:0 MPU-401 UART MIDI MPU-401 UART MIDI
24:0 Yamaha DS-1E (YMF754) MIDI Yamaha DS-1E (YMF754) MIDI
25:0 OPL3 FM synth OPL3 FM Port
32:0 SC-8820 SC-8820 Part A
32:1 SC-8820 SC-8820 Part B
32:2 SC-8820 SC-8820 MIDI
40:0 Virtual Raw MIDI 6-0 VirMIDI 6-0
41:0 Virtual Raw MIDI 6-1 VirMIDI 6-1
42:0 Virtual Raw MIDI 6-2 VirMIDI 6-2
43:0 Virtual Raw MIDI 6-3 VirMIDI 6-3
48:0 UM-2 UM-2 MIDI 1
48:1 UM-2 UM-2 MIDI 2
56:0 EMU10K1 MPU-401 (UART) EMU10K1 MPU-401 (UART)
57:0 Emu10k1 WaveTable Emu10k1 Port 0
57:1 Emu10k1 WaveTable Emu10k1 Port 1
57:2 Emu10k1 WaveTable Emu10k1 Port 2
57:3 Emu10k1 WaveTable Emu10k1 Port 3
60:0 Serial MIDI Serial MIDI 1
64:0 C-Media CMI8738-MC8 C-Media CMI8738-MC8 MIDI
(yes, I'm bragging :-)
Also, note that you can't rely on the
SND_SEQ_PORT_TYPE flags to tell you
anything useful either.
They're strictly optional, but at least all the drivers set them.
(Both the in-the-kernel-but-virtual drivers, snd-virmidi and snd-seq-dummy,
set SND_SEQ_PORT_TYPE_SOFTWARE instead of _HARDWARE.)
Regards,
Clemens