From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai 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 Message-ID: References: <20070927.141629.1300548182.anders@netinsight.se> <20071214.113736.1254634191.anders@netinsight.se> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mx1.suse.de (ns.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 0803024506 for ; Fri, 14 Dec 2007 14:57:27 +0100 (CET) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Jaroslav Kysela Cc: Anders =?ISO-8859-1?Q?Bostr=F6m?= , ALSA development , 438118@bugs.debian.org List-Id: alsa-devel@alsa-project.org At Fri, 14 Dec 2007 11:53:11 +0100 (CET), Jaroslav Kysela wrote: > = > On Fri, 14 Dec 2007, Anders Bostr=F6m wrote: > = > > >>>>> "TI" =3D=3D Takashi Iwai 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. W= hy > > >> 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 make= s = > sense - it will return state of stream (-EAGAIN - unfinished) or reset PC= M = > 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