让大家在30分钟内完成APPLEALC的声卡仿冒
背景远景现在的applehda声卡仿冒教程还是老前辈紫米留下来的方法,黑果小兵的制作APPLEALC的教程虽然也很详细,但是也是太过繁琐,让我这种小白操作起来还是觉得麻烦,这里写一篇根据万能声卡VoodooHDA的驱动来快速定制APPLEALC,介于现在APPLEALC的广泛普及,如果制作APPLEALC的定制声卡驱动的话,实际上需要的做的是3件事。提取声卡的 codec 信息制作 lay...
背景
远景现在的applehda声卡仿冒教程还是老前辈紫米留下来的方法,黑果小兵的制作APPLEALC的教程虽然也很详细,但是也是太过繁琐,让我这种小白操作起来还是觉得麻烦,这里写一篇根据万能声卡VoodooHDA的驱动来快速定制APPLEALC,介于现在APPLEALC的广泛普及,如果制作APPLEALC的定制声卡驱动的话,实际上需要的做的是3件事。
- 提取声卡的 codec 信息
- 制作 layout.xml 文件
- 制作 platforms.xml 文件
以上的所有操作都是在mac下操作,无需linux,
前期准备
- Xcode开发工具
- Git
- VoodooHDA.kext驱动
- 已经安装好的黑苹果,但是是由万能声卡驱动的想替换为APPLEALC驱动原生声卡的用户
- getdump 在mac下获取声卡的codec和型号信息
- getDumpXml 获取自动生成的platforms.xml文件
生成configdata数据
好了,废话不多说,开始实操。
首先下载getdump工具,利用工具生成codec工具
sudo cp ~/Downloads/getdump /usr/local/bin # 将getdump命令复制到/usr/local/bin目录下
sudo chmod +x /usr/local/bin/getdump # 为getdump添加执行权限
getdump > ~/Desktop/voodoo_dump.txt
提取codec信息和声卡型号,搜索Probing codec ,从下面的文件中提取如下信息
ound a device of class VoodooHDADevice: IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/HDAU@3/VoodooHDADevice
Probing codec #0...
HDA Codec #0: Intel Haswell HDMI
HDA Codec ID: 0x80862807
Vendor: 0x8086
Device: 0x2807
Revision: 0x00
Stepping: 0x00
PCI Subvendor: 0x397817aa
startNode=1 endNode=2
Found audio FG nid=1 startNode=2 endNode=4 total=2
Processing audio FG cad=0 nid=1...
Powering up...
Parsing audio FG...
GPIO: 0x00000000 NumGPIO=0 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=0
nid 3 0x18560010 as 1 seq 0 Digital-out Jack Digital Special Internal Unknown misc 0
Parsing vendor patch...
Nodes patching. Codec = 0
NumNodes = 2
VHDevice NID= 2 Config=00000000 (audio output ) Cap=00000000 Ctrl=00000000 -- Conns:
VHDevice NID= 3 Config=18560010 (pin: Digital-o) Cap=09000094 Ctrl=00000040 -- Conns: 0=2
Parsing Ctls...
Disabling nonaudio...
Disabling useless...
Patched pins configuration:
nid 3 0x18560010 as 1 seq 0 Digital-out Jack Digital Special Internal Unknown misc 0
Parsing pin associations...
1 associations found:
Association 0 (1) out:
Pin nid=3 seq=0
Redir type=-1 jack=0 def=0
Building AFG tree...
Tracing association 0 (1)
Tracing pin 3 with min nid 0
nid 2 returned 2
nid 3 returned 2
Pin 3 traced to DAC 2
Association 0 (1) trace succeeded
Tracing input monitor
Tracing other input monitors
Tracing beeper
Disabling unassociated widgets...
Disabling nonselected inputs...
Disabling useless...
Disabling crossassociated connections...
Disabling useless...
Binding associations to channels...
Assigning names to signal sources...
Assigning mixers to the tree...
Preparing pin controls...
AFG commit...
Creating PCM devices...
pcmAttach: HDA Intel Haswell HDMI PCM #0 DisplayPort at cad 0 nid 1
+--------------------------------------+
| DUMPING PCM Playback/Record Channels |
+--------------------------------------+
Playback:
Stream cap: 0x00000005
AC3 PCM
PCM cap: 0x001e07f0
16 20 24 32 bits, 32 44 48 88 96 176 192 KHz
DAC: 2
+-------------------------------+
| DUMPING Playback/Record Paths |
+-------------------------------+
Playback:
nid=3 [pin: Digital-out (HDMI)]
|
+ <- nid=2 [audio output] [src: pcm] bindSeq=00000001
+-------------------------+
| DUMPING Volume Controls |
+-------------------------+
Master Volume (OSS: vol)
|
+- control 1 (nid 3 out): dir - out oss: vol, pcm mute
PCM Volume (OSS: pcm)
|
+- control 1 (nid 3 out): dir - out oss: vol, pcm mute
OSS mixer initialization...
Registering PCM channels...
FG config/quirks: forcestereo ivref50 ivref80 ivref100 ivref
HP switch init...
+-------------------+
| DUMPING HDA NODES |
+-------------------+
Default Parameter
-----------------
IN amp: 0x00000000
OUT amp: 0x00000000
nid: 2
Name: audio output
Widget cap: 0x00006611
PWR DIGITAL FORMAT_OVR 8CH
Association: 0 (0x00000001)
OSS: pcm (pcm)
Stream cap: 0x00000005
AC3 PCM
PCM cap: 0x001e07f0
16 20 24 32 bits, 32 44 48 88 96 176 192 KHz
nid: 3
Name: pin: Digital-out (HDMI)
Widget cap: 0x0040778d
CP PWR DIGITAL UNSOL AMP_OVR OUT_AMP 8CH
Association: 0 (0x00000001)
Pin cap: 0x09000094
PDC OUT HDMI DP HBR
Pin config: 0x18560010
Pin control: 0x00000040 OUT
Output amp: 0x80000000
mute=1 step=0 size=0 offset=0
Output val: [0x00 0x00]
connections: 1 enabled 1
|
+ <- nid=2 [audio output]
Found a device of class VoodooHDADevice: IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/HDEF@1B/VoodooHDADevice
Probing codec #0...
HDA Codec #0: Realtek ALC282
HDA Codec ID: 0x10ec0282
Vendor: 0x10ec
Device: 0x0282
Revision: 0x00
Stepping: 0x03
PCI Subvendor: 0x397817aa
startNode=1 endNode=2
Found audio FG nid=1 startNode=2 endNode=36 total=34
Processing audio FG cad=0 nid=1...
Powering up...
Parsing audio FG...
GPIO: 0x40000003 NumGPIO=3 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1
nid 18 0x90a60940 as 4 seq 0 Microphone Fixed Digital N/A Internal Unknown misc 4 NoPresenceDetect
nid 20 0x411111f0 as 15 seq 0 Speaker None 1/8 Rear External Black misc 0 NoPresenceDetect
nid 23 0x411111f0 as 15 seq 0 Speaker None 1/8 Rear External Black misc 0 NoPresenceDetect
nid 24 0x04a11830 as 3 seq 0 Microphone Jack 1/8 Right External Black misc 4
nid 25 0x411111f0 as 15 seq 0 Speaker None 1/8 Rear External Black misc 0 NoPresenceDetect
nid 26 0x411111f0 as 15 seq 0 Speaker None 1/8 Rear External Black misc 0 NoPresenceDetect
nid 27 0x90170110 as 1 seq 0 Speaker Fixed Analog N/A Internal Unknown misc 0 NoPresenceDetect
Patching widget caps nid=29 0x00400400 -> 0x00700400
nid 30 0x04441120 as 2 seq 0 SPDIF-out Jack RCA Right External Black misc 0 NoPresenceDetect
nid 33 0x04211050 as 5 seq 0 Headphones Jack 1/8 Right External Black misc 0
Parsing vendor patch...
Nodes patching. Codec = 0
NumNodes = 2
VHDevice NID= 2 Config=00000000 (audio output ) Cap=00000000 Ctrl=00000000 -- Conns:
VHDevice NID= 3 Config=00000000 (audio output ) Cap=00000000 Ctrl=00000000 -- Conns:
VHDevice NID= 4 Config=00000000 (vendor widget ) Cap=00000000 Ctrl=00000000 -- Conns:
VHDevice NID= 5 Config=00000000 (vendor widget ) Cap=00000000 Ctrl=00000000 -- Conns:
VHDevice NID= 6 Config=00000000 (audio output ) Cap=00000000 Ctrl=00000000 -- Conns:
VHDevice NID= 7 Config=00000000 (vendor widget ) Cap=00000000 Ctrl=00000000 -- Conns:
VHDevice NID= 8 Config=00000000 (audio input ) Cap=00000000 Ctrl=00000000 -- Conns: 0=35
VHDevice NID= 9 Config=00000000 (audio input ) Cap=00000000 Ctrl=00000000 -- Conns: 0=34
VHDevice NID=10 Config=00000000 (vendor widget ) Cap=00000000 Ctrl=00000000 -- Conns:
VHDevice NID=11 disabled for Realtek by user info.list
VHDevice NID=12 Config=00000000 (audio mixer ) Cap=00000000 Ctrl=00000000 -- Conns: 0=2 1=11
VHDevice NID=13 Config=00000000 (audio mixer ) Cap=00000000 Ctrl=00000000 -- Conns: 0=3 1=11
VHDevice NID=14 Config=00000000 (vendor widget ) Cap=00000000 Ctrl=00000000 -- Conns:
VHDevice NID=15 Config=00000000 (audio mixer ) Cap=00000000 Ctrl=00000000 -- Conns: 0=13
VHDevice NID=16 Config=00000000 (vendor widget ) Cap=00000000 Ctrl=00000000 -- Conns:
VHDevice NID=17 Config=00000000 (audio input ) Cap=00000000 Ctrl=00000000 -- Conns: 0=18
VHDevice NID=18 Config=90a60940 (pin: Microphon) Cap=00000020 Ctrl=00000000 -- Conns:
VHDevice NID=19 Config=00000000 (vendor widget ) Cap=00000000 Ctrl=00000000 -- Conns:
VHDevice NID=20 Config=411111f0 (pin: Speaker () Cap=00010014 Ctrl=00000000 -- Conns: 0=12
VHDevice NID=21 Config=00000000 (vendor widget ) Cap=00000000 Ctrl=00000000 -- Conns:
VHDevice NID=22 Config=00000000 (vendor widget ) Cap=00000000 Ctrl=00000000 -- Conns:
VHDevice NID=23 Config=411111f0 (pin: Speaker () Cap=00000010 Ctrl=00000000 -- Conns: 0=15
VHDevice NID=24 Config=04a11830 (pin: Microphon) Cap=00003724 Ctrl=00000020 -- Conns:
VHDevice NID=25 Config=411111f0 (pin: Speaker () Cap=00003724 Ctrl=00000020 -- Conns:
VHDevice NID=26 Config=411111f0 (pin: Speaker () Cap=00003724 Ctrl=00000020 -- Conns:
VHDevice NID=27 Config=90170110 (pin: Speaker () Cap=0000373c Ctrl=00000020 -- Conns: 0=12 1=13
VHDevice NID=28 Config=00000000 (vendor widget ) Cap=00000000 Ctrl=00000000 -- Conns:
VHDevice NID=29 Config=00000000 (beep widget ) Cap=00000000 Ctrl=00000000 -- Conns:
VHDevice NID=30 Config=04441120 (pin: SPDIF-out) Cap=00000014 Ctrl=00000040 -- Conns: 0=6
VHDevice NID=31 Config=00000000 (vendor widget ) Cap=00000000 Ctrl=00000000 -- Conns:
VHDevice NID=32 Config=00000000 (vendor widget ) Cap=00000000 Ctrl=00000000 -- Conns:
VHDevice NID=33 Config=04211050 (pin: Headphone) Cap=0000001c Ctrl=00000000 -- Conns: 0=12 1=13
VHDevice NID=34 Config=00000000 (audio mixer ) Cap=00000000 Ctrl=00000000 -- Conns: 0=24 1=25 2=26 3=27 4=29 5=11
VHDevice NID=35 Config=00000000 (audio mixer ) Cap=00000000 Ctrl=00000000 -- Conns: 0=24 1=25 2=26 3=27 4=29 5=11
Parsing Ctls...
Disabling nonaudio...
Disabling useless...
Disabling control 10 nid 20 cnid -1 due to disabled widget.
Disabling control 11 nid 23 cnid -1 due to disabled widget.
Disabling control 13 nid 25 cnid -1 due to disabled widget.
Disabling control 14 nid 26 cnid -1 due to disabled widget.
Disabling control 19 nid 34 cnid 25 due to disabled widget.
Disabling control 20 nid 34 cnid 26 due to disabled widget.
Disabling control 24 nid 35 cnid 25 due to disabled widget.
Disabling control 25 nid 35 cnid 26 due to disabled widget.
Disabling nid 12 connection 1 due to disabled child widget.
Disabling nid 13 connection 1 due to disabled child widget.
Disabling nid 15 due to all it's consumers disabled.
Disabling nid 34 connection 5 due to disabled child widget.
Disabling nid 35 connection 5 due to disabled child widget.
Disabling control 7 nid 15 cnid 13 due to disabled widget.
Patched pins configuration:
nid 18 0x90a60940 as 4 seq 0 Microphone Fixed Digital N/A Internal Unknown misc 4 NoPresenceDetect
nid 20 0x411111f0 as 15 seq 0 Speaker None 1/8 Rear External Black misc 0 NoPresenceDetect [DISABLED]
nid 23 0x411111f0 as 15 seq 0 Speaker None 1/8 Rear External Black misc 0 NoPresenceDetect [DISABLED]
nid 24 0x04a11830 as 3 seq 0 Microphone Jack 1/8 Right External Black misc 4
nid 25 0x411111f0 as 15 seq 0 Speaker None 1/8 Rear External Black misc 0 NoPresenceDetect [DISABLED]
nid 26 0x411111f0 as 15 seq 0 Speaker None 1/8 Rear External Black misc 0 NoPresenceDetect [DISABLED]
nid 27 0x90170110 as 1 seq 0 Speaker Fixed Analog N/A Internal Unknown misc 0 NoPresenceDetect
nid 30 0x04441120 as 2 seq 0 SPDIF-out Jack RCA Right External Black misc 0 NoPresenceDetect
nid 33 0x04211050 as 5 seq 0 Headphones Jack 1/8 Right External Black misc 0
Parsing pin associations...
5 associations found:
Association 0 (1) out:
Pin nid=27 seq=0
Redir type=-1 jack=-1 def=0
Association 1 (2) out:
Pin nid=30 seq=0
Redir type=-1 jack=-1 def=0
Association 2 (3) in:
Pin nid=24 seq=0
Redir type=-1 jack=0 def=0
Association 3 (4) in:
Pin nid=18 seq=0
Redir type=-1 jack=-1 def=0
Association 4 (5) out:
Pin nid=33 seq=0
Redir type=-1 jack=0 def=0
Building AFG tree...
Tracing association 0 (1)
Tracing pin 27 with min nid 0
nid 2 returned 2
nid 12 returned 2
nid 3 returned 3
nid 13 returned 3
nid 27 returned 2
Pin 27 traced to DAC 2
Association 0 (1) trace succeeded
Tracing association 1 (2)
Tracing pin 30 with min nid 0
nid 6 returned 6
nid 30 returned 6
Pin 30 traced to DAC 6
Association 1 (2) trace succeeded
Tracing association 2 (3)
Tracing pin 24 to ADC 8
tracing via nid 24
tracing via nid 34
tracing via nid 9
nid 9 returned 0
nid 34 returned 0
tracing via nid 35
tracing via nid 8
nid 8 returned 1
nid 35 returned 1
nid 24 returned 1
Pin 24 traced to ADC 8
Association 2 (3) trace succeeded
Tracing association 3 (4)
Tracing pin 18 to ADC 9
tracing via nid 18
tracing via nid 17
nid 17 returned 0
nid 18 returned 0
Unable to trace pin 18 to ADC 9, undo traces
Tracing pin 18 to ADC 17
tracing via nid 18
tracing via nid 17
nid 17 returned 1
nid 18 returned 1
Pin 18 traced to ADC 17
Association 3 (4) trace succeeded
Tracing association 4 (5)
Tracing pin 33 with min nid 0
nid 12 busy by association 0
nid 3 returned 3
nid 13 returned 3
nid 33 returned 3
Pin 33 traced to DAC 3
Association 4 (5) trace succeeded
Tracing input monitor
Tracing nid mix 35 to out
tracing via nid 35
tracing via nid 8
nid 8 busy by input association 2
nid 35 returned 0
Tracing other input monitors
Tracing nid complex 18 to out
tracing via nid 18
tracing via nid 17
nid 17 busy by input association 3
nid 18 returned 0
Tracing nid complex 24 to out
tracing via nid 24
tracing via nid 34
tracing via nid 9
nid 9 returned 0
nid 34 returned 0
tracing via nid 35
nid 35 busy by input association 2
nid 24 returned 0
Tracing beeper
Tracing nid 29 to out
tracing via nid 29
tracing via nid 34
tracing via nid 9
nid 9 returned 0
nid 34 returned 0
tracing via nid 35
nid 35 busy by input association 2
nid 29 returned 0
Disabling unassociated widgets...
Disabling nonselected inputs...
Disabling useless...
Disabling control 4 nid 9 cnid -1 due to disabled widget.
Disabling control 18 nid 34 cnid 24 due to disabled widget.
Disabling control 21 nid 34 cnid 27 due to disabled widget.
Disabling control 22 nid 34 cnid 29 due to disabled widget.
Disabling crossassociated connections...
Disabling useless...
Binding associations to channels...
Assigning names to signal sources...
Assigning mixers to the tree...
Preparing pin controls...
AFG commit...
Creating PCM devices...
pcmAttach: HDA Realtek ALC282 PCM #0 Analog at cad 0 nid 1
+--------------------------------------+
| DUMPING PCM Playback/Record Channels |
+--------------------------------------+
Playback:
Stream cap: 0x00000001
PCM
PCM cap: 0x000e0560
16 20 24 bits, 44 48 96 192 KHz
DAC: 2
Record:
Stream cap: 0x00000001
PCM
PCM cap: 0x000e0560
16 20 24 bits, 44 48 96 192 KHz
ADC: 8
+-------------------------------+
| DUMPING Playback/Record Paths |
+-------------------------------+
Playback:
nid=27 [pin: Speaker (Analog)]
|
+ <- nid=12 [audio mixer] [src: mix] bindSeq=00000001
|
+ <- nid=2 [audio output] [src: pcm] bindSeq=00000001
Record:
nid=8 [audio input]
|
+ <- nid=35 [audio mixer] [src: mix] bindSeq=00000001
|
+ <- nid=24 [pin: Microphone (Black Right)] [src: mic] bindSeq=00000001
+ <- nid=29 [beep widget]
Input Mix:
nid=12 [audio mixer]
|
+ <- nid=2 [audio output] [src: pcm] bindSeq=00000001
nid=13 [audio mixer]
|
+ <- nid=3 [audio output] [src: pcm] bindSeq=00000001
nid=35 [audio mixer]
|
+ <- nid=24 [pin: Microphone (Black Right)] [src: mic] bindSeq=00000001
+ <- nid=29 [beep widget]
+-------------------------+
| DUMPING Volume Controls |
+-------------------------+
Master Volume (OSS: vol)
|
+- control 1 (nid 2 out): dir - out oss: vol, pcm, mix -65/+0dB (88 steps)
+- control 5 (nid 12 in 0): dir - out oss: vol, pcm, mix mute
+- control 15 (nid 27 out): dir - out oss: vol, mix mute
PCM Volume (OSS: pcm)
|
+- control 1 (nid 2 out): dir - out oss: vol, pcm, mix -65/+0dB (88 steps)
+- control 5 (nid 12 in 0): dir - out oss: vol, pcm, mix mute
Microphone Volume (OSS: mic)
|
+- control 12 (nid 24 in 0): dir - in oss: mic +0/+36dB (4 steps)
+- control 23 (nid 35 in 0): dir - in oss: mic, rec mute
Speaker/Beep Volume (OSS: speaker)
|
+- control 27 (nid 35 in 4): dir - in oss: speaker, rec mute
Recording Level (OSS: rec)
|
+- control 3 (nid 8 in 0): dir - in oss: mix, rec -17/+30dB (64 steps) + mute
+- control 23 (nid 35 in 0): dir - in oss: mic, rec mute
+- control 27 (nid 35 in 4): dir - in oss: speaker, rec mute
Input Mix Level (OSS: mix)
|
+- control 1 (nid 2 out): dir - out oss: vol, pcm, mix -65/+0dB (88 steps)
+- control 3 (nid 8 in 0): dir - in oss: mix, rec -17/+30dB (64 steps) + mute
+- control 5 (nid 12 in 0): dir - out oss: vol, pcm, mix mute
+- control 15 (nid 27 out): dir - out oss: vol, mix mute
OSS mixer initialization...
Registering PCM channels...
pcmAttach: HDA Realtek ALC282 PCM #1 Digital at cad 0 nid 1
+--------------------------------------+
| DUMPING PCM Playback/Record Channels |
+--------------------------------------+
Playback:
Stream cap: 0x00000005
AC3 PCM
PCM cap: 0x000e05e0
16 20 24 bits, 44 48 88 96 192 KHz
DAC: 6
+-------------------------------+
| DUMPING Playback/Record Paths |
+-------------------------------+
Playback:
nid=30 [pin: SPDIF-out (Black Right)]
|
+ <- nid=6 [audio output] [src: pcm] bindSeq=00000001
+-------------------------+
| DUMPING Volume Controls |
+-------------------------+
OSS mixer initialization...
Registering PCM channels...
pcmAttach: HDA Realtek ALC282 PCM #2 Analog at cad 0 nid 1
+--------------------------------------+
| DUMPING PCM Playback/Record Channels |
+--------------------------------------+
Playback:
Stream cap: 0x00000001
PCM
PCM cap: 0x000e0560
16 20 24 bits, 44 48 96 192 KHz
DAC: 3
Record:
Stream cap: 0x00000001
PCM
PCM cap: 0x000e0560
16 20 24 bits, 44 48 96 192 KHz
ADC: 17
+-------------------------------+
| DUMPING Playback/Record Paths |
+-------------------------------+
Playback:
nid=33 [pin: Headphones (Black Right)]
|
+ <- nid=13 [audio mixer] [src: mix] bindSeq=00000001
|
+ <- nid=3 [audio output] [src: pcm] bindSeq=00000001
Record:
nid=17 [audio input]
|
+ <- nid=18 [pin: Microphone (Digital)] [src: monitor] bindSeq=00000001
+-------------------------+
| DUMPING Volume Controls |
+-------------------------+
Master Volume (OSS: vol)
|
+- control 2 (nid 3 out): dir - out oss: vol, pcm, mix -65/+0dB (88 steps)
+- control 6 (nid 13 in 0): dir - out oss: vol, pcm, mix mute
+- control 17 (nid 33 out): dir - out oss: vol, mix mute
PCM Volume (OSS: pcm)
|
+- control 2 (nid 3 out): dir - out oss: vol, pcm, mix -65/+0dB (88 steps)
+- control 6 (nid 13 in 0): dir - out oss: vol, pcm, mix mute
Microphone2 Volume (OSS: monitor)
|
+- control 9 (nid 18 in 0): dir - in oss: monitor +0/+36dB (4 steps)
Recording Level (OSS: rec)
|
+- control 8 (nid 17 in 0): dir - in oss: rec -17/+30dB (64 steps) + mute
Input Mix Level (OSS: mix)
|
+- control 2 (nid 3 out): dir - out oss: vol, pcm, mix -65/+0dB (88 steps)
+- control 6 (nid 13 in 0): dir - out oss: vol, pcm, mix mute
+- control 17 (nid 33 out): dir - out oss: vol, mix mute
OSS mixer initialization...
Registering PCM channels...
FG config/quirks: forcestereo ivref50 ivref80 ivref100 ivref
HP switch init...
+-------------------+
| DUMPING HDA NODES |
+-------------------+
Default Parameter
-----------------
Stream cap: 0x00000001
PCM
PCM cap: 0x000e0560
16 20 24 bits, 44 48 96 192 KHz
IN amp: 0x00000000
OUT amp: 0x00000000
nid: 2
Name: audio output
Widget cap: 0x0000041d
PWR FORMAT_OVR AMP_OVR OUT_AMP STEREO
Association: 0 (0x00000001)
OSS: pcm (pcm)
Stream cap: 0x00000001
PCM
PCM cap: 0x000e0560
16 20 24 bits, 44 48 96 192 KHz
Output amp: 0x00025757
mute=0 step=87 size=2 offset=87
Output val: [0x38 0x38]
nid: 3
Name: audio output
Widget cap: 0x0000041d
PWR FORMAT_OVR AMP_OVR OUT_AMP STEREO
Association: 4 (0x00000001)
OSS: pcm (pcm)
Stream cap: 0x00000001
PCM
PCM cap: 0x000e0560
16 20 24 bits, 44 48 96 192 KHz
Output amp: 0x00025757
mute=0 step=87 size=2 offset=87
Output val: [0x38 0x38]
nid: 4 [DISABLED]
Name: vendor widget
Widget cap: 0x00f00000
nid: 5 [DISABLED]
Name: vendor widget
Widget cap: 0x00f00000
nid: 6
Name: audio output
Widget cap: 0x00000611
PWR DIGITAL FORMAT_OVR STEREO
Association: 1 (0x00000001)
OSS: pcm (pcm)
Stream cap: 0x00000001
PCM
PCM cap: 0x000e05e0
16 20 24 bits, 44 48 88 96 192 KHz
nid: 7 [DISABLED]
Name: vendor widget
Widget cap: 0x00f00000
nid: 8
Name: audio input
Widget cap: 0x0010051b
PWR FORMAT_OVR AMP_OVR IN_AMP STEREO
Association: 2 (0x00000001)
Stream cap: 0x00000001
PCM
PCM cap: 0x000e0560
16 20 24 bits, 44 48 96 192 KHz
Input amp: 0x80023f17
mute=1 step=63 size=2 offset=23
Input val: [0x33 0x33]
connections: 1 enabled 1
|
+ <- nid=35 [audio mixer]
nid: 9 [DISABLED]
Name: audio input
Widget cap: 0x0010051b
PWR FORMAT_OVR AMP_OVR IN_AMP STEREO
Stream cap: 0x00000001
PCM
PCM cap: 0x000e0560
16 20 24 bits, 44 48 96 192 KHz
Input amp: 0x80023f17
mute=1 step=63 size=2 offset=23
Input val: [0x80 0x80]
connections: 1 enabled 1
|
+ <- nid=34 [audio mixer] [DISABLED]
nid: 10 [DISABLED]
Name: vendor widget
Widget cap: 0x00f00000
nid: 11 [DISABLED]
Name: audio mixer
Widget cap: 0x0020010b
AMP_OVR IN_AMP STEREO
Input amp: 0x80051f17
mute=1 step=31 size=5 offset=23
Input val: [0x97 0x97] [0x97 0x97] [0x97 0x97] [0x97 0x97] [0x97 0x97]
connections: 5 enabled 5
|
+ <- nid=24 [pin: Microphone (Black Right)]
+ <- nid=25 [pin: Speaker (None)] [DISABLED]
+ <- nid=26 [pin: Speaker (None)] [DISABLED]
+ <- nid=27 [pin: Speaker (Analog)]
+ <- nid=29 [beep widget]
nid: 12
Name: audio mixer
Widget cap: 0x0020010b
AMP_OVR IN_AMP STEREO
Association: 0 (0x00000001)
OSS: mix (mix)
Input amp: 0x80000000
mute=1 step=0 size=0 offset=0
Input val: [0x00 0x00] [0x80 0x80]
connections: 2 enabled 1
|
+ <- nid=2 [audio output]
+ [DISABLED] <- nid=11 [audio mixer] [DISABLED]
nid: 13
Name: audio mixer
Widget cap: 0x0020010b
AMP_OVR IN_AMP STEREO
Association: 4 (0x00000001)
OSS: mix (mix)
Input amp: 0x80000000
mute=1 step=0 size=0 offset=0
Input val: [0x00 0x00] [0x80 0x80]
connections: 2 enabled 1
|
+ <- nid=3 [audio output]
+ [DISABLED] <- nid=11 [audio mixer] [DISABLED]
nid: 14 [DISABLED]
Name: vendor widget
Widget cap: 0x00f00000
nid: 15 [DISABLED]
Name: audio mixer
Widget cap: 0x0020010a
AMP_OVR IN_AMP
Input amp: 0x80000000
mute=1 step=0 size=0 offset=0
Input val: [0x80 0x80]
connections: 1 enabled 1
|
+ <- nid=13 [audio mixer]
nid: 16 [DISABLED]
Name: vendor widget
Widget cap: 0x00f00000
nid: 17
Name: audio input
Widget cap: 0x0010051b
PWR FORMAT_OVR AMP_OVR IN_AMP STEREO
Association: 3 (0x00000001)
Stream cap: 0x00000001
PCM
PCM cap: 0x000e0560
16 20 24 bits, 44 48 96 192 KHz
Input amp: 0x80023f17
mute=1 step=63 size=2 offset=23
Input val: [0x39 0x39]
connections: 1 enabled 1
|
+ <- nid=18 [pin: Microphone (Digital)]
nid: 18
Name: pin: Microphone (Digital)
Widget cap: 0x0040040b
PWR AMP_OVR IN_AMP STEREO
Association: 3 (0x00000001)
OSS: monitor (monitor)
Pin cap: 0x00000020
IN
Pin config: 0x90a60940
Pin control: 0x00000020 IN
Input amp: 0x002f0300
mute=0 step=3 size=47 offset=0
Input val: [0x02 0x02]
nid: 19 [DISABLED]
Name: vendor widget
Widget cap: 0x00f00000
nid: 20 [DISABLED]
Name: pin: Speaker (None)
Widget cap: 0x0040058d
PWR UNSOL AMP_OVR OUT_AMP STEREO
Pin cap: 0x00010014
PDC OUT EAPD
Pin config: 0x411111f0
Pin control: 0x00000000
EAPD: 0x00000002
Output amp: 0x80000000
mute=1 step=0 size=0 offset=0
Output val: [0x80 0x80]
connections: 1 enabled 1
|
+ <- nid=12 [audio mixer]
nid: 21 [DISABLED]
Name: vendor widget
Widget cap: 0x00f00000
nid: 22 [DISABLED]
Name: vendor widget
Widget cap: 0x00f00000
nid: 23 [DISABLED]
Name: pin: Speaker (None)
Widget cap: 0x0040050c
PWR AMP_OVR OUT_AMP
Pin cap: 0x00000010
OUT
Pin config: 0x411111f0
Pin control: 0x00000000
Output amp: 0x80000000
mute=1 step=0 size=0 offset=0
Output val: [0x80 0x80]
connections: 1 enabled 1
|
+ <- nid=15 [audio mixer] [DISABLED]
nid: 24
Name: pin: Microphone (Black Right)
Widget cap: 0x0040048b
PWR UNSOL AMP_OVR IN_AMP STEREO
Association: 2 (0x00000001)
OSS: mic (mic)
Pin cap: 0x00003724
PDC IN VREF[ 50 80 100 GROUND HIZ ]
Pin config: 0x04a11830
Pin control: 0x00000025 IN VREFs
Input amp: 0x002f0300
mute=0 step=3 size=47 offset=0
Input val: [0x02 0x02]
nid: 25 [DISABLED]
Name: pin: Speaker (None)
Widget cap: 0x0040048b
PWR UNSOL AMP_OVR IN_AMP STEREO
Pin cap: 0x00003724
PDC IN VREF[ 50 80 100 GROUND HIZ ]
Pin config: 0x411111f0
Pin control: 0x00000000
Input amp: 0x002f0300
mute=0 step=3 size=47 offset=0
Input val: [0x00 0x00]
nid: 26 [DISABLED]
Name: pin: Speaker (None)
Widget cap: 0x0040048b
PWR UNSOL AMP_OVR IN_AMP STEREO
Pin cap: 0x00003724
PDC IN VREF[ 50 80 100 GROUND HIZ ]
Pin config: 0x411111f0
Pin control: 0x00000000
Input amp: 0x002f0300
mute=0 step=3 size=47 offset=0
Input val: [0x00 0x00]
nid: 27
Name: pin: Speaker (Analog)
Widget cap: 0x0040058f
PWR UNSOL AMP_OVR OUT_AMP IN_AMP STEREO
Association: 0 (0x00000001)
Pin cap: 0x0000373c
PDC HP OUT IN VREF[ 50 80 100 GROUND HIZ ]
Pin config: 0x90170110
Pin control: 0x00000040 OUT
Output amp: 0x80000000
mute=1 step=0 size=0 offset=0
Output val: [0x00 0x00]
Input amp: 0x002f0300
mute=0 step=3 size=47 offset=0
Input val: [0x00 0x00]
connections: 2 enabled 1
|
+ <- nid=12 [audio mixer] (selected)
+ [DISABLED] <- nid=13 [audio mixer]
nid: 28 [DISABLED]
Name: vendor widget
Widget cap: 0x00f00000
nid: 29
Name: beep widget
Widget cap: 0x00700400
PWR
Association: -2 (0x00000000)
OSS: speaker (speaker)
nid: 30
Name: pin: SPDIF-out (Black Right)
Widget cap: 0x00400781
PWR DIGITAL UNSOL STEREO
Association: 1 (0x00000001)
Pin cap: 0x00000014
PDC OUT
Pin config: 0x04441120
Pin control: 0x00000040 OUT
connections: 1 enabled 1
|
+ <- nid=6 [audio output]
nid: 31 [DISABLED]
Name: vendor widget
Widget cap: 0x00f00000
nid: 32 [DISABLED]
Name: vendor widget
Widget cap: 0x00f00040
PROC
nid: 33
Name: pin: Headphones (Black Right)
Widget cap: 0x0040058d
PWR UNSOL AMP_OVR OUT_AMP STEREO
Association: 4 (0x00000001)
Pin cap: 0x0000001c
PDC HP OUT
Pin config: 0x04211050
Pin control: 0x000000c0 HP OUT
Output amp: 0x80000000
mute=1 step=0 size=0 offset=0
Output val: [0x00 0x00]
connections: 2 enabled 1
|
+ [DISABLED] <- nid=12 [audio mixer]
+ <- nid=13 [audio mixer] (selected)
nid: 34 [DISABLED]
Name: audio mixer
Widget cap: 0x0020010b
AMP_OVR IN_AMP STEREO
Input amp: 0x80000000
mute=1 step=0 size=0 offset=0
Input val: [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80]
connections: 6 enabled 3
|
+ <- nid=24 [pin: Microphone (Black Right)]
+ [DISABLED] <- nid=25 [pin: Speaker (None)] [DISABLED]
+ [DISABLED] <- nid=26 [pin: Speaker (None)] [DISABLED]
+ <- nid=27 [pin: Speaker (Analog)]
+ <- nid=29 [beep widget]
+ [DISABLED] <- nid=11 [audio mixer] [DISABLED]
nid: 35
Name: audio mixer
Widget cap: 0x0020010b
AMP_OVR IN_AMP STEREO
Association: 2 (0x00000001)
OSS: mix (mix)
Input amp: 0x80000000
mute=1 step=0 size=0 offset=0
Input val: [0x00 0x00] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x00 0x00] [0x80 0x80]
connections: 6 enabled 2
|
+ <- nid=24 [pin: Microphone (Black Right)]
+ [DISABLED] <- nid=25 [pin: Speaker (None)] [DISABLED]
+ [DISABLED] <- nid=26 [pin: Speaker (None)] [DISABLED]
+ [DISABLED] <- nid=27 [pin: Speaker (Analog)]
+ <- nid=29 [beep widget]
+ [DISABLED] <- nid=11 [audio mixer] [DISABLED]
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
codec信息和节点信息
找到的Intel的集成声卡信息
Probing codec #0...
HDA Codec #0: Realtek ALC282
HDA Codec ID: 0x10ec0282
Vendor: 0x10ec
Device: 0x0282
Revision: 0x00
Stepping: 0x03
PCI Subvendor: 0x397817aa
startNode=1 endNode=2
Found audio FG nid=1 startNode=2 endNode=36 total=34
Intel的集成HDMI的信息(这个暂时无关紧要)
Probing codec #0...
HDA Codec #0: Intel Haswell HDMI
HDA Codec ID: 0x80862807
Vendor: 0x8086
Device: 0x2807
Revision: 0x00
Stepping: 0x00
PCI Subvendor: 0x397817aa
startNode=1 endNode=2
Found audio FG nid=1 startNode=2 endNode=4 total=2
搜索Patched pins configuration:信息,提取pin default相关信息
Patched pins configuration:
nid 18 0x90a60940 as 4 seq 0 Microphone Fixed Digital N/A Internal Unknown misc 4 NoPresenceDetect
nid 20 0x411111f0 as 15 seq 0 Speaker None 1/8 Rear External Black misc 0 NoPresenceDetect [DISABLED]
nid 23 0x411111f0 as 15 seq 0 Speaker None 1/8 Rear External Black misc 0 NoPresenceDetect [DISABLED]
nid 24 0x04a11830 as 3 seq 0 Microphone Jack 1/8 Right External Black misc 4
nid 25 0x411111f0 as 15 seq 0 Speaker None 1/8 Rear External Black misc 0 NoPresenceDetect [DISABLED]
nid 26 0x411111f0 as 15 seq 0 Speaker None 1/8 Rear External Black misc 0 NoPresenceDetect [DISABLED]
nid 27 0x90170110 as 1 seq 0 Speaker Fixed Analog N/A Internal Unknown misc 0 NoPresenceDetect
nid 30 0x04441120 as 2 seq 0 SPDIF-out Jack RCA Right External Black misc 0 NoPresenceDetect
nid 33 0x04211050 as 5 seq 0 Headphones Jack 1/8 Right External Black misc 0
生成applealc需要的pin configuration信息
将PinDefault进行小端转换little-endian,这里借用一张紫米教程里面的图片进行小端转换的理解:
紫米这张图上的小端转换,
pin configuration的规则是,把pin default按两个一组,分为四组结构类似于这样
Address + Node + 71c +【c】 Address + Node + 71d +【d】 Address + Node + 71e +【e】 Address + Node + 71f +【f】
这样四组数据加上刚才小端转换后的组,这个config data可以通过列式编辑工具来批量处理。
这里用VS Code来处理,我会做个视频来,演示如何具体操作。
处理完之后的格式如下所示
01271c60 01271d01 01271ea0 01271f90
01471cf0 01471d00 01471d00 01471f40
01771cf0 01771d00 01771e00 01771f40
01871c70 01871d90 01871e81 01871f01
01971cf0 01971d00 01971e00 01971f40
01a71cf0 01a71d00 01a71e00 01a71f40
01b71c10 01b71d10 01b71e13 01b71f99
01d71cf0 01d71d00 01d71e00 01d71f40
01e71c90 01e71d61 01e71e4b 01e71f01
02171c20 02171d40 02171e21 02171f01
最整理为一行
01271c60 01271d01 01271ea0 01271f90 01471cf0 01471d00 01471d00 01471f40 01771cf0 01771d00 01771e00 01771f40 01871c70 01871d90 01871e81 01871f01 01971cf0 01971d00 01971e00 01971f40 01a71cf0 01a71d00 01a71e00 01a71f40 01b71c10 01b71d10 01b71e13 01b71f99 01d71cf0 01d71d00 01d71e00 01d71f40 01e71c90 01e71d61 01e71e4b 01e71f01 02171c20 02171d40 02171e21 02171f01
处理pin configuration信息
需要把上面的数据添节点信息由10进制转换为16进制。其他的按上面的来操作生成configdata
生成paltform.xml
然后执行GetDumpXml,执行之后会在桌面上生成Platform.xml文件,大部分情况下这个文件不需要再调整。
DumpXML_Realtek ALC282
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CommonPeripheralDSP</key>
<array>
<dict>
<key>DeviceID</key>
<integer>0</integer>
<key>DeviceType</key>
<string>Headphone</string>
</dict>
<dict>
<key>DeviceID</key>
<integer>0</integer>
<key>DeviceType</key>
<string>Microphone</string>
</dict>
</array>
<key>PathMaps</key>
<array>
<dict>
<key>PathMap</key>
<array>
<array>
<array>
<array>
<dict>
<key>Amp</key>
<dict>
<key>Channels</key>
<array>
<dict>
<key>Bind</key>
<integer>1</integer>
<key>Channel</key>
<integer>1</integer>
</dict>
<dict>
<key>Bind</key>
<integer>2</integer>
<key>Channel</key>
<integer>2</integer>
</dict>
</array>
<key>MuteInputAmp</key>
<true/>
<key>PublishMute</key>
<false/>
<key>PublishVolume</key>
<false/>
<key>VolumeInputAmp</key>
<true/>
</dict>
<key>NodeID</key>
<integer>8</integer>
</dict>
<dict>
<key>Amp</key>
<dict>
<key>Channels</key>
<array>
<dict>
<key>Bind</key>
<integer>1</integer>
<key>Channel</key>
<integer>1</integer>
</dict>
<dict>
<key>Bind</key>
<integer>2</integer>
<key>Channel</key>
<integer>2</integer>
</dict>
</array>
<key>MuteInputAmp</key>
<true/>
<key>PublishMute</key>
<false/>
<key>PublishVolume</key>
<false/>
<key>VolumeInputAmp</key>
<false/>
</dict>
<key>NodeID</key>
<integer>35</integer>
</dict>
<dict>
<key>Boost</key>
<integer>1</integer>
<key>NodeID</key>
<integer>24</integer>
</dict>
</array>
</array>
</array>
<array>
<array>
<array>
<dict>
<key>Amp</key>
<dict>
<key>Channels</key>
<array>
<dict>
<key>Bind</key>
<integer>1</integer>
<key>Channel</key>
<integer>1</integer>
</dict>
<dict>
<key>Bind</key>
<integer>2</integer>
<key>Channel</key>
<integer>2</integer>
</dict>
</array>
<key>MuteInputAmp</key>
<true/>
<key>PublishMute</key>
<false/>
<key>PublishVolume</key>
<false/>
<key>VolumeInputAmp</key>
<true/>
</dict>
<key>NodeID</key>
<integer>17</integer>
</dict>
<dict>
<key>Boost</key>
<integer>1</integer>
<key>NodeID</key>
<integer>18</integer>
</dict>
</array>
</array>
</array>
<array>
<array>
<array>
<dict>
<key>NodeID</key>
<integer>27</integer>
</dict>
<dict>
<key>Amp</key>
<dict>
<key>Channels</key>
<array>
<dict>
<key>Bind</key>
<integer>1</integer>
<key>Channel</key>
<integer>1</integer>
</dict>
<dict>
<key>Bind</key>
<integer>2</integer>
<key>Channel</key>
<integer>2</integer>
</dict>
</array>
<key>MuteInputAmp</key>
<true/>
<key>PublishMute</key>
<false/>
<key>PublishVolume</key>
<false/>
<key>VolumeInputAmp</key>
<false/>
</dict>
<key>NodeID</key>
<integer>12</integer>
</dict>
<dict>
<key>Amp</key>
<dict>
<key>Channels</key>
<array>
<dict>
<key>Bind</key>
<integer>1</integer>
<key>Channel</key>
<integer>1</integer>
</dict>
<dict>
<key>Bind</key>
<integer>2</integer>
<key>Channel</key>
<integer>2</integer>
</dict>
</array>
<key>MuteInputAmp</key>
<false/>
<key>PublishMute</key>
<false/>
<key>PublishVolume</key>
<true/>
<key>VolumeInputAmp</key>
<false/>
</dict>
<key>NodeID</key>
<integer>2</integer>
</dict>
</array>
</array>
</array>
<array>
<array>
<array>
<dict>
<key>NodeID</key>
<integer>30</integer>
</dict>
<dict>
<key>NodeID</key>
<integer>6</integer>
</dict>
</array>
</array>
</array>
<array>
<array>
<array>
<dict>
<key>NodeID</key>
<integer>33</integer>
</dict>
<dict>
<key>Amp</key>
<dict>
<key>Channels</key>
<array>
<dict>
<key>Bind</key>
<integer>1</integer>
<key>Channel</key>
<integer>1</integer>
</dict>
<dict>
<key>Bind</key>
<integer>2</integer>
<key>Channel</key>
<integer>2</integer>
</dict>
</array>
<key>MuteInputAmp</key>
<true/>
<key>PublishMute</key>
<false/>
<key>PublishVolume</key>
<false/>
<key>VolumeInputAmp</key>
<false/>
</dict>
<key>NodeID</key>
<integer>13</integer>
</dict>
<dict>
<key>Amp</key>
<dict>
<key>Channels</key>
<array>
<dict>
<key>Bind</key>
<integer>1</integer>
<key>Channel</key>
<integer>1</integer>
</dict>
<dict>
<key>Bind</key>
<integer>2</integer>
<key>Channel</key>
<integer>2</integer>
</dict>
</array>
<key>MuteInputAmp</key>
<false/>
<key>PublishMute</key>
<false/>
<key>PublishVolume</key>
<true/>
<key>VolumeInputAmp</key>
<false/>
</dict>
<key>NodeID</key>
<integer>3</integer>
</dict>
</array>
</array>
</array>
</array>
<key>PathMapID</key>
<integer>1</integer>
</dict>
</array>
</dict>
</plist>
这个文件需要调整的是PathMapID的值,在给APPLEALC添加资源文件时。自己找个自己喜欢的数字来作为自己申请的layout-id,只要不跟现有的id重复即可。还有文件名改为相应的platform+id.xml
定制自己的APPLEALC
后面就是需要clone APPLEALC这个仓库,进入正题。前面的都是准备工作。
applealc
mkdir ~/applealc # 在家目录下新建立`applealc`目录
cd ~/applealc # 进入`applealc`目录
git clone https://github.com/vit9696/AppleALC # 克隆AppleALC到本地
打开AppleALC目录,进入Resources目录,找到刚才对应的声卡名称,例如,这里的就是ALC282的目录。
修改Resrouce目录中的PinConfigs.kext的Info.plist文件
打开Info.plist文件后,直接搜索自己的声卡类型。例如,这里用的alc282搜索,搜索后,复制最后一条,并且修改相应的值。如图所示
修改layoutid,填入整理为一行的configdata。codecid一个声卡系列是同一个值。
修改自己声卡中映射的layout.xml和platform.xml的位置
在每一个声卡目录下面都有一个Info.plist文件
到这一步了接下来,说怎么来layout.xml文件,这个文件用公用的就行,我会在附件重提供。
最后
把layout.xml和platform.xml放在自己声卡型号里的位置,编译,自己测试即可。
开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!
更多推荐
所有评论(0)