From: Takashi Iwai Subject: Re: How to deal with cards with a large on-board buffer? Date: Thu, 04 May 2006 16:49:43 +0200 Message-ID: References: <20060502234125.GC4109@home> <20060504011806.GB6067@home> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <20060504011806.GB6067@home> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Nicolas Boullis Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Thu, 4 May 2006 03:18:06 +0200, Nicolas Boullis wrote: > > Hi, > > On Wed, May 03, 2006 at 02:26:34PM +0200, Takashi Iwai wrote: > > At Wed, 3 May 2006 01:41:25 +0200, Nicolas Boullis wrote: > > > > > > To make it short, the trouble is that, to get correct working, it seems > > > to require that the audio buffer be kept at some minimal fill level. Is > > > there a way I can enforce this? > > > > It's no way because the data is fed from the application. > > If less than watermark (usually equivalent with period size) is > > available, it's simply an underrun. > > Do you mean that userspace applications are expected to always have a > period worth of data available? Then I guess I should force the period > size to be larger than the buffer size... It's controlled via avail_min of snd_pcm_sw_params struct, and it's set to period_size as default. So, in most cases, it's guaranteed that the data is more than period_size -- or falls into an underrun. In theory the driver can refuses the wrong request by apps (avail_min < period_size), but currently there is no callback to the driver for sw_params. I'd suggest to leave as it is right now. If underruns occur too often, something is wrong in another place, e.g. the timing of transfer between HOST and on-chip memories. Takashi ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642