From: Takashi Iwai Subject: Re: dsnoop issues Date: Fri, 27 Apr 2007 14:37:39 +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 E94FC24341 for ; Fri, 27 Apr 2007 14:37:39 +0200 (CEST) In-Reply-To: <4631EC14.2060802@btinternet.com> 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: Gordon Miller Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org 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. The blocking mode means that the function waits until the threshold (watermark) condition is fulfilled. Takashi