Re: [linux-audio-dev] [ot] rawmidi && alsa

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] [ot] rawmidi && alsa
From: Paul Davis (pbd_AT_Op.Net)
Date: Tue Apr 24 2001 - 03:51:07 EEST


>> there is absolutely nothing that i know of above read/write/open/close
>> in the ALSA raw MIDI API that is of use to any application I have ever
>> seen.
>
>No drop, no drain, no status, no avail_min, no buffer_size?

I've never seen a program that does raw MIDI I/O that would use any of
these. the (my) model of a raw MIDI device doesn't include any of
these concepts. when i write data to a raw MIDI device, i expect:

      * it either gets put on the wire immediately, OR
      * my thread blocks until it can be put on the wire

if i read from it, then

      * i get data immediately, OR
      * i block until data is received from the wire

(ignoring O_NONBLOCK, etc.). the concept of "drain", "drop" etc. don't
have any place in the way i think about "raw MIDI". whats the status
of a UART delivery bytes to a wire ? there isn't one, other than a
permanent error. i am not sure how these crept into the alsa API. they
certainly belong in the sequencer API, but raw MIDI ? i don't think so.

>No support for client/server using the same API.

FIFOs, sockets and pipes provide the same thing, and the standard
syscall API works, whether the underlying MIDI device is supported by
an ALSA driver, OSS, or something else entirely.

>To have a rawmidi type for use with ordinary files (FIFO, sockets and
>pipes) it's trivial to implement.
>
>snd_rawmidi_open(NULL, &output, "file:/tmp/RMIDI", 0);

and a pre-existing socket ? stdout ?

>And you've a program useable with *all* rawmidi types (current or
>future).

if you attach more semantics to "raw MIDI" than I do, then
sure. otherwise, you've got bloat and an API that doesn't work right
for other fd's.

--p


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Tue Apr 24 2001 - 04:19:33 EEST