Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Jaroslav Kysela <perex@perex.cz>
Cc: "Anders Boström" <anders@netinsight.se>,
	"ALSA development" <alsa-devel@alsa-project.org>,
	438118@bugs.debian.org
Subject: Re: [Pkg-alsa-devel] Bug#438118: alsa-utils: aplay non-blocking mode isn't working
Date: Fri, 14 Dec 2007 13:41:07 +0100	[thread overview]
Message-ID: <s5hprx95tzw.wl%tiwai@suse.de> (raw)
In-Reply-To: <Pine.LNX.4.61.0712141143320.8243@tm8103.perex-int.cz>

At Fri, 14 Dec 2007 11:53:11 +0100 (CET),
Jaroslav Kysela wrote:
> 
> On Fri, 14 Dec 2007, Anders Boström wrote:
> 
> > >>>>> "TI" == Takashi Iwai <tiwai@suse.de> writes:
> > 
> >  TI> OK, thanks, I see the problem now.
> >  >> 
> >  TI> I don't remember whether it's a feature or a bug.  The drain ioctl
> >  TI> rejects the non-block mode.
> >  >> 
> >  >> I can understand the idea here, that in non-blocking mode, no call
> >  >> should block, ever. But on the other hand, if you call the drain
> >  >> ioctl, you probably expect it to work, even in non-blocking mode. Why
> >  >> would you otherwise call it?
> > 
> >  TI> Yes, that's my opinion, too.  This particular ioctl is to block the
> >  TI> operation, so it should be allowed as long as it's called.
> > 
> >  TI> But I vaguely remember that we discussed about it, and the current
> >  TI> form is the result of that.  Namely, we can call
> >  TI> snd_pcm_nonblock(FALSE) explicitly before calling snd_pcm_drain().
> > 
> >  TI> Though, I prefer fixing the behavior in the core side to allow the
> >  TI> blocking with this call...  Any reasonable objections in mind?
> > 
> > Any progress in including a solotion to this bug in mainstream
> > alsa & linux kernel? Has anything been done? The patch works fine for
> > me...
> 
> I think that this proposal breaks basic posix rules.

AFAIK, O_NONBLOCK doesn't define the behavior of each ioctl on POSIX
at all.  Some standard POSIX-defined ioctls block even with O_NONBLOCK
indeed.

> Application should 
> change blocking state itself. And non-blocking snd_pcm_drain() still makes 
> sense - it will return state of stream (-EAGAIN - unfinished) or reset PCM 
> state to SETUP in case when all data are played.

Well, this can be kept as is, but it's a bit weird (and silly)
behavior.  Anyway, we'll need fix this bug in our own codes in
alsa-utils first :)


Takashi

      reply	other threads:[~2007-12-14 13:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070815.153103.-1470506910.anders@netinsight.se>
     [not found] ` <20070815172821.GB7381@frodo.home.lxtec.de>
     [not found]   ` <20070816.094636.-753684517.anders@netinsight.se>
2007-09-11 16:08     ` [Pkg-alsa-devel] Bug#438118: alsa-utils: aplay non-blocking mode isn't working Elimar Riesebieter
2007-09-17 15:20       ` Takashi Iwai
2007-09-18  7:41         ` Bug#438118: [alsa-devel] " Anders Boström
2007-09-18 15:45           ` Takashi Iwai
2007-09-27 12:16             ` Bug#438118: [alsa-devel] " Anders Boström
2007-10-09 10:38               ` Takashi Iwai
2007-12-14 10:37                 ` Anders Boström
2007-12-14 10:53                   ` Jaroslav Kysela
2007-12-14 12:41                     ` Takashi Iwai [this message]

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=s5hprx95tzw.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=438118@bugs.debian.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=anders@netinsight.se \
    --cc=perex@perex.cz \
    /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