[Macbook Air 3,2] headset mic not recognized

Bug #950494 reported by Jon Melamut
50
This bug affects 10 people
Affects Status Importance Assigned to Milestone
alsa-driver (Ubuntu)
Invalid
High
David Henningsson

Bug Description

== Summary ==
Since upgrading a MacBook Air from 11.10 to 12.04 the headset microphone is no longer recognized.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: alsa-base 1.0.25+dfsg-0ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-18.28-generic 3.2.9
Uname: Linux 3.2.0-18-generic x86_64
NonfreeKernelModules: nvidia
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.24.
ApportVersion: 1.94-0ubuntu2
Architecture: amd64
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: NVidia [HDA NVidia], device 0: Cirrus Analog [Cirrus Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: jon 1864 F.... pulseaudio
Card0.Amixer.info:
 Card hw:0 'NVidia'/'HDA NVidia at 0xd3280000 irq 16'
   Mixer name : 'Nvidia MCP89 HDMI'
   Components : 'HDA:10134206,106b3d00,00100301 HDA:10de000c,10de0101,00100200'
   Controls : 36
   Simple ctrls : 12
Date: Thu Mar 8 21:09:23 2012
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64+mac (20111012)
PackageArchitecture: all
SourcePackage: alsa-driver
Symptom: audio
Title: USB sound card not detected
UpgradeStatus: Upgraded to precise on 2012-03-05 (3 days ago)
dmi.bios.date: 11/18/10
dmi.bios.vendor: Apple Inc.
dmi.bios.version: MBA31.88Z.0061.B01.1011181342
dmi.board.asset.tag: Base Board Asset Tag#
dmi.board.name: Mac-942C5DF58193131B
dmi.board.vendor: Apple Inc.
dmi.board.version: MacBookAir3,2
dmi.chassis.type: 10
dmi.chassis.vendor: Apple Inc.
dmi.chassis.version: Mac-942C5DF58193131B
dmi.modalias: dmi:bvnAppleInc.:bvrMBA31.88Z.0061.B01.1011181342:bd11/18/10:svnAppleInc.:pnMacBookAir3,2:pvr1.0:rvnAppleInc.:rnMac-942C5DF58193131B:rvrMacBookAir3,2:cvnAppleInc.:ct10:cvrMac-942C5DF58193131B:
dmi.product.name: MacBookAir3,2
dmi.product.version: 1.0
dmi.sys.vendor: Apple Inc.

Revision history for this message
Jon Melamut (jon-melamut-canonical) wrote :
Revision history for this message
Chris Van Hoof (vanhoof) wrote :

Attaching output from alsa-info.sh

description: updated
Changed in alsa-driver (Ubuntu):
assignee: nobody → David Henningsson (diwic)
importance: Undecided → High
status: New → Confirmed
summary: - headphone mic not recognized by sound menu
+ [Macbook Air 3,2] headset mic not recognized
description: updated
Revision history for this message
David Henningsson (diwic) wrote :

Ok, so looking at your alsa-info, there are no traces of external mic functionality, so we need to figure out how it could be working in earlier releases.
There are two ways to do this:

1) You boot up an installation of Ubuntu 11.10, plug the headset in, ensure the mic is working, and with the headset still plugged in, run the alsa-info script and attach the result here, or

2) Install the hda-jack-retask and snd-hda-tools packages from ppa:diwic/hda , run "sudo hda-jack-sense-test -a" with the headset plugged in and see if any pin other than the headphone pin is detected as "present=yes". If so, you can use the hda-jack-retask program to set that pin as microphone input.

Changed in alsa-driver (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Jon Melamut (jon-melamut-canonical) wrote :

jon@jon-MacBookAir:~$ sudo hda-jack-sense-test -a
Pin 0x09 (Green HP Out): present = Yes
Pin 0x0a (Internal Speaker): present = No
Pin 0x0b (Internal Speaker): present = No
Pin 0x0c (Not connected): present = No
Pin 0x0d (Internal Mic): present = No
Pin 0x0e (Not connected): present = No
Pin 0x0f (Not connected): present = No
Pin 0x10 (White SPDIF Out): present = No
Pin 0x12 (Not connected): present = No
Pin 0x15 (Not connected): present = No
jon@jon-MacBookAir:~$

As you can see -- no pin is detected.

Revision history for this message
David Henningsson (diwic) wrote :

Thanks. Well, no sign of an external mic there either. Still surprised that it was actually working in 11.10!

That remains option 1 then. Boot up a live-CD or installation of 11.10, verify that external mic is working (and that it's not just the internal one catching the sound), and grab an alsa-info in that setup. Then disconnect the external mic, verify that the internal mic is now working, and grab an alsa-info in that setup.

Revision history for this message
Naba Kumar (naba) wrote :

Hi, I can also confirm similar bug with Macbook Pro 13 inch (8.1 rev I think). I have a iphone headset, which works fine for both headphone and mic in Mac OS, but the mic doesn't even get detected in ubuntu precise. In gnome sound settings, there is only option for internal mic.

 Here is output of "hda-jack-sense-test -a"

$ sudo hda-jack-sense-test -a
Pin 0x09 (Green HP Out): present = Yes
Pin 0x0a (Internal Speaker): present = No
Pin 0x0b (Internal Speaker): present = No
Pin 0x0c (Not connected): present = No
Pin 0x0d (Internal Mic): present = No
Pin 0x0e (Not connected): present = No
Pin 0x0f (Not connected): present = No
Pin 0x10 (White SPDIF Out): present = No
Pin 0x12 (Not connected): present = No
Pin 0x15 (Not connected): present = No

My alsa-info.sh output
http://www.alsa-project.org/db/?f=c9ae2b59e879dac322f33a0236d59014d30366d4

Revision history for this message
David Henningsson (diwic) wrote :

Nabar's Id: Codec SSID 0x106b 1c00
Jon's ID: Codec SSID 0x106b 3d00
Seth's ID: Codec SSID 0x106b 6200

All of these are different machines and might require different fixes:
In best case, it's three different quirk lines in the same file, but I'm far from certain it would be that easy.

Revision history for this message
David Henningsson (diwic) wrote :

Seth has now tried booting Mac OS with a 4-pin headset plugged in. Mac OS does not detect any external mic, so we assume the hardware isn't there on that macbook.

At this point I feel there is not much I can do without either having the hardware at hand, or possibly somebody very patient to work with me remotely.

Revision history for this message
Kambiz Darabi (darabi) wrote :

I have the same problem on two MacBook Pro 9,4 (non-retina, 2012) with a fresh install of precise (one of them) and quantal (the other one). They have a Cirrus Logic CS4206 (cf. attached alsa-info-2012-11-14-without-trrs-mic-hp.txt and alsa-info-2012-11-14-with-trrs-mic-hp.txt).

!!HDA-Intel Codec information
Codec: Cirrus Logic CS4206
...
Subsystem Id: 0x106b5200

I found this thread on the alsa-devel mailing list:

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

and followed some of the 'experiments' which the OP performed.

hda-jack-sense-test first gave me an error:

$ sudo hda-jack-sense-test
[sudo] password for darabi:
Traceback (most recent call last):
  File "/usr/bin/hda-jack-sense-test", line 47, in <module>
    codec = HDACodec(cardindex, codecindex)
  File "/usr/share/snd-hda-tools/hda_codec.py", line 1036, in __init__
    self.parse_proc()
  File "/usr/share/snd-hda-tools/hda_codec.py", line 1135, in parse_proc
    self.proc_codec = HDACodecProc(self.card, self.device, file)
  File "/usr/share/snd-hda-tools/hda_proc.py", line 478, in __init__
    self.parse(proc_file)
  File "/usr/share/snd-hda-tools/hda_proc.py", line 672, in parse
    node.add_digital(line[11:])
  File "/usr/share/snd-hda-tools/hda_proc.py", line 295, in add_digital
    self.wrongfile('unknown dig1 bit %s' % repr(b))
  File "/usr/share/snd-hda-tools/hda_proc.py", line 143, in wrongfile
    raise ValueError, "wrong proc file format (%s)" % msg
ValueError: wrong proc file format (unknown dig1 bit 'Non-Copyright')

As you can see in the attached alsa-info, the 'Digital' line reads

  Digital: Preemphasis Non-Copyright

on my system.

So I changed hda_proc.py:

283c283
< 'Copyright': DIG1_BITS['COPYRIGHT'],
---
> 'Non-Copyright': DIG1_BITS['COPYRIGHT'],

and now have essentially the same output as the previous posters:

# without TRRS headset with microphone

$ sudo hda-jack-sense-test -a
Pin 0x09 (Green HP Out): present = No
Pin 0x0a (Internal Speaker): present = No
Pin 0x0b (Internal Speaker): present = No
Pin 0x0c (Blue Line In): present = No
Pin 0x0d (Internal Mic): present = No
Pin 0x0e (Not connected): present = No
Pin 0x0f (White SPDIF In): present = No
Pin 0x10 (White SPDIF Out): present = No
Pin 0x12 (Pink Mic): present = No
Pin 0x15 (Not connected): present = No

# WITH TRRS headset with microphone

$ sudo hda-jack-sense-test -a
Pin 0x09 (Green HP Out): present = Yes
Pin 0x0a (Internal Speaker): present = No
Pin 0x0b (Internal Speaker): present = No
Pin 0x0c (Blue Line In): present = No
Pin 0x0d (Internal Mic): present = No
Pin 0x0e (Not connected): present = No
Pin 0x0f (White SPDIF In): present = No
Pin 0x10 (White SPDIF Out): present = No
Pin 0x12 (Pink Mic): present = No
Pin 0x15 (Not connected): present = No

You wrote

> At this point I feel there is not much I can do without either having the
> hardware at hand, or possibly somebody very patient to work with me remotely.

I am the 'very patient' volunteer although in real life I'm not at all patient :) .

We could meet on irc or jabber, whatever you prefer.

Revision history for this message
Kambiz Darabi (darabi) wrote :
Revision history for this message
Kambiz Darabi (darabi) wrote :
Revision history for this message
Raymond (superquad-vortex2) wrote :
Revision history for this message
David Henningsson (diwic) wrote :

Hi Kambiz,

Something is strange here - according to your hda-jack-sense-test output there is a "Pink Mic" and pin 0x12, but according to your alsa-info, there's nothing at pin 0x12.

Are you sure that
1) these two reports came from the same machine,
2) that is actually is a headset jack, i e, both mic and headphone parts work under OS X?

Revision history for this message
Raymond (superquad-vortex2) wrote :

if you look at cs4207 datasheet, it can pan left or right channel

this may min that it only need one pin complex for the mono internal mic and mono external mic

http://git.kernel.org/?p=linux/kernel/git/tiwai/sound.git;a=commitdiff;h=16337e028a6dae9fbdd718c0d42161540a668ff3;hp=5a83b4b5a391f07141b157ac9daa51c409e71ab5.

Revision history for this message
Kambiz Darabi (darabi) wrote :

Sorry for the long delay. I didn't subscribe and didn't receive notifications.

@David:

re 1) yes, both reports were made within some minutes on the same machine

re 2) yes, mic (and headphone) works under OS X

@Raymond:

Thank you. To try out the patches you pointed to, I installed the hda dkms packages as described in

https://wiki.ubuntu.com/Audio/UpgradingAlsa/DKMS

the patch from your comment #12 was applied already in the package dkms-hda 0.201211261958~quantal1

the changeset from your comment #14 also partially

Unfortunately, none of them resolved the problem with the microphone.

----

hda-jack-sense-test -a now reports the following when I connect the headset:

$ hda-jack-sense-test -a
Unknown line, ignored: ( IEC Coding Type: 0x0)
Unknown line, ignored: ( IEC Coding Type: 0x0)
Unknown line, ignored: ( IEC Coding Type: 0x0)
Pin 0x09 (Green HP Out): present = Yes
Pin 0x0a (Internal Speaker): present = No
Pin 0x0b (Internal Speaker): present = No
Pin 0x0c (Not connected): present = No
Pin 0x0d (Internal Mic): present = No
Pin 0x0e (Not connected): present = No
Pin 0x0f (Not connected): present = No
Pin 0x10 (White SPDIF Out): present = No
Pin 0x12 (Not connected): present = No
Pin 0x15 (Not connected): present = No

and without headset:

$ hda-jack-sense-test -a
Unknown line, ignored: ( IEC Coding Type: 0x0)
Unknown line, ignored: ( IEC Coding Type: 0x0)
Unknown line, ignored: ( IEC Coding Type: 0x0)
Pin 0x09 (Green HP Out): present = No
Pin 0x0a (Internal Speaker): present = No
Pin 0x0b (Internal Speaker): present = No
Pin 0x0c (Not connected): present = No
Pin 0x0d (Internal Mic): present = No
Pin 0x0e (Not connected): present = No
Pin 0x0f (Not connected): present = No
Pin 0x10 (White SPDIF Out): present = No
Pin 0x12 (Not connected): present = No
Pin 0x15 (Not connected): present = No

Revision history for this message
Kambiz Darabi (darabi) wrote :
Revision history for this message
Kambiz Darabi (darabi) wrote :
Revision history for this message
Raymond (superquad-vortex2) wrote :

how did you test the mic and headphone (through pulseaudio or alsa hw device)?

send email to the author and cc the reporters and comitters if the patch did not fix your problem

Revision history for this message
Kambiz Darabi (darabi) wrote :

I created a ~/.pulse/client.conf with

autospawn = no

in it, then killed pulseaudio and checked that it wasn't running with ps.

As you proposed in

http://article.gmane.org/gmane.linux.alsa.devel/95283

I use

arecord --vumeter=stereo -f CD -Dhw:0,0 foo.wav

and see input activity on the right channel, which seems to correspond to the built-in microphone.

Revision history for this message
David Henningsson (diwic) wrote :

Hi Kambiz,

Next step will be to verify that you're also having a regression from 11.10, like the original poster. Can you boot a live-CD of 11.10, verify that the headset mic is working there, and attach an alsa-info from when the mic is working? Thanks.

Revision history for this message
Raymond (superquad-vortex2) wrote :

http://thread.gmane.org/gmane.linux.alsa.devel/95022/focus=95283

do you mean you need to change the coeff from 0x000a to 0x100a or 0x180a or 0x080a to get the channel to both hda channels?

Revision history for this message
Raymond (superquad-vortex2) wrote :

the amp-in at audio input is capture volume (Atten) control but the amp-in at pin complex is boost (gain)

control.10 {
  iface MIXER
  name 'Capture Volume'
  value.0 63
  value.1 63
  comment {
   access 'read write'
   type INTEGER
   count 2
   range '0 - 63'
   dbmin -5100
   dbmax 1200
   dbvalue.0 1200
   dbvalue.1 1200
  }
 }
 control.11 {
  iface MIXER
  name 'Mic Capture Volume'
  value.0 3
  value.1 3
  comment {
   access 'read write'
   type INTEGER
   count 2
   range '0 - 3'
   dbmin 0
   dbmax 3000
   dbvalue.0 3000
   dbvalue.1 3000
  }
 }

Revision history for this message
David Henningsson (diwic) wrote :

After talking to YK, I'm closing this due to lack of responses. Feel free to reopen if you would like to take this up again, and also have the time to run kernel bisects etc.

Changed in alsa-driver (Ubuntu):
status: Incomplete → Invalid
chrisolof (chrisolof)
Changed in alsa-driver (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
chrisolof (chrisolof) wrote :

Hello,

I'm running Ubuntu Gnome 14.04 on a new MacBookAir6,2 with the Cirrus Logic CS4208 and would love to get the microphone part of the TRRS connector working. Mac OS picks up and utilizes the TRRS headset mic without issue so I know the hardware is a go.

Running sudo hda-jack-sense-test -a results in:

Traceback (most recent call last):
  File "/usr/bin/hda-jack-sense-test", line 47, in <module>
    codec = HDACodec(cardindex, codecindex)
  File "/usr/share/snd-hda-tools/hda_codec.py", line 1036, in __init__
    self.parse_proc()
  File "/usr/share/snd-hda-tools/hda_codec.py", line 1135, in parse_proc
    self.proc_codec = HDACodecProc(self.card, self.device, file)
  File "/usr/share/snd-hda-tools/hda_proc.py", line 479, in __init__
    self.parse(proc_file)
  File "/usr/share/snd-hda-tools/hda_proc.py", line 677, in parse
    node.add_digital(line[11:])
  File "/usr/share/snd-hda-tools/hda_proc.py", line 296, in add_digital
    self.wrongfile('unknown dig1 bit %s' % repr(b))
  File "/usr/share/snd-hda-tools/hda_proc.py", line 143, in wrongfile
    raise ValueError, "wrong proc file format (%s)" % msg
ValueError: wrong proc file format (unknown dig1 bit 'KAE')

So not really sure where to go from here. I opened up hdajackretask to find four pins:
Green Headphone
Pin ID: 0x10
Headphone

Internal Speaker
Pin ID: 0x12
Internal speaker

Pink Mic
Pin ID: 0x18
Not connected

Internal Mic
Pin ID: 0x1c
Internal mic

Unplugging and replugging the headset changes the Output device in sound settings from Headphones to Speakers so that works, but nothing in the input tab ever changes. It always lists two devices: Internal Microphone and Microphone. Both of these seem to actually be the internal microphone in the mac - either works without the headset connected at all.

So I'm not really sure how to proceed from here, but I'd be happy to run whatever diagnostic tests might prove useful and/or even contribute code toward a fix - but I just have no idea where to start. Is it as simple as just finding the right pin and telling the system to use it as a microphone?

Revision history for this message
David Henningsson (diwic) wrote :

Hi chrisolof,

First, since your having a separate machine, yours is really a separate bug.
Second, you're running an old version of hda-jack-sense-test. You want hdajacksensetest which is available in my ppa:diwic/hda (in the alsa-tools package).
Third, alsa-info contains more info about your sound card: https://wiki.ubuntu.com/Audio/AlsaInfo

Changed in alsa-driver (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
chrisolof (chrisolof) wrote :

Awesome - thank you for the direction on those items! New bug for the Air 6,2 filed here:

https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1410618

To post a comment you must log in.