From mboxrd@z Thu Jan 1 00:00:00 1970 From: Raymond Yau Subject: Re: Problem with VIA VT1708S and git versions of alsa-driver. Date: Mon, 31 Jan 2011 17:22:22 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ew0-f51.google.com (mail-ew0-f51.google.com [209.85.215.51]) by alsa0.perex.cz (Postfix) with ESMTP id 0D847243A7 for ; Mon, 31 Jan 2011 10:22:23 +0100 (CET) Received: by ewy19 with SMTP id 19so2188003ewy.38 for ; Mon, 31 Jan 2011 01:22:22 -0800 (PST) In-Reply-To: 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: ALSA Development Mailing List List-Id: alsa-devel@alsa-project.org 2011/1/29 Mark Goldstein > On Sat, Jan 29, 2011 at 12:53 PM, Mark Goldstein > wrote: > > On Sat, Jan 29, 2011 at 12:42 PM, Mark Goldstein > > wrote: > >> On Sat, Jan 29, 2011 at 11:37 AM, Mark Goldstein > >> wrote: > >>> On Fri, Jan 28, 2011 at 2:47 AM, Raymond Yau > >>> wrote: > >>>> 2011/1/27 Mark Goldstein > >>>> > >>>>> On Thu, Jan 27, 2011 at 11:09 AM, Raymond Yau > >>>>> wrote: > >>>>> > 2011/1/27 Mark Goldstein > >>>>> > > >> > >>> Still trying to figure out why only Rear Mic works while Front Mic does > not. > >> > >> Ok, for some reason Pin-ctls for Front Mic (0x1e) set to VREF Hi-Z. > >> After I set it to VREF 50 using hda-analyser, Front Mic started > >> working. Have to figure out why it is set to Hi-Z. > >> > > > > static void via_auto_init_analog_input(struct hda_codec *codec) > > { > > struct via_spec *spec = codec->spec; > > const struct auto_pin_cfg *cfg = &spec->autocfg; > > unsigned int ctl; > > int i; > > > > for (i = 0; i < cfg->num_inputs; i++) { > > hda_nid_t nid = cfg->inputs[i].pin; > > if (spec->smart51_enabled && is_smart51_pins(spec, nid)) > > ctl = PIN_OUT; > > else if (i == AUTO_PIN_MIC) > > ^^^^^^^^^^^^^^^^^^^^^^^^^ > > ctl = PIN_VREF50; > > else > > ctl = PIN_IN; > > snd_hda_codec_write(codec, nid, 0, > > AC_VERB_SET_PIN_WIDGET_CONTROL, ctl); > > } > > } > > > > Should it probably be > > else if (cfg->input[i].type == AUTO_PIN_MIC) ? > > OK, now it works for me. > So totally there were 3 changes: > 1) setting of PIN control for Mics > 2) shifting the ids in pin_idxs one position to the right > 3) using specialized version of vt_auto_create_analog_input_ctls, that > passes idx - 1 to snd_hda_add_imux_item. > > Well, instead of last two changes it was probably possible to use only > 3rd, but instead of passing idx - 1 to snd_hda_add_imux_item pass idx > + 1 to via_new_analog_input. > > Of course it should be done in more common way, since not only VT1708S > used different indexes for via_new_analog_input and > snd_hda_add_imux_item. > > The reason is assign "Stereo Mix" as first element of input source , In snd_hda_input_mux_put() , imux->items[].index is the position of the pin in the connection list snd_hda_codec_write_cache(codec, nid, 0, AC_VERB_SET_CONNECT_SEL, imux->items[idx].index); if you look at print_codec_info() in hda_proc.c you can get the connection list of imux using snd_hda_get_connections() conn_len = snd_hda_get_connections(codec, nid, conn, HDA_MAX_CONNECTIONS);