p5n32e-plus HDA Nvidia AD1988B microphone input not working

Bug #776964 reported by Adrian Wilkins
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Low
Andy Whitcroft
Natty
Fix Committed
Low
Andy Whitcroft

Bug Description

Upstream bug at
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=5368

Before installing Natty, had previously suffered with bug #593018 (only works after switching to another input setting and back) for several releases.

Now that I've installed Natty, the workaround no longer functions, I cannot get the mic input working regardless of how I manipulate the input settings via the sound preferences or alsamixer. This now blocks certain productive uses of the sound hardware (Skype calling, principally).

Would be interested to see if original reporter also has noted this so I shall subscribe him (perhaps he can test it with a Live distribution).
---
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.23.
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: adrian 1487 F.... pulseaudio
 /dev/snd/pcmC0D0p: adrian 1487 F...m pulseaudio
Card0.Amixer.info:
 Card hw:0 'NVidia'/'HDA NVidia at 0xefff4000 irq 21'
   Mixer name : 'Analog Devices AD1988B'
   Components : 'HDA:11d4198b,104381f2,00100200'
   Controls : 44
   Simple ctrls : 25
Card1.Amixer.info:
 Card hw:1 'NVidia_1'/'HDA NVidia at 0xedffc000 irq 16'
   Mixer name : 'Nvidia GPU 16 HDMI/DP'
   Components : 'HDA:10de0016,10de0101,00100100'
   Controls : 16
   Simple ctrls : 4
DistroRelease: Ubuntu 11.04
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427.1)
NonfreeKernelModules: nvidia
Package: alsa-driver (not installed)
ProcEnviron:
 LANGUAGE=en_GB:en
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
Tags: natty running-unity
Uname: Linux 2.6.38-8-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare
dmi.bios.date: 11/17/2009
dmi.bios.vendor: Phoenix Technologies, LTD
dmi.bios.version: ASUS P5N32-E SLI PLUS ACPI BIOS Revision 1502
dmi.board.name: P5N32-E SLI PLUS
dmi.board.vendor: ASUSTeK Computer INC.
dmi.board.version: 1.XX
dmi.chassis.asset.tag: 123456789000
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufacture
dmi.chassis.version: Chassis Version
dmi.modalias: dmi:bvnPhoenixTechnologies,LTD:bvrASUSP5N32-ESLIPLUSACPIBIOSRevision1502:bd11/17/2009:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKComputerINC.:rnP5N32-ESLIPLUS:rvr1.XX:cvnChassisManufacture:ct3:cvrChassisVersion:
dmi.product.name: System Product Name
dmi.product.version: System Version
dmi.sys.vendor: System manufacturer

Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote : AlsaDevices.txt

apport information

tags: added: apport-collected natty running-unity
description: updated
Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote : AplayDevices.txt

apport information

Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote : ArecordDevices.txt

apport information

Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote : BootDmesg.txt

apport information

Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote : Card0.Amixer.values.txt

apport information

Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote : Card0.Codecs.codec.0.txt

apport information

Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote : Card1.Amixer.values.txt

apport information

Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote : Card1.Codecs.codec.0.txt

apport information

Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote : Card1.Codecs.codec.1.txt

apport information

Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote : Card1.Codecs.codec.2.txt

apport information

Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote : Card1.Codecs.codec.3.txt

apport information

Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote : PciMultimedia.txt

apport information

Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
Phillip "ZyanKLee" Stockmann (zyanklee) wrote :

Got the same problem (as stated in duplicate bug #777464 )

Revision history for this message
Phillip "ZyanKLee" Stockmann (zyanklee) wrote :

Erm, what I wanted to tell you is:

I had the problem from bug #593018 till I upgraded to natty, too.

Changed in alsa-driver (Ubuntu):
status: New → Confirmed
Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote :

Believe I have discovered core problem for this ; the pin caps for pin 0x17 (rear mic input) need to have PIN_VREF80 set for the input to work. VREF50 and VREF100 also seem to work, but this does not seem to be the convention in the driver, all VREF values are 80. HIZ and GRD do not work.

This is not done by default, or when switching inputs.

Comparing the patch_analog.c source from maverick and natty ..

possible candidate for change

ad1988_auto_init_analog_input

A conditional has changed that sets PIN_VREF80 | PIN_IN ; does this actually need to send both verbs, because we are initializing an input?

It puzzles me, because the rest of the code looks like it's setting it correctly, but I don't grok it that well yet.

Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote :

Patched and fixed ; routine that sets VREF_80 was comparing an array index to the pin type constant instead of the actual pin type. Have a git clone with fix committed but patch attached to bug.

A similar fix would probably resolve #593018 also, which is also comparing the array index to the pin type constant in the same location (but slightly different logic, older kernel sources).

Mic input now behaves as expected - VU meter in sound preferences shows the sound, Skype and Sound Recorder both work.

Revision history for this message
Phillip "ZyanKLee" Stockmann (zyanklee) wrote :

I'd test the fix if you tell me how?!

Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote :

To test / install fix... a bit involved this. I can't work out how to get launchpad to make a kernel package for my PPA, so had to do it manually. The source package linked to this isn't actually the full kernel sources, which you need to build.

See

https://help.ubuntu.com/community/Kernel/Compile
http://blog.avirtualhome.com/2010/11/06/how-to-compile-a-ubuntu-10-10-maverick-kernel/

You need the git tree for the kernel you want, currently that's

git://kernel.ubuntu.com/ubuntu/ubuntu-natty.git

The server isn't all that fast ; I found it faster to clone the "Linus" tree from kernel .org

git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
cd linux-2.6

And then do

git remote add natty git://kernel.ubuntu.com/ubuntu/ubuntu-natty.git
get fetch natty
git checkout -b fix-ad1988b-mic natty/master

Apply the patch attached to bug ticket

patch sound/pci/hda/patch_analog.c /path/to/patch_analog.c.diff

, edit the debian.master/changelog file as described in
http://blog.avirtualhome.com/2011/01/10/how-to-update-the-version-of-your-custom-ubuntu-10-10-kernel/

... to add a .1 to the end of the version number.

Commit the changes to your git clone

git add debian.master/changelog sound/pci/hda/patch_analog.c
git commit -m "Fixed AD1988B mic input bug"

.. and then build as described in the "compilation" section of article linked above ("How to compile an Ubuntu 10.10 kernel")

Make a cup of tea. And savour it. This takes AAAGES.

You should end up with some deb files in the folder above the sources, with your new version number. Install the header packages, and the linux-image.

cd ..
dpkg -i linux-headers*.deb linux-image*.deb

... and reboot.

If I work out how to get Soyuz to build me a kernel image in my PPA.... you could just download it from that :-(

Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote :

Patch accepted by ALSA dev mailing list.

Upstream bug at

https://bugtrack.alsa-project.org/alsa-bug/view.php?id=5368

description: updated
Revision history for this message
Andy Whitcroft (apw) wrote :

The upstream "discussion" is here:

    http://thread.gmane.org/gmane.linux.alsa.devel/85204

I have pulled the patch listed there into the Natty tree for testing. If those of you with the hardware could test the kernels below and report back here that would be helpful. Kernels are at this URL:

    http://people.canonical.com/~apw/lp776964-natty/

affects: alsa-driver (Ubuntu) → linux (Ubuntu)
Changed in linux (Ubuntu):
status: Confirmed → In Progress
importance: Undecided → Low
assignee: nobody → Andy Whitcroft (apw)
Changed in linux (Ubuntu Natty):
assignee: nobody → Andy Whitcroft (apw)
importance: Undecided → Low
status: New → In Progress
Revision history for this message
Phillip "ZyanKLee" Stockmann (zyanklee) wrote :

I'll test them as soon as I get home from work. But that won't happen in the next six hours ;)

Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote :

Tested supplied kernel from Mr Whitcroft, with positive results.

Upside : rear mic socket now works without resorting to manually tweaking pin parameters using ALSA HDAAnalzer

Downside : none discernible

Revision history for this message
Phillip "ZyanKLee" Stockmann (zyanklee) wrote :

Mic-Input works for me, too. Found no regressions (yet).

Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote :

Patch has been added to the 2.6.38-stable and 2.6.39-stable kernel trees as

alsa-hda-fix-input-src-parse-in-patch_analog.c.patch

Lee Santon (santon1)
Changed in linux (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote :

Latest Natty kernel update 2.6.38-10 does not contain this fix.

Confirmed absent from Natty kernel sources at tag Ubuntu-2.6.38-10.46

tagged Ubuntu-2.6.38-10.46

Fix is present and signed off for stable (> 2.6.37 ) releases in :

 git cherry-pick 5a2d227fdc7a02ed1b4cebba391d8fb9ad57caaf

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

Hi Adrian,

For Natty, this patch unfortunately didn't land in the 2.6.38-10.46 release, but it is committed to the natty git repo and should be queued for the next Natty kernel update. As such, I'm marking the Natty bug task as Fix Committed.

For Oneiric, this patch is already included in the latest 3.0.0-5.6 release so I'm marking the actively developed linux task as Fix Released.

Thanks for your patience.

Changed in linux (Ubuntu Natty):
status: In Progress → Fix Committed
Changed in linux (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

Bug 793702 handled the original pull request to sync the upstream stable 2.6.38.8 release into natty. The patch referenced here was a part of the 2.6.38.8 upstream stable release. As such, I'm going to mark this bug as a duplicate of bug 793702. This will ensure everyone here is properly notified when the fix has been released. Thanks.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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