From: Abramo Bagnara <abramo.bagnara@libero.it>
To: Anders Torger <torger@ludd.luth.se>
Cc: Clemens Ladisch <clemens@ladisch.de>, Paul Davis <pbd@op.net>,
alsa-devel@lists.sourceforge.net, Takashi Iwai <tiwai@suse.de>
Subject: Re: Why do I get broken pipe on write to a pcm instatePREPARED?
Date: Wed, 09 Oct 2002 20:54:29 +0200 [thread overview]
Message-ID: <3DA47B65.AEFFE757@libero.it> (raw)
In-Reply-To: 200210091048.g99Am6029123@d1o87.telia.com
Anders Torger wrote:
>
> On Wednesday 09 October 2002 09.52, Clemens Ladisch wrote:
> > Abramo Bagnara wrote:
> > > Clemens Ladisch wrote:
> > > > Abramo Bagnara wrote:
> > > > > The point is that stream is in bad state wrt read/write, this
> > > > > is the reason why poll should return POLLERR.
> > > >
> > > > I think the stream is _not_ in a bad state because one buffer of
> > > > data can (and has) be written. The reason for not allowing
> > > > further writes is that the buffer is full, and not that the
> > > > device wouldn't accept any data at all. This is similar to the
> > > > behaviour of a pipe with the reading end opened by an application
> > > > which currently doesn't read from the pipe, in contrast to a pipe
> > > > with the read end not opened at all.
> > >
> > > ??? With this message now I'm very confused about what you wish...
> >
> > I changed my mind about how the POSIX standard fits to our problem
> > case.
> >
> > > Can you resume to me the comparison between current and wanted
> > > behaviour wrt poll for both playback and capture.
> >
> > The behaviour of polling during capture is just fine:
> >
> > RUNNING: block until avail_min is available, then return POLLIN
> > DRAINING: return POLLIN until buffer is empty, then return POLLERR
> > (other states: POLLERR)
> >
> > The current behaviour for playback is:
> >
> > PREPARED: return POLLOUT until the buffer is full, then return
> > POLLERR RUNNING: block until avail_min can be written, then return
> > POLLOUT DRAINING: block (until state changes)
> > (other states: POLLERR)
> >
> > I want the behaviour in the PREPARED state to be similar to the
> > RUNNING state, i.e. return POLLOUT until the buffer is full, then
> > block.
>
> Why not have the same behaviour for polling during capture? Reading
> from a not-yet-started sound card is useful in the same way that
> writing to a not-yet-started sound card is useful. Perhaps especially
> in low-latency multi-threaded applications, when you want to start
> reading (or writing) as soon as possible after the sound card has been
> started (this can be accomplished in other ways of course). If poll
> keeps returning POLLERR it is no use. Blocking in both cases is better,
> and in my humble opinion more logical behaviour. I don't think having a
> special case for the prepared state in read or write is useful.
Yes, I buy that.
--
Abramo Bagnara mailto:abramo.bagnara@libero.it
Opera Unica Phone: +39.546.656023
Via Emilia Interna, 140
48014 Castel Bolognese (RA) - Italy
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
next prev parent reply other threads:[~2002-10-09 18:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3D98769A00183382@ims5a.libero.it>
2002-10-08 6:06 ` Why do I get broken pipe on write to a pcm in statePREPARED? Abramo Bagnara
2002-10-08 7:30 ` Clemens Ladisch
2002-10-08 18:50 ` Why do I get broken pipe on write to a pcm instatePREPARED? Abramo Bagnara
2002-10-09 7:52 ` Clemens Ladisch
2002-10-09 10:48 ` Anders Torger
2002-10-09 18:54 ` Abramo Bagnara [this message]
2002-10-09 13:28 ` James Courtier-Dutton
2002-10-09 13:54 ` Anders Torger
2002-10-10 2:15 ` James Courtier-Dutton
2002-10-10 3:51 ` Anders Torger
2002-10-10 14:21 ` Jaroslav Kysela
2002-10-10 15:03 ` Anders Torger
2002-10-09 14:39 ` Tim Goetze
2002-10-09 18:53 ` Why do I get broken pipe on write to a pcminstatePREPARED? Abramo Bagnara
2002-10-09 19:33 ` Jaroslav Kysela
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3DA47B65.AEFFE757@libero.it \
--to=abramo.bagnara@libero.it \
--cc=alsa-devel@lists.sourceforge.net \
--cc=clemens@ladisch.de \
--cc=pbd@op.net \
--cc=tiwai@suse.de \
--cc=torger@ludd.luth.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox