Raymond Yau superquad.vortex2@gmail.com writes:
[...]
As you can see, there's no detected difference between the TRS and TRRS headsets, which is the root of the problem.
can you post the output of alsa-info.sh ?
below is the output when the headset w/mic is plugged in
In the codec info, do you find Misc bit of pin defaults of the node [jack] Mic at Ext is set ? (i.e. Misc = NO_PRESENCE ) ?
I don't see any Mic at Ext, but I do see a 'Mic at Int' and it shows NO_PRESENCE.
Should I be seeing a 2 different Mics? one for internal one for external?
you need to add the mic select code to the unsolicited event of hp automute speaker
present = snd_hda_jack_detect(codec, 0x9) ; if (present) select ext mic
else select int mic
Not being an ALSA hacker, how exactly does one 'select ext mic' or 'select int mic'?
Looking at sound/pci/hda/patch_cirrus.c (which seems to be the codec I have), I see cs_automic() doing this. Would calling cs_automic() from cs_automute() when hp_present=1 do what you're suggesting?
Kevin
upload=true&script=true&cardinfo= !!################################ !!ALSA Information Script v 0.4.60 !!################################
!!Script ran on: Thu Mar 1 00:04:16 UTC 2012
!!Linux Distribution !!------------------
Ubuntu 11.10 \n \l DISTRIB_ID=Ubuntu DISTRIB_DESCRIPTION="Ubuntu 11.10"
!!DMI Information !!---------------
Manufacturer: Apple Inc. Product Name: MacBookAir4,1 Product Version: 1.0
!!Kernel Information !!------------------
Kernel release: 3.0.0-13-generic Operating System: GNU/Linux Architecture: x86_64 Processor: x86_64 SMP Enabled: Yes
!!ALSA Version !!------------
Driver version: 1.0.24 Library version: 1.0.24.1 Utilities version: 1.0.24.2
!!Loaded ALSA modules !!-------------------
snd_hda_intel
!!Sound Servers on this system !!----------------------------
Pulseaudio: Installed - Yes (/usr/bin/pulseaudio) Running - Yes
ESound Daemon: Installed - Yes (/usr/bin/esd) Running - No
!!Soundcards recognised by ALSA !!-----------------------------
0 [PCH ]: HDA-Intel - HDA Intel PCH HDA Intel PCH at 0xa0600000 irq 46
!!PCI Soundcards installed in the system !!--------------------------------------
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)
!!Advanced information - PCI Vendor/Device/Subsystem ID's !!--------------------------------------------------------
00:1b.0 0403: 8086:1c20 (rev 05) Subsystem: 8086:7270
!!Modprobe options (Sound related) !!--------------------------------
snd-atiixp-modem: index=-2 snd-intel8x0m: index=-2 snd-via82xx-modem: index=-2 snd-usb-audio: index=-2 snd-usb-caiaq: index=-2 snd-usb-ua101: index=-2 snd-usb-us122l: index=-2 snd-usb-usx2y: index=-2 snd-cmipci: mpu_port=0x330 fm_port=0x388 snd-pcsp: index=-2 snd-usb-audio: index=-2
!!Loaded sound module options !!--------------------------
!!Module: snd_hda_intel align_buffer_size : -1 bdl_pos_adj : 1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 beep_mode : 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 enable : Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y enable_msi : -1 id : (null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null) index : -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 model : (null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null) patch : (null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null) position_fix : 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 power_save : 0 power_save_controller : Y probe_mask : -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 probe_only : 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 single_cmd : N snoop : Y
!!HDA-Intel Codec information !!--------------------------- --startcollapse--
Codec: Cirrus Logic CS4206 Address: 0 AFG Function Id: 0x1 (unsol 0) Vendor Id: 0x10134206 Subsystem Id: 0x106b6200 Revision Id: 0x100302 No Modem Function Group found Default PCM: rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000 bits [0x1e]: 16 20 24 32 formats [0x3]: PCM FLOAT Default Amp-In caps: N/A Default Amp-Out caps: N/A GPIO: io=4, o=0, i=0, unsolicited=0, wake=0 IO[0]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0 IO[1]: enable=1, dir=1, wake=0, sticky=0, data=1, unsol=0 IO[2]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0 IO[3]: enable=1, dir=1, wake=0, sticky=0, data=0, unsol=0 Node 0x02 [Audio Output] wcaps 0xd041d: Stereo Amp-Out Control: name="Master Playback Switch", index=0, device=0 Control: name="Master Playback Volume", index=0, device=0 Control: name="Headphone Playback Switch", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Headphone Playback Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x73, nsteps=0x7f, stepsize=0x01, mute=1 Amp-Out vals: [0x31 0x31] Converter: stream=8, channel=0 PCM: rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000 bits [0x1e]: 16 20 24 32 formats [0x3]: PCM FLOAT Power states: D0 D3 EPSS Power: setting=D0, actual=D0 Delay: 13 samples Node 0x03 [Audio Output] wcaps 0xd041d: Stereo Amp-Out Amp-Out caps: ofs=0x73, nsteps=0x7f, stepsize=0x01, mute=1 Amp-Out vals: [0xf3 0xf3] Converter: stream=0, channel=0 PCM: rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000 bits [0x1e]: 16 20 24 32 formats [0x3]: PCM FLOAT Power states: D0 D3 EPSS Power: setting=D0, actual=D0 Delay: 13 samples Node 0x04 [Audio Output] wcaps 0xd041d: Stereo Amp-Out Control: name="Speaker Playback Switch", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Speaker Playback Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Device: name="Cirrus Analog", type="Audio", device=0 Amp-Out caps: ofs=0x73, nsteps=0x7f, stepsize=0x01, mute=1 Amp-Out vals: [0x80 0x80] Converter: stream=8, channel=0 PCM: rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000 bits [0x1e]: 16 20 24 32 formats [0x3]: PCM FLOAT Power states: D0 D3 EPSS Power: setting=D0, actual=D0 Delay: 13 samples Node 0x05 [Audio Input] wcaps 0x18051b: Stereo Amp-In Amp-In caps: ofs=0x33, nsteps=0x3f, stepsize=0x03, mute=1 Amp-In vals: [0xb3 0xb3] [0xb3 0xb3] Converter: stream=0, channel=0 SDI-Select: 0 PCM: rates [0x1f5]: 8000 16000 32000 44100 48000 88200 96000 bits [0x1e]: 16 20 24 32 formats [0x3]: PCM FLOAT Power states: D0 D3 EPSS Power: setting=D0, actual=D0 Delay: 8 samples Connection: 2 0x0c* 0x12 Node 0x06 [Audio Input] wcaps 0x18051b: Stereo Amp-In Control: name="Capture Switch", index=0, device=0 Control: name="Capture Volume", index=0, device=0 Device: name="Cirrus Analog", type="Audio", device=0 Amp-In caps: ofs=0x33, nsteps=0x3f, stepsize=0x03, mute=1 Amp-In vals: [0x3f 0x3f] [0x3f 0x3f] Converter: stream=0, channel=0 SDI-Select: 0 PCM: rates [0x1f5]: 8000 16000 32000 44100 48000 88200 96000 bits [0x1e]: 16 20 24 32 formats [0x3]: PCM FLOAT Power states: D0 D3 EPSS Power: setting=D0, actual=D0 Delay: 8 samples Connection: 2 0x0d* 0x0e Node 0x07 [Audio Input] wcaps 0x180791: Stereo Digital Converter: stream=0, channel=0 SDI-Select: 0 Digital: Preemphasis Copyright Digital category: 0x0 PCM: rates [0x570]: 32000 44100 48000 96000 192000 bits [0x1e]: 16 20 24 32 formats [0x7]: PCM FLOAT AC3 Unsolicited: tag=00, enabled=0 Power states: D0 D3 EPSS Power: setting=D0, actual=D0 Delay: 8 samples Connection: 1 0x0f Node 0x08 [Audio Output] wcaps 0x40611: Stereo Digital Converter: stream=0, channel=0 Digital: Digital category: 0x0 PCM: rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000 bits [0x1e]: 16 20 24 32 formats [0x7]: PCM FLOAT AC3 Power states: D0 D3 EPSS Power: setting=D0, actual=D0 Delay: 4 samples Node 0x09 [Pin Complex] wcaps 0x410581: Stereo Control: name="Headphone Jack", index=0, device=0 Pincap 0x0000001c: OUT HP Detect Pin Default 0x012b4030: [Jack] HP Out at Ext Rear Conn = Comb, Color = Green DefAssociation = 0x3, Sequence = 0x0 Pin-ctls: 0xc0: OUT HP Unsolicited: tag=01, enabled=1 Power states: D0 D3 EPSS Power: setting=D0, actual=D0 Delay: 1 samples Connection: 1 0x02 Node 0x0a [Pin Complex] wcaps 0x410581: Stereo Pincap 0x00000054: OUT Detect Balanced Pin Default 0x400000f0: [N/A] Line Out at Ext N/A Conn = Unknown, Color = Unknown DefAssociation = 0xf, Sequence = 0x0 Pin-ctls: 0x00: Unsolicited: tag=00, enabled=0 Power states: D0 D3 EPSS Power: setting=D0, actual=D0 Delay: 1 samples Connection: 1 0x03 Node 0x0b [Pin Complex] wcaps 0x410101: Stereo Pincap 0x00000050: OUT Balanced Pin Default 0x90100120: [Fixed] Speaker at Int N/A Conn = Unknown, Color = Unknown DefAssociation = 0x2, Sequence = 0x0 Misc = NO_PRESENCE Pin-ctls: 0x00: Delay: 1 samples Connection: 1 0x04 Node 0x0c [Pin Complex] wcaps 0x41048b: Stereo Amp-In Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0 Amp-In vals: [0x00 0x00] Pincap 0x00000024: IN Detect Pin Default 0x400000f0: [N/A] Line Out at Ext N/A Conn = Unknown, Color = Unknown DefAssociation = 0xf, Sequence = 0x0 Pin-ctls: 0x00: Unsolicited: tag=00, enabled=0 Power states: D0 D3 EPSS Power: setting=D0, actual=D0 Delay: 1 samples Node 0x0d [Pin Complex] wcaps 0x41048b: Stereo Amp-In Control: name="Mic Capture Volume", index=0, device=0 ControlAmp: chs=3, dir=In, idx=0, ofs=0 Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0 Amp-In vals: [0x03 0x03] Pincap 0x00001764: IN Detect Balanced Vref caps: HIZ 50 GRD 80 Pin Default 0x90a00110: [Fixed] Mic at Int N/A Conn = Unknown, Color = Unknown DefAssociation = 0x1, Sequence = 0x0 Misc = NO_PRESENCE Pin-ctls: 0x24: IN VREF_80 Unsolicited: tag=00, enabled=0 Power states: D0 D3 EPSS Power: setting=D0, actual=D0 Delay: 1 samples Node 0x0e [Pin Complex] wcaps 0x41000b: Stereo Amp-In Amp-In caps: ofs=0x00, nsteps=0x02, stepsize=0x27, mute=0 Amp-In vals: [0x00 0x00] Pincap 0x00000020: IN Pin Default 0x400000f0: [N/A] Line Out at Ext N/A Conn = Unknown, Color = Unknown DefAssociation = 0xf, Sequence = 0x0 Pin-ctls: 0x00: Delay: 1 samples Node 0x0f [Pin Complex] wcaps 0x410681: Stereo Digital Pincap 0x00000024: IN Detect Pin Default 0x400000f0: [N/A] Line Out at Ext N/A Conn = Unknown, Color = Unknown DefAssociation = 0xf, Sequence = 0x0 Pin-ctls: 0x00: Unsolicited: tag=00, enabled=0 Power states: D0 D3 EPSS Power: setting=D0, actual=D0 Delay: 1 samples Node 0x10 [Pin Complex] wcaps 0x410301: Stereo Digital Pincap 0x00000010: OUT Pin Default 0x400000f0: [N/A] Line Out at Ext N/A Conn = Unknown, Color = Unknown DefAssociation = 0xf, Sequence = 0x0 Pin-ctls: 0x00: Delay: 1 samples Connection: 1 0x08 Node 0x11 [Vendor Defined Widget] wcaps 0xf00040: Mono Processing caps: benign=0, ncoeff=22 Node 0x12 [Pin Complex] wcaps 0x41000b: Stereo Amp-In Amp-In caps: ofs=0x00, nsteps=0x02, stepsize=0x27, mute=0 Amp-In vals: [0x00 0x00] Pincap 0x00000020: IN Pin Default 0x400000f0: [N/A] Line Out at Ext N/A Conn = Unknown, Color = Unknown DefAssociation = 0xf, Sequence = 0x0 Pin-ctls: 0x00: Delay: 1 samples Node 0x13 [Beep Generator Widget] wcaps 0x700000: Mono Node 0x14 [Audio Output] wcaps 0x40611: Stereo Digital Converter: stream=0, channel=0 Digital: Digital category: 0x0 PCM: rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000 bits [0x1e]: 16 20 24 32 formats [0x7]: PCM FLOAT AC3 Power states: D0 D3 EPSS Power: setting=D0, actual=D0 Delay: 4 samples Node 0x15 [Pin Complex] wcaps 0x410301: Stereo Digital Pincap 0x00000010: OUT Pin Default 0x400000f0: [N/A] Line Out at Ext N/A Conn = Unknown, Color = Unknown DefAssociation = 0xf, Sequence = 0x0 Pin-ctls: 0x00: Delay: 1 samples Connection: 1 0x14 Codec: Intel CougarPoint HDMI Address: 3 AFG Function Id: 0x1 (unsol 0) Vendor Id: 0x80862805 Subsystem Id: 0x80860101 Revision Id: 0x100000 No Modem Function Group found Default PCM: rates [0x0]: bits [0x0]: formats [0x0]: Default Amp-In caps: N/A Default Amp-Out caps: N/A GPIO: io=0, o=0, i=0, unsolicited=0, wake=0 Node 0x02 [Audio Output] wcaps 0x6611: 8-Channels Digital Converter: stream=0, channel=0 Digital: Enabled GenLevel Digital category: 0x2 PCM: rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000 bits [0x1e]: 16 20 24 32 formats [0x5]: PCM AC3 Power states: D0 D3 EPSS Power: setting=D0, actual=D0 Node 0x03 [Audio Output] wcaps 0x6611: 8-Channels Digital Converter: stream=0, channel=0 Digital: Enabled GenLevel Digital category: 0x2 PCM: rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000 bits [0x1e]: 16 20 24 32 formats [0x5]: PCM AC3 Power states: D0 D3 EPSS Power: setting=D0, actual=D0 Node 0x04 [Audio Output] wcaps 0x6611: 8-Channels Digital Converter: stream=0, channel=0 Digital: Enabled GenLevel Digital category: 0x2 PCM: rates [0x7f0]: 32000 44100 48000 88200 96000 176400 192000 bits [0x1e]: 16 20 24 32 formats [0x5]: PCM AC3 Power states: D0 D3 EPSS Power: setting=D0, actual=D0 Node 0x05 [Pin Complex] wcaps 0x40778d: 8-Channels Digital Amp-Out CP Control: name="HDMI/DP,pcm=3 Jack", index=0, device=0 Control: name="IEC958 Playback Con Mask", index=0, device=0 Control: name="IEC958 Playback Pro Mask", index=0, device=0 Control: name="IEC958 Playback Default", index=0, device=0 Control: name="IEC958 Playback Switch", index=0, device=0 Control: name="ELD", index=0, device=3 Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x00 0x00] Pincap 0x09000094: OUT Detect HBR HDMI DP Pin Default 0x18560010: [Jack] Digital Out at Int HDMI Conn = Digital, Color = Unknown DefAssociation = 0x1, Sequence = 0x0 Pin-ctls: 0x00: Unsolicited: tag=01, enabled=1 Power states: D0 D3 EPSS Power: setting=D0, actual=D0 Connection: 1 0x02 Node 0x06 [Pin Complex] wcaps 0x40778d: 8-Channels Digital Amp-Out CP Control: name="HDMI/DP,pcm=7 Jack", index=0, device=0 Control: name="IEC958 Playback Con Mask", index=1, device=0 Control: name="IEC958 Playback Pro Mask", index=1, device=0 Control: name="IEC958 Playback Default", index=1, device=0 Control: name="IEC958 Playback Switch", index=1, device=0 Control: name="ELD", index=0, device=7 Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x00 0x00] Pincap 0x09000094: OUT Detect HBR HDMI DP Pin Default 0x18560010: [Jack] Digital Out at Int HDMI Conn = Digital, Color = Unknown DefAssociation = 0x1, Sequence = 0x0 Pin-ctls: 0x00: Unsolicited: tag=02, enabled=1 Power states: D0 D3 EPSS Power: setting=D0, actual=D0 Connection: 1 0x03 Node 0x07 [Pin Complex] wcaps 0x40778d: 8-Channels Digital Amp-Out CP Control: name="HDMI/DP,pcm=8 Jack", index=0, device=0 Control: name="IEC958 Playback Con Mask", index=2, device=0 Control: name="IEC958 Playback Pro Mask", index=2, device=0 Control: name="IEC958 Playback Default", index=2, device=0 Control: name="IEC958 Playback Switch", index=2, device=0 Control: name="ELD", index=0, device=8 Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x00 0x00] Pincap 0x09000094: OUT Detect HBR HDMI DP Pin Default 0x18560010: [Jack] Digital Out at Int HDMI Conn = Digital, Color = Unknown DefAssociation = 0x1, Sequence = 0x0 Pin-ctls: 0x00: Unsolicited: tag=03, enabled=1 Power states: D0 D3 EPSS Power: setting=D0, actual=D0 Connection: 1 0x04 Node 0x08 [Vendor Defined Widget] wcaps 0xf00000: Mono --endcollapse--