On Sat, 15 Jul 2000, Benno Senoner wrote:

> On Sat, 15 Jul 2000, Chris Baugher wrote:
> > The patch worked! I was also able to decrease the value to 5000 without
> > causing the "resource unavailable" error. The response seems quite good
> > although I'm not a keyboard player so I might not be a good judge. As far
> > as the midi problem goes, I ran the following code to try to reproduce the
> > error:
> 
> I _STRONGLY_ suspect that this error is due to broken blocking MIDI
> I/O in ALSA, but it would be nice to get a confirmation from the ALSA folks.
> ( all on vacation ?  :-))) )

ALSA doesn't use blocking I/O at all for the OSS emulation. If I remember
correctly, the OSS code had not this feature at the design time of the 
ALSA raw midi layer (KeyKit package had big troubles with the correct
implementation), so we have these lines in our code:

#ifdef CONFIG_SND_OSSEMUL
        if (minor < 256)
                file->f_flags |= O_NONBLOCK;
#endif

I hope that it explains all your problems. It appears that latest OSS/Free
implements O_NONBLOCK well, so I removed these lines from the ALSA
rawmidi code.

BTW: The best solution for the midi input is non-blocking I/O with
select() or poll() usage and bigger read buffer than 1 (to minimize
interactions with the kernel when more bytes are received).

                                                Jaroslav

-----
Jaroslav Kysela <[EMAIL PROTECTED]>
SuSE Linux    http://www.suse.com
ALSA project  http://www.alsa-project.org

Reply via email to