 |
 |
 |
 |
| Mac Chat The place to discuss your Fedora/ Mac woes (including ibooks and powerbooks). |

10th April 2012, 06:13 PM
|
|
Registered User
|
|
Join Date: Aug 2008
Posts: 17

|
|
|
Red Light in Headphone Jack - Macbook Pro 5,1
I have a Macbook Pro 5,1 and I cannot get the red light in the headphone jack to permanently turn off. If I run alsamixer and mute "S/PDIF", the light will turn off. Upon rebooting (or even just logging out to gdm and back in), the light will come back on. I've run "alsactl store" and put "alsactl restore" in my /etc/rc.d/rc.local file. Any other suggestions?
|

10th April 2012, 07:14 PM
|
 |
"Registered User" T-Shirt Winner
|
|
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,126

|
|
|
Re: Red Light in Headphone Jack - Macbook Pro 5,1
Here is what I do:
1) Change the permissions on the asound.state file to be read/writable by all users.
Code:
# chmod 0666 /var/lib/alsa/asound.state
2) Add myself (regular user paul) to the audio group.
Code:
# usermod -a -G audio paul
Assuming you're running F15/16, you should not need to add the "alsactl restore" command to the rc.local file because there are now systemd services that do that, theoretically:
Code:
BASH:~/-> sudo systemctl status alsa-store.service alsa-restore.service
alsa-store.service - Store Sound Card State
Loaded: loaded (/lib/systemd/system/alsa-store.service; static)
Active: inactive (dead)
CGroup: name=systemd:/system/alsa-store.service
alsa-restore.service - Restore Sound Card State
Loaded: loaded (/lib/systemd/system/alsa-restore.service; static)
Active: inactive (dead) since Tue, 10 Apr 2012 12:24:20 -0400; 1h 26min ago
Process: 959 ExecStart=/sbin/alsactl restore (code=exited, status=0/SUCCESS)
CGroup: name=systemd:/system/alsa-restore.service
These two services should be enabled by default. This (mostly) works for me to retain audio settings on reboots. However, on my laptop where I boot to runlevel 3, my headphone volume is sometimes at 100% at bootup. To keep from breaking my eardrums before listening to audio from the laptop, I run a script that sets volume levels on 3 channels using the amixer command, just to be on the safe side.
If after doing all of the above and you still have the red LED light on problem after boot, I'd suggest adding a "amixer" command to mute your S/PDIF channel to the rc.local file instead of the "alsactl restore" command.
Last edited by PabloTwo; 10th April 2012 at 07:23 PM.
|

10th April 2012, 08:34 PM
|
|
Registered User
|
|
Join Date: Aug 2008
Posts: 17

|
|
|
Re: Red Light in Headphone Jack - Macbook Pro 5,1
Sadly, that did not work. When I ran 'amixer controls' to see what command I should add to rc.local, S/PDIF does not appear. In alsamixer, I have 13 or 14 controls, but here is the output of 'amixer controls'.
Code:
numid=4,iface=MIXER,name='Master Playback Switch'
numid=3,iface=MIXER,name='Master Playback Volume'
numid=2,iface=MIXER,name='Capture Switch'
numid=1,iface=MIXER,name='Capture Volume'
|

10th April 2012, 09:15 PM
|
 |
"Registered User" T-Shirt Winner
|
|
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,126

|
|
|
Re: Red Light in Headphone Jack - Macbook Pro 5,1
That's curious. Do you have more than 1 audio "card"? On my desktop computer, where the HDMI port on my Nvidia video card is counted as an audio card:
Code:
BASH:~/-> cat /proc/asound/cards
0 [PCH ]: HDA-Intel - HDA Intel PCH
HDA Intel PCH at 0xfa200000 irq 48
1 [NVidia ]: HDA-Intel - HDA NVidia
HDA NVidia at 0xfa080000 irq 17
You can specify the card to query with the amixer command:
Code:
amixer -c0 controls
On my desktop system, where [PCH] is the onboard audio chipset:
Code:
BASH:~/-> amixer -c0 controls
numid=39,iface=CARD,name='Front Headphone Jack'
numid=41,iface=CARD,name='Front Mic Jack'
numid=42,iface=CARD,name='Line Jack'
numid=37,iface=CARD,name='Line Out CLFE Jack'
numid=35,iface=CARD,name='Line Out Front Jack'
numid=38,iface=CARD,name='Line Out Side Jack'
numid=36,iface=CARD,name='Line Out Surround Jack'
numid=40,iface=CARD,name='Rear Mic Jack'
numid=34,iface=MIXER,name='Master Playback Switch'
numid=33,iface=MIXER,name='Master Playback Volume'
numid=12,iface=MIXER,name='Headphone Playback Switch'
numid=11,iface=MIXER,name='Headphone Playback Volume'
numid=43,iface=MIXER,name='PCM Playback Volume'
numid=21,iface=MIXER,name='Front Mic Boost Volume'
numid=16,iface=MIXER,name='Front Mic Playback Switch'
numid=15,iface=MIXER,name='Front Mic Playback Volume'
numid=2,iface=MIXER,name='Front Playback Switch'
numid=1,iface=MIXER,name='Front Playback Volume'
numid=4,iface=MIXER,name='Surround Playback Switch'
numid=3,iface=MIXER,name='Surround Playback Volume'
numid=7,iface=MIXER,name='Center Playback Switch'
numid=5,iface=MIXER,name='Center Playback Volume'
numid=8,iface=MIXER,name='LFE Playback Switch'
numid=6,iface=MIXER,name='LFE Playback Volume'
numid=18,iface=MIXER,name='Line Playback Switch'
numid=17,iface=MIXER,name='Line Playback Volume'
numid=22,iface=MIXER,name='Capture Switch'
numid=23,iface=MIXER,name='Capture Switch',index=1
numid=24,iface=MIXER,name='Capture Volume'
numid=25,iface=MIXER,name='Capture Volume',index=1
numid=32,iface=MIXER,name='IEC958 Default PCM Playback Switch'
numid=28,iface=MIXER,name='IEC958 Playback Con Mask'
numid=29,iface=MIXER,name='IEC958 Playback Pro Mask'
numid=30,iface=MIXER,name='IEC958 Playback Default'
numid=31,iface=MIXER,name='IEC958 Playback Switch'
numid=19,iface=MIXER,name='Auto-Mute Mode'
numid=26,iface=MIXER,name='Input Source'
numid=27,iface=MIXER,name='Input Source',index=1
numid=20,iface=MIXER,name='Rear Mic Boost Volume'
numid=14,iface=MIXER,name='Rear Mic Playback Switch'
numid=13,iface=MIXER,name='Rear Mic Playback Volume'
numid=10,iface=MIXER,name='Side Playback Switch'
numid=9,iface=MIXER,name='Side Playback Volume'
I'm not really sure, but I think the "IEC958" items relate to my S/PDIF port. Maybe someone more in the know can shed some light on that.
Edit: In alsamixer, I see "S/PDIF" and "S/PDIE D", both are toggled "ON". Using amixer to query "numid=31" and "numid=32", both "switches", they are toggled "ON", reinforcing my suspicion that those are my S/PDIF port "switches"
Code:
BASH:~/-> amixer -c0 cget numid=31
numid=31,iface=MIXER,name='IEC958 Playback Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on
BASH:~/-> amixer -c0 cget numid=32
numid=32,iface=MIXER,name='IEC958 Default PCM Playback Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on
Last edited by PabloTwo; 11th April 2012 at 12:37 AM.
|

10th April 2012, 09:29 PM
|
|
Registered User
|
|
Join Date: Aug 2008
Posts: 17

|
|
|
Re: Red Light in Headphone Jack - Macbook Pro 5,1
That still didn't work. Here's my output for the commands you gave, as well as my rc.local file.
cat /proc/asound/cards
Code:
0 [NVidia ]: HDA-Intel - HDA NVidia
HDA NVidia at 0xdf480000 irq 21
Running 'amixer -c0 controls' instead of 'amixer controls' did make a difference.
Code:
numid=35,iface=MIXER,name='Master Playback Switch'
numid=34,iface=MIXER,name='Master Playback Volume'
numid=8,iface=MIXER,name='Headphone Playback Switch'
numid=7,iface=MIXER,name='Headphone Playback Volume'
numid=36,iface=MIXER,name='PCM Playback Volume'
numid=2,iface=MIXER,name='Front Playback Switch'
numid=1,iface=MIXER,name='Front Playback Volume'
numid=4,iface=MIXER,name='Surround Playback Switch'
numid=3,iface=MIXER,name='Surround Playback Volume'
numid=6,iface=MIXER,name='LFE Playback Switch'
numid=5,iface=MIXER,name='LFE Playback Volume'
numid=13,iface=MIXER,name='Line Boost Volume'
numid=10,iface=MIXER,name='Line Playback Switch'
numid=9,iface=MIXER,name='Line Playback Volume'
numid=14,iface=MIXER,name='Mic Boost Volume'
numid=12,iface=MIXER,name='Mic Playback Switch'
numid=11,iface=MIXER,name='Mic Playback Volume'
numid=16,iface=MIXER,name='Capture Switch'
numid=17,iface=MIXER,name='Capture Switch',index=1
numid=18,iface=MIXER,name='Capture Switch',index=2
numid=19,iface=MIXER,name='Capture Volume'
numid=20,iface=MIXER,name='Capture Volume',index=1
numid=21,iface=MIXER,name='Capture Volume',index=2
numid=29,iface=MIXER,name='IEC958 Default PCM Playback Switch'
numid=25,iface=MIXER,name='IEC958 Playback Con Mask'
numid=26,iface=MIXER,name='IEC958 Playback Pro Mask'
numid=27,iface=MIXER,name='IEC958 Playback Default'
numid=28,iface=MIXER,name='IEC958 Playback Switch'
numid=31,iface=MIXER,name='IEC958 Capture Default'
numid=30,iface=MIXER,name='IEC958 Capture Switch'
numid=33,iface=MIXER,name='Beep Playback Switch'
numid=32,iface=MIXER,name='Beep Playback Volume'
numid=15,iface=MIXER,name='Channel Mode'
numid=22,iface=MIXER,name='Input Source'
numid=23,iface=MIXER,name='Input Source',index=1
numid=24,iface=MIXER,name='Input Source',index=2
Running 'amixer -c0 cset numid=28 mute' turns off the red light.
My rc.local looks like this
Code:
#!/bin/bash
/home/ryan/Admin/jsz-mbpfand-9c365c9/jsz-mbpfand-9c365c9 & (a fan speed script)
echo '8' > '/sys/class/backlight/apple_backlight/brightness' (setting the screen brightness)
amixer -c0 cset numid=28 mute
Both the fan script and the screen brightness work, so I know there's nothing wrong with my rc.local file itself. But, as soon as I logged in, even with the amixer line in rc.local, the red light came on.
|

10th April 2012, 09:30 PM
|
 |
"Registered User" T-Shirt Winner
|
|
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,126

|
|
|
Re: Red Light in Headphone Jack - Macbook Pro 5,1
I just confirmed that myself by doing:
Code:
BASH:~/-> amixer -c0 cset numid=31 off
numid=31,iface=MIXER,name='IEC958 Playback Switch'
; type=BOOLEAN,access=rw------,values=1
: values=off
then looking at alsamixer and finding "S/PDIF" toggled to OFF (MM).
I wonder if youe audio card still isn't initialized or something at the time the rc.local script(s) run?
Last edited by PabloTwo; 10th April 2012 at 09:35 PM.
|

10th April 2012, 09:36 PM
|
|
Registered User
|
|
Join Date: Aug 2008
Posts: 17

|
|
|
Re: Red Light in Headphone Jack - Macbook Pro 5,1
We must have different models because my red light goes off and S/PDIF is toggled as off in alsamixer after I run 'amixer -c0 cset numid=28 mute'. It's still puzzling why it turns back on after I log in, even with 'amixer -c0 cset numid=28 mute' in rc.local.
Edit:
In fact, I can run that command and simply log out to gdm and the light will come back on.
---------- Post added at 04:36 PM ---------- Previous post was at 04:32 PM ----------
I also tried 'amixer -c0 cset numid=28 off' instead of 'amixer -c0 cset numid=28 mute' and there was no difference.
|

10th April 2012, 09:37 PM
|
 |
"Registered User" T-Shirt Winner
|
|
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,126

|
|
|
Re: Red Light in Headphone Jack - Macbook Pro 5,1
Also, make sure you have ended the "amixer" line with a carriage return.
|

10th April 2012, 09:40 PM
|
|
Registered User
|
|
Join Date: Aug 2008
Posts: 17

|
|
|
Re: Red Light in Headphone Jack - Macbook Pro 5,1
That didn't make a difference either. I just ran 'amixer -c0 cset numid=28 off &', the light went off, I logged out to gdm, and the light came back on. I ran it as both root and normal user.
To make this even weirder, if I mute my main speakers or change their audio levels, they are correctly restored on boot and login/logout.
Last edited by hank863; 10th April 2012 at 09:42 PM.
|

10th April 2012, 09:48 PM
|
 |
"Registered User" T-Shirt Winner
|
|
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,126

|
|
|
Re: Red Light in Headphone Jack - Macbook Pro 5,1
Have you tried, after setting the "numid=28" to off, giving the "aslactl store" command and then logging out/in and/or rebooting?
|

10th April 2012, 09:52 PM
|
|
Registered User
|
|
Join Date: Aug 2008
Posts: 17

|
|
|
Re: Red Light in Headphone Jack - Macbook Pro 5,1
Yeah, I did. That didn't work either, though :/
|

10th April 2012, 09:57 PM
|
 |
"Registered User" T-Shirt Winner
|
|
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,126

|
|
|
Re: Red Light in Headphone Jack - Macbook Pro 5,1
Quote:
|
To make this even weirder, if I mute my main speakers or change their audio levels, they are correctly restored on boot and login/logout.
|
That would infer, to me, that the alsa-restore.service bit is working.... at least in part. One would think the mixer settings would be an "all or nothing" deal when saving to the asound.state file, but that doesn't seem to be the case in reality. Sort of like my headphone volume level on the laptop machine... sometimes it's set to where I left it on boot up, sometimes not, while other major controls seem to "play fair".
---------- Post added at 04:57 PM ---------- Previous post was at 04:53 PM ----------
My other suggestion would be to put the "alsamixer -c0 numid=28 off" line into a bash script, say, call it "die-led" and put that somewhere, then add an "autostart" item to your session log-in, that item just being a call to your "die-led" script. Should work then OK.
|

10th April 2012, 09:59 PM
|
|
Registered User
|
|
Join Date: Aug 2008
Posts: 17

|
|
|
Re: Red Light in Headphone Jack - Macbook Pro 5,1
I guess so. That's unfortunate. This problem is not specific to Fedora. I do remember being able to fix it about a year ago, but maybe an update caused the problems we are seeing now.
Thank you very much for your time and effort!
---------- Post added at 04:59 PM ---------- Previous post was at 04:57 PM ----------
I'll try your last suggestion in a bit and report back.
|

10th April 2012, 10:00 PM
|
 |
"Registered User" T-Shirt Winner
|
|
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,126

|
|
|
Re: Red Light in Headphone Jack - Macbook Pro 5,1
See my last suggestion.... posted same time as your last post.
|

10th April 2012, 10:42 PM
|
|
Registered User
|
|
Join Date: Aug 2008
Posts: 17

|
|
|
Re: Red Light in Headphone Jack - Macbook Pro 5,1
That worked for when I'm logged in. I can live with the red light on boot and whenever I log out to gdm. Thanks for the suggestion and all of your help
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 13:42 (Tuesday, 21-05-2013)
|
|
 |
 |
 |
 |
|
|