Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761450AbYHOWB6 (ORCPT ); Fri, 15 Aug 2008 18:01:58 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754375AbYHOWBr (ORCPT ); Fri, 15 Aug 2008 18:01:47 -0400 Received: from py-out-1112.google.com ([64.233.166.176]:8997 "EHLO py-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761273AbYHOWBp (ORCPT ); Fri, 15 Aug 2008 18:01:45 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=JlDwVXTGpPemfsRgDiyRNQXyk4akrtvbVmdXC/y3t7PFRub+28dVgsAl7w7AduCOMq wXYI9TuZrxwntf4yht6MQTpgvL82Z38VuPM8TqUVbjfB/SrFI3wSk5nPc/hyM8x2wK2l O5/7xMgYtYJAWfbgJvjL+ojgj/C7K0hVpyMcw= Message-ID: <6278d2220808151501i207e5cccg733e20b8fa1d227d@mail.gmail.com> Date: Fri, 15 Aug 2008 23:01:42 +0100 From: "Daniel J Blueman" To: "Takashi Iwai" Subject: Re: ALC883 recording troubles... Cc: "Vegard Nossum" , "Romano Giannetti" , "Linux Kernel" In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_66627_5323877.1218837702892" References: <6278d2220806091259t47c9b070v269da0f5855ef014@mail.gmail.com> <6278d2220806111200g4f802885wfc5f0fd6c0405efb@mail.gmail.com> <6278d2220806271705v5bd5fec3l86c3560283063092@mail.gmail.com> <19f34abd0806280311s115062e6vc6d0f304cb744934@mail.gmail.com> <6278d2220806280329j2f77c52dp8fbae78420c136c1@mail.gmail.com> <6278d2220808141210p3c612feen6fe779bc84a4ae78@mail.gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 12203 Lines: 251 ------=_Part_66627_5323877.1218837702892 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Takashi, On Fri, Aug 15, 2008 at 3:42 PM, Takashi Iwai wrote: > At Thu, 14 Aug 2008 20:10:03 +0100, > Daniel J Blueman wrote: >> >> Hi Takashi, >> >> I am still finding this recording +ve saturation on my ALC883 Intel >> HDA sound device with 2.6.27-rc3 (ie ALSA 1.0.17 drivers) and ALSA >> 1.0.16-1 libraries on Ubuntu Intrepid. >> >> The previous workaround still 'gets us out of jail': >> >> # ./hda-verb /dev/snd/hwC0D0 0x23 SET_AMP_GAIN_MUTE 0x7180 >> nid = 0x23, verb = 0x300, param = 0x7180 >> value = 0x0 > > Could you try the patch below? With this patch, unused connections > will be disabled. Let me know if it really works so that I can merge > it to git tree. > > Takashi > > --- > diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c > index 9473abb..6f0485a 100644 > --- a/sound/pci/hda/patch_realtek.c > +++ b/sound/pci/hda/patch_realtek.c > @@ -6442,6 +6442,40 @@ static void alc882_auto_init_analog_input(struct hda_codec *codec) > } > } > > +static void alc882_auto_init_input_src(struct hda_codec *codec) > +{ > + struct alc_spec *spec = codec->spec; > + const struct hda_input_mux *imux = spec->input_mux; > + int c; > + > + for (c = 0; c < spec->num_adc_nids; c++) { > + hda_nid_t conn_list[10]; > + hda_nid_t nid = spec->capsrc_nids[c]; > + int conns, mute, idx, item; > + > + conns = snd_hda_get_connections(codec, nid, conn_list, > + ARRAY_SIZE(conn_list)); > + if (conns < 0) > + continue; > + mute = HDA_AMP_MUTE; > + for (idx = 0; idx < conns; idx++) { > + /* if the current connection is the selected one, > + * unmute it as default - otherwise mute it > + */ > + for (item = 0; item < imux->num_items; item++) { > + if (imux->items[item].index == idx) { > + if (spec->cur_mux[c] == item) > + mute = 0; > + break; > + } > + } > + snd_hda_codec_amp_stereo(codec, nid, HDA_INPUT, > + idx, HDA_AMP_MUTE, mute); > + } > + > + } > +} > + > /* add mic boosts if needed */ > static int alc_auto_add_mic_boost(struct hda_codec *codec) > { > @@ -6496,6 +6530,7 @@ static void alc882_auto_init(struct hda_codec *codec) > alc882_auto_init_multi_out(codec); > alc882_auto_init_hp_out(codec); > alc882_auto_init_analog_input(codec); > + alc882_auto_init_input_src(codec); > if (spec->unsol_event) > alc_sku_automute(codec); > } > @@ -8290,6 +8325,8 @@ static void alc883_auto_init_analog_input(struct hda_codec *codec) > } > } > > +#define alc883_auto_init_input_src alc882_auto_init_input_src > + > /* almost identical with ALC880 parser... */ > static int alc883_parse_auto_config(struct hda_codec *codec) > { > @@ -8320,6 +8357,7 @@ static void alc883_auto_init(struct hda_codec *codec) > alc883_auto_init_multi_out(codec); > alc883_auto_init_hp_out(codec); > alc883_auto_init_analog_input(codec); > + alc883_auto_init_input_src(codec); > if (spec->unsol_event) > alc_sku_automute(codec); > } > @@ -9703,6 +9741,7 @@ static int alc262_parse_auto_config(struct hda_codec *codec) > #define alc262_auto_init_multi_out alc882_auto_init_multi_out > #define alc262_auto_init_hp_out alc882_auto_init_hp_out > #define alc262_auto_init_analog_input alc882_auto_init_analog_input > +#define alc262_auto_init_input_src alc882_auto_init_input_src > > > /* init callback for auto-configuration model -- overriding the default init */ > @@ -9712,6 +9751,7 @@ static void alc262_auto_init(struct hda_codec *codec) > alc262_auto_init_multi_out(codec); > alc262_auto_init_hp_out(codec); > alc262_auto_init_analog_input(codec); > + alc262_auto_init_input_src(codec); > if (spec->unsol_event) > alc_sku_automute(codec); > } > @@ -13382,6 +13422,8 @@ static void alc861vd_auto_init_analog_input(struct hda_codec *codec) > } > } > > +#define alc861vd_auto_init_input_src alc882_auto_init_input_src > + > #define alc861vd_idx_to_mixer_vol(nid) ((nid) + 0x02) > #define alc861vd_idx_to_mixer_switch(nid) ((nid) + 0x0c) > > @@ -13564,6 +13606,7 @@ static void alc861vd_auto_init(struct hda_codec *codec) > alc861vd_auto_init_multi_out(codec); > alc861vd_auto_init_hp_out(codec); > alc861vd_auto_init_analog_input(codec); > + alc861vd_auto_init_input_src(codec); > if (spec->unsol_event) > alc_sku_automute(codec); > } > @@ -14729,6 +14772,8 @@ static void alc662_auto_init_analog_input(struct hda_codec *codec) > } > } > > +#define alc662_auto_init_input_src alc882_auto_init_input_src > + > static int alc662_parse_auto_config(struct hda_codec *codec) > { > struct alc_spec *spec = codec->spec; > @@ -14785,6 +14830,7 @@ static void alc662_auto_init(struct hda_codec *codec) > alc662_auto_init_multi_out(codec); > alc662_auto_init_hp_out(codec); > alc662_auto_init_analog_input(codec); > + alc662_auto_init_input_src(codec); > if (spec->unsol_event) > alc_sku_automute(codec); > } There were a couple of issues: getting the mute logic right from moving the assignment and increasing the number of inputs beyond the 11 required here to avoid the 'Too many connections' message and fixing the last input being skipped. With the updated patch, the problem is fully addressed; no resulting DC offset, so recording quality is great. This seems logically safe and a hopeful for 2.6.27-rc4... The updated patch is against 2.6.27-rc3. Thanks once again, Daniel Signed-off-by: Daniel J Blueman -- Daniel J Blueman ------=_Part_66627_5323877.1218837702892 Content-Type: text/x-patch; name=alc-input-muting.patch Content-Transfer-Encoding: base64 X-Attachment-Id: f_fjxc5i380 Content-Disposition: attachment; filename=alc-input-muting.patch ZGlmZiAtLWdpdCBhL3NvdW5kL3BjaS9oZGEvcGF0Y2hfcmVhbHRlay5jIGIvc291bmQvcGNpL2hk YS9wYXRjaF9yZWFsdGVrLmMKaW5kZXggYWRkNGU4Ny4uMjY3NzliNyAxMDA2NDQKLS0tIGEvc291 bmQvcGNpL2hkYS9wYXRjaF9yZWFsdGVrLmMKKysrIGIvc291bmQvcGNpL2hkYS9wYXRjaF9yZWFs dGVrLmMKQEAgLTY0MzcsNiArNjQzNywzOSBAQCBzdGF0aWMgdm9pZCBhbGM4ODJfYXV0b19pbml0 X2FuYWxvZ19pbnB1dChzdHJ1Y3QgaGRhX2NvZGVjICpjb2RlYykKIAl9CiB9CiAKK3N0YXRpYyB2 b2lkIGFsYzg4Ml9hdXRvX2luaXRfaW5wdXRfc3J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dG9faW5pdF9pbnB1dF9zcmMKKwogc3RhdGljIGludCBhbGM2NjJfcGFyc2VfYXV0 b19jb25maWcoc3RydWN0IGhkYV9jb2RlYyAqY29kZWMpCiB7CiAJc3RydWN0IGFsY19zcGVjICpz cGVjID0gY29kZWMtPnNwZWM7CkBAIC0xNDczMyw2ICsxNDc3Nyw3IEBAIHN0YXRpYyB2b2lkIGFs YzY2Ml9hdXRvX2luaXQoc3RydWN0IGhkYV9jb2RlYyAqY29kZWMpCiAJYWxjNjYyX2F1dG9faW5p dF9tdWx0aV9vdXQoY29kZWMpOwogCWFsYzY2Ml9hdXRvX2luaXRfaHBfb3V0KGNvZGVjKTsKIAlh bGM2NjJfYXV0b19pbml0X2FuYWxvZ19pbnB1dChjb2RlYyk7CisJYWxjNjYyX2F1dG9faW5pdF9p bnB1dF9zcmMoY29kZWMpOwogCWlmIChzcGVjLT51bnNvbF9ldmVudCkKIAkJYWxjX3NrdV9hdXRv bXV0ZShjb2RlYyk7CiB9Cgo= ------=_Part_66627_5323877.1218837702892-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/