[Thinkpad R61i/T61] Lenovo sound chip Conexant CX20549 Venice doesn't work correctly.

Bug #886975 reported by c4pp4 on 2011-11-07
78
This bug affects 18 people
Affects Status Importance Assigned to Milestone
alsa-driver (Ubuntu)
Medium
Unassigned

Bug Description

Computer: IBM Lenovo Thinkpad R61i
Card: HDA Intel
Sound chip: Conexant CX20549 (Venice)
Device: 00:1b.0 Audio device [0403]: Intel Corporation 82801H (ICH8 Family) HD Audio Controller [8086:284b] (rev 03)
 Subsystem: Lenovo ThinkPad T61 [17aa:20ac]
System: Ubuntu Oneiric 11.10 (desktop-i386)
Kernel: 3.0.0-12-generic-pae#20-Ubuntu SMP Fri Oct 7 16:37:17 UTC 2011

Problems:
1) Integrated microphone doesn't work at all because the driver uses node 0x14 instead of 0x15 for integrated mic and node 0x12 instead of 0x14 for external mic.
2) Sound output is muted in the "0% <-> unamplified" part of the volume slider and is working in the "unamplified <-> 100% ->" part only; the driver doesn't allow amplified part because sound is distorted over 0dB of the PCM level so there is no need amplified part of the volume slider.

Solution: Attached patch is fixing nodes of integrated and external microphone and is removing the amplified part of the volume slider.
---
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.24.
ApportVersion: 1.23-0ubuntu4
Architecture: i386
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: Intel [HDA Intel], device 0: CONEXANT Analog [CONEXANT Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: c4pp4 1698 F.... pulseaudio
 /dev/snd/pcmC0D0p: c4pp4 1698 F...m pulseaudio
CRDA: Error: [Errno 2] Adresář nebo soubor neexistuje
Card0.Amixer.info:
 Card hw:0 'Intel'/'HDA Intel at 0xfe100000 irq 48'
   Mixer name : 'Conexant CX20549 (Venice)'
   Components : 'HDA:14f15045,17aa20db,00100100'
   Controls : 19
   Simple ctrls : 10
Card29.Amixer.info:
 Card hw:29 'ThinkPadEC'/'ThinkPad Console Audio Control at EC reg 0x30, fw 7KHT24WW-1.08'
   Mixer name : 'ThinkPad EC 7KHT24WW-1.08'
   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 11.10
HibernationDevice: RESUME=UUID=6e091b39-d59a-4d75-a7c5-dec246d020e5
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release i386 (20111012)
MachineType: LENOVO 89329ZG
Package: linux (not installed)
PccardctlIdent:
 Socket 0:
   no product info available
PccardctlStatus:
 Socket 0:
   no card
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.0.0-12-generic-pae root=UUID=666241df-0a9e-4711-a44e-92d2e6f5eccc ro quiet splash vt.handoff=7
ProcVersionSignature: Ubuntu 3.0.0-12.20-generic-pae 3.0.4
RelatedPackageVersions:
 linux-restricted-modules-3.0.0-12-generic-pae N/A
 linux-backports-modules-3.0.0-12-generic-pae N/A
 linux-firmware 1.60
Tags: oneiric
Uname: Linux 3.0.0-12-generic-pae i686
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare vboxusers
dmi.bios.date: 04/09/2010
dmi.bios.vendor: LENOVO
dmi.bios.version: 7OETC4WW (2.24 )
dmi.board.name: 89329ZG
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:bvr7OETC4WW(2.24):bd04/09/2010:svnLENOVO:pn89329ZG:pvrThinkPadR61/R61i:rvnLENOVO:rn89329ZG:rvrNotAvailable:cvnLENOVO:ct10:cvrNotAvailable:
dmi.product.name: 89329ZG
dmi.product.version: ThinkPad R61/R61i
dmi.sys.vendor: LENOVO

c4pp4 (c4pp4) wrote :

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 886975

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
tags: added: oneiric
c4pp4 (c4pp4) wrote : AcpiTables.txt

apport information

tags: added: apport-collected
description: updated
c4pp4 (c4pp4) wrote : AlsaDevices.txt

apport information

apport information

c4pp4 (c4pp4) wrote : BootDmesg.txt

apport information

apport information

apport information

apport information

c4pp4 (c4pp4) wrote : IwConfig.txt

apport information

c4pp4 (c4pp4) wrote : Lspci.txt

apport information

c4pp4 (c4pp4) wrote : Lsusb.txt

apport information

apport information

apport information

apport information

apport information

apport information

c4pp4 (c4pp4) wrote : PulseSinks.txt

apport information

apport information

c4pp4 (c4pp4) wrote : RfKill.txt

apport information

c4pp4 (c4pp4) wrote : UdevDb.txt

apport information

c4pp4 (c4pp4) wrote : UdevLog.txt

apport information

c4pp4 (c4pp4) wrote : WifiSyslog.txt

apport information

Changed in linux (Ubuntu):
status: Incomplete → New
Brad Figg (brad-figg) on 2011-11-07
Changed in linux (Ubuntu):
status: New → Confirmed
c4pp4 (c4pp4) on 2011-11-07
summary: - Lenovo Conexant CX20549 Venice doesn't work correctly.
+ Lenovo sound chip Conexant CX20549 Venice doesn't work correctly.
description: updated
tags: added: patch

@c4pp4

Is this a new issue, or do you happen to know if this issue existed in prior releases?

c4pp4 (c4pp4) wrote :

@ Joseph Salisbury

The issue #1 (microphone) is known from the time when this computer model comes to market in 2008, the patch I made is from 3/2009. The issue #2 (about unamplified part) is a new from Oneiric but the patch is solving it in its old state, so I have reported the new bug and summarize both issues in one.

c4pp4 (c4pp4) on 2011-11-18
description: updated
c4pp4 (c4pp4) wrote :

Patched Linux Kernel Ubuntu 11.10 - Oneiric Ocelot:
https://launchpad.net/~c4pp4/+archive/ppa

Brad Figg (brad-figg) wrote :

@c4pp4,

1. I have put up test kernels at: http://people.canonical.com/~bradf/lp886975/
    These are the latest Oneiric kernel plus your patch. Please test and make sure
    they resolve your issue.

2. Have you tried to submit your patch upstream to get it into the main kernel tree?

Changed in linux (Ubuntu):
status: Confirmed → Incomplete
c4pp4 (c4pp4) wrote :

I've just upgraded the official oneiric kernel from 3.0.0-13 to 3.0.0-14 and found out that there is a change causing the microphone working finally correctly.
I've searched what happened and here is a possible answer: http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff;h=6b45214277bec2193ad3ccb8d7aa6100b5a0f1a9

Can anybody confirm that microphone is working correctly now?

Eugene Savelov (savelov) wrote :

yes I confirm on Lenovo R61i internal microphone is working with 3.0.0-14-generic kernel. previously I had to use the modified kernel from this bugreport. But as a side note, I noticed that output from earphones connected to the audio-out connector are not working with this kernel

c4pp4 (c4pp4) wrote :

@ Eugene Savelov
Thanks. There are trying to use a new way of autoconfig and it seems it's not ok yet.

c4pp4 (c4pp4) wrote :

@ Brad Figg

1. Yes, I've tested it and it's resolving my issue.
2. No.

Thanks.

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Jan-Pieter Jacobs (jpjacobs) wrote :

Hi, I also had the same problem. I can confirm that the 3.0.0.14-generic kernel fixes (more or less) the microphone problem. Testing with skype, the sound was a bit crackly.

Another thing to notice is that apparently the volume does not scale linearly as would be expected when upping/downing the volume. 4 ticks down from the maximum, the output is to silent too hear (while the slider is at +- 75%).

But anyway, it appears things are finally going in the good direction! Thanks for the effort!

c4pp4 (c4pp4) wrote :

Summary:

Stable kernel 3.0.0-14 is BAD (still issue #2 and regression with headphones)

Brad Figg kernel 3.0.0-15 is OK

Eugene Savelov (savelov) wrote :

I also confirm that with Brag Figg's 3.0.0-15 kernel headphones work correctly, and microphone issue is resolved

c4pp4 (c4pp4) wrote :

I've tried the latest daily live of Precise and headphones works. So there is only (probably) problem with sound muted between 0 and unapmlified part of volume slider now.

Anyway I've updated oneiric ppa.

"Jan-Pieter Jacobs (jpjacobs) wrote on 2011-12-17: #32
Hi, I also had the same problem. I can confirm that the 3.0.0.14-generic kernel fixes (more or less) the microphone problem. Testing with skype, the sound was a bit crackly."

Have you tried my oneiric ppa kernel? There is a crackling Skype sound too?

Brad Figg (brad-figg) wrote :

I've been informed that it is unlikely the patch will be accepted upstream due to use of an "old" model. Can people affected by this issue take a look at: https://wiki.ubuntu.com/Audio/UpgradingAlsa/DKMS and see if that dkms package will address this issue for them?

c4pp4 (c4pp4) wrote :

@Brad Figg

Thank you. The alsa-hda-dkms package has the same behavior as I previously (#35) wrote about Precise version. Microphone OK, headphones OK, volume slider with unamplified part BAD (there is still sound muted).

I've also noted it uses directly a node 0x19 (Audio Output Analog) instead of a node 0x17 (Audio Mixer), but I don't know if it's necessary and has to do with sound quality. I guess that sound going through the node 0x17 is hardware mixed and through the 0x19 is post-mixed by a software driver. As I said I don't know.

I'm going to continue with my ppa because the volume slider problem is quite annoying and I believe the node 0x17 is right way of directing sound production. The "old" model is old but it just works instead of a "modern" autoconfig script.

And I keep that alsa-hda-dkms package installed because it can fill the moment between an official update and update of my ppa version.

c4pp4 (c4pp4) wrote :

Just a note to my last paragraph: It's necessary to uninstall the alsa-hda-dkms package after updating to my ppa kernel version.

c4pp4 (c4pp4) wrote :

Patched Linux Kernel Ubuntu 12.04 LTS - Precise Pangolin:
https://launchpad.net/~c4pp4/+archive/ppa

c4pp4 (c4pp4) wrote :

Please read carefully!

I've changed the way of providing the sound driver. Now I'm using the DKMS framework so there is no need to wait for my updates. Your system will be always updated with the correct sound driver.

I've created a package called 'lenovo-conexant-dkms'. It's a repack of the package provided by Ubuntu Audio Development Team (Brad Figg's link at #36).

I'm still using my old ppa (link at #39) so there is no need to change your repositories. Just install the new package called 'lenovo-conexant-dkms'.

A description of the changes are in my ppa. I've also included some minor upstream changes.

One issue is remaining to resolve. After the updgrade there is still a crackling (popping) sound when rebooting or shutting down the computer although the crackling sound when suspending the computer was eliminated. I'm using the following workaround to also eliminate it:

- fire up Terminal and follow the instructions

- create a script file amixer-master-mute (or download the attached one)
gksudo gedit /etc/init.d/amixer-master-mute

- insert the following code to mute the master mixer
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: amixer-master-mute
# Required-Start:
# Required-Stop:
# Default-Start:
# Default-Stop: 0 6
# Short-Description: Mute the Master mixer
# Description: Mute the Master mixer to avoid
# a crackling (popping) sound
# from the speakers when rebooting
# or shutting down the computer.
### END INIT INFO

case "$1" in
    start)
        ;;
    restart|reload|force-reload)
        echo "Error: argument '$1' not supported" >&2
        exit 3
        ;;
    stop)
        amixer set Master mute > /dev/null
        ;;
    *)
        echo "Usage: $0 start|stop" >&2
        exit 3
        ;;
esac

exit 0

- save the script and set the execute flag on it
sudo chmod 755 /etc/init.d/amixer-master-mute

- set to start the script when rebooting or shutting down the computer (arguments are terminated by ".")
sudo update-rc.d amixer-master-mute start 20 0 6 .

- to remove the workaround
sudo update-rc.d -f amixer-master-mute remove
sudo rm /etc/init.d/amixer-master-mute

affects: linux (Ubuntu) → alsa-driver (Ubuntu)
Changed in alsa-driver (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Incomplete
Changed in alsa-driver (Ubuntu):
status: Incomplete → Confirmed
summary: - Lenovo sound chip Conexant CX20549 Venice doesn't work correctly.
+ [Thinkpad R61i] Lenovo sound chip Conexant CX20549 Venice doesn't work
+ correctly.
summary: - [Thinkpad R61i] Lenovo sound chip Conexant CX20549 Venice doesn't work
- correctly.
+ [Thinkpad R61i/T61] Lenovo sound chip Conexant CX20549 Venice doesn't
+ work correctly.
Changed in alsa-driver (Ubuntu):
status: Confirmed → Incomplete
36 comments hidden view all 116 comments
David Henningsson (diwic) wrote :

Oops, wanted to write something more in that comment:

If you like, you can join the discussion I'm having with upstream (cc:ed into this bug). All I need is your email address to cc you in and you can discuss with Takashi (the upstream maintainer) and me directly.

c4pp4 (c4pp4) wrote :

@David Henningsson

If it's not necessary to join the upstream discussion I'd like to stay over here if you don't mind.

After putting down that initial click noise I discovered a new one and that's why the solution avoids two sorts of click noise. Both had been appearing within the transition to D0. The first one (the initial click noise) was caused by the eapd workaround - not powering down the speaker 0x10 widget within the transition to D3. The second one is quite soft and that's why I didn't noticed it before. It was caused by the small transition time to power up the AFG. It had been appearing at the same time as the initial click noise as well as after the reboot (when on battery power). I read the hda specification and successfully tried to use 75ms delay according to hda specification - "It is permissible for the audio fidelity for analog outputs to be slightly degraded if audio rendering begins immediately once the fully operational state is entered. However, audio fidelity must not be degraded 75ms after the transitioning to D0 state." Now there is no click noise with one exception - when I try to record from D3 state there is a recorded click. I tried to avoid that recorded click but the solution is in extending the time to power up the AFG up to 300ms instead of 75ms. But I think it's too long because the start of sound output is lagging. What do you think about it?

Commentary:
the source is from dkms-hda_0.201212172004~quantal1
---------------------------
patch_conexant.c
---------------------------
+ * Copyright (c) 2006 Pototskiy Alex <email address hidden>
just a typo

+ snd_hda_codec_set_power_to_all(codec, fg, power_state, false);
when transitioning to D3 set eapd_workaround to false because we need to power down the widget - Speaker 0x10, if it's not set it causes the initial click noise

+ msleep(75);
time to power up the AFG to avoid the soft click noise

+ .set_power_state = conexant_set_power,
use conexant power settings for auto model

----------------------
hda_codec.c
----------------------
+ hda_set_power_state(codec, AC_PWRST_D0);
(when on battery power) power up the AFG to avoid the soft click noise when rebooting

Would you rewrite it into the "upstream style"?
Thank you.

c4pp4 (c4pp4) wrote :

@David Henningsson

GUI Sliders DEMO:
- unamplified part bug
- no control of mic bug

http://youtu.be/AZTcPCGejoA

- better to use flash version with quality 720p
- html5 version has bad annotations

I think that solution with unaplified part is AC_VERB_SET_CONNECT_SEL to Audio Mixer (0x10 -> 0x17, 0x11 -> 0x17) instead of Audio Output ( 0x10 -> 0x19, 0x11 -> 0x19) and override the setting of 0x17 Amp-In Caps by snd_hda_override_amp_caps(codec, 0x17, HDA_INPUT, (0x14 << AC_AMPCAP_OFFSET_SHIFT) | (0x14 << AC_AMPCAP_NUM_STEPS_SHIFT) | (0x05 << AC_AMPCAP_STEP_SIZE_SHIFT) | (1 << AC_AMPCAP_MUTE_SHIFT));

c4pp4 (c4pp4) wrote :

@David Henningsson

To resolve the unamplified part bug I changed TLV data for a virtual master volume:

tlv[2] = -nums * step;
tlv[3] = step;

new values:
tlv[2] = -6450;
tlv[3] = 150;

Originally the range of the master volume is from 0db to 10.75db with step 0.25.
After the change the range is from -64.50db to 0db with step 1.50. Now there is no unamplified mark and the slider works all over the length.

-------------------------------------------------------

To resolve the mic control bug I followed your workaround:
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/946232/comments/32
"For those of you who are missing an internal mic port, edit /usr/share/pulseaudio/alsa-mixer/paths/analog-input-internal-mic.conf and comment out all lines that start with "required-any"."

c4pp4 (c4pp4) wrote :
David Henningsson (diwic) wrote :

c4pp4, thanks for your work so far. FYI, I'll be back from holiday at 2nd of Jan 2013. (And depending on workload, might be a few days extra until I'll have time to look at your patches)

c4pp4 (c4pp4) wrote :

@David Henningsson

Take your time, happy Holidays.

David Henningsson (diwic) wrote :

Ok, back. It is easier to try to examine the clicks one at a time. So in priority order, is this correct:

1) The biggest clicks are fixed by the patch in comment #71

2) To second click needs these two to fix:
+ snd_hda_codec_set_power_to_all(codec, fg, power_state, false);
when transitioning to D3 set eapd_workaround to false because we need to power down the widget - Speaker 0x10, if it's not set it causes the initial click noise
+ .set_power_state = conexant_set_power,
use conexant power settings for auto model

3) For the soft click when powering up, have you tried anything between 10 and 75 to see if that also resolves the click? I'm thinking that we should not set a higher latency than absolutely necessary. (And I agree that 300 would likely be too much, better live with the recorded click.)

c4pp4 (c4pp4) wrote :

1) Right.

2) Right.

3) Yes, I have. I guess the number 75 is just a compromise because the click noise is still there but it's hardly audible = more time less audible.
+ msleep(75);
+ else
+ hda_set_power_state(codec, AC_PWRST_D0);

4) GUI Master Volume slider:
+ vmaster_tlv[2] = -6450;
+ vmaster_tlv[3] = 150;

5) GUI Input Volume slider
/usr/share/pulseaudio/alsa-mixer/paths/analog-input-internal-mic.conf
#required-any

On 12/19/2012 11:38 AM, Takashi Iwai wrote:
> At Wed, 19 Dec 2012 11:34:46 +0100,
> David Henningsson wrote:
>>
>> On 12/19/2012 11:24 AM, Takashi Iwai wrote:
>>> At Wed, 19 Dec 2012 09:44:47 +0100,
>>> David Henningsson wrote:
>>>>
>>>> This reverts commit 697c373e34613609cb5450f98b91fefb6e910588.
>>>>
>>>> The original patch was meant to remove clicking, but in fact caused even
>>>> more clicking instead.
>>>>
>>>> Thanks to c4pp4 for doing most of the work with this bug.
>>>>
>>>> BugLink: https://bugs.launchpad.net/bugs/886975
>>>> Signed-off-by: David Henningsson <email address hidden>
>>>> ---
>>>>
>>>> @c4pp4: Is this consistent with what you have done to reduce the clicking?
>>>> Will you recommend upstream Linux to take the patch below?
>>>
>>> So, it shouldn't be merged yet right now?
>>> Now is the last chance for merging it to 3.8-rc1.
>>
>> If we don't have time waiting for c4pp4's confirmation without missing
>> the entire 3.8 cycle, then I think we should merge it.
>
> It's no new feature, so it's fine to merge it at any time during 3.8
> cycle, even after 3.8-rc1.
>
> But such a fix should be merged with Cc to stable, so a bit more tests
> would be better.

Do you have a suggestion on how that should be tested? I have no
conexant machines here currently.

--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic

Takashi Iwai (tiwai) wrote :

At Thu, 03 Jan 2013 17:04:15 +0100,
David Henningsson wrote:
>
> On 12/19/2012 11:38 AM, Takashi Iwai wrote:
> > At Wed, 19 Dec 2012 11:34:46 +0100,
> > David Henningsson wrote:
> >>
> >> On 12/19/2012 11:24 AM, Takashi Iwai wrote:
> >>> At Wed, 19 Dec 2012 09:44:47 +0100,
> >>> David Henningsson wrote:
> >>>>
> >>>> This reverts commit 697c373e34613609cb5450f98b91fefb6e910588.
> >>>>
> >>>> The original patch was meant to remove clicking, but in fact caused even
> >>>> more clicking instead.
> >>>>
> >>>> Thanks to c4pp4 for doing most of the work with this bug.
> >>>>
> >>>> BugLink: https://bugs.launchpad.net/bugs/886975
> >>>> Signed-off-by: David Henningsson <email address hidden>
> >>>> ---
> >>>>
> >>>> @c4pp4: Is this consistent with what you have done to reduce the clicking?
> >>>> Will you recommend upstream Linux to take the patch below?
> >>>
> >>> So, it shouldn't be merged yet right now?
> >>> Now is the last chance for merging it to 3.8-rc1.
> >>
> >> If we don't have time waiting for c4pp4's confirmation without missing
> >> the entire 3.8 cycle, then I think we should merge it.
> >
> > It's no new feature, so it's fine to merge it at any time during 3.8
> > cycle, even after 3.8-rc1.
> >
> > But such a fix should be merged with Cc to stable, so a bit more tests
> > would be better.
>
> Do you have a suggestion on how that should be tested? I have no
> conexant machines here currently.

Well, at best, test 3.8-rc2 with the patch. The content isn't too
intrusive so it should suffice for merge. Alternatively, the tester
can try older kernel with the same patch.

The point is to confirm that the patch really works.

thanks,

Takashi

Raymond (superquad-vortex2) wrote :

> fix-master.patch

does the virtual master really work on CD20549 since

spec->vmaster_nid = spec->private_dac_nids[0];

in cx_auto_parse_output

but the volume control are at pin complex instead of audio output (DAC)

David Henningsson (diwic) wrote :

@Raymond, I think your observation in comment #88 is correct, would you mind writing a patch for that, or do you want me to do it?

David Henningsson (diwic) wrote :

@c4pp4:

Still trying to get 1) through upstream...

The following dkms package contains patch for 1) only, on top of git master. Can you just install it, reboot, and make sure that the 1) click is gone. Thanks.

David Henningsson (diwic) wrote :
c4pp4 (c4pp4) wrote :

@David Henningsson

Would you please make a package for the release 12.10 (quantal) 32-bit - kernel linux 3.5.0-21-generic?

David Henningsson (diwic) wrote :

Here it is, based on Takashi's for-linus branch

c4pp4 (c4pp4) wrote :

I can confirm that the 1) clicks are gone by the attached package.

David Henningsson (diwic) wrote :

On 01/04/2013 09:49 AM, Takashi Iwai wrote:
> At Thu, 03 Jan 2013 17:04:15 +0100,
> David Henningsson wrote:
>>
>> On 12/19/2012 11:38 AM, Takashi Iwai wrote:
>>> At Wed, 19 Dec 2012 11:34:46 +0100,
>>> David Henningsson wrote:
>>>>
>>>> On 12/19/2012 11:24 AM, Takashi Iwai wrote:
>>>>> At Wed, 19 Dec 2012 09:44:47 +0100,
>>>>> David Henningsson wrote:
>>>>>>
>>>>>> This reverts commit 697c373e34613609cb5450f98b91fefb6e910588.
>>>>>>
>>>>>> The original patch was meant to remove clicking, but in fact caused even
>>>>>> more clicking instead.
>>>>>>
>>>>>> Thanks to c4pp4 for doing most of the work with this bug.
>>>>>>
>>>>>> BugLink: https://bugs.launchpad.net/bugs/886975
>>>>>> Signed-off-by: David Henningsson <email address hidden>
>>>>>> ---
>>>>>>
>>>>>> @c4pp4: Is this consistent with what you have done to reduce the clicking?
>>>>>> Will you recommend upstream Linux to take the patch below?
>>>>>
>>>>> So, it shouldn't be merged yet right now?
>>>>> Now is the last chance for merging it to 3.8-rc1.
>>>>
>>>> If we don't have time waiting for c4pp4's confirmation without missing
>>>> the entire 3.8 cycle, then I think we should merge it.
>>>
>>> It's no new feature, so it's fine to merge it at any time during 3.8
>>> cycle, even after 3.8-rc1.
>>>
>>> But such a fix should be merged with Cc to stable, so a bit more tests
>>> would be better.
>>
>> Do you have a suggestion on how that should be tested? I have no
>> conexant machines here currently.
>
> Well, at best, test 3.8-rc2 with the patch. The content isn't too
> intrusive so it should suffice for merge. Alternatively, the tester
> can try older kernel with the same patch.
>
> The point is to confirm that the patch really works.

This has now been confirmed by c4pp4. Please commit the patch.

--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic

Takashi Iwai (tiwai) wrote :

At Wed, 09 Jan 2013 09:36:24 +0100,
David Henningsson wrote:
>
> On 01/04/2013 09:49 AM, Takashi Iwai wrote:
> > At Thu, 03 Jan 2013 17:04:15 +0100,
> > David Henningsson wrote:
> >>
> >> On 12/19/2012 11:38 AM, Takashi Iwai wrote:
> >>> At Wed, 19 Dec 2012 11:34:46 +0100,
> >>> David Henningsson wrote:
> >>>>
> >>>> On 12/19/2012 11:24 AM, Takashi Iwai wrote:
> >>>>> At Wed, 19 Dec 2012 09:44:47 +0100,
> >>>>> David Henningsson wrote:
> >>>>>>
> >>>>>> This reverts commit 697c373e34613609cb5450f98b91fefb6e910588.
> >>>>>>
> >>>>>> The original patch was meant to remove clicking, but in fact caused even
> >>>>>> more clicking instead.
> >>>>>>
> >>>>>> Thanks to c4pp4 for doing most of the work with this bug.
> >>>>>>
> >>>>>> BugLink: https://bugs.launchpad.net/bugs/886975
> >>>>>> Signed-off-by: David Henningsson <email address hidden>
> >>>>>> ---
> >>>>>>
> >>>>>> @c4pp4: Is this consistent with what you have done to reduce the clicking?
> >>>>>> Will you recommend upstream Linux to take the patch below?
> >>>>>
> >>>>> So, it shouldn't be merged yet right now?
> >>>>> Now is the last chance for merging it to 3.8-rc1.
> >>>>
> >>>> If we don't have time waiting for c4pp4's confirmation without missing
> >>>> the entire 3.8 cycle, then I think we should merge it.
> >>>
> >>> It's no new feature, so it's fine to merge it at any time during 3.8
> >>> cycle, even after 3.8-rc1.
> >>>
> >>> But such a fix should be merged with Cc to stable, so a bit more tests
> >>> would be better.
> >>
> >> Do you have a suggestion on how that should be tested? I have no
> >> conexant machines here currently.
> >
> > Well, at best, test 3.8-rc2 with the patch. The content isn't too
> > intrusive so it should suffice for merge. Alternatively, the tester
> > can try older kernel with the same patch.
> >
> > The point is to confirm that the patch really works.
>
> This has now been confirmed by c4pp4. Please commit the patch.

OK, applied now.

Takashi

Luis Henriques (henrix) wrote :

This bug is awaiting verification that the kernel for Quantal in -proposed solves the problem (3.5.0-24.37). Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-quantal' to 'verification-done-quantal'.

If verification is not done by one week from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-quantal
c4pp4 (c4pp4) on 2013-02-12
tags: added: verification-done-quantal
removed: verification-needed-quantal
David Henningsson (diwic) wrote :

Hi c4pp4,

A while has passed and we fixed the worst click as mentioned in 1).

Meanwhile, a big rewrite of the HDA drivers has progressed and is now scheduled to reach kernel 3.9. I ran your codec against that code, and it seems like most of the stuff is fixed:

2) I think the click you mentioned is now fixed, but not sure
4) the master volume range bug is fixed
5) I'm a little confused about this one. It should be fixed in 3.9, but it should also already have been fixed in 12.10 actually.

You can read more about the rewrite here: http://voices.canonical.com/david.henningsson/2013/01/18/upcoming-changes-to-the-intel-hda-drivers/
And here's how to test these drivers: https://wiki.ubuntu.com/Audio/UpgradingAlsa/DKMS

c4pp4 (c4pp4) wrote :

@David Henningsson

Great news, thank you!
Where can I find official patch for 2,4 and 5? What about number 3?

David Henningsson (diwic) wrote :

I think 3) is unchanged/remaining, but not sure.

The upstream tree to look at is: http://git.kernel.org/?p=linux/kernel/git/tiwai/sound.git;a=summary
I currently don't have time to scavenge this tree to find which patches fixes which issues.

c4pp4 (c4pp4) wrote :

I've tried a latest alsa-hda-dkms (Quantal up-to-date).
1) Fixed
2) Not fixed - I'm trying to find out where the problem is because there are a lot of changes in the source code.
3) I can't try it because of 2)
4) Fixed
5) Not fixed (in case that the fix should be applied by the alsa-hda-dkms package, furthermore I'm not sure what is the fix about)

c4pp4 (c4pp4) wrote :

Addition

2) Why it's not fixed:
There was a flag to not power down the widget if it controls eapd, it was called eapd_workaround and was set to true. I found out we need to set it to false to avoid the click #2 because when transitioning to D3 we need to power down the widget - Speaker 0x10 and it controls eapd. Now after changes there is no flag. EAPD part was separated to a new function default_power_filter without any flag to skip that. I've tried to add a new condition and the initial click noise vanished:

--- a/hda_codec.c
+++ b/hda_codec.c
@@ -3763,6 +3763,8 @@
       unsigned int power_state)
 {
  if (power_state == AC_PWRST_D3 &&
+ !((codec->vendor_id == 0x14f15045) &&
+ (codec->subsystem_id == 0x17aa20db)) &&
      get_wcaps_type(get_wcaps(codec, nid)) == AC_WID_PIN &&
      (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)) {
   int eapd = snd_hda_codec_read(codec, nid, 0,

3) Now I can tell it's not fixed

David Henningsson (diwic) wrote :

Ok, thanks for the finding. If default_power_filter does not work, it seems most logical to override default_power_filter entirely, as has been done in this patch. Is this solving click 2) for you?

David Henningsson (diwic) wrote :

For 5) can we recap that a little? I understand the problem is that you don't have an input slider in the GUI, or that it doesn't control the gain? Or that Internal Mic does not show up at all?

Could you run the latest dkms, and attach alsa-info and a pulseaudio log (while the log is on, try to change the internal mic gain)?
https://wiki.ubuntu.com/Audio/AlsaInfo
https://wiki.ubuntu.com/PulseAudio/Log

c4pp4 (c4pp4) wrote :

2) Yes, it's solving it. ("codec->power_filter = NULL;" is avoiding the initial click noise when on battery power)

5)
Internal mic doesn't show up at all. Look at a screenshot here: http://ge.tt/2D2PuQY/v/0
I have to use your workaround to show it up: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/946232/comments/32
Alsainfo: http://www.alsa-project.org/db/?f=091359b9c86fff995dd99c915f5624fe16819f87
PulseAudio Log attached.

David Henningsson (diwic) wrote :

Thanks. I've discovered the problem for 5) - Ubuntu 12.10 is missing this patch:
http://bazaar.launchpad.net/~ubuntu-audio-dev/pulseaudio/ubuntu.precise/view/head:/debian/patches/0624-alsa-mixer-Add-Phantom-Jack-support.patch

I have no idea how I could have missed it for 12.10, I was 100% sure that it was added.

This chip needs the speaker pin to go to D3 to avoid clicks,
so default_power_filter does not work here.

This was found on Thinkpad R61i/T61i but I guess it applies to
the entire chip. If not, quirks should be set for at least
PCI SSID 17aa:20ac.

Thanks to c4pp4 for testing.

BugLink: https://bugs.launchpad.net/bugs/886975
Signed-off-by: David Henningsson <email address hidden>
---
 sound/pci/hda/patch_conexant.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 7d941ef..941bf6c 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -3350,6 +3350,7 @@ static int patch_conexant_auto(struct hda_codec *codec)
  switch (codec->vendor_id) {
  case 0x14f15045:
   codec->single_adc_amp = 1;
+ codec->power_filter = NULL; /* Needs speaker amp to D3 to avoid click */
   break;
  case 0x14f15047:
   codec->pin_amp_workaround = 1;
--
1.7.9.5

Takashi Iwai (tiwai) wrote :

At Thu, 14 Feb 2013 11:36:39 +0100,
David Henningsson wrote:
>
> This chip needs the speaker pin to go to D3 to avoid clicks,
> so default_power_filter does not work here.
>
> This was found on Thinkpad R61i/T61i but I guess it applies to
> the entire chip. If not, quirks should be set for at least
> PCI SSID 17aa:20ac.
>
> Thanks to c4pp4 for testing.
>
> BugLink: https://bugs.launchpad.net/bugs/886975
> Signed-off-by: David Henningsson <email address hidden>

Thanks, applied now.

Just wonder, though, whether rather setting
spec->gen.power_down_unused = 1 works. When it's set, the generic
parser applies the own power filter, and it doesn't have the EAPD
check either (plus it does more aggressive power-down of unused
widgets).

Or, maybe we just drop the EAPD check, and move it to specific fixup.
AFAIK, it was required only for old Gateway laptops.

Takashi

> ---
> sound/pci/hda/patch_conexant.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
> index 7d941ef..941bf6c 100644
> --- a/sound/pci/hda/patch_conexant.c
> +++ b/sound/pci/hda/patch_conexant.c
> @@ -3350,6 +3350,7 @@ static int patch_conexant_auto(struct hda_codec *codec)
> switch (codec->vendor_id) {
> case 0x14f15045:
> codec->single_adc_amp = 1;
> + codec->power_filter = NULL; /* Needs speaker amp to D3 to avoid click */
> break;
> case 0x14f15047:
> codec->pin_amp_workaround = 1;
> --
> 1.7.9.5
>

c4pp4 (c4pp4) wrote :

David, it's because we are no robots, fortunately ;)
Thank you for applying it.

Now there is remaining the last one - number 3. I'd like to ask you if it's in a job queue or something like that.

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.

Brad Figg (brad-figg) on 2013-03-02
tags: added: verification-needed-precise
Brad Figg (brad-figg) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed' to 'verification-done'.

If verification is not done by one week from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

c4pp4 (c4pp4) wrote :

I don't have precise version so someone else would try it.

David Henningsson (diwic) wrote :

@Brad Figg, this came from upstream stable and thus does not require verification.

Luis Henriques (henrix) wrote :

Tagging as verified in Precise as fix came from an upstream stable update (as diwic referred in previous comment).

tags: added: verification-done-precise
removed: verification-needed-precise
c4pp4 (c4pp4) wrote :

Ubuntu 13.04:
1) Fixed
2) Fixed after oem-audio-hda-daily-dkms installation
3) Not fixed
4) Fixed after oem-audio-hda-daily-dkms installation
5) Fixed

ljubisa (ljubisadenik) on 2015-09-02
Changed in alsa-driver (Ubuntu):
status: Incomplete → Confirmed
Daniel van Vugt (vanvugt) wrote :

Thank you for reporting this bug to Ubuntu.
Ubuntu 11.10 (oneiric) reached end-of-life on May 9, 2013.
Ubuntu 13.04 (raring) reached end-of-life on January 27, 2014.
Ubuntu 12.04 (precise) reached end-of-life on April 28, 2017.

See this document for currently supported Ubuntu releases:
https://wiki.ubuntu.com/Releases

We appreciate that this bug may be old and you might not be interested in discussing it any more. But if you are then please upgrade to the latest Ubuntu version and re-test. If you then find the bug is still present in the newer Ubuntu version, please add a comment here telling us which new version it is in and change the bug status to Confirmed.

Changed in alsa-driver (Ubuntu):
status: Confirmed → Won't Fix
Displaying first 40 and last 40 comments. View all 116 comments or add a comment.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.