Solved MacBook (Pro) 5,1 + Realtek ALC889A sound setup

Atsuri

Active Member

Thanks: 23
Messages: 137

#1
Dear FreeBSD users,

I recently decided to revisit my attempts to install FreeBSD 10.x on an older MacBook 5,1 (2008-2009 series) device. It has nice, integrated nVidia graphics (GeForce 9400M), well supported by the binary blob and a Broadcom bcm4322 wireless adapter that is supposedly being worked on.
In essence, almost everything works as advertised...except sound.

The sound card in question is Realtek ALC889A that was put into MacBook and MacBook Pro 5,1 laptops. I did some basic troubleshooting, though with hardly any progress. I also read forum posts on our FreeBSD forums here, alas it did not seem like anyone achieved much success. Therefore, before we go into any technicalities, I would like to know whether anyone has actually made the Realtek ALC889A chip cooperate.

The primary goal is to get the integrated speakers to work, with a secondary goal of enabling hot-plugging of headphones to the jack port.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 6,232
Messages: 27,212

#2
Is the card detected at all? If so, can you post the output of cat /dev/sndstat?
 
OP
OP
A

Atsuri

Active Member

Thanks: 23
Messages: 137

#3
Is the card detected at all? If so, can you post the output of cat /dev/sndstat?
That's the thing. The card is detected perfectly fine. alsamixer reports several channels and cat dev/sndstat shows that the speakers are selected as the default sound output.

EDIT - Relevant output below:
cat /dev/sndstat:
Code:
Installed devices:
pcm0: <Realtek ALC889A (Internal Analog 3.1/2.0)> (play/rec) default
pcm1: <Realtek ALC889A (Rear Analog)> (play/rec)
pcm2: <Realtek ALC889A (Rear Digital)> (play/rec)
pcm3: <Realtek ALC889A (Rear Analog Mic)> (rec)
dmesg | grep pcm:
Code:
pcm0: <Realtek ALC889A (Internal Analog 3.1/2.0)> at nid 24,26 and 25 on hdaa0
pcm1: <Realtek ALC889A (Rear Analog)> at nid 20 and 21 on hdaa0
pcm2: <Realtek ALC889A (Rear Digital)> at nid 30 and 31 on hdaa0
pcm3: <Realtek ALC889A (Rear Analog Mic)> at nid 27 on hdaa0
sysctl -a | grep hda:
Code:
device   snd_hda
dev.pcm.3.%parent: hdaa0
dev.pcm.2.%parent: hdaa0
dev.pcm.1.%parent: hdaa0
dev.pcm.0.%parent: hdaa0
dev.hdaa.0.reconfig: 0
dev.hdaa.0.gpo_config:
dev.hdaa.0.gpo_state:
dev.hdaa.0.gpio_config: 0=keep 1=keep
dev.hdaa.0.gpio_state: 0=disabled 1=disabled
dev.hdaa.0.gpi_state:
dev.hdaa.0.config: forcestereo,ivref50,ivref80,ivref100,ivref,vref
dev.hdaa.0.nid38: audio mixer [DISABLED]
dev.hdaa.0.nid37: audio output [DISABLED]
dev.hdaa.0.nid36: audio mixer
dev.hdaa.0.nid35: audio mixer
dev.hdaa.0.nid34: audio mixer
dev.hdaa.0.nid33: volume widget [DISABLED]
dev.hdaa.0.nid32: vendor widget [DISABLED]
dev.hdaa.0.nid31_original: 0x01cbe030 as=3 seq=0 device=SPDIF-in conn=Jack ctype=Combo loc=Rear color=White misc=0
dev.hdaa.0.nid31_config: 0x01cbe030 as=3 seq=0 device=SPDIF-in conn=Jack ctype=Combo loc=Rear color=White misc=0
dev.hdaa.0.nid31: pin: SPDIF-in (White Jack)
dev.hdaa.0.nid30_original: 0x014be060 as=6 seq=0 device=SPDIF-out conn=Jack ctype=Combo loc=Rear color=White misc=0
dev.hdaa.0.nid30_config: 0x014be060 as=6 seq=0 device=SPDIF-out conn=Jack ctype=Combo loc=Rear color=White misc=0
dev.hdaa.0.nid30: pin: SPDIF-out (White Jack)
dev.hdaa.0.nid29_original: 0x400000f0 as=15 seq=0 device=Line-out conn=None ctype=Unknown loc=0x00 color=Unknown misc=0
dev.hdaa.0.nid29_config: 0x400000f0 as=15 seq=0 device=Line-out conn=None ctype=Unknown loc=0x00 color=Unknown misc=0
dev.hdaa.0.nid29: beep widget
dev.hdaa.0.nid28_original: 0x400000f0 as=15 seq=0 device=Line-out conn=None ctype=Unknown loc=0x00 color=Unknown misc=0
dev.hdaa.0.nid28_config: 0x400000f0 as=15 seq=0 device=Line-out conn=None ctype=Unknown loc=0x00 color=Unknown misc=0
dev.hdaa.0.nid28: pin: Line-out (None) [DISABLED]
dev.hdaa.0.nid27_original: 0x01a19070 as=7 seq=0 device=Mic conn=Jack ctype=1/8 loc=Rear color=Pink misc=0
dev.hdaa.0.nid27_config: 0x01a19070 as=7 seq=0 device=Mic conn=Jack ctype=1/8 loc=Rear color=Pink misc=0
dev.hdaa.0.nid27: pin: Mic (Pink Jack)
dev.hdaa.0.nid26_original: 0x90100141 as=4 seq=1 device=Speaker conn=Fixed ctype=Unknown loc=Internal color=Unknown misc=1
dev.hdaa.0.nid26_config: 0x90100141 as=4 seq=1 device=Speaker conn=Fixed ctype=Unknown loc=Internal color=Unknown misc=1
dev.hdaa.0.nid26: pin: Speaker (Fixed)
dev.hdaa.0.nid25_original: 0x90a00110 as=1 seq=0 device=Mic conn=Fixed ctype=Unknown loc=Internal color=Unknown misc=1
dev.hdaa.0.nid25_config: 0x90a00110 as=1 seq=0 device=Mic conn=Fixed ctype=Unknown loc=Internal color=Unknown misc=1
dev.hdaa.0.nid25: pin: Mic (Fixed)
dev.hdaa.0.nid24_original: 0x90100140 as=4 seq=0 device=Speaker conn=Fixed ctype=Unknown loc=Internal color=Unknown misc=1
dev.hdaa.0.nid24_config: 0x90100140 as=4 seq=0 device=Speaker conn=Fixed ctype=Unknown loc=Internal color=Unknown misc=1
dev.hdaa.0.nid24: pin: Speaker (Fixed)
dev.hdaa.0.nid23_original: 0x400000f0 as=15 seq=0 device=Line-out conn=None ctype=Unknown loc=0x00 color=Unknown misc=0
dev.hdaa.0.nid23_config: 0x400000f0 as=15 seq=0 device=Line-out conn=None ctype=Unknown loc=0x00 color=Unknown misc=0
dev.hdaa.0.nid23: pin: Line-out (None) [DISABLED]
dev.hdaa.0.nid22_original: 0x400000f0 as=15 seq=0 device=Line-out conn=None ctype=Unknown loc=0x00 color=Unknown misc=0
dev.hdaa.0.nid22_config: 0x400000f0 as=15 seq=0 device=Line-out conn=None ctype=Unknown loc=0x00 color=Unknown misc=0
dev.hdaa.0.nid22: pin: Line-out (None) [DISABLED]
dev.hdaa.0.nid21_original: 0x018b3020 as=2 seq=0 device=Line-in conn=Jack ctype=Combo loc=Rear color=Blue misc=0
dev.hdaa.0.nid21_config: 0x018b3020 as=2 seq=0 device=Line-in conn=Jack ctype=Combo loc=Rear color=Blue misc=0
dev.hdaa.0.nid21: pin: Line-in (Blue Jack)
dev.hdaa.0.nid20_original: 0x012b4050 as=5 seq=0 device=Headphones conn=Jack ctype=Combo loc=Rear color=Green misc=0
dev.hdaa.0.nid20_config: 0x012b4050 as=5 seq=0 device=Headphones conn=Jack ctype=Combo loc=Rear color=Green misc=0
dev.hdaa.0.nid20: pin: Headphones (Green Jack)
dev.hdaa.0.nid19: vendor widget [DISABLED]
dev.hdaa.0.nid18: vendor widget [DISABLED]
dev.hdaa.0.nid17: vendor widget [DISABLED]
dev.hdaa.0.nid16: vendor widget [DISABLED]
dev.hdaa.0.nid15: audio mixer [DISABLED]
dev.hdaa.0.nid14: audio mixer
dev.hdaa.0.nid13: audio mixer
dev.hdaa.0.nid12: audio mixer
dev.hdaa.0.nid11: audio mixer
dev.hdaa.0.nid10: audio input
dev.hdaa.0.nid9: audio input
dev.hdaa.0.nid8: audio input
dev.hdaa.0.nid7: audio input
dev.hdaa.0.nid6: audio output
dev.hdaa.0.nid5: audio output [DISABLED]
dev.hdaa.0.nid4: audio output
dev.hdaa.0.nid3: audio output
dev.hdaa.0.nid2: audio output
dev.hdaa.0.%parent: hdacc0
dev.hdaa.0.%pnpinfo: type=0x01 subsystem=0x106b3f00
dev.hdaa.0.%location: nid=1
dev.hdaa.0.%driver: hdaa
dev.hdaa.0.%desc: Realtek ALC889A Audio Function Group
dev.hdaa.%parent:
dev.hdacc.0.%parent: hdac0
dev.hdacc.0.%pnpinfo: vendor=0x10ec device=0x0885 revision=0x01 stepping=0x03
dev.hdacc.0.%location: cad=0
dev.hdacc.0.%driver: hdacc
dev.hdacc.0.%desc: Realtek ALC889A HDA CODEC
dev.hdacc.%parent:
dev.hdac.0.polling: 0
dev.hdac.0.pindump: 0
dev.hdac.0.%parent: pci0
dev.hdac.0.%pnpinfo: vendor=0x10de device=0x0ac0 subvendor=0x10de subdevice=0xcb79 class=0x040300
dev.hdac.0.%location: pci0:0:8:0 handle=\_SB_.PCI0.HDEF
dev.hdac.0.%driver: hdac
dev.hdac.0.%desc: NVIDIA MCP79 HDA Controller
dev.hdac.%parent:
Any chance the device can be configured properly? :)
 
OP
OP
A

Atsuri

Active Member

Thanks: 23
Messages: 137

#4
I am double-posting as I accidentally found the solution through trial-and-error based on gpio trickery some other people did. The below code in /boot/device.hints solved the problem:
Code:
hint.hdaa.0.config="ovref"
hint.hdaa.0.gpio_config="0=set"
Apparently, sound was configured properly, but the speakers were set to 'off' as I read under device.hints() :).
 

amgpuma

New Member


Messages: 2

#6
Hi, I'm trying to replicate these comands but got the following:

fish: Unsupported use of '='. In fish, please use 'set hint.hdaa.0.config ovref'.
amgpuma@amgpuma-freebsd ~> set hint.hdaa.0.config ovref
set: Variable name 'hint.hdaa.0.config' is not valid. See `help identifiers`.

any clue how can I sort this out?
Many thanks
 

trev

Aspiring Daemon

Thanks: 109
Messages: 605

#7
This is what I put in /etc/sysctl.conf for a 2009 Mac Mini:

Code:
# cat /dev/sndstat
# -> pcm0: <Realtek ALC889A (Analog)> (play/rec)
# -> pcm1: <Realtek ALC889A (Rear Digital)> (play/rec)
# -> pcm2: <Realtek ALC889A (Rear Analog Headphones)> (play) default
# Below to set sound to pcm2 (rear analog headphones) on Mac Mini
dev.hdaa.0.gpio_config="0=set 1=set"
hw.snd.default_unit=2
 

Phishfry

Son of Beastie

Thanks: 961
Messages: 2,937

#8
Hi, I'm trying to replicate these comands but got the following:

fish: Unsupported use of '='. In fish, please use 'set hint.hdaa.0.config ovref'.
amgpuma@amgpuma-freebsd ~> set hint.hdaa.0.config ovref
set: Variable name 'hint.hdaa.0.config' is not valid. See `help identifiers`.

any clue how can I sort this out?
Many thanks
Sorry no one helped you.
You are using the wrong syntax. 'set' is an shell environmental setting.
Type set in to your shell and you will see all your shell settings.

Hints will go in /boot/device.hints
This would work for a one liner:
echo hint.hdaa.0.config ovref >> /boot/device.hints
 
Top