[alsa-devel] No sound with Sony VAIO VPCZ1 (ALC889)

Takashi Iwai tiwai at suse.de
Mon Jul 8 10:04:22 CEST 2013


At Mon, 08 Jul 2013 01:09:55 +0200,
Tormen wrote:
> 
> On 05/07/13 23:38, Adam Williamson wrote:
> > On 2013-07-05 5:29, Takashi Iwai wrote:
> >
> >>> This is the debian 3.9.6 kernel + alsa-compile to get "debug=2" for
> >>> snd.ko module to work as by default the CONFIG_SND_DEBUG is not set in
> >>> debian kernels.
> >>
> >> OK, looking at two outputs, the difference is that the recent kernel
> >> allows the 5.1 output configuration with two mic jacks.  But, this
> >> looks rather strange as a laptop.  Does the machine have really two
> >> microphone jacks?  The BIOS sets pins 0x18 and 0x19 are mic jacks.
> >
> > I feel like this was the issue the LAST time it stopped working, too.
> > No, the system does not have two mic jacks - at least, there is only
> > one visible and accessible to the user on the outside of the case, on
> > my model.
> Actually... there should be three mic channels:
>      The built-in (internal) microphone
>      +
>      One mic jack beside the headphone jack
>      +
>      One other hidden within the headphone jack:
>      (a) the Notebook came with Noise-cancelling headsets, but they are 
> small in-ear plugs so there is no place for noise-cancelling logic in 
> the plugs
>      (b) I think I remember to have read somewhere that this thingy 
> actually needs the windows driver installed to be noise-cancelling!
>      (c) the PLUG of these headphones have another channel (visible 
> through another ring on the jack)
> 
> This explains the 2nd mic channel :)
> 
> In addition, I will try also to verify this plugging the special 
> headphones and watching the alsamixer input meter(s).
> But of course them not showing would not prove anything as the linux 
> driver might just not be setup correctly.

OK, then two mic jacks seem correct.  In that case, the second patch
should be used.

> >> You have three items in "Capture Source", Internal Mic, Mic and Mic 1.
> >> Which inputs are working actually?  If one of the last two is bogus,
> >> we can disable it, then we can the unused pin.  For example, a patch
> >> to disable the pin 0x19 would be like below.
> >
> > I don't have a working kernel on mine at present, but if Tormen can't
> > provide this info soon, I'll track one down and provide it. I expect
> > that one of the latter two inputs must be bogus.
> It's ok I am on it. I started this and now I will see it through until 
> the end (otherwise I would have let you know :).
> 
> Do you need this info for the working kernel only ? Or also for 3.9.6 ?
> I'll test that tomorrow then.
> I also wanted to take a look at the two patches and your explanations 
> about them and test them for you.
> 
> Should they apply well to 3.9.6 ?

Yes, it should be applicable.  But I found one missing piece in my
previous patch.  Try the patch below instead, and let me know if it
works.  Then I'll queue it for the next pull request for 3.11-rc1,
then it'll be backported to stable kernels.


thanks,

Takashi

---
From: Takashi Iwai <tiwai at suse.de>
Subject: [PATCH] ALSA: hda - Add no_multi_io hda_gen_spec flag

We got a bug report about the silent speaker output on Sony VAIO-Z,
and it turned out that the previous workaround for assigning the first
DAC to the speaker pin 0x14 didn't work any longer properly with the
recent code.  The culprit is the handling of multi-I/O capability.

The recent driver allows the multi-I/O 5.1 setup even with two mic
jacks as long as they are placed in the same slot.  This is the case
of VAIO-Z breakage.  It has a secondary mic via a headset, and this
confused the driver as if there are really two mic jacks that are
capable of bidirectional I/O.

For solving this situation, this patch adds yet another flag to
hda_gen_spec indicating that the machine needs no multi-I/O, and sets
this new flag in the exiting fixup for VAIO-Z.

Reported-by: Tormen <my.nl.abos at gmail.com>
Reported-by: Adam Williamson <awilliam at redhat.com>
Cc: <stable at vger.kernel.org> [v3.9+]
Signed-off-by: Takashi Iwai <tiwai at suse.de>
---
 Documentation/sound/alsa/HD-Audio.txt |  2 ++
 sound/pci/hda/hda_generic.c           | 14 ++++++++++----
 sound/pci/hda/hda_generic.h           |  1 +
 sound/pci/hda/patch_realtek.c         |  4 +++-
 4 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/Documentation/sound/alsa/HD-Audio.txt b/Documentation/sound/alsa/HD-Audio.txt
index c3c912d..42a0a39 100644
--- a/Documentation/sound/alsa/HD-Audio.txt
+++ b/Documentation/sound/alsa/HD-Audio.txt
@@ -454,6 +454,8 @@ The generic parser supports the following hints:
 - need_dac_fix (bool): limits the DACs depending on the channel count
 - primary_hp (bool): probe headphone jacks as the primary outputs;
   default true
+- multi_io (bool): try probing multi-I/O config (e.g. shared
+  line-in/surround, mic/clfe jacks)
 - multi_cap_vol (bool): provide multiple capture volumes
 - inv_dmic_split (bool): provide split internal mic volume/switch for
   phase-inverted digital mics
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 8e77cbb..33062ad 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -142,6 +142,9 @@ static void parse_user_hints(struct hda_codec *codec)
 	val = snd_hda_get_bool_hint(codec, "primary_hp");
 	if (val >= 0)
 		spec->no_primary_hp = !val;
+	val = snd_hda_get_bool_hint(codec, "multi_io");
+	if (val >= 0)
+		spec->no_multi_io = !val;
 	val = snd_hda_get_bool_hint(codec, "multi_cap_vol");
 	if (val >= 0)
 		spec->multi_cap_vol = !!val;
@@ -1541,7 +1544,8 @@ static int fill_and_eval_dacs(struct hda_codec *codec,
 					      cfg->speaker_pins,
 					      spec->multiout.extra_out_nid,
 					      spec->speaker_paths);
-			if (fill_mio_first && cfg->line_outs == 1 &&
+			if (!spec->no_multi_io &&
+			    fill_mio_first && cfg->line_outs == 1 &&
 			    cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {
 				err = fill_multi_ios(codec, cfg->line_out_pins[0], true);
 				if (!err)
@@ -1554,7 +1558,7 @@ static int fill_and_eval_dacs(struct hda_codec *codec,
 				   spec->private_dac_nids, spec->out_paths,
 				   spec->main_out_badness);
 
-	if (fill_mio_first &&
+	if (!spec->no_multi_io && fill_mio_first &&
 	    cfg->line_outs == 1 && cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {
 		/* try to fill multi-io first */
 		err = fill_multi_ios(codec, cfg->line_out_pins[0], false);
@@ -1582,7 +1586,8 @@ static int fill_and_eval_dacs(struct hda_codec *codec,
 			return err;
 		badness += err;
 	}
-	if (cfg->line_outs == 1 && cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {
+	if (!spec->no_multi_io &&
+	    cfg->line_outs == 1 && cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {
 		err = fill_multi_ios(codec, cfg->line_out_pins[0], false);
 		if (err < 0)
 			return err;
@@ -1600,7 +1605,8 @@ static int fill_and_eval_dacs(struct hda_codec *codec,
 				check_aamix_out_path(codec, spec->speaker_paths[0]);
 	}
 
-	if (cfg->hp_outs && cfg->line_out_type == AUTO_PIN_SPEAKER_OUT)
+	if (!spec->no_multi_io &&
+	    cfg->hp_outs && cfg->line_out_type == AUTO_PIN_SPEAKER_OUT)
 		if (count_multiio_pins(codec, cfg->hp_pins[0]) >= 2)
 			spec->multi_ios = 1; /* give badness */
 
diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h
index e199a85..48d4402 100644
--- a/sound/pci/hda/hda_generic.h
+++ b/sound/pci/hda/hda_generic.h
@@ -220,6 +220,7 @@ struct hda_gen_spec {
 	unsigned int hp_mic:1; /* Allow HP as a mic-in */
 	unsigned int suppress_hp_mic_detect:1; /* Don't detect HP/mic */
 	unsigned int no_primary_hp:1; /* Don't prefer HP pins to speaker pins */
+	unsigned int no_multi_io:1; /* Don't try multi I/O config */
 	unsigned int multi_cap_vol:1; /* allow multiple capture xxx volumes */
 	unsigned int inv_dmic_split:1; /* inverted dmic w/a for conexant */
 	unsigned int own_eapd_ctl:1; /* set EAPD by own function */
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 8bd2261..7913a2c 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1843,8 +1843,10 @@ static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
 				       const struct hda_fixup *fix, int action)
 {
 	struct alc_spec *spec = codec->spec;
-	if (action == HDA_FIXUP_ACT_PRE_PROBE)
+	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
 		spec->gen.no_primary_hp = 1;
+		spec->gen.no_multi_io = 1;
+	}
 }
 
 static const struct hda_fixup alc882_fixups[] = {
-- 
1.8.3.1



More information about the Alsa-devel mailing list