Skip to contentSkip to conversation

Conexant 5051 lenovo-x200 fixes

DISCUSSION Ulo Mets 2 participants 15 messages Aug 18, 2011 – Aug 24, 2011

Subsystems (2)
lore
Share & tools
lore

Ulo Mets

author
#0 lore raw

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)

With best regards,

Ulo Mets

Signed-off-by Ulo Mets<umets at osa.pri.ee>

---b/sound/pci/hda/patch_conexant.c 2011-08-01 12:45:32.302640276 +0300
+++ a/sound/pci/hda/patch_conexant.c 2011-08-01 12:50:22.003141176 +0300
@@ -1785,6 +1785,19 @@
{}
};

+static const struct snd_kcontrol_new cxt5051_lenovo_x200_mixers[] = {
+ HDA_CODEC_VOLUME("Int Mic Volume", 0x14, 0x00, HDA_INPUT),
+ HDA_CODEC_MUTE("Int Mic Switch", 0x14, 0x00, HDA_INPUT),
+ HDA_CODEC_VOLUME("Dock Mic Volume", 0x14, 0x01, HDA_INPUT),
+ HDA_CODEC_MUTE("Dock Mic Switch", 0x14, 0x01, HDA_INPUT),
+ HDA_CODEC_VOLUME("Ext Mic Volume", 0x15, 0x00, HDA_INPUT),
+ HDA_CODEC_MUTE("Ext Mic Switch", 0x15, 0x00, HDA_INPUT),
+ HDA_CODEC_VOLUME("Int Mic Boost", 0x1d, 0x00, HDA_INPUT),
+ HDA_CODEC_VOLUME("Dock Mic Boost", 0x17, 0x00, HDA_INPUT),
+ HDA_CODEC_VOLUME("Ext Mic Boost", 0x18, 0x00, HDA_INPUT),
+ {}
+};
+
static const struct snd_kcontrol_new cxt5051_hp_mixers[] = {
HDA_CODEC_VOLUME("Internal Mic Volume", 0x14, 0x00, HDA_INPUT), HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT),
@@ -2055,6 +2079,7 @@
break;
case CXT5051_LENOVO_X200:
spec->init_verbs[0] = cxt5051_lenovo_x200_init_verbs;
+ spec->mixers[0] = cxt5051_lenovo_x200_mixers;
/* Thinkpad X301 does not have S/PDIF wired and no ability
to use a docking station. */
if (codec->subsystem_id == 0x17aa211f)

#1 lore raw

At Thu, 18 Aug 2011 03:45:33 +0300,

Quoted 9 lines · Ulo Mets

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.

Takashi

author
#2 lore raw
Quoted 10 lines · Takashi Iwai

At Thu, 18 Aug 2011 03:45:33 +0300,

Quoted 8 lines · Ulo Mets

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)

Quoted 2 lines

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.
Also, the Dock Microphone is not detected, so I would conclude that for X200T "auto" does not work.

It would be surprising if Auto was better than dedicated model. (X200 and X200T accept
same part numbers for audio card).
The kernel version that I used for this latest testing is 3.0-ARCH

It would be nice to get the mute switches to work as well.

#3 lore raw

At Fri, 19 Aug 2011 03:00:58 +0300,

Quoted 12 lines · Ulo Mets
Quoted 10 lines · Takashi Iwai

At Thu, 18 Aug 2011 03:45:33 +0300,

Quoted 8 lines · Ulo Mets

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)

Quoted 7 lines
Quoted 2 lines

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?

Quoted 2 lines

Also, the Dock Microphone is not detected, so I would conclude that for X200T "auto" does not work.

OK, it means that BIOS doesn't set up the pins for docking-station.

Quoted 3 lines

It would be surprising if Auto was better than dedicated model. (X200 and X200T accept
same part numbers for audio card).

The auto-parser is nowadays much better than the model specific quirks. I'm going to reduce model quirks as much as possible now. So, basically, I won't add a model fix any more unless it's unavoidable. In your case, we'll need to fix pin configurations (like in patch_sigmatel.c or patch_realtek.c) and fix the auto-parser.

Quoted 3 lines

The kernel version that I used for this latest testing is 3.0-ARCH

It would be nice to get the mute switches to work as well.

Which mute switch do you mean exactly?

thanks,

Takashi

author
#4 lore raw
Quoted 15 lines · Takashi Iwai

At Fri, 19 Aug 2011 03:00:58 +0300,

Quoted 13 lines · Ulo Mets
Quoted 12 lines · Takashi Iwai

At Thu, 18 Aug 2011 03:45:33 +0300,

Quoted 8 lines · Ulo Mets

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.

Quoted 8 lines
Quoted 5 lines

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.

Quoted 2 lines
Quoted 1 line

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?

Regards,

Ulo

#5 lore raw

At Sat, 20 Aug 2011 18:14:20 +0300,

Quoted 23 lines · Ülo Mets
Quoted 20 lines · Takashi Iwai

At Fri, 19 Aug 2011 03:00:58 +0300,

Quoted 18 lines · Ulo Mets
Quoted 10 lines · Takashi Iwai

At Thu, 18 Aug 2011 03:45:33 +0300,

Quoted 8 lines · Ulo Mets

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)

Quoted 2 lines

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.

Quoted 4 lines
Quoted 3 lines

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.

Quoted 6 lines
Quoted 2 lines
Quoted 1 line

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 :)
But you can figure out almost all things in the codec proc file.

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.

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.

When you finish figuring out these pins, please let me know.

Takashi
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

author
#6 lore raw
Quoted 30 lines · Takashi Iwai

At Sat, 20 Aug 2011 18:14:20 +0300,

Quoted 22 lines · Ülo Mets
Quoted 20 lines · Takashi Iwai

At Fri, 19 Aug 2011 03:00:58 +0300,

Quoted 18 lines · Ulo Mets
Quoted 10 lines · Takashi Iwai

At Thu, 18 Aug 2011 03:45:33 +0300,

Quoted 8 lines · Ulo Mets

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)

Quoted 2 lines

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.

Quoted 4 lines
Quoted 3 lines

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.

Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
Quoted 1 line

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. BTW, the chip revision in question is -15Z

Quoted 1 line

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.

Quoted 3 lines

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

Quoted 5 lines

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.

Quoted 3 lines

When you finish figuring out these pins, please let me know.

Takashi

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#7 lore raw

At Tue, 23 Aug 2011 14:32:21 +0300,

Quoted 32 lines · Ulo Mets
Quoted 30 lines · Takashi Iwai

At Sat, 20 Aug 2011 18:14:20 +0300,

Quoted 22 lines · Ülo Mets
Quoted 20 lines · Takashi Iwai

At Fri, 19 Aug 2011 03:00:58 +0300,

Quoted 18 lines · Ulo Mets
Quoted 10 lines · Takashi Iwai

At Thu, 18 Aug 2011 03:45:33 +0300,

Quoted 8 lines · Ulo Mets

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)

Quoted 2 lines

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.

Quoted 4 lines
Quoted 3 lines

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.

Quoted 8 lines
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
Quoted 1 line

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.

Quoted 1 line

BTW, the chip revision in question is -15Z

It should be compatible no matter which revision is.

Quoted 8 lines
Quoted 1 line

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.

Quoted 3 lines

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.

Quoted 6 lines
Quoted 5 lines

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 <[email protected]>
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.

---
 sound/pci/hda/patch_conexant.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
sound/pci/hda/patch_conexant.c +10 -3
index 502fc94..4c462c3 100644
@@ -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)
Signature · 6 lines
1.7.6

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
author
#8 lore raw
Quoted 78 lines · Takashi Iwai

At Tue, 23 Aug 2011 14:32:21 +0300,

Quoted 31 lines · Ulo Mets
Quoted 30 lines · Takashi Iwai

At Sat, 20 Aug 2011 18:14:20 +0300,

Quoted 22 lines · Ülo Mets
Quoted 20 lines · Takashi Iwai

At Fri, 19 Aug 2011 03:00:58 +0300,

Quoted 18 lines · Ulo Mets
Quoted 10 lines · Takashi Iwai

At Thu, 18 Aug 2011 03:45:33 +0300,

Quoted 8 lines · Ulo Mets

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)

Quoted 2 lines

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.

Quoted 4 lines
Quoted 3 lines

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.

Quoted 8 lines
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
Quoted 1 line

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.

Quoted 1 line

BTW, the chip revision in question is -15Z

It should be compatible no matter which revision is.

Quoted 8 lines
Quoted 1 line

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.

Quoted 3 lines

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.

Quoted 6 lines
Quoted 5 lines

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
----------------------------------------------------------------

Quoted 7 lines

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.

I only replaced the snd-hda-codec-conexant module, I hope this is enough. Loading of x200t-pincfg and BIOS autoconfig was reported in syslog.

There is only one difference from the stock module with model=auto:
in the new version the dock headphone is correctly adjusted with headphone volume, while in stock version it is adjusted by speaker volume.

The right side headphone is adjusted with headphone control in both cases, and also the speaker is muted properly.

The microphone autosensing does not work, the internal microphone remains active when cables are plugged to either of mic jacks.
The dock microphone is not seen by the mixer (alsamixer).

Is there anything specific that I can test or do?

with best regards,

Ulo

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

author
#9 lore raw
In reply to Takashi Iwai
Quoted 14 lines · Takashi Iwai

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
----------------------------------------------------------------

Quoted 7 lines

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.

Please disregard my last message.
I amended the x200t-pincfg file with [codec] section and added [pincfg] header, now it works much better.

In Rec screen of Alsamixer all three mic volume and boost controls are present. Autosensing of Dock Mic works, and so do its controls. Internal mic works too, but autosensing of Ext mic does not.
(Internal Mic Boost is so long name that it does not want to fit in its space)

In Playback screen the three Mic Boost controls are present, which is perhaps not necessary. There is also an Auto-Mute Mode on/off control, which does not seem to do anything. The headphone sensing and controls work as expected.

Regards,

Ulo

#10 lore raw

At Wed, 24 Aug 2011 06:25:58 +0300,

Quoted 20 lines · Ulo Mets
Quoted 18 lines · Takashi Iwai

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.

Quoted 5 lines
Quoted 3 lines

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

Please disregard my last message.
I amended the x200t-pincfg file with [codec] section and added [pincfg] header, now it works much better.

Oh yeah, sorry, I forgot to add that.

Quoted 3 lines

In Rec screen of Alsamixer all three mic volume and boost controls are present. Autosensing of Dock Mic works, and so do its controls. Internal mic works too, but autosensing of Ext mic does not.

Does ext-mic pin (0x18) jack-sense work with hda-emu at all? When this pin is selected, the recording is done via another ADC (0x15) instead of the one for int-mic and dock-mic (0x14). Try to reopen the recording stream when you plug the ext-mic. It might be a bug in the dynamic ADC-switching of the running stream.

Quoted 3 lines

(Internal Mic Boost is so long name that it does not want to fit in its space)

In Playback screen the three Mic Boost controls are present, which is perhaps not necessary.

This is an issue in alsa-lib (and remaining intentionally), no driver problem.

Quoted 1 line

There is also an Auto-Mute Mode on/off control, which does not seem to do anything.

It should change the headphone auto-mute behavior. The speaker will be always turned on.

thanks,

Takashi

#11 lore raw

At Wed, 24 Aug 2011 07:53:00 +0200,

Quoted 10 lines · Takashi Iwai
Quoted 4 lines

In Rec screen of Alsamixer all three mic volume and boost controls are present. Autosensing of Dock Mic works, and so do its controls. Internal mic works too, but autosensing of Ext mic does not.

Does ext-mic pin (0x18) jack-sense work with hda-emu at all? When this pin is selected, the recording is done via another ADC (0x15) instead of the one for int-mic and dock-mic (0x14). Try to reopen the recording stream when you plug the ext-mic. It might be a bug in the dynamic ADC-switching of the running stream.

The patch below should fix the ADC-switching behavior.

Takashi

---
From: Takashi Iwai <[email protected]>
Subject: [PATCH] ALSA: hda/conexant - Enable ADC-switching for auto-mic mode,
too

The ADC-switching can work also in the auto-mic mode, too.

---
 sound/pci/hda/patch_conexant.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/pci/hda/patch_conexant.c +1 -1
index 4c462c3..5616444 100644
@@ -3866,7 +3866,7 @@ static void cx_auto_parse_input(struct hda_codec *codec)
 	}
 	if (imux->num_items >= 2 && cfg->num_inputs == imux->num_items)
 		cx_auto_check_auto_mic(codec);
-	if (imux->num_items > 1 && !spec->auto_mic) {
+	if (imux->num_items > 1) {
 		for (i = 1; i < imux->num_items; i++) {
 			if (spec->imux_info[i].adc != spec->imux_info[0].adc) {
 				spec->adc_switching = 1;
Signature · 1 line
1.7.6
author
#12 lore raw
Quoted 11 lines · Takashi Iwai

At Wed, 24 Aug 2011 07:53:00 +0200,

Quoted 8 lines · Takashi Iwai
Quoted 3 lines

In Rec screen of Alsamixer all three mic volume and boost controls are present. Autosensing of Dock Mic works, and so do its controls. Internal mic works too, but autosensing of Ext mic does not.

Does ext-mic pin (0x18) jack-sense work with hda-emu at all? When this pin is selected, the recording is done via another ADC (0x15) instead of the one for int-mic and dock-mic (0x14). Try to reopen the recording stream when you plug the ext-mic. It might be a bug in the dynamic ADC-switching of the running stream.

The patch below should fix the ADC-switching behavior.

Thank you so much! Recording side works also great now.
The only remaining issue seems to be that the Auto-Mute Mode control
has no effeect on speaker muting. It is always muted.
The speaker mute button on the keyboard also mutes the speaker, and the volume buttons unmute it. The Beep volume also works, but Beep mute only affects the treble content of the beep.

And then the most important part: in proc file, both Dock connectors are described as black, and the Dock Mic location states "at sep Left", while it should be "sep Rear" I believe.

If you need to test anything else on X200t, or T420, I'll be happy to help.

Thanks once more!
With best regards,

Ulo

#13 lore raw

At Wed, 24 Aug 2011 14:26:51 +0300,

Quoted 12 lines · Ulo Mets
Quoted 10 lines · Takashi Iwai

At Wed, 24 Aug 2011 07:53:00 +0200,

Quoted 8 lines · Takashi Iwai
Quoted 3 lines

In Rec screen of Alsamixer all three mic volume and boost controls are present. Autosensing of Dock Mic works, and so do its controls. Internal mic works too, but autosensing of Ext mic does not.

Does ext-mic pin (0x18) jack-sense work with hda-emu at all? When this pin is selected, the recording is done via another ADC (0x15) instead of the one for int-mic and dock-mic (0x14). Try to reopen the recording stream when you plug the ext-mic. It might be a bug in the dynamic ADC-switching of the running stream.

Quoted 5 lines
Quoted 1 line

The patch below should fix the ADC-switching behavior.

Thank you so much! Recording side works also great now.
The only remaining issue seems to be that the Auto-Mute Mode control
has no effeect on speaker muting. It is always muted.
The speaker mute button on the keyboard also mutes the speaker, and the volume buttons unmute it.

It might be the thinkpad_acpi stuff? Some ThinkPads have another layer of the speaker-mute, and it works independently from the sound device.

Quoted 4 lines

The Beep volume also works, but Beep mute only affects the treble content of the beep.

And then the most important part: in proc file, both Dock connectors are described as black, and the Dock Mic location states "at sep Left", while it should be "sep Rear" I believe.

It doesn't matter as long as it works. You can rotate the device :) If it's important, just adjust the pin-config value as you like.

Takashi

#14 lore raw

At Wed, 24 Aug 2011 13:58:27 +0200,

Quoted 24 lines · Takashi Iwai

At Wed, 24 Aug 2011 14:26:51 +0300,

Quoted 12 lines · Ulo Mets
Quoted 10 lines · Takashi Iwai

At Wed, 24 Aug 2011 07:53:00 +0200,

Quoted 8 lines · Takashi Iwai
Quoted 3 lines

In Rec screen of Alsamixer all three mic volume and boost controls are present. Autosensing of Dock Mic works, and so do its controls. Internal mic works too, but autosensing of Ext mic does not.

Does ext-mic pin (0x18) jack-sense work with hda-emu at all? When this pin is selected, the recording is done via another ADC (0x15) instead of the one for int-mic and dock-mic (0x14). Try to reopen the recording stream when you plug the ext-mic. It might be a bug in the dynamic ADC-switching of the running stream.

Quoted 5 lines
Quoted 1 line

The patch below should fix the ADC-switching behavior.

Thank you so much! Recording side works also great now.
The only remaining issue seems to be that the Auto-Mute Mode control
has no effeect on speaker muting. It is always muted.
The speaker mute button on the keyboard also mutes the speaker, and the volume buttons unmute it.

It might be the thinkpad_acpi stuff? Some ThinkPads have another layer of the speaker-mute, and it works independently from the sound device.

Quoted 7 lines
Quoted 4 lines

The Beep volume also works, but Beep mute only affects the treble content of the beep.

And then the most important part: in proc file, both Dock connectors are described as black, and the Dock Mic location states "at sep Left", while it should be "sep Rear" I believe.

It doesn't matter as long as it works. You can rotate the device :) If it's important, just adjust the pin-config value as you like.

FWIW, the patch below is the implementation of static configuration. With this, the driver should work as is (at least for 3.1 kernel). For 3.0 kernel, you'd need to pass model=auto.

Takashi

---
From: Takashi Iwai <[email protected]>
Subject: [PATCH] ALSA: hda - Rewrite Lenovo X200 quirk with pincfg-fix using
auto-parser

Introduce the pincfg table to patch_conexant.c for fixing up the extra pin-configuration for auto-parser. As an example, Lenovo X200 model is replaced with this new mechanism. (This also fixes the wrong mixer elements for docking-station I/O in the previous model quirk automagically.)

---
 Documentation/sound/alsa/HD-Audio-Models.txt |    1 -
 sound/pci/hda/patch_conexant.c               |   93 ++++++++++++++------------
 2 files changed, 50 insertions(+), 44 deletions(-)
Documentation/sound/alsa/HD-Audio-Models.txt +0 -1
index 57e80eb..7085436 100644
@@ -237,7 +237,6 @@ Conexant 5051
   hp-dv6736	HP dv6736
   hp-f700	HP Compaq Presario F700
   ideapad	Lenovo IdeaPad laptop
-  lenovo-x200	Lenovo X200 laptop
   toshiba	Toshiba Satellite M300
 
 Conexant 5066
sound/pci/hda/patch_conexant.c +50 -43

135 lines not on this page · raw message

Signature · 1 line
1.7.6