All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Why do I get broken pipe on write to a pcm in state PREPARED?
@ 2002-09-11 19:04 Anders Torger
  2002-09-11 21:52 ` Tim Goetze
  0 siblings, 1 reply; 49+ messages in thread
From: Anders Torger @ 2002-09-11 19:04 UTC (permalink / raw)
  To: alsa-devel


On Wednesday 11 September 2002 20.48, you wrote:
> On Wed, 11 Sep 2002, Anders Torger wrote:
> > I use a RME9652 hammerfall with two periods (the hardware is that
> > way).
> >
> > I watch a file descriptor associated to the output with select(),
> > when it gets ready for writing, I write data to the pcm with
> > snd_pcm_writen(). In the beginning, the state of the pcm is
> > PREPARED.
> >
> > What I would expect then, is that the file descriptor is ready for
> > writing until the two periods has been filled with data, and then
> > select will block (output buffers full, sound card not running).
> > But instead, when the two periods is filled with data, select()
> > still returns and says that the file descriptor is ready for
> > writing, but when calling snd_pcm_writen(), it returns -EPIPE. The
> > pcm state is still PREPARED.
> >
> > What is wrong? Is it me (probably), or is it alsa?
>
> You should also check for POLLERR. I'm not sure, that it's necessary
> to return POLLOUT together with POLLERR in that case. Anyway,
> application should check for POLLERR at first and then write data.

I'm sorry, I don't understand, what would be the error in the above
case? I just want to watch the file descriptor for writing, and expect
that it will be triggered when there is available space in the output
buffer to write to, or, if there is an error, for example broken pipe.
But how could it be broken pipe if the pcm is in state PREPARED? It has
never been put into RUNNING.

The problem here is that the output buffer is full, the pcm is not
RUNNING, but the file descriptor gets triggered anyway. When can that
happen?

/Anders Torger


-------------------------------------------------------
In remembrance
www.osdn.com/911/

^ permalink raw reply	[flat|nested] 49+ messages in thread
* Why do I get broken pipe on write to a pcm in state PREPARED?
@ 2002-09-11 18:29 Anders Torger
  2002-09-11 18:48 ` Jaroslav Kysela
  0 siblings, 1 reply; 49+ messages in thread
From: Anders Torger @ 2002-09-11 18:29 UTC (permalink / raw)
  To: alsa-devel


I use a RME9652 hammerfall with two periods (the hardware is that way).

I watch a file descriptor associated to the output with select(), when 
it gets ready for writing, I write data to the pcm with 
snd_pcm_writen(). In the beginning, the state of the pcm is PREPARED.

What I would expect then, is that the file descriptor is ready for 
writing until the two periods has been filled with data, and then 
select will block (output buffers full, sound card not running). But 
instead, when the two periods is filled with data, select() still 
returns and says that the file descriptor is ready for writing, but 
when calling snd_pcm_writen(), it returns -EPIPE. The pcm state is 
still PREPARED.

What is wrong? Is it me (probably), or is it alsa?

/Anders Torger


-------------------------------------------------------
In remembrance
www.osdn.com/911/

^ permalink raw reply	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2002-10-15 17:05 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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
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

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.