From: Takashi Iwai Subject: Re: AC97 slot information Date: Mon, 30 Nov 2009 11:03:11 +0100 Message-ID: References: <20091129165058.GA15959@n2100.arm.linux.org.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 mx1.suse.de (cantor.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id B82D024393 for ; Mon, 30 Nov 2009 11:03:11 +0100 (CET) In-Reply-To: <20091129165058.GA15959@n2100.arm.linux.org.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: Russell King - ARM Linux Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Sun, 29 Nov 2009 16:50:58 +0000, Russell King - ARM Linux wrote: > > When opening an AC'97 codec under ALSA using snd_ac97_pcm_open(), > specifying the number of channels desired (2, 4 or 6) is there a > way to read back which slots will be in use? Hm, a quick look through the code, there seems no such way right now. Actually, slots subsets are determined in snd_ac97_pcm_assign(), and the open function just accepts the reduced slots in there. > Currently, in the AACI driver, I use a lookup table to convert from > channels to a slot mask - if this information is already available > from ALSA, I'd much rather use it rather than inventing keeping my > own solution. > > Also, should the 'slots' value passed to snd_ac97_pcm_open() be > those in pcm->r[].slots or should it be selected from the number > of channels? pcm->r[].slots, I suppose. Well, but snd_ac97_pcm_open() behaves a bit differently from what I thought. It doesn't check cfg value (usually the number of channels (2, 4 or 6) is passed) to reduce the assigned slots, so it'll try always the full slots. Then reducing the slots bits in the caller look mandatory right now... Jaroslav, is it the intended behavior, or just a missing piece? thanks, Takashi