[MacBookAir5,1, Cirrus Logic CS4206, Blue Line In, Rear] Line In using TRRS plug does not work correctly

Bug #1329191 reported by Sean Crosby
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
alsa-driver (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Microphone connected via TRRS plug on Macbook Air 5,1 is not recognised. Selecting "Analogue In" in Pulseaudio mixer is same as selecting "Microphone" - i.e. sounds recorded are always the Internal microphone, and not the microphone connected via the TRRS plug. When using OSX however, the TRRS microphone works correctly.

Have tried booting Live CDs of 12.04, 13.04, and 14.04, and even tried upgrading kernel to 3.15, and problem persists.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: alsa-base 1.0.25+dfsg-0ubuntu4
ProcVersionSignature: Ubuntu 3.13.0-29.53-generic 3.13.11.2
Uname: Linux 3.13.0-29-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 2.14.1-0ubuntu3.2
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: scrosby 2172 F.... pulseaudio
 /dev/snd/pcmC0D0c: scrosby 2172 F...m pulseaudio
CurrentDesktop: Unity
Date: Thu Jun 12 16:58:10 2014
InstallationDate: Installed on 2014-02-24 (107 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Alpha amd64+mac (20140223)
PackageArchitecture: all
SourcePackage: alsa-driver
Symptom: audio
Symptom_AlsaRecordingTest: ALSA recording test through plughw:PCH successful
Symptom_Card: Built-in Audio - HDA Intel PCH
Symptom_Jack: Blue Line In, Rear
Symptom_PulseAudioRecordingTest: PulseAudio recording test through plughw:PCH failed
Symptom_Type: Only some of inputs are working
Title: [MacBookAir5,1, Cirrus Logic CS4206, Blue Line In, Rear] Recording problem
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 11/27/2012
dmi.bios.vendor: Apple Inc.
dmi.bios.version: MBA51.88Z.00EF.B02.1211271028
dmi.board.asset.tag: Base Board Asset Tag#
dmi.board.name: Mac-66F35F19FE2A0D05
dmi.board.vendor: Apple Inc.
dmi.board.version: MacBookAir5,1
dmi.chassis.type: 10
dmi.chassis.vendor: Apple Inc.
dmi.chassis.version: Mac-66F35F19FE2A0D05
dmi.modalias: dmi:bvnAppleInc.:bvrMBA51.88Z.00EF.B02.1211271028:bd11/27/2012:svnAppleInc.:pnMacBookAir5,1:pvr1.0:rvnAppleInc.:rnMac-66F35F19FE2A0D05:rvrMacBookAir5,1:cvnAppleInc.:ct10:cvrMac-66F35F19FE2A0D05:
dmi.product.name: MacBookAir5,1
dmi.product.version: 1.0
dmi.sys.vendor: Apple Inc.
modified.conffile..etc.modprobe.d.alsa.base.conf: [deleted]

Revision history for this message
Sean Crosby (richardnixonshead) wrote :
Revision history for this message
christoph (spaem) wrote :

*push*

this happens on the MacBook 6,1 (late 2009) as well. It has the same Cirrus CS4206.

I just tested the most recent alsa-daily which builds for wily/amd64 without effect. Internal Speakers, Internal Mic, Headphones all work - TRRS mic doesn't work (Mac OS X supports exactly this Headset device out of the box).
I'm using 15.10 GNOME Ubuntu. In sound settings I can only activate the internal mic and don't even see any external (as with output where the label of the output device automatically changes if the headset is connected).

uname -r
Linux macbook 4.2.0-23-generic #28-Ubuntu SMP Sun Dec 27 17:47:31 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

running alsa-info.sh (with headset connected) =>
 Your ALSA information is located at http://www.alsa-project.org/db/?f=7556cfd21195211e5d8bd44184d481b0bd26d892

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in alsa-driver (Ubuntu):
status: New → Confirmed
Revision history for this message
Raymond (superquad-vortex2) wrote :

https://www.cirrus.com/en/products/pro/detail/P1233.html

Study datasheet and take a look at windows inf file to find those verbs and pincfg

Revision history for this message
christoph (spaem) wrote :

Honestly I don't know at which values I have to look in this inf file (and then what to do with them).

I tried to override x0c pin with hdajackretask as external Microphone which leaves me with 2 input devices in Settings -> Sound and 2 capture devices in alsamixer as well. Fiddling around with unmuting/muting etc.: they both don't produce signals (not even the internal laptop mic).
I tried different settings for hdajackretask with pin x0c but they didn't affect sound devices at all.
Overriding other pins mutes the headset + internal speakers (and don't affect input devices).

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

Find out the initverbs, pincfg related to the subsystem id

Codec: Cirrus Logic CS4206
Address: 0
AFG Function Id: 0x1 (unsol 0)
 Vendor Id: 0x10134206
Subsystem Id: 0x106b5500
Revision Id: 0x100302

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

Codec: Cirrus Logic CS4206
Address: 0
AFG Function Id: 0x1 (unsol 0)
Vendor Id: 0x10134206
 Subsystem Id: 0x106b5400
Revision Id: 0x100301

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

hm. for my model (MacBook 6,1) there are no pincfg table and I can't find the subsystem Id.
Closest is 0x106b5600, "MacBookAir 5,2". Unfortunately there is no pincfg table for this model either + none for the generic "Apple" for 0x106b SSIDs

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

sorry, this is beyond my skill, and I didn't find a guide to follow.
Maybe you can give me a little bit more precise instructions on what to do with the values.
I think I found the relevant part of the windows .inf file (Section starting with [CDB4206DM12PinConfigOverride]), i think I have to switch the bytes e.g. 0x1,10,1c,97,00 will become 00 97 1c 10 and I found a guide describing what those hex digits mean (comment #15 on http://www.insanelymac.com/forum/topic/275086-pin-config-patching-voodoohda-0272-project-os-x-branch/)

the info retrieved from the pins matches with the comments of the windows .inf file.

But now? What do I do with these hex codes. Which of these and where do I have to patch my audio driver to recognize the TRRS input signal?

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

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

If pin 0x12 is the headset mic, you need to set pin cfg to a headset mic jack

so that driver set pin ctl to IN instead of 0

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

Dynamic adc switching between 0x05 and 0x06

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] 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=D3, actual=D0 Delay: 8 samples
 Connection: 2 0x0c* 0x12

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

Do internal mic use both left and right channel of node 0x0d? Try mute either left or right amp in value of ADC

You need to find the missing headset mic from the remaining unconnected pin complex which pincap support IN

Node 0x0d [Pin Complex] wcaps 0x41048b: Stereo
 Amp-In Control: name="Mic Boost 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: [0x02 0x02]
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

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

http://git.kernel.org/cgit/linux/kernel/git/tiwai/hda-emu.git/tree/README?id=HEAD

hda-emu, alsa driver source and your codec info show which verbs send to the codecs by alsa dri ver, hda-decode-verb and hda-decode-pincfg decode those init verbs, proc coef and pincfg

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.