Subject: Re: [linux-audio-dev] O_NONBLOCK in OSS
From: Billy Biggs (vektor_AT_DIV8.NET)
Date: ti marras 16 1999 - 00:34:43 EST
On Tue, 16 Nov 1999, Paul Barton-Davis wrote:
> > The real issue is that I cannot have the app block if the soundcard
> >cannot be opened immediately. That's the point of the O_NONBLOCK flag.
> >OSS shouldn't give it any more meaning than that.
>
> thats not what O_NONBLOCK means. it means "do not block if read or
> write cannot be satisfied without blocking". it has little or no
> impact on the open(2) implementation for most drivers of any kind. by
> using it, you are telling the driver to return zero if it has no space
> available to put the data you are write(2)-ing or no data to return if
> you are read(2)-ing. thats all.
We're both wrong, I think:
O_NONBLOCK or O_NDELAY
The file is opened in non-blocking mode. Neither
the open nor any subsequent operations on the file
descriptor which is returned will cause the call
ing process to wait. For the handling of FIFOs
(named pipes), see also fifo(4).
So basically, I don't want my app to sit there waiting if someone else
is using the soundcard. That's what happens if I take out the O_NONBLOCK
flag to the call to open. The only hack I can think of would be to try to
open it NONBLOCK, and if that works, re-open it without the flag. Ugly
ugly ugly.
I don't think I (or anybody else, if they want to make a user-friendly
program) has any choice but to buffer audio ourselves.
-- Billy Biggs vektor_AT_div8.net http://www.div8.net/billy wbiggs_AT_uwaterloo.ca
This archive was generated by hypermail 2b28 : pe maalis 10 2000 - 07:23:25 EST