Ubuntu

[Thinkpad W520] headset microphone controlled by dock mic path

Reported by Jamie Strandboge on 2012-08-16
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Medium
David Henningsson
Quantal
Medium
David Henningsson

Bug Description

I'm not sure what package this should be targeted to, so feel free to reassign.

I upgraded my main system to Quantal earlier in the week. I have a headset with a microphone and headphones that I use with my laptop, which has a headphone and microphone jack. On earlier releases when attending a meeting, I would plug the headphones into the headphones jack and the mic into the microphone jack and both would work without issue. In 12.10, only the headphone works automatically.

Using gnome-control-center's sound settings, I observe on the output tab:
 * plugging in the headphone causes 'Play sound through' to change to 'Headphones'
 * unplugging the headphones cause 'Play sound through' to change to 'Speakers'

Using gnome-control-center's sound settings, I observe on the input tab (notice there is no change-- it always says to use the Build-in Audio):
 * plugging in the microphone causes 'Record sound through' to change to 'Microphone - Built-in Audio'
 * unplugging the microphone causes 'Record sound through' to change to 'Microphone - Built-in Audio'

Looking in alsamixer, pressing 'F4: [Capture]' I see settings for 'Doc Mic' and 'Internal Mic' (and Boosts for each). I observe:
 * plugging in the microphone causes no change in 'Doc Mic'. It's levels are '0' and it is not set to capture. I can't find a way to enable 'CAPTURE" in alsamixer
 * unplugging the microphone causes 'Internal Mic' to display 'CAPTURE' in red, with levels at 100/78

Looking in pavucontrol, and clicking 'Input Devices', I can select a 'Port'. The 'Microphone' port is displayed by default. However I am able to force levels with this. When the microphone is plugged in, the 'Microphone' port (internal mic) does not record. If I change the port to be 'Dock Microphone', I can record. Furthermore, after making this change in pavucontrol, I observe in alsamixer that the 'Doc Mic' is now setup for 'CAPTURE' with levels at 96/96. If I unplug the microphone and plug it back in, I must manually pick the port in pavucontrol to have the mic work again.

What appears to be happening is that everything works fine for the internal speakers and mic. Everything works fine when I plug in the headphones. When I unplug the microphone, the headset mic ('Doc Mic') is automatically set to not capture and the internal mic is. When I plug the headset, the internal mic is set to not capture, but the 'Doc Mic' is not set to capture. pavucontrol allows me to force using the 'Doc Mic'.

WORKAROUND: after plugging in the headset microphone, launch pavucontrol, go to 'Input Devices' and select the 'Dock Microphone' port.

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: gnome-control-center 1:3.4.2-0ubuntu8
ProcVersionSignature: Ubuntu 3.5.0-10.10-generic 3.5.1
Uname: Linux 3.5.0-10-generic x86_64
ApportVersion: 2.4-0ubuntu6
Architecture: amd64
Date: Thu Aug 16 10:22:59 2012
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110425.2)
SourcePackage: gnome-control-center
UpgradeStatus: Upgraded to quantal on 2012-08-13 (2 days ago)
---
ApportVersion: 2.5.2-0ubuntu4
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: jamie 2915 F.... pulseaudio
DistroRelease: Ubuntu 12.10
HibernationDevice: RESUME=UUID=c4c5dbc0-d41a-428d-8af4-b680b67dd3dc
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110425.2)
Lsusb:
 Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
 Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 Bus 002 Device 003: ID 046d:c01b Logitech, Inc. MX310 Optical Mouse
MachineType: LENOVO 5129CTO
Package: linux (not installed)
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.5.0-15-generic root=UUID=88689ad2-74b5-442c-9290-8ae60b63e16b ro quiet splash vt.handoff=7
ProcVersionSignature: Ubuntu 3.5.0-15.23-generic 3.5.4
RelatedPackageVersions:
 linux-restricted-modules-3.5.0-15-generic N/A
 linux-backports-modules-3.5.0-15-generic N/A
 linux-firmware 1.94
RfKill:
 0: phy0: Wireless LAN
  Soft blocked: no
  Hard blocked: no
Tags: quantal running-unity quantal running-unity
Uname: Linux 3.5.0-15-generic x86_64
UpgradeStatus: Upgraded to quantal on 2012-08-13 (42 days ago)
UserGroups: adm admin cdrom dialout kvm libvirtd lpadmin plugdev sambashare sbuild
dmi.bios.date: 02/24/2011
dmi.bios.vendor: LENOVO
dmi.bios.version: 6QET64WW (1.34 )
dmi.board.name: 5129CTO
dmi.board.vendor: LENOVO
dmi.board.version: Not Available
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: Not Available
dmi.modalias: dmi:bvnLENOVO:bvr6QET64WW(1.34):bd02/24/2011:svnLENOVO:pn5129CTO:pvrThinkPadX201s:rvnLENOVO:rn5129CTO:rvrNotAvailable:cvnLENOVO:ct10:cvrNotAvailable:
dmi.product.name: 5129CTO
dmi.product.version: ThinkPad X201s
dmi.sys.vendor: LENOVO

Jamie Strandboge (jdstrand) wrote :
tags: added: rls-q-incoming
removed: release-q-incoming
Sebastien Bacher (seb128) wrote :

gnome-control-center didn't change between precise and quantal but pulseaudio got a major update recently so let's assume it's a pulseaudio issue

affects: gnome-control-center (Ubuntu) → pulseaudio (Ubuntu)
Didier Roche (didrocks) wrote :

Luke, can you please have a look on that one?

Changed in pulseaudio (Ubuntu):
assignee: nobody → Luke Yelavich (themuso)
importance: Undecided → Medium
tags: removed: rls-q-incoming
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pulseaudio (Ubuntu):
status: New → Confirmed
Jeff Campbell (jeff-soupbowl) wrote :

I'm seeing this same issue on Ubuntu 12.04 64bit on a Lenovo W520.

The WORKAROUND fixes my issue also (Selecting "Dock Microphone" from pavucontrol)

 affects ubuntu/pulseaudio
 assignee diwic

Please run apport-collect 1037642 so we can get some hardware info. Please also get a log as per https://wiki.ubuntu.com/PulseAudio/Log.

I might also have to defer to David Henningssen, as he is the resident jack detection expert, since hde has done more along those lines than I have, and understands how that works much better than I do.

Changed in pulseaudio (Ubuntu):
assignee: Luke Yelavich (themuso) → David Henningsson (diwic)

Ok, setting to incomplete while waiting for Jamie to provide either apport-collect or alsa-info (see https://wiki.ubuntu.com/Audio/AlsaInfo ), or Jeff to provide alsa-info.

Btw, are you sure it is 'Doc Mic' and not 'Dock Mic'? (Note the different spellings) The name is wrong nonetheless if it's not on a docking station (which I assume it is not), but would be good to confirm.

Changed in pulseaudio (Ubuntu Quantal):
status: Confirmed → Incomplete

AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.24.
ApportVersion: 2.0.1-0ubuntu13
Architecture: amd64
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: PCH [HDA Intel PCH], device 0: CONEXANT Analog [CONEXANT Analog]
   Subdevices: 0/1
   Subdevice #0: subdevice #0
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC1: jcampbell 2291 F.... pulseaudio
 /dev/snd/controlC0: jcampbell 2291 F.... pulseaudio
 /dev/snd/pcmC0D0c: jcampbell 2291 F...m pulseaudio
 /dev/snd/pcmC0D0p: jcampbell 2291 F...m pulseaudio
Card0.Amixer.info:
 Card hw:0 'PCH'/'HDA Intel PCH at 0xd5320000 irq 22'
   Mixer name : 'Conexant CX20590'
   Components : 'HDA:14f1506e,17aa21cf,00100002 HDA:14f12c06,17aa2122,00100000'
   Controls : 21
   Simple ctrls : 11
Card1.Amixer.info:
 Card hw:1 'NVidia'/'HDA NVidia at 0xd3000000 irq 17'
   Mixer name : 'Nvidia GPU 14 HDMI/DP'
   Components : 'HDA:10de0014,10de0101,00100100'
   Controls : 24
   Simple ctrls : 4
Card29.Amixer.info:
 Card hw:29 'ThinkPadEC'/'ThinkPad Console Audio Control at EC reg 0x30, fw unknown'
   Mixer name : 'ThinkPad EC (unknown)'
   Components : ''
   Controls : 1
   Simple ctrls : 1
Card29.Amixer.values:
 Simple mixer control 'Console',0
   Capabilities: pswitch pswitch-joined penum
   Playback channels: Mono
   Mono: Playback [on]
DistroRelease: Ubuntu 12.04
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
NonfreeKernelModules: nvidia
Package: pulseaudio
PackageArchitecture: amd64
ProcVersionSignature: Ubuntu 3.2.0-30.48-generic 3.2.27
Tags: precise running-unity
Uname: Linux 3.2.0-30-generic x86_64
UpgradeStatus: Upgraded to precise on 2012-04-25 (147 days ago)
UserGroups: adm admin androiddev cdrom dialout lpadmin plugdev sambashare vboxusers
dmi.bios.date: 11/02/2011
dmi.bios.vendor: LENOVO
dmi.bios.version: 8BET54WW (1.34 )
dmi.board.asset.tag: Not Available
dmi.board.name: 427637U
dmi.board.vendor: LENOVO
dmi.board.version: Not Available
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: Not Available
dmi.modalias: dmi:bvnLENOVO:bvr8BET54WW(1.34):bd11/02/2011:svnLENOVO:pn427637U:pvrThinkPadW520:rvnLENOVO:rn427637U:rvrNotAvailable:cvnLENOVO:ct10:cvrNotAvailable:
dmi.product.name: 427637U
dmi.product.version: ThinkPad W520
dmi.sys.vendor: LENOVO

tags: added: apport-collected precise

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

Changed in pulseaudio (Ubuntu Quantal):
status: Incomplete → Confirmed

On the Thinkpad W520 - and probably several other machines with
Conexant 506x chips - the Dock Mic and Mic are connected to the
same two selector nodes. This patch will make Dock Mic take one
selector node and Mic take the other, when possible.

Without the patch, both paths would take the first selector,
leading to the normal Mic's volume being controlled by
"Dock Mic Boost".
(On other machines, this could instead fixup similar problems between
Mic and Line In, for example.)

BugLink: https://bugs.launchpad.net/bugs/1037642
Signed-off-by: David Henningsson <email address hidden>
---

I asked for alsa-info on this one but got Ubuntu apport info instead,
see e g
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1037642/+attachment/3323954/+files/Card0.Codecs.codec.0.txt

In general I guess this could be sent to stable but it always feels scary
when it's generic code :-) what do you think?

 sound/pci/hda/patch_conexant.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index b871b013..c03d3b8 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -3540,8 +3540,9 @@ static int __select_input_connection(struct hda_codec *codec, hda_nid_t mux,
          hda_nid_t pin, hda_nid_t *srcp,
          bool do_select, int depth)
 {
+ struct conexant_spec *spec = codec->spec;
  hda_nid_t conn[HDA_MAX_NUM_INPUTS];
- int i, nums;
+ int startidx, i, nums;

  switch (get_wcaps_type(get_wcaps(codec, mux))) {
  case AC_WID_AUD_IN:
@@ -3565,14 +3566,25 @@ static int __select_input_connection(struct hda_codec *codec, hda_nid_t mux,
  depth++;
  if (depth == 2)
   return -1;
+
+ /* Try to rotate around connections to avoid one boost controlling
+ another input path as well */
+ startidx = 0;
+ for (i = 0; i < spec->private_imux.num_items; i++)
+ if (spec->imux_info[i].pin == pin) {
+ startidx = i;
+ break;
+ }
+
  for (i = 0; i < nums; i++) {
- int ret = __select_input_connection(codec, conn[i], pin, srcp,
+ int j = (i + startidx) % nums;
+ int ret = __select_input_connection(codec, conn[j], pin, srcp,
            do_select, depth);
   if (ret >= 0) {
    if (do_select)
     snd_hda_codec_write(codec, mux, 0,
- AC_VERB_SET_CONNECT_SEL, i);
- return i;
+ AC_VERB_SET_CONNECT_SEL, j);
+ return j;
   }
  }
  return -1;
--
1.7.9.5

Thanks Jeff,

I was able to reproduce your problem in the emulator and come up with a fix. I just sent it upstream, let's see what Takashi says about it.

affects: pulseaudio (Ubuntu Quantal) → linux (Ubuntu Quantal)
Changed in linux (Ubuntu Quantal):
status: Confirmed → In Progress
summary: - headset microphone no longer detected and therefore won't record
+ [Thinkpad W520] headset microphone no longer detected and therefore
+ won't record
summary: - [Thinkpad W520] headset microphone no longer detected and therefore
- won't record
+ [Thinkpad W520] headset microphone controlled by dock mic path
Takashi Iwai (tiwai) wrote :

At Thu, 20 Sep 2012 15:41:21 +0200,
David Henningsson wrote:
>
> On the Thinkpad W520 - and probably several other machines with
> Conexant 506x chips - the Dock Mic and Mic are connected to the
> same two selector nodes. This patch will make Dock Mic take one
> selector node and Mic take the other, when possible.
>
> Without the patch, both paths would take the first selector,
> leading to the normal Mic's volume being controlled by
> "Dock Mic Boost".
> (On other machines, this could instead fixup similar problems between
> Mic and Line In, for example.)
>
> BugLink: https://bugs.launchpad.net/bugs/1037642
> Signed-off-by: David Henningsson <email address hidden>

Applied now, thanks.

> ---
>
> I asked for alsa-info on this one but got Ubuntu apport info instead,
> see e g
> https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1037642/+attachment/3323954/+files/Card0.Codecs.codec.0.txt
>
> In general I guess this could be sent to stable but it always feels scary
> when it's generic code :-) what do you think?

I think it doesn't need to be in stable in this case, as this will
result in the mixer element renames. If anything is missing, it'd be
good to fix in stable. But, this is a mis-assigned name, but still
controllable.

Takashi

>
> sound/pci/hda/patch_conexant.c | 20 ++++++++++++++++----
> 1 file changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
> index b871b013..c03d3b8 100644
> --- a/sound/pci/hda/patch_conexant.c
> +++ b/sound/pci/hda/patch_conexant.c
> @@ -3540,8 +3540,9 @@ static int __select_input_connection(struct hda_codec *codec, hda_nid_t mux,
> hda_nid_t pin, hda_nid_t *srcp,
> bool do_select, int depth)
> {
> + struct conexant_spec *spec = codec->spec;
> hda_nid_t conn[HDA_MAX_NUM_INPUTS];
> - int i, nums;
> + int startidx, i, nums;
>
> switch (get_wcaps_type(get_wcaps(codec, mux))) {
> case AC_WID_AUD_IN:
> @@ -3565,14 +3566,25 @@ static int __select_input_connection(struct hda_codec *codec, hda_nid_t mux,
> depth++;
> if (depth == 2)
> return -1;
> +
> + /* Try to rotate around connections to avoid one boost controlling
> + another input path as well */
> + startidx = 0;
> + for (i = 0; i < spec->private_imux.num_items; i++)
> + if (spec->imux_info[i].pin == pin) {
> + startidx = i;
> + break;
> + }
> +
> for (i = 0; i < nums; i++) {
> - int ret = __select_input_connection(codec, conn[i], pin, srcp,
> + int j = (i + startidx) % nums;
> + int ret = __select_input_connection(codec, conn[j], pin, srcp,
> do_select, depth);
> if (ret >= 0) {
> if (do_select)
> snd_hda_codec_write(codec, mux, 0,
> - AC_VERB_SET_CONNECT_SEL, i);
> - return i;
> + AC_VERB_SET_CONNECT_SEL, j);
> + return j;
> }
> }
> return -1;
> --
> 1.7.9.5
>

apport information

description: updated

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

Jamie Strandboge (jdstrand) wrote :
David Henningsson (diwic) wrote :

@Jamie, thanks. You're both having the same bug/root cause, so as of today it should be fixed in upstream trunk (see https://wiki.ubuntu.com/Audio/UpgradingAlsa/DKMS

tags: added: rls-q-incoming
tags: removed: rls-q-incoming
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 3.5.0-16.24

---------------
linux (3.5.0-16.24) quantal-proposed; urgency=low

  [ Andy Whitcroft ]

  * SAUCE: ata_piix: add a disable_driver option
    - LP: #994870

  [ Christian König ]

  * (pre-stable) drm/radeon: make 64bit fences more robust v3 (3.5 stable)
    - LP: #1029582

  [ David Henningsson ]

  * SAUCE: ALSA: hda - use both input paths on Conexant auto parser
    - LP: #1037642
  * SAUCE: ALSA: hda - fix control names for multiple speaker out on
    IDT/STAC
    - LP: #1046734

  [ Herton Ronaldo Krzesinski ]

  * SAUCE: ALSA: hda/via - don't report presence on HPs with no presence
    support
    - LP: #1052499
  * SAUCE: ext4: fix crash when accessing /proc/mounts concurrently
    - LP: #1053019
  * SAUCE: ALSA: hda/realtek - Fix detection of ALC271X codec
    - LP: #1006690

  [ Kyle Fazzari ]

  * SAUCE: input: Cypress PS/2 Trackpad fix disabling tap-to-click
    - LP: #1048816

  [ Leann Ogasawara ]

  * [Config] Disable CONFIG_DRM_AST
    - LP: #1053290

  [ Stefan Bader ]

  * [Config] Disable the Cirrus QEMU drm driver
    - LP: #1038055

  [ Upstream Kernel Changes ]

  * Revert "KVM: VMX: Fix KVM_SET_SREGS with big real mode segments"
    - LP: #1045027
  * x86, efi: Handover Protocol
  * drm/i915: HDMI - Clear Audio Enable bit for Hot Plug
    - LP: #1056729
  * UBUNTU SAUCE: apparmor: fix IRQ stack overflow
    - LP: #1056078
  * drm/nouveau: fix booting with plymouth + dumb support
    - LP: #1043518
  * ALSA: hda - Add DeviceID for Haswell HDA
    - LP: #1057698
  * ALSA: hda - add Haswell HDMI codec id
    - LP: #1057698
  * ALSA: hda - Fix driver type of Haswell controller to AZX_DRIVER_SCH
    - LP: #1057698
  * ALSA: hda_intel: Add Device IDs for Intel Lynx Point-LP PCH
    - LP: #1011438, #1057698

  [ Wang Xingchao ]

  * SAUCE: ALSA: hda - Add another pci id for Haswell board
    - LP: #1057698

  [ Wen-chien Jesse Sung ]

  * SAUCE: drm/i915: Explicitly disable RC6 for certain models
    - LP: #1002170, #1008867
 -- Leann Ogasawara <email address hidden> Thu, 27 Sep 2012 13:55:52 -0700

Changed in linux (Ubuntu Quantal):
status: In Progress → Fix Released
Jamie Strandboge (jdstrand) wrote :

I can confirm that this is now working correctly again. Thanks!

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

To post a comment you must log in.