Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sujunmin/9d9a270009f5c42049de4089e9675b02 to your computer and use it in GitHub Desktop.
Save sujunmin/9d9a270009f5c42049de4089e9675b02 to your computer and use it in GitHub Desktop.
How to use AppleALC kext with kernel patch

最近升級到 Monterey 的時候,升級 OpenCore 並且升級各個 kext 時,發現到使用到 FakePCIID 這個 kext 會跟 lilu, WhatEverGreen (WEG) 作用的時候會任意當機有人說可以降級 liluWEG 來解決這個問題,我試了一下還算可以,但前幾天開機做事的時候又忽然自己當機了,查了各大論壇都是覺得 FakePCIID 這種方式是過時的方式,FakePCIID 的 repo 也很久沒更新了,只能再找找其他方式。 看了一下 AppleALC 支援的卡越來越多,加上有我的設備,就想說來試試看。不過大部分的的教學都是在 AppleALC 支援的設備有直接支援的,就是在 config.plistDeviceProperties 加上 layout-id,hackintool 這個工具還直接給你設定,照着抄就行了。 可是我的是在 Controllers patches 這個位置裏,該怎麼作呢?網路上查查都沒什麼分享的,這個筆記就是來說明有支援但是在 Controllers patches 裏的該怎麼作。

  1. 先把 FakePCIID 與相關的 kexts 先關掉,起碼不會一直當。
  2. 確定是哪個設備,透過 hackintool 就很清楚能看得到。 AppALC_01
  3. 查詢到正確的設備。 AppleALC_02 4.點進去可以查詢一下位置能得到 kernel patch 的位置。
  <dict>
		<key>Device</key>
		<integer>41712</integer>
		<key>Name</key>
		<string>200 Series PCH HD Audio</string>
		<key>Patches</key>
		<array>
			<dict>
				<key>Count</key>
				<integer>6</integer>
				<key>Find</key>
				<data>cKEAAA==</data>
				<key>MinKernel</key>
				<integer>16</integer>
				<key>Name</key>
				<string>AppleHDAController</string>
				<key>Replace</key>
				<data>8KIAAA==</data>
			</dict>
			<dict>
				<key>Count</key>
				<integer>1</integer>
				<key>Find</key>
				<data>hoBwoQ==</data>
				<key>MinKernel</key>
				<integer>16</integer>
				<key>Name</key>
				<string>AppleHDAController</string>
				<key>Replace</key>
				<data>hoDwog==</data>
			</dict>
		</array>
		<key>Vendor</key>
		<string>Intel</string>
	</dict>
  1. config.plistKernel/Patch 加入內容,有一些欄位可能是不同版本的 OpenCore 會有增減,但上面提到的都一定要加。我自己的 OpenCore 0.7.5 的內容如下。
       <dict>
				<key>Arch</key>
				<string>Any</string>
				<key>Base</key>
				<string></string>
				<key>Comment</key>
				<string></string>
				<key>Count</key>
				<integer>6</integer>
				<key>Enabled</key>
				<true/>
				<key>Find</key>
				<data>cKEAAA==</data>
				<key>Identifier</key>
				<string>com.apple.driver.AppleHDAController</string>
				<key>Limit</key>
				<integer>0</integer>
				<key>Mask</key>
				<data></data>
				<key>MaxKernel</key>
				<string></string>
				<key>MinKernel</key>
				<string>16</string>
				<key>Replace</key>
				<data>8KIAAA==</data>
				<key>ReplaceMask</key>
				<data></data>
				<key>Skip</key>
				<integer>0</integer>
			</dict>
			<dict>
				<key>Arch</key>
				<string>Any</string>
				<key>Base</key>
				<string></string>
				<key>Comment</key>
				<string></string>
				<key>Count</key>
				<integer>1</integer>
				<key>Enabled</key>
				<true/>
				<key>Find</key>
				<data>hoBwoQ==</data>
				<key>Identifier</key>
				<string>com.apple.driver.AppleHDAController</string>
				<key>Limit</key>
				<integer>0</integer>
				<key>Mask</key>
				<data></data>
				<key>MaxKernel</key>
				<string></string>
				<key>MinKernel</key>
				<string>16</string>
				<key>Replace</key>
				<data>hoDwog==</data>
				<key>ReplaceMask</key>
				<data></data>
				<key>Skip</key>
				<integer>0</integer>
			</dict>
  1. 重開機試試看,在 hackintool 應該是能找得到設備了,但可能還沒有聲音。(我被辨識成 ALC662) AppleALC_03
  2. 透過 hackintool 取得 DeviceProperties,這邊要記得的是 device-id 已經在之前的 kernel patch 改過了,記得不能直接抄。 原來產生的
				<key>device-id</key>
				<data>
				cKEAAA==
				</data>

要修改爲

				<key>device-id</key>
				<data>
				8KIAAA==
				</data>

最後應爲

<dict>
	<key>DeviceProperties</key>
	<dict>
		<key>Add</key>
		<dict>
			<key>PciRoot(0x0)/Pci(0x1F,0x3)</key>
			<dict>
				<key>AAPL,slot-name</key>
				<string>Internal@0,31,3</string>
				<key>device-id</key>
				<data>
				8KIAAA==
				</data>
				<key>device_type</key>
				<string>Audio device</string>
				<key>hda-gfx</key>
				<string>onboard-1</string>
				<key>layout-id</key>
				<data>
				CwAAAA==
				</data>
				<key>model</key>
				<string>200 Series PCH HD Audio</string>
			</dict>
		</dict>
	</dict>
</dict>
  1. 重開機應該就有聲音了,如果沒聲音可以換幾個 layout-id 看看 (根據辨識成的 ALC662)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment