From: Takashi Iwai <tiwai@suse.de>
To: Paul Davis <pbd@op.net>
Cc: Anders Torger <torger@ludd.luth.se>, alsa-devel@lists.sourceforge.net
Subject: Re: Why do I get broken pipe on write to a pcm in state PREPARED?
Date: Thu, 12 Sep 2002 13:13:14 +0200 [thread overview]
Message-ID: <s5hadmnpik5.wl@alsa2.suse.de> (raw)
In-Reply-To: <E17pDpC-0005FU-00@usw-sf-list1.sourceforge.net>
At Wed, 11 Sep 2002 16:14:19 -0400,
Paul Davis wrote:
>
> >Is it possible to adjust a stop threshold or something to get my
> >desired behaviour?
>
> i think you should have set the start mode to START_DATA and the start
> threshold appropriately. then the device would have started as soon as
> the buffer was full.
but this will make the driver to start the stream automatically.
if you want to start explicitly by yourself, then it's not a
concrete solution.
the question is the behavior at the following situation:
you are trying to write data greater than buffer size. the device is
set up as blocking mode. how does write() behave?
if the stream is running, it's blocked. ok, fine.
meanwhile, on the current implementation, if the stream is prepared or
paused, it returns -EPIPE.
this is correct in a certain perspective: the file is not writable,
and unless you change its state, data will be _never_ written.
blocking the operation makes no sense, hence the driver returns an
error. this argument is valid on a single thread program.
however, if the program is multi-threaded the state can be changed in
other thread, then the operation may start in background.
hence, the driver should block. this is the case we faced now.
the behavior of poll() is dependent on the behavior of write().
thus, in the former case, poll() should return POLLERR, while in the
latter case it should block.
i myself prefer to block the operation. it's more intuitive.
if you don't like blocking, then you can open it in the non-blocking
mode. i don't see any other drawbacks.
anyway, i'd like to hear other opinions, too.
ciao,
Takashi
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
next prev parent reply other threads:[~2002-09-12 11:13 UTC|newest]
Thread overview: 49+ 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 [this message]
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
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
2002-09-11 19:04 Why do I get broken pipe on write to a pcm in state PREPARED? Anders Torger
2002-09-11 21:52 ` Tim Goetze
2002-09-12 4:06 ` Anders Torger
2002-09-12 9:08 ` Tim Goetze
-- strict thread matches above, loose matches on Subject: below --
2002-09-11 18:29 Anders Torger
2002-09-11 18:48 ` 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=s5hadmnpik5.wl@alsa2.suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@lists.sourceforge.net \
--cc=pbd@op.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.