From: Takashi Iwai Subject: Re: SALSA and aplay Date: Fri, 20 Jul 2007 17:06:47 +0200 Message-ID: References: <200707161340.23503.gineera@aspect135.co.uk> <200707201257.07580.gineera@aspect135.co.uk> <200707201620.49675.gineera@aspect135.co.uk> 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 (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 036AD243AD for ; Fri, 20 Jul 2007 17:06:48 +0200 (CEST) In-Reply-To: <200707201620.49675.gineera@aspect135.co.uk> 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: Alan Horstmann Cc: ALSA devel List-Id: alsa-devel@alsa-project.org At Fri, 20 Jul 2007 16:20:49 +0100, Alan Horstmann wrote: > > On Friday 20 July 2007 13:10, you wrote: > > At Fri, 20 Jul 2007 12:57:07 +0100, > > > > Alan Horstmann wrote: > > > > OK. Salsa is performing the same as asound using "hw", except one other > > > perhaps trivial thing I have noticed. The aplay code does > > > err = snd_output_stdio_attach(&log, stderr, 0); > > > and prints things > > > snd_pcm_hw_params_dump(params, log); > > > finishing with > > > snd_output_close(log) > > > In alsa-lib, the third parameter of .._attach is used to set 'close', and > > > being 0, means stderr is not closed. However, with salsa the file is > > > always closed at the end. I am using the aplay code as a function, and > > > on the 2nd call, there are non of the print items. Preventing this close > > > in salsa or the aplay code does remove the problem. Is this intended > > > trimming of functionality for min size? > > > > Ah, that stupid wrapper for FILE I/O. I don't understand why such a > > thing was introduced... > > > > Not sure whether I'll fix it or leave it yet. > > Actually, if my reading of the code is right (which it may not be), in > alsa-lib all that snd_output_close(..) does is close(file) if 'close'=1. > > So if the aplay code does .._attach with 'close'=0, is there any reason to > call snd_output_close(..)? Or just omit that? So probably no fix needed? It frees the internal buffer and allocated records. But for aplay it's not inevitablly necessary. Takashi