From: Takashi Iwai Subject: Re: dsnoop issues Date: Fri, 27 Apr 2007 15:09:10 +0200 Message-ID: References: <4631EC14.2060802@btinternet.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id D11EF2434D for ; Fri, 27 Apr 2007 15:09:10 +0200 (CEST) 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: ALSA development , Gordon Miller List-Id: alsa-devel@alsa-project.org At Fri, 27 Apr 2007 15:00:22 +0200 (CEST), Jaroslav Kysela wrote: > > On Fri, 27 Apr 2007, Takashi Iwai wrote: > > > At Fri, 27 Apr 2007 13:27:00 +0100, > > Gordon Miller wrote: > > > > > > Hi > > > > > > All my snd_pcm_readi calls return too few frames. Also when I switch to > > > stereo, the sound is muted. I cannot change this by adjusting period & > > > buffer sizes. dsnoop is enabled by default. The documentation for > > > snd_pcm_readi says that the only way that the frame count can be short > > > is because of a signal or xrun. Well this clearly isn't the case. > > > > Actually, the documentation is wrong, IMO. The typical behavior of > > read syscall is that it returns a value actually read by that call. > > It doesn't guarantee whether the requested size is filled, and can be > > shorter than requested. As snd_pcm_readi() emulates the read syscall, > > it should behave in that way. > > I don't think so completely. For blocking mode (!O_NONBLOCK), all possible > data should be read. Only signal or an error should break this. > > The read logic for dsnoop is in snd_pcm_read_areas() in pcm/pcm.c > (alsa-lib). In the current implementation, it may work in that way. But, in general, I'm against such a condition. It's not what read syscalls does, so there is no real reason that snd_pcm_readi() should do so. Takashi