From: Abramo Bagnara <abramo.bagnara@libero.it>
To: Anders Torger <torger@ludd.luth.se>
Cc: "alsa-devel@lists.sourceforge.net" <alsa-devel@lists.sourceforge.net>
Subject: Re: Why do I get broken pipe on write to a pcm in statePREPARED?
Date: Tue, 17 Sep 2002 10:12:29 +0200 [thread overview]
Message-ID: <3D86E3ED.5C06BCB1@libero.it> (raw)
In-Reply-To: 200209162014.g8GKEc014124@d1o87.telia.com
Anders Torger wrote:
>
> On Monday 16 September 2002 21.31, you wrote:
> > I think that the best behaviour is the current and it's also the
> > simplest to describe and to understand: poll/select never blocks when
> > there is nothing to wait.
> >
> > ... and in PREPARED state definitely there's nothing to wait from
> > sound card.
>
> I don't agree. To a beginner which has never seen a unix system before,
> this might be the case. For anyone that has programmed with file
> descriptors before, this behaviour appears broken, and is therefore
> harder to understand.
>
> Also, as we have noted, there is no real use for the current behaviour
> (at least no-one has said what it is), while there is use for the
> proper work-as-all-other-file-descriptors behaviour.
>
> * It behaves as programmers expect it to behave
> * It simplifies multi-threaded programming
Please use technical argumentations: pseudo statistical and subjective
ones does not worth a lot.
> "If the sound card output buffer is full of data, and it is not
> running, what would happen if you poll that file descriptor for writing"
>
> 1) it will block, because it is not ready for writing
> 2) it would not block, because it would then block forever
2 is better because the programmer can know the reason of failure.
With 1 the programmer will not receive enough info to detect it (also
using a timeout)
> "If you write to a non-blocking sound card output file descriptor, but
> the buffer is full, and the sound card is not running, what will then
> happen?"
>
> 1) it will return with errno set to EAGAIN, because it is not ready for
> writing
> 2) it will return with errno set to EPIPE, because there is a buffer
> overflow
2 is better because EAGAIN would be returned also if buffer is
*temporarily* full.
Consider also that "retry again later" is definitely a misleading hint.
> In conclusion, I advice you to change the behaviour to what we as
> programmers expect, and sometimes program for. I would very much
> appriciate it, and I'm sure others will as well
Please understand that it's very hard to satisfy everybody and I'm not
sure it's a worthy goal.
That apart, I'm very interested to hear further technical reason to
change current behaviour.
--
Abramo Bagnara mailto:abramo.bagnara@libero.it
Opera Unica Phone: +39.546.656023
Via Emilia Interna, 140
48014 Castel Bolognese (RA) - Italy
-------------------------------------------------------
Sponsored by: AMD - Your access to the experts on Hammer Technology!
Open Source & Linux Developers, register now for the AMD Developer
Symposium. Code: EX8664 http://www.developwithamd.com/developerlab
next prev parent reply other threads:[~2002-09-17 8:12 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.33.0209112103010.607-100000@pnote.perex-int.cz>
2002-09-11 19:26 ` Why do I get broken pipe on write to a pcm in state PREPARED? Anders Torger
2002-09-11 20:14 ` Paul Davis
2002-09-12 11:13 ` Takashi Iwai
2002-09-12 11:48 ` Anders Torger
2002-09-12 15:56 ` Takashi Iwai
2002-09-12 16:14 ` Anders Torger
2002-09-12 20:02 ` Tim Goetze
2002-09-13 9:41 ` Jaroslav Kysela
2002-09-13 10:43 ` Takashi Iwai
2002-09-13 11:45 ` Tim Goetze
2002-09-13 12:37 ` Takashi Iwai
2002-09-15 17:56 ` Why do I get broken pipe on write to a pcm in statePREPARED? Abramo Bagnara
2002-09-16 10:46 ` Takashi Iwai
2002-09-16 13:18 ` Tim Goetze
2002-09-16 14:31 ` Takashi Iwai
2002-09-16 19:31 ` Abramo Bagnara
2002-09-16 19:49 ` Tim Goetze
2002-09-16 20:14 ` Anders Torger
2002-09-17 8:12 ` Abramo Bagnara [this message]
2002-09-17 9:03 ` Anders Torger
2002-09-17 13:04 ` Paul Davis
2002-09-17 9:05 ` Clemens Ladisch
2002-09-17 10:09 ` Anders Torger
2002-09-17 11:09 ` Takashi Iwai
2002-09-17 11:55 ` tomasz motylewski
2002-09-17 12:52 ` Takashi Iwai
2002-09-17 13:01 ` Anders Torger
2002-09-17 14:40 ` Clemens Ladisch
2002-09-18 19:57 ` Anders Torger
2002-10-04 8:14 ` Anders Torger
2002-10-04 12:58 ` Takashi Iwai
2002-10-04 18:04 ` Abramo Bagnara
2002-10-07 10:15 ` Takashi Iwai
2002-10-07 12:07 ` Abramo Bagnara
2002-10-07 13:19 ` Anders Torger
2002-10-07 17:46 ` Abramo Bagnara
2002-10-08 9:54 ` Takashi Iwai
2002-10-07 13:57 ` Tim Goetze
2002-10-09 18:13 ` Jack O'Quin
2002-09-17 13:03 ` Paul Davis
2002-10-15 15:49 ` multiple devices/ possible bug in aplay or somewhere else? Guilhem Tardy
2002-10-15 16:14 ` Jaroslav Kysela
2002-10-15 17:05 ` Guilhem Tardy
[not found] <3D8638F6.AC6DE0C2@racine.ra.it>
2002-09-16 22:04 ` Why do I get broken pipe on write to a pcm in statePREPARED? Tim Goetze
2002-09-17 8:21 ` Abramo Bagnara
2002-09-17 9:21 ` Tim Goetze
[not found] <200209171301.g8HD1Ww01231@mother.ludd.luth.se>
2002-09-17 13:04 ` Anders Torger
[not found] <3D98769A000FAA05@ims5a.libero.it>
2002-10-05 7:45 ` Abramo Bagnara
[not found] <3D98769A00183382@ims5a.libero.it>
2002-10-08 6:06 ` Abramo Bagnara
2002-10-08 7:30 ` Clemens Ladisch
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=3D86E3ED.5C06BCB1@libero.it \
--to=abramo.bagnara@libero.it \
--cc=alsa-devel@lists.sourceforge.net \
--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