Tim Goetze wrote:
> 
> the following method is known to work since alsa-0.6.x (as has been
> said on alsa-devel):
> 
> fd = open ("/dev/snd/midiCxDy", O_RDONLY); /* x = card, y = device */
> 
> while (!done)
> {
>   if (read (fd, &data, 1) == 1)
>     parse (data);
> }
> 
> O_NONBLOCK with poll(2) and O_WRONLY/O_RDWR with write(2) work, too.
> 
> the only drawback is that due to a long-standing bug alsa does not
> route MIDI data you write to this fd to hardware MIDI (wavetable/FM),
> so for a emu8k, /dev/snd/midiCxDy with y > 0 is dead.
> 
> external connectors work well here with emu8k, ice1712 and an isa
> mpu401.
> 
> actually, i regard this method not as a workaround but as superior
> since a) it is easier to implement and read, and b) you can use it
> with sockets and pipes, too.
> 
> there's code that implements this method in pbd's libmidi++ or my
> midithing (quitte.de/midithing.html).
> 
> hope this lessens the frustration,

Please avoid to use direct access to ALSA kernel API, this means to ask
for troubles.

Please understand that we'll have no hesitation to break compatibility
of your applications with future releases.

You've no drawbacks to use alsa-lib API.

-- 
Abramo Bagnara                       mailto:[EMAIL PROTECTED]

Opera Unica                          Phone: +39.546.656023
Via Emilia Interna, 140
48014 Castel Bolognese (RA) - Italy

ALSA project               http://www.alsa-project.org
It sounds good!

Reply via email to