All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Ulo Mets <umets@osa.pri.ee>
Cc: alsa-devel@alsa-project.org
Subject: Re: Conexant 5051 lenovo-x200 fixes
Date: Tue, 23 Aug 2011 15:10:48 +0200	[thread overview]
Message-ID: <s5hhb58p92f.wl%tiwai@suse.de> (raw)
In-Reply-To: <4E538FC5.5020600@osa.pri.ee>

At Tue, 23 Aug 2011 14:32:21 +0300,
Ulo Mets wrote:
> 
> On 8/22/2011 3:00 PM, Takashi Iwai wrote:
> > At Sat, 20 Aug 2011 18:14:20 +0300,
> > Ülo Mets wrote:
> >> On 08/19/2011 08:43 AM, Takashi Iwai wrote:
> >>
> >>> At Fri, 19 Aug 2011 03:00:58 +0300,
> >>> Ulo Mets wrote:
> >>>> On 08/18/2011 01:08 PM, Takashi Iwai wrote:
> >>>>> At Thu, 18 Aug 2011 03:45:33 +0300,
> >>>>> Ulo Mets wrote:
> >>>>>> Hi,
> >>>>>> I am not a kernel developer, but occasionally dig into it if something gets in my way.
> >>>>>> On Lenovo X200 Tablet none of the mixers showed Mic Boost adjustments, but HDA-Analyzer found them
> >>>>>> and adjusted properly. So I inserted the corresponding controls, and it worked.
> >>>>>> Then, during testing I found that the labels of External and Docking Mic are swapped,
> >>>>>> so I exchanged these too. Since I could not test it on other hardware, I put it all on lenovo-x200 branch.
> >>>>>> The patch applies to 3.1-rc2, I hope it is sufficiently recent.
> >>>>>> The Mic Switches don't have any effect on my unit (X200T without modem)
> >>>>> Could you try model=auto instead of patching?
> >>>>> The recent auto-parser should work better.
> >>>> Model=auto seems to give a very generic configuration, which indeed does
> >>>> include working
> >>>> Mic boost for Internal Mic. (Ext?) Mic Boost and gain are also present,
> >>>> but jack sensing does not work,
> >>>> so these cannot be tested.
> >>> The automatic mic-switch by jack-sensing works without model=auto,
> >>> right?  Then we need to fix it.  Could you give alsa-info.sh output?
> >>>
> >> Right. The alsa-info.sh output is attached.
> > Thanks.
> >
> >>>> It would be nice to get the mute switches to work as well.
> >>> Which mute switch do you mean exactly?
> >> I see the "Mic Switch" controls in the input nodes 0x14 and 0x15, and some Mute controls
> >>
> >> with hda-analyzer. But it may well be just wishful thinking. I wonder if anybody has seen the
> >> datasheet of CX20561?
> > Google is your friend :)
> Is that so? I'll give you $100 for a set of keywords that leads to the datasheet.

Then it has been removed.  Ask Conexant if you still need it.

> BTW, the chip revision in question is -15Z

It should be compatible no matter which revision is.

> > But you can figure out almost all things in the codec proc file.
> Yes, the Pin Defaults are correct in the proc file, and the control names in 0x14 and 0x15 contradict these.
> That's why it was so easy to fix.
> 
> > What you should test is to check which I/O the pins 0x16, 0x17, 0x18
> > and 0x19 correspond.  I suppose 0x16 = HP, 0x17 = mic-jack, 0x18 =
> > dock-mic, 0x19 = dock-HP.
> Almost. 0x16 = HP, 0x17 = dock-mic, 0x18 = ext-mic, 0x19 = dock-HP

OK.

> > An easy way would be to test the jack-detection via hda-verb.
> > 	# hda-verb /dev/snd/hwC0D0 0x16 GET_PIN_SENSE 0
> >
> > When any jack corresponds to the pin 0x16, it'll report 0x80000000
> > upon plugged.
> Nice tool. But ver. 0.3 reports 0xffffffff when plugged and 0x7fffffff when unplugged.

It doesn't matter.  The only meaningful bit is the bit 31.

For making auto-parser working, apply the patch below.
It fixes the multi-headphone assignment case.

Then, put lines below to /lib/firmware/x200t-pincfg file.

----------------------------------------------------------------
0x16 0x042140ff
0x17 0x23a11040
0x18 0x04a190f0
0x19 0x2121103f
0x1a 0x901701f0
0x1d 0x90a601f0
----------------------------------------------------------------

After creating the file, pass "patch=x200t-pincfg model=auto" module
options to snd-hda-intel driver.  Now the driver will be set up using
the auto-parser with the given pin-configuration table.

Let me know if this works.  Once after confirming it's working, we can
add a static configuration in the driver itself.


thanks,

Takashi

---
From: Takashi Iwai <tiwai@suse.de>
Subject: [PATCH] ALSA: hda - Fix double-headphone/speaker paths for Cxt
 auto-parser

When multiple headphones or speakers are assigned but no individual
DACs are available, the driver should take the first HP/SPK DAC instead
of another primary output.  The patch adds a bit-flag to dac field of
struct pin_dac_pair indicating that it's a slave DAC.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/pci/hda/patch_conexant.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 502fc94..4c462c3 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -3348,6 +3348,8 @@ static hda_nid_t get_unassigned_dac(struct hda_codec *codec, hda_nid_t pin,
 
 #define MAX_AUTO_DACS	5
 
+#define DAC_SLAVE_FLAG	0x8000	/* filled dac is a slave */
+
 /* fill analog DAC list from the widget tree */
 static int fill_cx_auto_dacs(struct hda_codec *codec, hda_nid_t *dacs)
 {
@@ -3379,6 +3381,8 @@ static int fill_dacs_for_pins(struct hda_codec *codec, hda_nid_t *pins,
 		filled[nums].pin = pins[i];
 		filled[nums].type = type;
 		filled[nums].dac = get_unassigned_dac(codec, pins[i], dacs, rest);
+		if (!filled[nums].dac && i > 0 && filled[0].dac)
+			filled[nums].dac = filled[0].dac | DAC_SLAVE_FLAG;
 		nums++;
 	}
 	return nums;
@@ -3407,7 +3411,7 @@ static void cx_auto_parse_output(struct hda_codec *codec)
 	/* fill multiout struct */
 	for (i = 0; i < nums; i++) {
 		hda_nid_t dac = spec->dac_info[i].dac;
-		if (!dac)
+		if (!dac || (dac & DAC_SLAVE_FLAG))
 			continue;
 		switch (spec->dac_info[i].type) {
 		case AUTO_PIN_LINE_OUT:
@@ -4035,6 +4039,8 @@ static void cx_auto_init_output(struct hda_codec *codec)
 		nid = spec->dac_info[i].dac;
 		if (!nid)
 			nid = spec->multiout.dac_nids[0];
+		else if (nid & DAC_SLAVE_FLAG)
+			nid &= ~DAC_SLAVE_FLAG;
 		select_connection(codec, spec->dac_info[i].pin, nid);
 	}
 	if (spec->auto_mute) {
@@ -4191,7 +4197,8 @@ static int cx_auto_build_output_controls(struct hda_codec *codec)
 	for (i = 0; i < spec->dac_info_filled; i++) {
 		const char *label;
 		int idx, type;
-		if (!spec->dac_info[i].dac)
+		hda_nid_t dac = spec->dac_info[i].dac;
+		if (!dac || (dac & DAC_SLAVE_FLAG))
 			continue;
 		type = spec->dac_info[i].type;
 		if (type == AUTO_PIN_LINE_OUT)
@@ -4211,7 +4218,7 @@ static int cx_auto_build_output_controls(struct hda_codec *codec)
 			idx = num_spk++;
 			break;
 		}
-		err = try_add_pb_volume(codec, spec->dac_info[i].dac,
+		err = try_add_pb_volume(codec, dac,
 					spec->dac_info[i].pin,
 					label, idx);
 		if (err < 0)
-- 
1.7.6

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2011-08-23 13:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-18  0:45 Conexant 5051 lenovo-x200 fixes Ulo Mets
2011-08-18 10:08 ` Takashi Iwai
2011-08-19  0:00   ` Ulo Mets
2011-08-19  5:43     ` Takashi Iwai
2011-08-20 15:14       ` Ülo Mets
2011-08-22 12:00         ` Takashi Iwai
2011-08-23 11:32           ` Ulo Mets
2011-08-23 13:10             ` Takashi Iwai [this message]
2011-08-24  2:45               ` Ulo Mets
2011-08-24  3:25               ` Ulo Mets
2011-08-24  5:53                 ` Takashi Iwai
2011-08-24  8:59                   ` Takashi Iwai
2011-08-24 11:26                     ` Ulo Mets
2011-08-24 11:58                       ` Takashi Iwai
2011-08-24 16:33                         ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hhb58p92f.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=umets@osa.pri.ee \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.