Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Dec 2010 15:06:07 GMT
From:      Ted Haining <ted.haining@yahoo.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/152864: snd_hda headphone jack detection not working with AD1986A on ASUS M2NPV-VM
Message-ID:  <201012061506.oB6F67XD014493@red.freebsd.org>
Resent-Message-ID: <201012061510.oB6FA84R021889@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         152864
>Category:       misc
>Synopsis:       snd_hda headphone jack detection not working with AD1986A on ASUS M2NPV-VM
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 06 15:10:08 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Ted Haining
>Release:        9.0-CURRENT
>Organization:
>Environment:
FreeBSD workstation 9.0-CURRENT FreeBSD 9.0-CURRENT #1: Sun Dec  5 02:26:10 PST 2010     root@workstation:/usr/obj/usr/src/sys/WORKSTATION  amd64
>Description:
Kernel config WORKSTATION is simply GENERIC plus the following four lines:
326,330d327
< 
< # Add in some sound card support
< device                sound
< device                snd_hda

The problem: 

I have two audio outputs on the system in question.  The first is on the back, using the "green" plug using a connector mounted on the motherboard.  The second is using a "green" headphone connector on the front of the case.  The connector on the back works fine.  The connector on the front is silent.

A little debugging shows that the snd_hda driver thinks that this front 
connector is nid=26 (see below).  

Looking at the driver man page, I see that it says the following:

The sequence number 15 has a special meaning for output
associations.  Output pins with this number and device
type ``Headphones'' will duplicate (with automatic mute if
jack detection is supported) the first pin in that association.

Acting on the idea that the "automatic mute" might be the problem, I added the following to device.hints:

hint.hdac.1.cad0.nid26.config="as=1 seq=2 type=Line-out"

This worked around the problem; the headphone jack now works.

Here is a verbose dump of the hdac:

hdac1: <NVidia MCP51 High Definition Audio Controller> mem 0xfe024000-0xfe027fff irq 21 at device 16.1 on pci0
hdac1: HDA Driver Revision: 20100226_0142
hdac1: Caps: OSS 4, ISS 4, BSS 0, NSDO 1, 64bit, CORB 256, RIRB 256
hdac1: Probing codec #0...
hdac1: HDA Codec #0: Analog Devices AD1986A
hdac1:  HDA Codec ID: 0x11d41986
hdac1:        Vendor: 0x11d4
hdac1:        Device: 0x1986
hdac1:      Revision: 0x05
hdac1:      Stepping: 0x00
hdac1: PCI Subvendor: 0x81cb1043
hdac1:  Found audio FG nid=1 startnode=2 endnode=44 total=42
hdac1: 
hdac1: Processing audio FG cad=0 nid=1...
hdac1: GPIO: 0x00000100 NumGPIO=0 NumGPO=1 NumGPI=0 GPIWake=0 GPIUnsol=0
hdac1: GHOST: nid=2 j=0 entnum=4 index=0 res=0x00000601
hdac1: hdac_widget_connection_parse: nid=18 WARNING: zero cnid entnum=4 j=2 index=0 entries=8 found=2 res=0x21002211
hdac1: GHOST: nid=18 j=2 entnum=4 index=0 res=0x21002211
hdac1:  nid 26 0x02214021 as  2 seq  1    Headphones  Jack jack  1 loc  2 color   Green misc 0
hdac1: Patching pin config nid=26 0x02214021 -> 0x0221401f
hdac1:  nid 27 0x01014011 as  1 seq  1      Line-out  Jack jack  1 loc  1 color   Green misc 0
hdac1:  nid 28 0x01013012 as  1 seq  2      Line-out  Jack jack  1 loc  1 color    Blue misc 0
hdac1: Patching pin config nid=28 0x01013012 -> 0x01813081
hdac1:  nid 29 0x01019015 as  1 seq  5      Line-out  Jack jack  1 loc  1 color    Pink misc 0
hdac1: Patching pin config nid=29 0x01019015 -> 0x01019005
hdac1:  nid 30 0x501700f0 as 15 seq  0       Speaker  None jack  7 loc 16 color Unknown misc 0
hdac1:  nid 31 0x02a190f0 as 15 seq  0           Mic  Jack jack  1 loc  2 color    Pink misc 0
hdac1: Patching pin config nid=31 0x02a190f0 -> 0x02a19083
hdac1:  nid 32 0x018130f0 as 15 seq  0       Line-in  Jack jack  1 loc  1 color    Blue misc 0
hdac1: Patching pin config nid=32 0x018130f0 -> 0x01813084
hdac1:  nid 33 0x509700f0 as 15 seq  0           AUX  None jack  7 loc 16 color Unknown misc 0
hdac1:  nid 34 0x993310f0 as 15 seq  0            CD Fixed jack  3 loc 25 color   Black misc 0
hdac1: Patching pin config nid=34 0x993310f0 -> 0x99331085
hdac1:  nid 35 0x50b700f0 as 15 seq  0     Telephony  None jack  7 loc 16 color Unknown misc 0
hdac1:  nid 36 0x90f700f0 as 15 seq  0         Other Fixed jack  7 loc 16 color Unknown misc 0
hdac1: Patching pin config nid=36 0x90f700f0 -> 0x90f70086
hdac1:  nid 37 0x014510f0 as 15 seq  0     SPDIF-out  Jack jack  5 loc  1 color   Black misc 0
hdac1: Patched pins configuration:
hdac1:  nid 26 0x0221401f as  1 seq 15    Headphones  Jack jack  1 loc  2 color   Green misc 0
hdac1:  nid 27 0x01014011 as  1 seq  1      Line-out  Jack jack  1 loc  1 color   Green misc 0
hdac1:  nid 28 0x01813081 as  8 seq  1       Line-in  Jack jack  1 loc  1 color    Blue misc 0
hdac1:  nid 29 0x01019005 as  0 seq  5      Line-out  Jack jack  1 loc  1 color    Pink misc 0 [DISABLED]
hdac1:  nid 30 0x501700f0 as 15 seq  0       Speaker  None jack  7 loc 16 color Unknown misc 0 [DISABLED]
hdac1:  nid 31 0x02a19083 as  8 seq  3           Mic  Jack jack  1 loc  2 color    Pink misc 0
hdac1:  nid 32 0x01813084 as  8 seq  4       Line-in  Jack jack  1 loc  1 color    Blue misc 0
hdac1:  nid 33 0x509700f0 as 15 seq  0           AUX  None jack  7 loc 16 color Unknown misc 0 [DISABLED]
hdac1:  nid 34 0x99331085 as  8 seq  5            CD Fixed jack  3 loc 25 color   Black misc 0
hdac1:  nid 35 0x50b700f0 as 15 seq  0     Telephony  None jack  7 loc 16 color Unknown misc 0 [DISABLED]
hdac1:  nid 36 0x90f70086 as  8 seq  6         Other Fixed jack  7 loc 16 color Unknown misc 0
hdac1:  nid 37 0x014510f0 as 15 seq  0     SPDIF-out  Jack jack  5 loc  1 color   Black misc 0
hdac1: 3 associations found:
hdac1: Association 0 (1) out:
hdac1:  Pin nid=27 seq=1
hdac1:  Pin nid=26 seq=15
hdac1: Association 1 (8) in:
hdac1:  Pin nid=28 seq=1
hdac1:  Pin nid=31 seq=3
hdac1:  Pin nid=32 seq=4
hdac1:  Pin nid=34 seq=5
hdac1:  Pin nid=36 seq=6
hdac1: Association 2 (15) out:
hdac1:  Pin nid=37 seq=0
hdac1: Tracing association 0 (1)
hdac1:  Pin 27 traced to DAC 3
hdac1:  Pin 26 traced to DAC 3 and hpredir 1
hdac1: Association 0 (1) trace succeeded
hdac1: Tracing association 1 (8)
hdac1:  Pin 28 traced to ADC 6
hdac1:  Pin 31 traced to ADC 6
hdac1:  Pin 32 traced to ADC 6
hdac1:  Pin 34 traced to ADC 6
hdac1:  Unable to trace pin 36 to ADC 6, undo traces
hdac1: Association 1 (8) trace failed
hdac1: Tracing association 2 (15)
hdac1:  Pin 37 traced to DAC 2
hdac1: Association 2 (15) trace succeeded
hdac1: Tracing input monitor
hdac1: Tracing other input monitors
hdac1: Tracing beeper
hdac1:  nid 25 traced to out
hdac1: Enabling headphone/speaker audio routing switching:
hdac1:  as=0 sense nid=26 [UNSOL]
hdac1: Pin sense: nid=26 res=0x0000f96d
hdac1: FG config/quirks: forcestereo ivref50 ivref80 ivref100 ivref
>How-To-Repeat:
Run the 9.0 CURRENT amd64 version of the snd_hda driver with an AD1986A audio controller (hopefully not just on the ASUS M2NPV-VM motherboard). 
Attempt to produce audio through the line reported as Headphones by the controller BIOS. 
>Fix:
A workaround: change the Association sequence number to something other than
15 to disable automatic mute in device.hints.  For example:

hint.hdac.X.cad0.nid26.config="as=1 seq=2 type=Line-out"

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012061506.oB6F67XD014493>