From: Takashi Iwai Subject: Re: snd_pcm_hw_params_get_xxx question Date: Wed, 07 Nov 2007 13:24:04 +0100 Message-ID: References: <174059.99030.qm@web36509.mail.mud.yahoo.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 mx1.suse.de (mx1.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id A143224526 for ; Wed, 7 Nov 2007 16:30:05 +0100 (CET) In-Reply-To: <174059.99030.qm@web36509.mail.mud.yahoo.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: Ben C Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Tue, 6 Nov 2007 18:21:01 -0800 (PST), Ben C wrote: > > Hello, > > I'm trying to develop an external PCM plugin. I'm calling snd_pcm_hw_params_get_xxx functions to retrieve some values. I got everything to work as expected on alsa-lib 1.0.15. However the client's setup is 1.0.13, and I don't think they want to upgrade. > > For 1.0.13, everything compiled and linked fine after some minor changes. But when I called say snd_pcm_hw_params_get_rate(hw, &val, &dir), I was expecting the return value to be a status, and val to contain "44100" which was the case for 1.0.15. However for 1.0.13, val is 0, but returned status = 44100? > > I looked in the header files, and 1.0.13 seems to be the same as 1.0.15 in regards to this function. Am I accidentally using some sort of old API that was intended for backward compatibility? If so, what should I do to use the "new" API's? Yes, it sounds like you're accessing the old API. Do you use libasound from a module? If it's used from a module, the module itself should be built once with link to libasound. For example, $(CC) -shared -o MODULE.so -lasound In such a way, the properly versioned symbol is chosen. The weak link results in the old API. This is irrelveant whether it's ALSA 1.0.13 or 1.0.15. Takashi