From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Goldstein Subject: Re: Problem with VIA VT1708S and git versions of alsa-driver. Date: Sat, 29 Jan 2011 14:42:43 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-yx0-f179.google.com (mail-yx0-f179.google.com [209.85.213.179]) by alsa0.perex.cz (Postfix) with ESMTP id 91ECB2444B for ; Sat, 29 Jan 2011 13:43:04 +0100 (CET) Received: by yxs7 with SMTP id 7so1649064yxs.38 for ; Sat, 29 Jan 2011 04:43:03 -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 Cc: ALSA Development Mailing List List-Id: alsa-devel@alsa-project.org 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) > { > =A0 =A0 =A0 =A0struct via_spec *spec =3D codec->spec; > =A0 =A0 =A0 =A0const struct auto_pin_cfg *cfg =3D &spec->autocfg; > =A0 =A0 =A0 =A0unsigned int ctl; > =A0 =A0 =A0 =A0int i; > > =A0 =A0 =A0 =A0for (i =3D 0; i < cfg->num_inputs; i++) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0hda_nid_t nid =3D cfg->inputs[i].pin; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (spec->smart51_enabled && is_smart51_pi= ns(spec, nid)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ctl =3D PIN_OUT; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else if (i =3D=3D AUTO_PIN_MIC) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0^^^^^^^^^^^^^^^^^^^^^^= ^^^ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ctl =3D PIN_VREF50; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ctl =3D PIN_IN; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0snd_hda_codec_write(codec, nid, 0, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AC= _VERB_SET_PIN_WIDGET_CONTROL, ctl); > =A0 =A0 =A0 =A0} > } > > Should it probably be > else if (cfg->input[i].type =3D=3D 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. -- = Mark Goldstein