From: Takashi Iwai Subject: Re: [PATCH V3 1/5] sound: asoc: Adding support for STA529 Audio Codec Date: Fri, 15 Apr 2011 11:27:29 +0200 Message-ID: References: <1302499804-24386-1-git-send-email-rajeev-dlh.kumar@st.com> <1302499804-24386-2-git-send-email-rajeev-dlh.kumar@st.com> <20110411145621.GA26769@opensource.wolfsonmicro.com> <20110414141936.GD31985@qtel.sh.intel.com> <20110414142845.GE31985@qtel.sh.intel.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 (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id D58DE1038F0 for ; Fri, 15 Apr 2011 11:27:29 +0200 (CEST) In-Reply-To: <20110414142845.GE31985@qtel.sh.intel.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: Lu Guanqun Cc: "alsa-devel@alsa-project.org" , Mark Brown , Rajeev Kumar , "lrg@slimlogic.co.uk" List-Id: alsa-devel@alsa-project.org At Thu, 14 Apr 2011 22:28:45 +0800, Lu Guanqun wrote: > > On Thu, Apr 14, 2011 at 10:19:36PM +0800, Lu Guanqun wrote: > > On Thu, Apr 14, 2011 at 05:54:11PM +0800, Takashi Iwai wrote: > > > At Mon, 11 Apr 2011 07:56:22 -0700, > > > Mark Brown wrote: > > > > > > > > > +static const struct snd_kcontrol_new sta529_new_snd_controls[] = { > > > > > + SOC_ENUM("pwm select", pwm_src_enum), > > > > > + SOC_ENUM("mode select", mode_src_enum), > > > > > +}; > > > > > > > > ALSA control names are idiomatically things like "PWM Select" with > > > > capitalisation. > > > > > > Actually, the capital words are no mandatory requirement (although > > > it's conventionally so). It's just alsa-mixer grouping rule that > > > requires the capital words "Play", "Capture", "Volume", "Switch", > > > etc. > > > > Hi Takashi, > > > > Where can I find these alsa-mixer grouping rule? > > So that I can obey these rules and make them appear in the right view in > > alsamixer. > > Hi Takashi, > > I'm reading this comment from file `sound/aoa/codecs/tas.c`: > > /* If we name this 'Input Source', it properly shows up in > * alsamixer as a selection, * but it's shown under the > * 'Playback' category. > * If I name it 'Capture Source', it shows up in strange > * ways (two bools of which one can be selected at a > * time) but at least it's shown in the 'Capture' > * category. > * I was told that this was due to backward compatibility, > * but I don't understand then why the mangling is *not* > * done when I name it "Input Source"..... > */ > > I'm wondering what's the story behind? Can you shed some lights? In alsa-mixer abstraction, the "Capture Source" enum control is split over multiple switches (a switch per enum item). This was a historical design at the time SoundBlaster is still standard. One of the problems with this abstraction is that it can't handle multiple capture-source controls. So, many drivers use nowadays "Input Source" control instead. But, in the earlier alsa-lib, this wasn't handled as the capture control, thus it appears as a global (both directional) control in alsamixer. Now, this control is handled as a capture control in alsa-lib, so the appearance is corrected. Takashi