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: Tue, 09 Oct 2007 12:38:12 +0200 Message-ID: References: <20070918.094148.-529052212.anders@netinsight.se> <20070927.141629.1300548182.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 (mail.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id C36C6103832 for ; Tue, 9 Oct 2007 12:38:14 +0200 (CEST) In-Reply-To: <20070927.141629.1300548182.anders@netinsight.se> 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: Anders =?ISO-8859-1?Q?Bostr=F6m?= Cc: alsa-devel@alsa-project.org, 438118@bugs.debian.org List-Id: alsa-devel@alsa-project.org At Thu, 27 Sep 2007 14:16:29 +0200 (CEST), Anders Bostr=F6m wrote: > = > >>>>> "TI" =3D=3D Takashi Iwai writes: > = > TI> At Tue, 18 Sep 2007 09:41:48 +0200 (CEST), > TI> Anders Bostr=F6m wrote: > >> = > >> >>>>> "TI" =3D=3D Takashi Iwai writes: > >> = > >> >> can one please have a lokk at this? aplay -N isn't working for the > >> >> OP. > >> = > TI> Cannot reproduce here. Could you _post_ more details? > >> = > >> OK, I've tested more, and discovered that the problem seems to be that > >> the end of the sound is cut in non-blocking mode. And if I play a very > >> short sound-file, I can't hear anything. Blocking mode works fine. > >> = > >> When using non-blocking mode, an strace contains "ioctl(4, 0x4144, > >> 0x2b9f785d8000) =3D -1 EAGAIN (Resource temporarily > >> unavailable)". Blocking mode never contains the EAGAIN response. > >> = > >> I attach two files. When playing halt.au, I can only hear the start, > >> about as much as "ha". When playing metal.au, I can't hear anything. > = > 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? Yes, that's my opinion, too. This particular ioctl is to block the operation, so it should be allowed as long as it's called. But I vaguely remember that we discussed about it, and the current form is the result of that. Namely, we can call snd_pcm_nonblock(FALSE) explicitly before calling snd_pcm_drain(). Though, I prefer fixing the behavior in the core side to allow the blocking with this call... Any reasonable objections in mind? Takashi