You are not logged in.

#1 2014-08-09 23:10:50

Saser
Member
Registered: 2014-07-31
Posts: 4

Red light from headphone jack in MacBook Pro 11,1

I recently installed Arch on my MacBook Pro model 11,1 (13" Retina, late 2013).

From the get-go, the headphone jack output a red light, indicating that it does not work. The wiki says that sound works, so I thought it would work out of the box, but it seems it does not.

First, I installed pulseaudio after following some YouTube tutorial (stupid of me). Then, I tried to follow the instructions on the wiki page for ALSA, by installing alsa-utils and then running alsamixer. I initially only saw three S/PDIF items. I switched to the HDA Intel PCH sound card and found the Master channel and an S/PDIF Default PCM channel. I made sure both of these were unmuted, as well as the other channels (Headphones, Speaker, Bass Speaker). I then exited alsamixer and ran

speaker-test -c 2

which gave me the following message:

Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
Playback open error: -2,No such file or directory

I then ran

aplay -L | grep :CARD

which gave the two following rows, amongst others:

sysdefault:CARD=PCH
front:CARD=PCH,DEV=0

Running

speaker-test -c 2 -D sysdefault

gives me the same result as omitting the -D flag. However, running

speaker-test -c 2 -D front

does not give me the snd_pcm_dmix_open error, but still gives me the playback open error.

I am at a loss as to what to do. I'm new to Arch and Linux in general. Have I simply forgotten to install or configure something?

Offline

#2 2014-08-09 23:40:26

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Red light from headphone jack in MacBook Pro 11,1

The 'speaker-test -c 2' probably does not work, because the default sound card has the default device other than 0, in case of HDMI it is usually 3. So try 'speaker-test -c 2 -t wav -D plughw:0,3'  or 'speaker-test -c 2 -t wav -D plughw:PCH' instead. What specific hardware is thik MacBook using? Provide the usual:

aplay -lL;
lspci -nn | grep -i audio; 
lsmod | grep ^snd; 
amixer; amixer -c 2; amixer -c 3; # In your card probably only the first one will work
systool -v -m sound_module_that_is_being_used_lookup_lsmod_output
fuser -v /dev/snd/*

Edit: For speaker-test to work properly pulseaudio needs to be shut down.

Edit2: From the looks of it, the patch in its final form is integrated into patch_cirrus.c, at least that is the case in my linux-rt sources that were recently updated.

Edit3: Since judging by the patch your hardware is hda compliant, you could look into hdajackretask from alsa-tools package, check if the pinout is correct.

Last edited by emeres (2014-08-10 02:23:23)

Offline

#3 2014-08-10 14:36:28

Saser
Member
Registered: 2014-07-31
Posts: 4

Re: Red light from headphone jack in MacBook Pro 11,1

Here's the output of the commands you gave me:

aplay -lL

null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
default
    Default ALSA Output (currently PulseAudio Sound Server)
hdmi:CARD=HDMI,DEV=0
    HDA Intel HDMI, HDMI 0
    HDMI Audio Output
hdmi:CARD=HDMI,DEV=1
    HDA Intel HDMI, HDMI 1
    HDMI Audio Output
hdmi:CARD=HDMI,DEV=2
    HDA Intel HDMI, HDMI 2
    HDMI Audio Output
sysdefault:CARD=PCH
    HDA Intel PCH, CS4208 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, CS4208 Analog
    Front speakers
surround21:CARD=PCH,DEV=0
    HDA Intel PCH, CS4208 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, CS4208 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, CS4208 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, CS4208 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, CS4208 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, CS4208 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=PCH,DEV=0
    HDA Intel PCH, CS4208 Digital
    IEC958 (S/PDIF) Digital Audio Output
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: CS4208 Analog [CS4208 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 1: CS4208 Digital [CS4208 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

lspci -nn

00:00.0 Host bridge [0600]: Intel Corporation Haswell-ULT DRAM Controller [8086:0a04] (rev 09)
00:02.0 VGA compatible controller [0300]: Intel Corporation Device [8086:0a2e] (rev 09)
00:03.0 Audio device [0403]: Intel Corporation Haswell-ULT HD Audio Controller [8086:0a0c] (rev 09)
00:14.0 USB controller [0c03]: Intel Corporation 8 Series USB xHCI HC [8086:9c31] (rev 04)
00:16.0 Communication controller [0780]: Intel Corporation 8 Series HECI #0 [8086:9c3a] (rev 04)
00:1b.0 Audio device [0403]: Intel Corporation 8 Series HD Audio Controller [8086:9c20] (rev 04)
00:1c.0 PCI bridge [0604]: Intel Corporation 8 Series PCI Express Root Port 1 [8086:9c10] (rev e4)
00:1c.1 PCI bridge [0604]: Intel Corporation 8 Series PCI Express Root Port 2 [8086:9c12] (rev e4)
00:1c.2 PCI bridge [0604]: Intel Corporation 8 Series PCI Express Root Port 3 [8086:9c14] (rev e4)
00:1c.4 PCI bridge [0604]: Intel Corporation 8 Series PCI Express Root Port 5 [8086:9c18] (rev e4)
00:1c.5 PCI bridge [0604]: Intel Corporation 8 Series PCI Express Root Port 6 [8086:9c1a] (rev e4)
00:1f.0 ISA bridge [0601]: Intel Corporation 8 Series LPC Controller [8086:9c43] (rev 04)
00:1f.3 SMBus [0c05]: Intel Corporation 8 Series SMBus Controller [8086:9c22] (rev 04)
02:00.0 Multimedia controller [0480]: Broadcom Corporation Device [14e4:1570]
03:00.0 Network controller [0280]: Broadcom Corporation BCM4360 802.11ac Wireless Network Adapter [14e4:43a0] (rev 03)
04:00.0 SATA controller [0106]: Samsung Electronics Co Ltd Apple PCIe SSD [144d:1600] (rev 01)

lsmod | grep ^snd

snd_hda_codec_hdmi     40396  1 
snd_hda_codec_cirrus     9654  1 
snd_hda_codec_generic    56366  1 snd_hda_codec_cirrus
snd_hda_intel          22831  0 
snd_hda_controller     22975  1 snd_hda_intel
snd_hda_codec         104665  5 snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_intel,snd_hda_controller,snd_hda_codec_cirrus
snd_hwdep               6652  1 snd_hda_codec
snd_pcm                83207  4 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,snd_hda_controller
snd_timer              19294  1 snd_pcm
snd                    61276  8 snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel,snd_hda_codec_cirrus

amixer

Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'IEC958',1
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'IEC958',2
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]

I did not run the the systool command since I was not sure about which sound module that is being used. As you can see, the lsmod command gave me a bunch of rows, and I'm not sure exactly how to interpret them.

Also, the fuser command gave me no output at all.

Offline

#4 2014-08-10 16:52:28

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Red light from headphone jack in MacBook Pro 11,1

Edit: Try what Gusar suggested first. Read the whole thread if you want, I have made a wrong assumption at one point, so some information might not be accurate for your case, even though they might work.

So judging by your input so far, you should set PCH as default first. Read the wiki first, the whole chapter. I assume "Haswell-ULT HD Audio Controller" is the PCH card, so in your case try this as /etc/modprobe.d/50-alsa-base.conf:

options snd-hda-intel index=0 vid=8086 pid=0a0c
options snd-hda-intel index=1 vid=8086 pid=9c3a

Should you get messages in output of 'dmesg | grep -i hda' about vid and pid ignored or HDMI still remains as card 0, use this instead:

options snd-hda-intel index=0,1 vid=8086,8086 pid=0a0c,9c3a

To check the order of sound cards you can run 'aplay -l', PCH should be card 0. After that running 'speaker-test -c 2 -t wav' should produce sound. If not try 'speaker-test -c 2 -t wav -D plug:sysdefault' or any of the others I posted before.

Are you certain that the red light is not the signal from iec? I would disable all iec switches reported by amixer. Maybe a simple "amixer sset 'IEC958' off" will work, if not try appending ",0" to the control name (amixer sset 'IEC958',0 off; amixer sset 'IEC958',1 off; amixer sset 'IEC958',2 off; ). Check if the red light is still there afterwards.

Did you run the speaker-test commands I posted previously? Because you should have, otherwise I have to speculate. DId you run 'fuser -v /dev/snd' or 'fuser -v /dev/snd/*'? The first one should not produce output, the second one should when an application uses or controls sound cards, so play a mp3 or run speaker-test on the appropriate device. Take your time to read and understand this. Most if not all of the commands I posted, have a manual, which can be accessed via 'man application', so 'man fuser' for example.

Edit:

Wiki wrote:

Also, if you are using PulseAudio, sometimes it thinks HDMI is the default sound card; to solve this problem, install pavucontrol and set Analog Stereo as the fallback device.

You did that, right?

Re-edit: I will leave these here, but as for now they should not be used, since id does not identify but apparently assigns cards id, so the original order stays intact.

options snd-hda-intel index=0 id=PCH
options snd-hda-intel index=1 id=HDMI

Or better yet:

options snd-hda-intel index=0,1 id=PCH,HDMI
# or simply
options snd-hda-intel id=PCH,HDMI

Last edited by emeres (2014-08-10 20:19:54)

Offline

#5 2014-08-10 17:20:39

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: Red light from headphone jack in MacBook Pro 11,1

The snd-hda-intel module does not take pid and vid options, so dmesg will always say they're ignored. If you have a config that changes the sound device order, it was done by something other than the vid and pid options. The part of the wiki that advises setting them is just plain wrong. To change the order of PCH and HDMI, usually a simple "options snd-hda-intel index=1" and nothing else will do it.

About the red light, here I agree it's probably indicating IEC/SPDIF status, I have the same thing on my old laptop.

Offline

#6 2014-08-10 17:40:46

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Red light from headphone jack in MacBook Pro 11,1

@Gusar Yes, that is the conclusion I came to after looking into the 'enable' parameter recently. I will change the wiki eventually. However, simply using index with both cards using the same module will not do, meaning it might work and it might not work, that depends on the hardware path or how the bios/uefi handles the hardware. So the second suggestion with using both cards in the same options line is correct. It does change the order, depending on the vid and pid. Also simply using 'id' would be sufficient, but that brings other problems with it.

Do you happen to know where the source code for parsing modprobe.d directory is? Modprobe is part of kmod, but I did not have time to search intensively.

Edit: I put a hold on that. Dmesg still throws ignore warnings, yes I am aware of that particular modules parameters. I thought snd took over here, apparently not, so this may have to do with slots.

Last edited by emeres (2014-08-10 17:54:37)

Offline

#7 2014-08-10 18:13:31

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: Red light from headphone jack in MacBook Pro 11,1

emeres wrote:

However, simply using index with both cards using the same module will not do

I didn't say use it with both cards. I said "options snd-hda-intel index=1" and nothing else. A single option.

I've been trying to figure out why that works, and this is what I've come up with: The first initialized audio device will get index 0 and thus be default. By using "options snd-hda-intel index=1" you tell the system to give the first device index 1, leaving index 0 free for the second device.

Offline

#8 2014-08-10 18:40:48

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Red light from headphone jack in MacBook Pro 11,1

Yes, only thing is, this is pretty unreliable should the default card become something else than default. I can read, thank you. How about you?

emeres wrote:

However, simply using index with both cards using the same module will not do

That may be interpreted the wrong way, I give you that, but it is meant to state, the module is used by both/multiple cards and the options, single assignment for one sound card, can be specified to the wrong card, since there is no distinction between them.
It has been an unfortunate coincidence in my case, since I tested this on two separate machines, but apparently missed the dmesg, used it with a different hardware setup back then or already aliases came into place. Since it worked, I left it at that, I should have known better.
I would argue the behaviour is that of slots, since like I already mentioned the enable parameter behaves very similar in appropriate circumstances. But it is inconsistent, or so it seems, which is the reason I need to go through the source code.

Last edited by emeres (2014-08-10 18:42:43)

Offline

#9 2014-08-10 19:02:50

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: Red light from headphone jack in MacBook Pro 11,1

emeres wrote:

That may be interpreted the wrong way, I give you that

Yep, I interpreted it differently than you meant it.

emeres wrote:

single assignment for one sound card, can be specified to the wrong card

But that's just the thing, it doesn't get specified to the wrong card. On machines where HDMI is initialized first, it's *always* initialized first, on every boot, no exception. And using "options snd-hda-intel index=1", it'll thus always get index 1 instead of index 0.

Maybe that's coincidence, but I think it's more than that. I've been thinking it has to do with pci bus order. If you look at Saser's lspci output, HDMI audio is at 00:03.0, PCH audio is after it at 00:1b.0, and that's why HDMI is always initialized first.


emeres wrote:

Edit: This should be waterproof

options snd-hda-intel index=0 id=PCH
options snd-hda-intel index=1 id=HDMI

Or better yet:

options snd-hda-intel index=0,1 id=PCH,HDMI
# or simply
options snd-hda-intel id=PCH,HDMI

Actually, that won't work. The id option doesn't select, it assigns. Thus "index=0 id=PCH" doesn't mean "give the device named PCH index 0", it means "assign the first initialized device an id of PCH" - the result being that you have a HDMI device named PCH.

Last edited by Gusar (2014-08-10 19:17:02)

Offline

#10 2014-08-10 19:40:44

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Red light from headphone jack in MacBook Pro 11,1

I have seen too many cases of changing boot order to settle with *always* as a good enough argument. I fully understand your train of thought and it is a good one. But again, should the default cease to be default for whatever cause the whole concept falls apart, which is the reason I have been, wrongly apparently, pushing vid and pid, since this would limit incorrect behaviour to a very few exceptions, like exact same hardware in unfortunate hardware paths and therefore order, so highly improbable.

Yes, I see less inconsistencies with the boot order as compared to few years back. Maybe it comes with new hardware. I would argue, that there are just too many hardware configurations to settle with one ambiguous approach however, that might exclude a whole group of users. Maybe I am overcautious here.

Alsa-Configuration.txt

Alsa-Configuration.txt wrote:

  Common parameters for top sound card modules
  --------------------------------------------

    Each of top level sound card module takes the following options.

    index    - index (slot #) of sound card
        - Values: 0 through 31 or negative
        - If nonnegative, assign that index number
                - if negative, interpret as a bitmask of permissible
          indices; the first free permitted index is assigned
        - Default: -1
    id        - card ID (identifier or name)
        - Can be up to 15 characters long
        - Default: the card type
        - A directory by this name is created under /proc/asound/
          containing information about the card
        - This ID can be used instead of the index number in
          identifying the card
    enable      - enable card
        - Default: enabled, for PCI and ISA PnP cards

I wish the documentation would have been more precise at this spot. I will scratch that previous part, but it would have been so much easier if it worked the way I interpreted it would. Good thing you pointed that out, I appreciate it.

Just for information, using the enable parameter, can under circumstances also change the order:

card A index=0 enable=0
card B index=1 enable=1

will set B to default and leave A enable. It looks like slot behaviour - first argument of a parameter goes to the first card, here A. Both A and B use the same module.

@Saser should you use the approach Gusar pointed out, do remember about it next time you have audio problems. Maybe it is the better approach for now, I hope the whole exchange between Gusar and me does not confuse you too much.

Last edited by emeres (2014-08-10 19:49:24)

Offline

#11 2014-12-17 20:41:21

Kamek
Member
Registered: 2013-05-24
Posts: 10

Re: Red light from headphone jack in MacBook Pro 11,1

I have the same machine, only issues I have are webcam and microphone related.
Not much we can do about the webcam, but did you manage to get the microphone to work ? I'm using PulseAudio btw.

--
edit : I tried pavucontrol, it works now. I have no idea what changed though.

Last edited by Kamek (2014-12-17 23:06:10)

Offline

Board footer

Powered by FluxBB