diff --git a/EFI/CLOVER/ACPI/patched/ssdt-1.aml b/EFI/CLOVER/ACPI/patched/ssdt-1.aml index 6bfa2ce..5753c4a 100755 Binary files a/EFI/CLOVER/ACPI/patched/ssdt-1.aml and b/EFI/CLOVER/ACPI/patched/ssdt-1.aml differ diff --git a/EFI/CLOVER/config-backup.plist b/EFI/CLOVER/config-backup.plist index b34dc57..e893d74 100755 --- a/EFI/CLOVER/config-backup.plist +++ b/EFI/CLOVER/config-backup.plist @@ -161,31 +161,17 @@ Comment - t1-10.12-AppleHDA/Realtek ALC... - Disabled - - Find - - ihnUEQ== - - Name - AppleHDA - Replace - - AAAAAA== - - - - Comment - t1-10.9-10.12-AppleHDA/Realtek ALC892 + t1-10.8-AppleHDA-Realtek-ALC892 Disabled Find ixnUEQ== + InfoPlistPatch + Name - AppleHDA + com.apple.driver.AppleHDA Replace kgjsEA== @@ -193,20 +179,62 @@ Comment - t1-AppleHDA/Resources/xml>zml + t1-AppleHDA-Resources-xml>zml-(cloverALC-all_codecs) Disabled Find eG1sLnps + InfoPlistPatch + Name - AppleHDA + com.apple.driver.AppleHDA Replace em1sLnps + + Comment + t1-10.12-AppleHDA-Realtek-ALC...(cloverALC-all_codecs) + Disabled + + Find + + ihnUEQ== + + InfoPlistPatch + + MatchOS + 10.12.x,10.13.x + Name + com.apple.driver.AppleHDA + Replace + + AAAAAA== + + + + Comment + t1-10.11-AppleHDA-Realtek-ALC...(cloverALC-all_codecs) + Disabled + + Find + + gxnUEQ== + + InfoPlistPatch + + MatchOS + 10.11.x + Name + com.apple.driver.AppleHDA + Replace + + AAAAAA== + + Comment change 15 port limit to 26 in XHCI kext (100-series) 10.12 @@ -216,6 +244,8 @@ g710////EA== + InfoPlistPatch + Name AppleUSBXHCIPCI Replace @@ -232,6 +262,8 @@ g72M/v//EA== + InfoPlistPatch + Name AppleUSBXHCIPCI Replace @@ -248,6 +280,8 @@ dW5sb2FkAA== + InfoPlistPatch + Name AppleGraphicsDevicePolicy Replace @@ -264,6 +298,8 @@ Q29uZmlnTWFwAA== + InfoPlistPatch + Name AppleGraphicsDevicePolicy Replace @@ -280,6 +316,8 @@ RGVmYXVsdAA= + InfoPlistPatch + Name AppleGraphicsDevicePolicy Replace @@ -294,6 +332,8 @@ cgoATWFjUHJvNCwxAE1hY1BybzUsMQBY + InfoPlistPatch + Name AppleTyMCEDriver Replace @@ -310,6 +350,8 @@ RXh0ZXJuYWw= + InfoPlistPatch + Name AppleAHCIPort Replace @@ -326,6 +368,8 @@ RmVhdHVyZUNvbnRyb2wA + InfoPlistPatch + Name AppleGraphicsDevicePolicy Replace @@ -342,6 +386,8 @@ Ym9hcmQtaWQ= + InfoPlistPatch + Name AppleGraphicsDevicePolicy Replace @@ -358,6 +404,8 @@ RURJRAA= + InfoPlistPatch + Name AppleGraphicsDevicePolicy Replace @@ -374,6 +422,8 @@ wegQD7bw + InfoPlistPatch + Name AppleAPIC Replace @@ -390,6 +440,8 @@ g32MEA== + InfoPlistPatch + Name AppleUSBXHCIPCI Replace @@ -397,6 +449,24 @@ g32MGw== + + Comment + 10.13.4 USB Port Limit Patch + Disabled + + Find + + g32UDw+DlwQAAA== + + InfoPlistPatch + + Name + AppleUSBXHCI + Replace + + g32UD5CQkJCQkA== + + RtVariables @@ -413,33 +483,45 @@ SMBIOS BiosReleaseDate - 06/12/13 + 02/08/2018 BiosVendor Apple Inc. BiosVersion - MP61.88Z.0116.B04.1312061508 + IM171.88Z.0151.B00.1802080854 Board-ID - Mac-F60DEB81FF30ACF6 + Mac-B809C3757DA9BB8D BoardManufacturer Apple Inc. + BoardSerialNumber + C02713102GUF653AD BoardType - 11 + 10 + BoardVersion + 1.0 ChassisAssetTag - Pro-Enclosure + iMac-Aluminum ChassisManufacturer Apple Inc. ChassisType - 06 + 0x09 Family - Mac Pro + iMac17,1 + FirmwareFeatures + 0xFC0FE137 + FirmwareFeaturesMask + 0xFF1FFF3F + LocationInChassis + Part Component Manufacturer Apple Inc. - ProductName - MacPro6,1 - SerialNumber - C02LXDOMF693 - Trust + Mobile + PlatformFeature + 0x00 + ProductName + iMac17,1 + SerialNumber + C02THUZCGG7L Version 1.0 diff --git a/EFI/CLOVER/config.plist b/EFI/CLOVER/config.plist index 3f268a3..39a610b 100755 --- a/EFI/CLOVER/config.plist +++ b/EFI/CLOVER/config.plist @@ -161,25 +161,7 @@ Comment - t1-10.12-AppleHDA/Realtek ALC... - Disabled - - Find - - ihnUEQ== - - InfoPlistPatch - - Name - AppleHDA - Replace - - AAAAAA== - - - - Comment - t1-10.9-10.12-AppleHDA/Realtek ALC892 + t1-10.8-AppleHDA-Realtek-ALC892 Disabled Find @@ -189,7 +171,7 @@ InfoPlistPatch Name - AppleHDA + com.apple.driver.AppleHDA Replace kgjsEA== @@ -197,7 +179,7 @@ Comment - t1-AppleHDA/Resources/xml>zml + t1-AppleHDA-Resources-xml>zml-(cloverALC-all_codecs) Disabled Find @@ -207,12 +189,52 @@ InfoPlistPatch Name - AppleHDA + com.apple.driver.AppleHDA Replace em1sLnps + + Comment + t1-10.12-AppleHDA-Realtek-ALC...(cloverALC-all_codecs) + Disabled + + Find + + ihnUEQ== + + InfoPlistPatch + + MatchOS + 10.12.x,10.13.x + Name + com.apple.driver.AppleHDA + Replace + + AAAAAA== + + + + Comment + t1-10.11-AppleHDA-Realtek-ALC...(cloverALC-all_codecs) + Disabled + + Find + + gxnUEQ== + + InfoPlistPatch + + MatchOS + 10.11.x + Name + com.apple.driver.AppleHDA + Replace + + AAAAAA== + + Comment change 15 port limit to 26 in XHCI kext (100-series) 10.12 @@ -445,6 +467,24 @@ g32UD5CQkJCQkA== + + Comment + 10.13.4 HDMIAUDIO PATCH + Disabled + + Find + + 3hALDg== + + InfoPlistPatch + + Name + com.apple.driver.AppleHDAController + Replace + + 3hC6Dw== + + RtVariables diff --git a/EFI/CLOVER/kexts/10.12/FakePCIID.kext/Contents/Info.plist b/EFI/CLOVER/kexts/10.12/FakePCIID.kext/Contents/Info.plist index 0a0e300..73ed504 100755 --- a/EFI/CLOVER/kexts/10.12/FakePCIID.kext/Contents/Info.plist +++ b/EFI/CLOVER/kexts/10.12/FakePCIID.kext/Contents/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 16F73 + 17E199 CFBundleDevelopmentRegion en CFBundleExecutable @@ -17,7 +17,7 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 1.3.9 + 1.3.12 CFBundleSignature ???? CFBundleSupportedPlatforms @@ -25,11 +25,11 @@ MacOSX CFBundleVersion - 1.3.9 + 1.3.12 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - 8E2002 + 9E145 DTPlatformVersion GM DTSDKBuild @@ -37,11 +37,11 @@ DTSDKName macosx10.6 DTXcode - 0832 + 0930 DTXcodeBuild - 8E2002 + 9E145 OSBundleCompatibleVersion - 1.3.9 + 1.3.12 OSBundleLibraries com.apple.iokit.IOPCIFamily diff --git a/EFI/CLOVER/kexts/10.12/FakePCIID.kext/Contents/MacOS/FakePCIID b/EFI/CLOVER/kexts/10.12/FakePCIID.kext/Contents/MacOS/FakePCIID index c3548cf..ab52f76 100755 Binary files a/EFI/CLOVER/kexts/10.12/FakePCIID.kext/Contents/MacOS/FakePCIID and b/EFI/CLOVER/kexts/10.12/FakePCIID.kext/Contents/MacOS/FakePCIID differ diff --git a/EFI/CLOVER/kexts/10.12/FakePCIID_Intel_GbX.kext/Contents/Info.plist b/EFI/CLOVER/kexts/10.12/FakePCIID_Intel_GbX.kext/Contents/Info.plist index 610be3c..3fbe6b0 100755 --- a/EFI/CLOVER/kexts/10.12/FakePCIID_Intel_GbX.kext/Contents/Info.plist +++ b/EFI/CLOVER/kexts/10.12/FakePCIID_Intel_GbX.kext/Contents/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 16F73 + 17E199 CFBundleIdentifier org.rehabman.injector.FakePCIID-Intel-GbX CFBundleInfoDictionaryVersion @@ -13,17 +13,17 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 1.3.9 + 1.3.12 CFBundleSupportedPlatforms MacOSX CFBundleVersion - 1.3.9 + 1.3.12 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - 8E2002 + 9E145 DTPlatformVersion GM DTSDKBuild @@ -31,9 +31,9 @@ DTSDKName macosx10.6 DTXcode - 0832 + 0930 DTXcodeBuild - 8E2002 + 9E145 IOKitPersonalities Intel GbX diff --git a/EFI/CLOVER/kexts/10.12/FakePCIID_Intel_HDMI_Audio.kext/Contents/Info.plist b/EFI/CLOVER/kexts/10.12/FakePCIID_Intel_HDMI_Audio.kext/Contents/Info.plist index 79f611e..e00fe65 100755 --- a/EFI/CLOVER/kexts/10.12/FakePCIID_Intel_HDMI_Audio.kext/Contents/Info.plist +++ b/EFI/CLOVER/kexts/10.12/FakePCIID_Intel_HDMI_Audio.kext/Contents/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 16F73 + 17E199 CFBundleIdentifier org.rehabman.injector.FakePCIID-Intel-HDMI-Audio CFBundleInfoDictionaryVersion @@ -13,17 +13,17 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 1.3.9 + 1.3.12 CFBundleSupportedPlatforms MacOSX CFBundleVersion - 1.3.9 + 1.3.12 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - 8E2002 + 9E145 DTPlatformVersion GM DTSDKBuild @@ -31,9 +31,9 @@ DTSDKName macosx10.6 DTXcode - 0832 + 0930 DTXcodeBuild - 8E2002 + 9E145 IOKitPersonalities Intel HDMI Audio - 100-series 0x9d70 @@ -76,6 +76,26 @@ IOProviderClass IOPCIDevice + Intel HDMI Audio - 100-series 0x9d74 + + CFBundleIdentifier + org.rehabman.driver.FakePCIID + FakeProperties + + RM,device-id + + cKEAAA== + + + IOClass + FakePCIID + IOMatchCategory + FakePCIID + IOPCIPrimaryMatch + 0x9d748086 + IOProviderClass + IOPCIDevice + Intel HDMI Audio - 100-series 0xa170 CFBundleIdentifier @@ -136,6 +156,26 @@ IOProviderClass IOPCIDevice + Intel HDMI Audio - 300-series 0xa348 + + CFBundleIdentifier + org.rehabman.driver.FakePCIID + FakeProperties + + RM,device-id + + cKEAAA== + + + IOClass + FakePCIID + IOMatchCategory + FakePCIID + IOPCIPrimaryMatch + 0xa3488086 + IOProviderClass + IOPCIDevice + Intel HDMI Audio - Haswell CFBundleIdentifier diff --git a/EFI/CLOVER/kexts/10.12/FakePCIID_Intel_HD_Graphics.kext/Contents/Info.plist b/EFI/CLOVER/kexts/10.12/FakePCIID_Intel_HD_Graphics.kext/Contents/Info.plist index ba2c8d3..c0ed9bf 100755 --- a/EFI/CLOVER/kexts/10.12/FakePCIID_Intel_HD_Graphics.kext/Contents/Info.plist +++ b/EFI/CLOVER/kexts/10.12/FakePCIID_Intel_HD_Graphics.kext/Contents/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 16F73 + 17E199 CFBundleIdentifier org.rehabman.injector.FakePCIID-Intel-HD-Graphics CFBundleInfoDictionaryVersion @@ -13,17 +13,17 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 1.3.9 + 1.3.12 CFBundleSupportedPlatforms MacOSX CFBundleVersion - 1.3.9 + 1.3.12 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - 8E2002 + 9E145 DTPlatformVersion GM DTSDKBuild @@ -31,9 +31,9 @@ DTSDKName macosx10.6 DTXcode - 0832 + 0930 DTXcodeBuild - 8E2002 + 9E145 IOKitPersonalities HD4200 HD4400 HD4600 P4600 @@ -156,6 +156,54 @@ IOProviderClass IOPCIDevice + UHD620 KabyLake-R + + CFBundleIdentifier + org.rehabman.driver.FakePCIID + FakeProperties + + RM,device-id + + FlkAAA== + + + IOClass + FakePCIID + IOMatchCategory + FakePCIID + IOPCIClassMatch + 0x03000000&0xff000000 + IOPCIPrimaryMatch + 0x59168086 0x59178086 + IOProbeScore + 9001 + IOProviderClass + IOPCIDevice + + UHD630 CoffeeLake + + CFBundleIdentifier + org.rehabman.driver.FakePCIID + FakeProperties + + RM,device-id + + kj4AAA== + + + IOClass + FakePCIID + IOMatchCategory + FakePCIID + IOPCIClassMatch + 0x03000000&0xff000000 + IOPCIPrimaryMatch + 0x3e918086 0x3e928086 + IOProbeScore + 9001 + IOProviderClass + IOPCIDevice + OSBundleRequired Root diff --git a/EFI/CLOVER/kexts/10.12/FakePCIID_XHCIMux.kext/Contents/Info.plist b/EFI/CLOVER/kexts/10.12/FakePCIID_XHCIMux.kext/Contents/Info.plist index 18376af..1125799 100755 --- a/EFI/CLOVER/kexts/10.12/FakePCIID_XHCIMux.kext/Contents/Info.plist +++ b/EFI/CLOVER/kexts/10.12/FakePCIID_XHCIMux.kext/Contents/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 16F73 + 17E199 CFBundleDevelopmentRegion en CFBundleExecutable @@ -17,7 +17,7 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 1.3.9 + 1.3.12 CFBundleSignature ???? CFBundleSupportedPlatforms @@ -25,11 +25,11 @@ MacOSX CFBundleVersion - 1.3.9 + 1.3.12 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - 8E2002 + 9E145 DTPlatformVersion GM DTSDKBuild @@ -37,9 +37,9 @@ DTSDKName macosx10.6 DTXcode - 0832 + 0930 DTXcodeBuild - 8E2002 + 9E145 IOKitPersonalities XHCIMux 7-series @@ -142,7 +142,7 @@ com.apple.kpi.unsupported 8.0.0 org.rehabman.driver.FakePCIID - 1.3.9 + 1.3.12 OSBundleRequired Root diff --git a/EFI/CLOVER/kexts/10.12/FakePCIID_XHCIMux.kext/Contents/MacOS/FakePCIID_XHCIMux b/EFI/CLOVER/kexts/10.12/FakePCIID_XHCIMux.kext/Contents/MacOS/FakePCIID_XHCIMux index c26d8b5..b5b72c0 100755 Binary files a/EFI/CLOVER/kexts/10.12/FakePCIID_XHCIMux.kext/Contents/MacOS/FakePCIID_XHCIMux and b/EFI/CLOVER/kexts/10.12/FakePCIID_XHCIMux.kext/Contents/MacOS/FakePCIID_XHCIMux differ diff --git a/EFI/CLOVER/kexts/10.12/FakeSMC.kext/Contents/Info.plist b/EFI/CLOVER/kexts/10.12/FakeSMC.kext/Contents/Info.plist index 26f350b..793c10b 100755 --- a/EFI/CLOVER/kexts/10.12/FakeSMC.kext/Contents/Info.plist +++ b/EFI/CLOVER/kexts/10.12/FakeSMC.kext/Contents/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 16F73 + 17E199 CFBundleDevelopmentRegion English CFBundleExecutable @@ -17,7 +17,7 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 6.25-333-g05e0f4be.1759 + 6.26-344-g1cf53906.1787 CFBundleSignature ???? CFBundleSupportedPlatforms @@ -25,7 +25,7 @@ MacOSX CFBundleVersion - 1759 + 1787 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild @@ -274,7 +274,7 @@ RM,Build Release-rehabman RM,Version - FakeSMC 1759 + FakeSMC 1787 FakeSMCKeyStore diff --git a/EFI/CLOVER/kexts/10.12/FakeSMC.kext/Contents/MacOS/FakeSMC b/EFI/CLOVER/kexts/10.12/FakeSMC.kext/Contents/MacOS/FakeSMC index 1cfc167..0a02c62 100755 Binary files a/EFI/CLOVER/kexts/10.12/FakeSMC.kext/Contents/MacOS/FakeSMC and b/EFI/CLOVER/kexts/10.12/FakeSMC.kext/Contents/MacOS/FakeSMC differ diff --git a/EFI/CLOVER/kexts/10.12/FakeSMC_ACPISensors.kext/Contents/Info.plist b/EFI/CLOVER/kexts/10.12/FakeSMC_ACPISensors.kext/Contents/Info.plist index 5adfb2f..ad1ec5a 100755 --- a/EFI/CLOVER/kexts/10.12/FakeSMC_ACPISensors.kext/Contents/Info.plist +++ b/EFI/CLOVER/kexts/10.12/FakeSMC_ACPISensors.kext/Contents/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 16F73 + 17E199 CFBundleDevelopmentRegion English CFBundleExecutable @@ -15,7 +15,7 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 6.25-333-g05e0f4be.1759 + 6.26-344-g1cf53906.1787 CFBundleSignature ???? CFBundleSupportedPlatforms @@ -23,7 +23,7 @@ MacOSX CFBundleVersion - 1759 + 1787 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild diff --git a/EFI/CLOVER/kexts/10.12/FakeSMC_CPUSensors.kext/Contents/Info.plist b/EFI/CLOVER/kexts/10.12/FakeSMC_CPUSensors.kext/Contents/Info.plist index aab5ef4..260c999 100755 --- a/EFI/CLOVER/kexts/10.12/FakeSMC_CPUSensors.kext/Contents/Info.plist +++ b/EFI/CLOVER/kexts/10.12/FakeSMC_CPUSensors.kext/Contents/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 16F73 + 17E199 CFBundleDevelopmentRegion English CFBundleExecutable @@ -15,7 +15,7 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 6.25-333-g05e0f4be.1759 + 6.26-344-g1cf53906.1787 CFBundleSignature ???? CFBundleSupportedPlatforms @@ -23,7 +23,7 @@ MacOSX CFBundleVersion - 1759 + 1787 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild diff --git a/EFI/CLOVER/kexts/10.12/FakeSMC_CPUSensors.kext/Contents/MacOS/CPUSensors b/EFI/CLOVER/kexts/10.12/FakeSMC_CPUSensors.kext/Contents/MacOS/CPUSensors index 07c28b0..2075d5d 100755 Binary files a/EFI/CLOVER/kexts/10.12/FakeSMC_CPUSensors.kext/Contents/MacOS/CPUSensors and b/EFI/CLOVER/kexts/10.12/FakeSMC_CPUSensors.kext/Contents/MacOS/CPUSensors differ diff --git a/EFI/CLOVER/kexts/10.12/FakeSMC_GPUSensors.kext/Contents/Info.plist b/EFI/CLOVER/kexts/10.12/FakeSMC_GPUSensors.kext/Contents/Info.plist index 35388e7..512542e 100755 --- a/EFI/CLOVER/kexts/10.12/FakeSMC_GPUSensors.kext/Contents/Info.plist +++ b/EFI/CLOVER/kexts/10.12/FakeSMC_GPUSensors.kext/Contents/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 16F73 + 17E199 CFBundleDevelopmentRegion English CFBundleExecutable @@ -17,7 +17,7 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 6.25-333-g05e0f4be.1759 + 6.26-344-g1cf53906.1787 CFBundleSignature ???? CFBundleSupportedPlatforms @@ -25,7 +25,7 @@ MacOSX CFBundleVersion - 1759 + 1787 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild diff --git a/EFI/CLOVER/kexts/10.12/FakeSMC_GPUSensors.kext/Contents/MacOS/GPUSensors b/EFI/CLOVER/kexts/10.12/FakeSMC_GPUSensors.kext/Contents/MacOS/GPUSensors index 062f7ca..bc7afe9 100755 Binary files a/EFI/CLOVER/kexts/10.12/FakeSMC_GPUSensors.kext/Contents/MacOS/GPUSensors and b/EFI/CLOVER/kexts/10.12/FakeSMC_GPUSensors.kext/Contents/MacOS/GPUSensors differ diff --git a/EFI/CLOVER/kexts/10.12/FakeSMC_LPCSensors.kext/Contents/Info.plist b/EFI/CLOVER/kexts/10.12/FakeSMC_LPCSensors.kext/Contents/Info.plist index dcf265e..3ed8370 100755 --- a/EFI/CLOVER/kexts/10.12/FakeSMC_LPCSensors.kext/Contents/Info.plist +++ b/EFI/CLOVER/kexts/10.12/FakeSMC_LPCSensors.kext/Contents/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 16F73 + 17E199 CFBundleDevelopmentRegion English CFBundleExecutable @@ -17,7 +17,7 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 6.25-333-g05e0f4be.1759 + 6.26-344-g1cf53906.1787 CFBundleSignature ???? CFBundleSupportedPlatforms @@ -25,7 +25,7 @@ MacOSX CFBundleVersion - 1759 + 1787 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild @@ -2999,6 +2999,8 @@ Nuvoton,NCT6791D Nuvoton,NCT6792D Nuvoton,NCT6793D + Nuvoton,NCT6795D + Nuvoton,NCT6796D IOProbeScore 3000 diff --git a/EFI/CLOVER/kexts/10.12/FakeSMC_LPCSensors.kext/Contents/MacOS/LPCSensors b/EFI/CLOVER/kexts/10.12/FakeSMC_LPCSensors.kext/Contents/MacOS/LPCSensors index 89512cf..6021180 100755 Binary files a/EFI/CLOVER/kexts/10.12/FakeSMC_LPCSensors.kext/Contents/MacOS/LPCSensors and b/EFI/CLOVER/kexts/10.12/FakeSMC_LPCSensors.kext/Contents/MacOS/LPCSensors differ diff --git a/EFI/CLOVER/kexts/10.12/IntelMausiEthernet.kext/Contents/Info.plist b/EFI/CLOVER/kexts/10.12/IntelMausiEthernet.kext/Contents/Info.plist index ce7e348..6ab06c7 100755 --- a/EFI/CLOVER/kexts/10.12/IntelMausiEthernet.kext/Contents/Info.plist +++ b/EFI/CLOVER/kexts/10.12/IntelMausiEthernet.kext/Contents/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 16D32 + 17E199 CFBundleDevelopmentRegion English CFBundleExecutable @@ -17,7 +17,7 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 2.2.1d1 + 2.4.0d0 CFBundleSignature ???? CFBundleSupportedPlatforms @@ -25,21 +25,21 @@ MacOSX CFBundleVersion - 2.2.1d1 + 2.4.0d0 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - 8C1002 + 9E145 DTPlatformVersion GM DTSDKBuild - 16C58 + 15E60 DTSDKName - macosx10.12 + macosx10.11 DTXcode - 0821 + 0930 DTXcodeBuild - 8C1002 + 9E145 IOKitPersonalities IntelMausi @@ -47,11 +47,11 @@ CFBundleIdentifier com.insanelymac.IntelMausiEthernet Driver_Version - 2.2.1d1 + 2.4.0d0 IOClass IntelMausi IOPCIMatch - 0x10EA8086 0x10EB8086 0x10EF8086 0x10F08086 0x15028086 0x15038086 0x153A8086 0x153B8086 0x155A8086 0x15598086 0x15A08086 0x15A18086 0x15A28086 0x15A38086 0x156F8086 0x15708086 0x15B78086 0x15B88086 0x15d68086 0x15d78086 0x15d88086 0x15e38086 + 0x10EA8086 0x10EB8086 0x10EF8086 0x10F08086 0x15028086 0x15038086 0x153A8086 0x153B8086 0x155A8086 0x15598086 0x15A08086 0x15A18086 0x15A28086 0x15A38086 0x156F8086 0x15708086 0x15B78086 0x15B88086 0x15D78086 0x15D88086 0x15E38086 0x15D68086 0x15BD8086 0x15BE8086 0x15BB8086 0x15BC8086 0x15DF8086 0x15E08086 0x15E18086 0x15E28086 IOProbeScore 1000 IOProviderClass diff --git a/EFI/CLOVER/kexts/10.12/IntelMausiEthernet.kext/Contents/MacOS/IntelMausiEthernet b/EFI/CLOVER/kexts/10.12/IntelMausiEthernet.kext/Contents/MacOS/IntelMausiEthernet index 3f49bd1..81c66af 100755 Binary files a/EFI/CLOVER/kexts/10.12/IntelMausiEthernet.kext/Contents/MacOS/IntelMausiEthernet and b/EFI/CLOVER/kexts/10.12/IntelMausiEthernet.kext/Contents/MacOS/IntelMausiEthernet differ diff --git a/EFI/CLOVER/kexts/10.12/Lilu.kext/Contents/Info.plist b/EFI/CLOVER/kexts/10.12/Lilu.kext/Contents/Info.plist index 69dc308..f20a590 100755 --- a/EFI/CLOVER/kexts/10.12/Lilu.kext/Contents/Info.plist +++ b/EFI/CLOVER/kexts/10.12/Lilu.kext/Contents/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 16G29 + 17E199 CFBundleDevelopmentRegion en CFBundleExecutable @@ -17,7 +17,7 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 1.2.0 + 1.2.3 CFBundleSignature ???? CFBundleSupportedPlatforms @@ -25,21 +25,21 @@ MacOSX CFBundleVersion - 1.2.0 + 1.2.3 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - 9A235 + 9E145 DTPlatformVersion GM DTSDKBuild - 17A360 + 17E189 DTSDKName macosx10.13 DTXcode - 0900 + 0930 DTXcodeBuild - 9A235 + 9E145 IOKitPersonalities as.vit9696.Lilu diff --git a/EFI/CLOVER/kexts/10.12/Lilu.kext/Contents/MacOS/Lilu b/EFI/CLOVER/kexts/10.12/Lilu.kext/Contents/MacOS/Lilu index e12dedf..303cca3 100755 Binary files a/EFI/CLOVER/kexts/10.12/Lilu.kext/Contents/MacOS/Lilu and b/EFI/CLOVER/kexts/10.12/Lilu.kext/Contents/MacOS/Lilu differ diff --git a/EFI/CLOVER/kexts/10.12/NightShiftUnlocker.kext/Contents/Info.plist b/EFI/CLOVER/kexts/10.12/NightShiftUnlocker.kext/Contents/Info.plist new file mode 100755 index 0000000..c432e97 --- /dev/null +++ b/EFI/CLOVER/kexts/10.12/NightShiftUnlocker.kext/Contents/Info.plist @@ -0,0 +1,79 @@ + + + + + BuildMachineOSBuild + 17A405 + CFBundleDevelopmentRegion + en + CFBundleExecutable + NightShiftUnlocker + CFBundleIdentifier + science.firewolf.NightShiftUnlocker + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + NightShiftUnlocker + CFBundlePackageType + KEXT + CFBundleShortVersionString + 2.2.1 + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 2.2.1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 8E3004b + DTPlatformVersion + GM + DTSDKBuild + 16E185 + DTSDKName + macosx10.12 + DTXcode + 0833 + DTXcodeBuild + 8E3004b + IOKitPersonalities + + science.firewolf.NightShiftUnlocker + + CFBundleIdentifier + science.firewolf.NightShiftUnlocker + IOClass + NightShiftUnlocker + IOMatchCategory + NightShiftUnlocker + IOProviderClass + IOResources + IOResourceMatch + IOKit + + + NSHumanReadableCopyright + Copyright © 2017 FireWolf. All rights reserved. + OSBundleLibraries + + as.vit9696.Lilu + 1.2.0 + com.apple.kpi.bsd + 16.6 + com.apple.kpi.dsep + 16.6 + com.apple.kpi.iokit + 16.6 + com.apple.kpi.libkern + 16.6 + com.apple.kpi.mach + 16.6 + com.apple.kpi.unsupported + 16.6 + + OSBundleRequired + Root + + diff --git a/EFI/CLOVER/kexts/10.12/NightShiftUnlocker.kext/Contents/MacOS/NightShiftUnlocker b/EFI/CLOVER/kexts/10.12/NightShiftUnlocker.kext/Contents/MacOS/NightShiftUnlocker new file mode 100755 index 0000000..e80498f Binary files /dev/null and b/EFI/CLOVER/kexts/10.12/NightShiftUnlocker.kext/Contents/MacOS/NightShiftUnlocker differ diff --git a/EFI/CLOVER/kexts/10.12/NvidiaGraphicsFixup.kext/Contents/Info.plist b/EFI/CLOVER/kexts/10.12/NvidiaGraphicsFixup.kext/Contents/Info.plist index ab95501..bc1380a 100755 --- a/EFI/CLOVER/kexts/10.12/NvidiaGraphicsFixup.kext/Contents/Info.plist +++ b/EFI/CLOVER/kexts/10.12/NvidiaGraphicsFixup.kext/Contents/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 16G29 + 17E199 CFBundleDevelopmentRegion en CFBundleExecutable @@ -17,7 +17,7 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 1.2.1 + 1.2.6 CFBundleSignature ???? CFBundleSupportedPlatforms @@ -25,21 +25,21 @@ MacOSX CFBundleVersion - 1.2.1 + 1.2.6 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - 9A1004 + 9E145 DTPlatformVersion GM DTSDKBuild - 17A360 + 17E189 DTSDKName macosx10.13 DTXcode - 0901 + 0930 DTXcodeBuild - 9A1004 + 9E145 IOKitPersonalities as.lvs1974.NvidiaAudio diff --git a/EFI/CLOVER/kexts/10.12/NvidiaGraphicsFixup.kext/Contents/MacOS/NvidiaGraphicsFixup b/EFI/CLOVER/kexts/10.12/NvidiaGraphicsFixup.kext/Contents/MacOS/NvidiaGraphicsFixup index 8be23bf..83d2a1e 100755 Binary files a/EFI/CLOVER/kexts/10.12/NvidiaGraphicsFixup.kext/Contents/MacOS/NvidiaGraphicsFixup and b/EFI/CLOVER/kexts/10.12/NvidiaGraphicsFixup.kext/Contents/MacOS/NvidiaGraphicsFixup differ diff --git a/EFI/CLOVER/kexts/10.12/NvidiaGraphicsFixup.kext/Contents/Resources/FAQ.md b/EFI/CLOVER/kexts/10.12/NvidiaGraphicsFixup.kext/Contents/Resources/FAQ.md deleted file mode 100755 index 407905d..0000000 --- a/EFI/CLOVER/kexts/10.12/NvidiaGraphicsFixup.kext/Contents/Resources/FAQ.md +++ /dev/null @@ -1,49 +0,0 @@ -- _What are the system requirements?_ -while there are no particular limitations, this FAQ does not include the specific information regarding GPUs before Kepler (i.e. older than 6xx series). -In general it appears to be less convenient to use CPUs newer than Ivy and Haswell with NVIDIA GPUs. -For GPUs newer than Kepler (e.g. Maxwell or Pascal) you need [NVIDIA Web Driver](http://www.nvidia.com/download/driverResults.aspx/125379/en-us). Use `nv_disable=1` boot argument to install it. - -- _What is the general idea?_ -If you have builtin Intel GPU, make sure to rename it to IGPU and enable with connector-less frame first. Then choose a most suitable mac model and install NvidiaGraphicsFixup. To get hardware video decoding you are likely to need [Shiki](https://github.com/vit9696/Shiki), please read its [FAQ](https://github.com/vit9696/Shiki/blob/master/Manual/FAQ.en.md) carefully to get a good understanding. - -- _How to properly choose a mac model?_ -If you have Ivy Bridge or Haswell CPU you should go with iMac13,2 or iMac14,2. Otherwise choose the model you prefer, but keep this in mind: - * If you have Intel GPU, especially if Ivy Bridge or newer, choose the model (by `board-id`) that has `forceOfflineRenderer` set to YES (true) in /System/Library/PrivateFrameworks/AppleGVA.framework/Versions/A/Info.plist. - * Models other than iMac13,2 and iMac14,2 require patches, which are though normally automated in NvidiaGraphicsFixup (see below) - * CPUs newer than Haswell require Shiki patches for hardware video decoding (see below). - -- _Why should I use Intel GPU with a connector-less frame?_ -Nvidia GPUs newer than 2xx do not implement hardware video decoder in macOS, also starting with 10.13 dual-GPU setups often cause a bootloop. If you absolutely need your IGPU with connector-full frame you will have to use [IntelGraphicsFixup](https://sourceforge.net/projects/intelgraphicsfixup) and most likely [Shiki](https://github.com/vit9696/Shiki) with `shikigva=1` OR a model without `forceOfflineRenderer`. - -- _How to use Intel GPU with a connector-less frame?_ -Please refer to [Shiki FAQ](https://github.com/vit9696/Shiki/blob/master/Manual/FAQ.en.md) for full details. You could use SSDT to rename GFX0 to IGPU by creating a proper IGPU device and setting STA of the existing one to Zero: -``` -Scope (GFX0) { - Name (_STA, Zero) // _STA: Status -} -``` - -- _What patches do I need for mac models other than iMac13,2 and iMac14,2?_ -AppleGraphicsDisplayPolicy.kext contains a check against its Info.plist and determines which mode should be used for a specific board-id. It is dependent on the GPU which mode is suitable and is normally determined experimentally. NvidiaGraphicsFixup contains several ways to configure to set power management modes: - - kext patch enforcing `none` into ConfigMap dictionary for system board-id (ngfxpatch=cfgmap) - - kext patch disabling string comparison `` (ngfxpatch=vit9696, enabled by default) - - kext patch replacing `board-id` with `board-ix` (ngfxpatch=pikera) - -- _What patches do I need for Maxwell or Pascal GPUs?_ -Maxwell GPUs (normally 9xx and some 7xx) no longer supply a correct IOVARendererID to enable hardware video decoder. See more details: [here](https://github.com/vit9696/Shiki/issues/5). You no longer need any changes (e.g. iMac.kext) but NvidiaGraphicsFixup. This fix was added in 1.2.0 branch. Can be switched off by using boot-arg "-ngfxnovarenderer". - -- _What patches do processors newer than Haswell need?_ -Apple limits hardware video decoder with NVIDIA to only Haswell and earlier. To get hardware accelerated video decoding you need to patch AppleGVA.framework. To do so you could use [Shiki](https://github.com/vit9696/Shiki) with `shikigva=4` boot argument. On 10.13 you may currently use a temporary workaround that enables hardware video decoding only for a subset of processes via `shikigva=12` boot argument. - -- _What patches do Pascal GPUs need on 10.12?_ -On 10.12 and possibly on 10.13 Pascal GPUs need a team id unlock to avoid glitches like empty transparent windows and so on. This patch is already present in NvidiaGraphicsFixup, and the use of any other kext (e.g. NVWebDriverLibValFix.kext) is not needed. -Can be switched off by using boot-arg "-ngfxlibvalfix". - -- _How can I enable digital (HDMI audio)?_ -NvidiaGraphicsFixup will do it itself but you must esnure that you do not have any conflicting "fixes" from Clover, SSDT patches, Arbitrary and so on (e.g. FixDisplay, AddHDMI, etc.). NvidiaGraphicsFixup also renames GPU devices to GFX0 and HDAU and injects audio connectors @0,connector-type - @5,connector-type. Injection can be switched off by using boot-arg "-ngfxnoaudio" or more specific "-ngfxnoaudiocon". You can also use ioreg properties in GPU to disable respective injections: "no-audio-autofix" or "no-audio-fixconn". - -- _How can I partially fix Apple Logo during boot?_ -Inject `@X,AAPL,boot-display` GFX0 property with the main screen index instead of X, the value does not matter. - -- _Does NvidiaGraphicsFixup fix visual issues on wakeup with Pascal GPUs?_ -Not at the moment. It is also known that HDMI audio may not always work with Pascal GPUs. diff --git a/EFI/CLOVER/kexts/10.12/USBInjectAll.kext/Contents/Info.plist b/EFI/CLOVER/kexts/10.12/USBInjectAll.kext/Contents/Info.plist index bc34e1f..f81d9fa 100755 --- a/EFI/CLOVER/kexts/10.12/USBInjectAll.kext/Contents/Info.plist +++ b/EFI/CLOVER/kexts/10.12/USBInjectAll.kext/Contents/Info.plist @@ -3,13 +3,13 @@ BuildMachineOSBuild - 16G29 + 17C88 CFBundleDevelopmentRegion English CFBundleExecutable USBInjectAll CFBundleGetInfoString - 0.6.2 Copyright © 2015 RehabMan. All rights reserved. + 0.6.4 Copyright © 2015 RehabMan. All rights reserved. CFBundleIdentifier com.rehabman.driver.USBInjectAll CFBundleInfoDictionaryVersion @@ -19,7 +19,7 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 0.6.2 + 0.6.4 CFBundleSignature ???? CFBundleSupportedPlatforms @@ -27,11 +27,11 @@ MacOSX CFBundleVersion - 0.6.2 + 0.6.4 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - 8E3004b + 9C40b DTPlatformVersion GM DTSDKBuild @@ -39,9 +39,9 @@ DTSDKName macosx10.11 DTXcode - 0833 + 0920 DTXcodeBuild - 8E3004b + 9C40b IOKitPersonalities ConfigurationData @@ -7400,6 +7400,100 @@ model iMac18,3 + iMac19,1-AppeBusPowerControllerUSB + + CFBundleIdentifier + com.rehabman.driver.USBInjectAll + IOClass + org_rehabman_USBInjectAll + IOProviderClass + AppleBusPowerControllerUSB + kConfigurationName + AppleBusPowerControllerUSB + model + iMac19,1 + + iMac19,1-EH01 + + CFBundleIdentifier + com.rehabman.driver.USBInjectAll + IOClass + org_rehabman_USBInjectAll + IONameMatch + EH01 + IOProviderClass + AppleUSBEHCIPCI + kConfigurationName + EH01 + model + iMac19,1 + + iMac19,1-EH01-internal-hub + + CFBundleIdentifier + com.rehabman.driver.USBInjectAll + IOClass + org_rehabman_USBInjectAll + IOProbeScore + 5000 + IOProviderClass + AppleUSB20InternalHub + kConfigurationName + HUB1 + locationID + 487587840 + model + iMac19,1 + + iMac19,1-EH02 + + CFBundleIdentifier + com.rehabman.driver.USBInjectAll + IOClass + org_rehabman_USBInjectAll + IONameMatch + EH02 + IOProviderClass + AppleUSBEHCIPCI + kConfigurationName + EH02 + model + iMac19,1 + + iMac19,1-EH02-internal-hub + + CFBundleIdentifier + com.rehabman.driver.USBInjectAll + IOClass + org_rehabman_USBInjectAll + IOProbeScore + 5000 + IOProviderClass + AppleUSB20InternalHub + kConfigurationName + HUB2 + locationID + 437256192 + model + iMac19,1 + + iMac19,1-XHC + + CFBundleIdentifier + com.rehabman.driver.USBInjectAll + IOClass + org_rehabman_USBInjectAll + IONameMatch + XHC + IOProviderClass + AppleUSBXHCIPCI + kConfigurationName + XHC + kIsXHC + + model + iMac19,1 + iMac4,1-AppeBusPowerControllerUSB CFBundleIdentifier @@ -8058,6 +8152,100 @@ model iMac9,1 + iMacPro1,1-AppeBusPowerControllerUSB + + CFBundleIdentifier + com.rehabman.driver.USBInjectAll + IOClass + org_rehabman_USBInjectAll + IOProviderClass + AppleBusPowerControllerUSB + kConfigurationName + AppleBusPowerControllerUSB + model + iMacPro1,1 + + iMacPro1,1-EH01 + + CFBundleIdentifier + com.rehabman.driver.USBInjectAll + IOClass + org_rehabman_USBInjectAll + IONameMatch + EH01 + IOProviderClass + AppleUSBEHCIPCI + kConfigurationName + EH01 + model + iMacPro1,1 + + iMacPro1,1-EH01-internal-hub + + CFBundleIdentifier + com.rehabman.driver.USBInjectAll + IOClass + org_rehabman_USBInjectAll + IOProbeScore + 5000 + IOProviderClass + AppleUSB20InternalHub + kConfigurationName + HUB1 + locationID + 487587840 + model + iMacPro1,1 + + iMacPro1,1-EH02 + + CFBundleIdentifier + com.rehabman.driver.USBInjectAll + IOClass + org_rehabman_USBInjectAll + IONameMatch + EH02 + IOProviderClass + AppleUSBEHCIPCI + kConfigurationName + EH02 + model + iMacPro1,1 + + iMacPro1,1-EH02-internal-hub + + CFBundleIdentifier + com.rehabman.driver.USBInjectAll + IOClass + org_rehabman_USBInjectAll + IOProbeScore + 5000 + IOProviderClass + AppleUSB20InternalHub + kConfigurationName + HUB2 + locationID + 437256192 + model + iMacPro1,1 + + iMacPro1,1-XHC + + CFBundleIdentifier + com.rehabman.driver.USBInjectAll + IOClass + org_rehabman_USBInjectAll + IONameMatch + XHC + IOProviderClass + AppleUSBXHCIPCI + kConfigurationName + XHC + kIsXHC + + model + iMacPro1,1 + NSHumanReadableCopyright Copyright © 2015 RehabMan. All rights reserved. diff --git a/EFI/CLOVER/kexts/10.12/USBInjectAll.kext/Contents/MacOS/USBInjectAll b/EFI/CLOVER/kexts/10.12/USBInjectAll.kext/Contents/MacOS/USBInjectAll index bd88ea2..40c3619 100755 Binary files a/EFI/CLOVER/kexts/10.12/USBInjectAll.kext/Contents/MacOS/USBInjectAll and b/EFI/CLOVER/kexts/10.12/USBInjectAll.kext/Contents/MacOS/USBInjectAll differ diff --git a/EFI/CLOVER/kexts/10.12/realtekALC.kext/Contents/Info.plist b/EFI/CLOVER/kexts/10.12/realtekALC.kext/Contents/Info.plist deleted file mode 100755 index d819987..0000000 --- a/EFI/CLOVER/kexts/10.12/realtekALC.kext/Contents/Info.plist +++ /dev/null @@ -1,379 +0,0 @@ - - - - - BuildMachineOSBuild - 13CA598 - CFBundleDevelopmentRegion - English - CFBundleGetInfoString - Realtek ALC 2.8, Copyright © 2017 toleda. All rights reserved. - CFBundleIdentifier - com.apple.driver.RealtekALC - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Realtek ALC Configuation Driver - CFBundlePackageType - KEXT - CFBundleShortVersionString - 1.8-toledaALC-120 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - IOKitPersonalities - - HDA Hardware Config Resource - - CFBundleIdentifier - com.apple.driver.AppleHDAHardwareConfigDriver - HDAConfigDefault - - - CodecID - 283904133 - ConfigData - IUccECFHHUAhRx4RIUcfASFXHCAhVx0QIVceASFXHwEhZxwwIWcdYCFnHgEhZx8BIXcc8CF3HQAhdx4AIXcfQCGHHEAhhx2QIYceoCGHH5AhlxxgIZcdkCGXHoEhlx8CIaccUCGnHTAhpx6BIacfASG3HHAhtx1AIbceISG3HwIh5xyQIecdYSHnHksh5x8BIfccoCH3HQEh9x7LIfcfASEXHPAhFx0AIRceACEXH0A= - FuncGroup - 1 - LayoutID - 1 - Comment - toledaALC - - - CodecID - 283904135 - ConfigData - IUccECFHHUAhRx4RIUcfkCFHDAIhVxwgIVcdECFXHgEhVx8BIWccMCFnHWAhZx4BIWcfASF3HPAhdx0AIXceACF3H0AhhxxAIYcdkCGHHqAhhx+QIZccYCGXHZAhlx6BIZcfAiGnHFAhpx0wIacegSGnHwEhtxxwIbcdQCG3HiEhtx8CIbcMAiHnHJAh5x1hIeceSyHnHwEh9xzwIfcdACH3HgAh9x9AIRcc8CEXHQAhFx4AIRcfQA== - FuncGroup - 1 - LayoutID - 1 - Comment - toledaALC - - - CodecID - 283904135 - ConfigData - IUccECFHHUAhRx4RIUcfkCFHDAIhVxzwIVcdACFXHgAhVx9AIWcc8CFnHQAhZx4AIWcfQCF3HPAhdx0AIXceACF3H0AhhxxAIYcdYCGHHgEhhx8BIZccYCGXHZAhlx6gIZcfkCGnHFAhpx0QIaceASGnHwEhtxxwIbcdQCG3HiEhtx8CIbcMAiHnHJAh5x1hIeceSyHnHwEh9xzwIfcdACH3HgAh9x9AIRcc8CEXHQAhFx4AIRcfQA== - FuncGroup - 1 - LayoutID - 2 - Comment - toledaALC - - - CodecID - 283904135 - ConfigData - IUccECFHHUAhRx4RIUcfkCFXHCAhVx0QIVceASFXHwEhZxzwIWcdACFnHgAhZx9AIXcc8CF3HQAhdx4AIXcfQCGHHEAhhx2QIYceoCGHH5AhlxxgIZcdkCGXHoEhlx8CIaccUCGnHTAhpx6BIacfASG3HHAhtx1AIbceISG3HwIh5xyQIecdYSHnHksh5x8BIfcc8CH3HQAh9x4AIfcfQCEXHPAhFx0AIRceACEXH0A= - FuncGroup - 1 - LayoutID - 3 - Comment - toledaALC - - - CodecID - 283904136 - ConfigData - IUccECFHHUAhRx4RIUcfkCFXHCAhVx0QIVceASFXHwEhZxwwIWcdYCFnHgEhZx8BIXcc8CF3HQAhdx4AIXcfQCGHHEAhhx2QIYceoCGHH5AhlxxgIZcdkCGXHoEhlx8CIaccUCGnHTAhpx6BIacfASG3HHAhtx1AIbceISG3HwIh5xyQIecdYSHnHksh5x8BIfcc8CH3HQAh9x4AIfcfQCEXHPAhFx0AIRceACEXH0A= - FuncGroup - 1 - LayoutID - 1 - Comment - toledaALC - - - CodecID - 283904136 - ConfigData - IUccECFHHUAhRx4RIUcfkCFXHPAhVx0AIVceACFXH0AhZxzwIWcdACFnHgAhZx9AIXcc8CF3HQAhdx4AIXcfQCGHHEAhhx1gIYceASGHHwEhlxxgIZcdkCGXHqAhlx+QIaccUCGnHRAhpx4BIacfASG3HHAhtx1AIbceISG3HwIh5xyQIecdYSHnHksh5x8BIfcc8CH3HQAh9x4AIfcfQCEXHPAhFx0AIRceACEXH0A= - FuncGroup - 1 - LayoutID - 2 - Comment - toledaALC - - - CodecID - 283904136 - ConfigData - IUccECFHHUAhRx4RIUcfkCFXHCAhVx0QIVceASFXHwEhZxzwIWcdACFnHgAhZx9AIXcc8CF3HQAhdx4AIXcfQCGHHEAhhx2QIYceoCGHH5AhlxxgIZcdkCGXHoEhlx8CIaccUCGnHTAhpx6BIacfASG3HHAhtx1AIbceISG3HwIh5xyQIecdYSHnHksh5x8BIfcc8CH3HQAh9x4AIfcfQCEXHPAhFx0AIRceACEXH0A= - FuncGroup - 1 - LayoutID - 3 - Comment - toledaALC - - - CodecID - 283904137 - ConfigData - IUccECFHHUAhRx4RIUcfkCFXHCAhVx0QIVceASFXHwEhZxwwIWcdYCFnHgEhZx8BIXcc8CF3HQAhdx4AIXcfQCGHHEAhhx2QIYceoCGHH5AhlxxgIZcdkCGXHoEhlx8CIaccUCGnHTAhpx6BIacfASG3HHAhtx1AIbceISG3HwIh5xyQIecdYSHnHksh5x8BIfcc8CH3HQAh9x4AIfcfQCEXHPAhFx0AIRceACEXH0A= - FuncGroup - 1 - LayoutID - 1 - Comment - toledaALC - - - CodecID - 283904137 - ConfigData - IUccECFHHUAhRx4RIUcfkCFXHPAhVx0AIVceACFXH0AhZxzwIWcdACFnHgAhZx9AIXcc8CF3HQAhdx4AIXcfQCGHHEAhhx1gIYceASGHHwEhlxxgIZcdkCGXHqAhlx+QIaccUCGnHRAhpx4BIacfASG3HHAhtx1AIbceISG3HwIh5xyQIecdYSHnHksh5x8BIfcc8CH3HQAh9x4AIfcfQCEXHPAhFx0AIRceACEXH0A= - FuncGroup - 1 - LayoutID - 2 - Comment - toledaALC - - - CodecID - 283904137 - ConfigData - IUccECFHHUAhRx4RIUcfkCFXHCAhVx0QIVceASFXHwEhZxzwIWcdACFnHgAhZx9AIXcc8CF3HQAhdx4AIXcfQCGHHEAhhx2QIYceoCGHH5AhlxxgIZcdkCGXHoEhlx8CIaccUCGnHTAhpx6BIacfASG3HHAhtx1AIbceISG3HwIh5xyQIecdYSHnHksh5x8BIfcc8CH3HQAh9x4AIfcfQCEXHPAhFx0AIRceACEXH0A= - FuncGroup - 1 - LayoutID - 3 - Comment - toledaALC - - - CodecID - 283904146 - ConfigData - IUccECFHHUAhRx4RIUcfkCFHDAIhVxwgIVcdECFXHgEhVx8BIWccMCFnHWAhZx4BIWcfASF3HPAhdx0AIXceACF3H0AhhxxAIYcdkCGHHqAhhx+QIZccYCGXHZAhlx6BIZcfAiGnHFAhpx0wIacegSGnHwEhtxxwIbcdQCG3HiEhtx8CIbcMAiHnHJAh5x1hIeceSyHnHwEh9xzwIfcdACH3HgAh9x9AIRcc8CEXHQAhFx4AIRcfQA== - LayoutID - 1 - FuncGroup - 1 - Comment - toledaALC - - - CodecID - 283904146 - ConfigData - IUccECFHHUAhRx4RIUcfkCFHDAIhVxzwIVcdACFXHgAhVx9AIWcc8CFnHQAhZx4AIWcfQCF3HPAhdx0AIXceACF3H0AhhxxAIYcdYCGHHgEhhx8BIZccYCGXHZAhlx6gIZcfkCGnHFAhpx0QIaceASGnHwEhtxxwIbcdQCG3HiEhtx8CIbcMAiHnHJAh5x1hIeceSyHnHwEh9xzwIfcdACH3HgAh9x9AIRcc8CEXHQAhFx4AIRcfQA== - FuncGroup - 1 - LayoutID - 2 - Comment - toledaALC - - - CodecID - 283904146 - FuncGroup - 1 - ConfigData - IUccECFHHUAhRx4RIUcfkCFXHCAhVx0QIVceASFXHwEhZxzwIWcdACFnHgAhZx9AIXcc8CF3HQAhdx4AIXcfQCGHHEAhhx2QIYceoCGHH5AhlxxgIZcdkCGXHoEhlx8CIaccUCGnHTAhpx6BIacfASG3HHAhtx1AIbceISG3HwIh5xyQIecdYSHnHksh5x8BIfcc8CH3HQAh9x4AIfcfQCEXHPAhFx0AIRceACEXH0A= - LayoutID - 3 - Comment - toledaALC - - - CodecID - 283904153 - ConfigData - IUccECFHHUAhRx4RIUcfkCFHDAIhVxwgIVcdECFXHgEhVx8BIWccMCFnHWAhZx4BIWcfASF3HPAhdx0AIXceACF3H0AhhxxAIYcdkCGHHqAhhx+QIZccYCGXHZAhlx6BIZcfAiGnHFAhpx0wIacegSGnHwEhtxxwIbcdQCG3HiEhtx8CIbcMAiHnHJAh5x1hIeceSyHnHwEh9xzwIfcdACH3HgAh9x9AIRcc8CEXHQAhFx4AIRcfQA== - FuncGroup - 1 - LayoutID - 1 - Comment - toledaALC - - - CodecID - 283904153 - ConfigData - IUccECFHHUAhRx4RIUcfkCFHDAIhVxzwIVcdACFXHgAhVx9AIWcc8CFnHQAhZx4AIWcfQCF3HPAhdx0AIXceACF3H0AhhxxAIYcdYCGHHgEhhx8BIZccYCGXHZAhlx6gIZcfkCGnHFAhpx0QIaceASGnHwEhtxxwIbcdQCG3HiEhtx8CIbcMAiHnHJAh5x1hIeceSyHnHwEh9xzwIfcdACH3HgAh9x9AIRcc8CEXHQAhFx4AIRcfQA== - FuncGroup - 1 - LayoutID - 2 - Comment - toledaALC - - - CodecID - 283904153 - ConfigData - IUccECFHHUAhRx4RIUcfkCFXHCAhVx0QIVceASFXHwEhZxzwIWcdACFnHgAhZx9AIXcc8CF3HQAhdx4AIXcfQCGHHEAhhx2QIYceoCGHH5AhlxxgIZcdkCGXHoEhlx8CIaccUCGnHTAhpx6BIacfASG3HHAhtx1AIbceISG3HwIh5xyQIecdYSHnHksh5x8BIfcc8CH3HQAh9x4AIfcfQCEXHPAhFx0AIRceACEXH0A= - FuncGroup - 1 - LayoutID - 3 - Comment - toledaALC - - - CodecID - 283904256 - ConfigData - AUccEAFHHUABRx4RAUcfkAFHDAIBVxwgAVcdEAFXHgEBVx8BAWccMAFnHWABZx4BAWcfAQF3HPABdx0AAXceAAF3H0ABhxxAAYcdkAGHHqABhx+QAZccYAGXHZABlx6BAZcfAgGnHFABpx0wAacegQGnHwEBtxxwAbcdQAG3HiEBtx8CAbcMAgHnHJAB5x1hAeceSwHnHwEB9xzwAfcdAAH3HgAB9x9AARcc8AEXHQABFx4AARcfQA== - FuncGroup - 1 - LayoutID - 1 - Comment - toledaALC - - - CodecID - 283904256 - ConfigData - AUccEAFHHUABRx4RAUcfkAFHDAIBVxzwAVcdAAFXHgABVx9AAWcc8AFnHQABZx4AAWcfQAF3HPABdx0AAXceAAF3H0ABhxxAAYcdYAGHHgEBhx8BAZccYAGXHZABlx6gAZcfkAGnHFABpx0QAaceAQGnHwEBtxxwAbcdQAG3HiEBtx8CAbcMAgHnHJAB5x1hAeceSwHnHwEB9xzwAfcdAAH3HgAB9x9AARcc8AEXHQABFx4AARcfQA== - FuncGroup - 1 - LayoutID - 2 - Comment - toledaALC - - - CodecID - 283904256 - ConfigData - AUccEAFHHUABRx4RAUcfkAFXHCABVx0QAVceAQFXHwEBZxzwAWcdAAFnHgABZx9AAXcc8AF3HQABdx4AAXcfQAGHHEABhx2QAYceoAGHH5ABlxxgAZcdkAGXHoEBlx8CAaccUAGnHTABpx6BAacfAQG3HHABtx1AAbceIQG3HwIB5xyQAecdYQHnHksB5x8BAfcc8AH3HQAB9x4AAfcfQAEXHPABFx0AARceAAEXH0A= - FuncGroup - 1 - LayoutID - 3 - Comment - toledaALC - - - CodecID - 283902569 - ConfigData - IUcc8CFHHQAhRx4AIUcfQCFXHHAhVx1AIVceISFXHwIhZxzwIWcdACFnHgAhZx9AIXcc8CF3HQAhdx4AIXcfQCGHHPAhhx0AIYceACGHH0AhlxzwIZcdACGXHgAhlx9AIacc8CGnHQAhpx4AIacfQCG3HPAhtx0AIbceACG3H0Ah5xyQIecdYSHnHksh5x8B - FuncGroup - 1 - LayoutID - 1 - Comment - toledaALC - - - CodecID - 283902595 - ConfigData - AScc8AEnHQABJx4AAScfQAFHHPABRx0AAUceAAFHH0ABdxzwAXcdAAF3HgABdx9AAYcc8AGHHQABhx4AAYcfQAGXHGABlx0wAZceiwGXHwEBpxzwAacdAAGnHgABpx9AAbcc8AG3HQABtx4AAbcfQAHXHPAB1x0AAdceAAHXH0AB5xzwAecdAAHnHgAB5x9AAhcccAIXHUACFx4rAhcfAQGXDAICFwwC - FuncGroup - 1 - LayoutID - 1 - Comment - toledaALC - - - CodecID - 283904103 - ConfigData - IUccECFHHUAhRx4RIUcfkCFHDAIhVxwgIVcdECFXHgEhVx8BIWccMCFnHWAhZx4BIWcfASF3HPAhdx0AIXceACF3H0AhhxxAIYcdkCGHHqAhhx+QIZccYCGXHZAhlx6BIZcfAiGnHFAhpx0wIacegSGnHwEhtxxwIbcdQCG3HiEhtx8CIbcMAiHnHJAh5x1hIeceSyHnHwEh9xzwIfcdACH3HgAh9x9AIRcc8CEXHQAhFx4AIRcfQA== - FuncGroup - 1 - LayoutID - 1 - Comment - toledaALC - - - CodecID - 283904103 - ConfigData - IUccECFHHUAhRx4RIUcfkCFHDAIhVxzwIVcdACFXHgAhVx9AIWcc8CFnHQAhZx4AIWcfQCF3HPAhdx0AIXceACF3H0AhhxxAIYcdYCGHHgEhhx8BIZccYCGXHZAhlx6gIZcfkCGnHFAhpx0QIaceASGnHwEhtxxwIbcdQCG3HiEhtx8CIbcMAiHnHJAh5x1hIeceSyHnHwEh9xzwIfcdACH3HgAh9x9AIRcc8CEXHQAhFx4AIRcfQA== - FuncGroup - 1 - LayoutID - 2 - Comment - toledaALC - - - CodecID - 283906408 - ConfigData - AUccEAFHHUABRx4RAUcfkAFHDAIBVxwgAVcdEAFXHgEBVx8BAWccMAFnHWABZx4BAWcfAQF3HPABdx0AAXceAAF3H0ABhxxAAYcdkAGHHqABhx+QAZccYAGXHZABlx6BAZcfAgGnHFABpx0wAacegQGnHwEBtxxwAbcdQAG3HiEBtx8CAbcMAgHnHJAB5x1hAeceSwHnHwEB9xzwAfcdAAH3HgAB9x9AARcc8AEXHQABFx4AARcfQA== - FuncGroup - 1 - LayoutID - 1 - Comment - toledaALC - - - CodecID - 283906408 - ConfigData - AUccEAFHHUABRx4RAUcfkAFHDAIBVxzwAVcdAAFXHgABVx9AAWcc8AFnHQABZx4AAWcfQAF3HPABdx0AAXceAAF3H0ABhxxAAYcdYAGHHgEBhx8BAZccYAGXHZABlx6gAZcfkAGnHFABpx0QAaceAQGnHwEBtxxwAbcdQAG3HiEBtx8CAbcMAgHnHJAB5x1hAeceSwHnHwEB9xzwAfcdAAH3HgAB9x9AARcc8AEXHQABFx4AARcfQA== - FuncGroup - 1 - LayoutID - 2 - Comment - toledaALC - - - CodecID - 283906592 - ConfigData - AUccEAFHHUABRx4RAUcfkAFHDAIBVxwgAVcdEAFXHgEBVx8BAWccMAFnHWABZx4BAWcfAQGHHEABhx2QAYceoAGHH5ABlxxgAZcdkAGXHoEBlx8CAaccUAGnHTABpx6BAacfAQG3HHABtx1AAbceIQG3HwIBtwwCAecckAHnHWEB5x5LAecfAQ== - FuncGroup - 1 - LayoutID - 1 - Comment - toledaALC - - - CodecID - 283906592 - ConfigData - AUccEAFHHUABRx4RAUcfkAFHDAIBVxzwAVcdAAFXHgABVx9AAWcc8AFnHQABZx4AAWcfQAGHHEABhx1gAYceAQGHHwEBlxxgAZcdkAGXHqABlx+QAaccUAGnHRABpx4BAacfAQG3HHABtx1AAbceIQG3HwIBtwwCAecckAHnHWEB5x5LAecfAQ== - FuncGroup - 1 - LayoutID - 2 - Comment - toledaALC - - - CodecID - 283906592 - ConfigData - AUccEAFHHUABRx4RAUcfAQGHHFABhx2QAYceoAGHH5ABlxxgAZcdkAGXHoEBlx8CAacccAGnHTABpx6BAacfAQG3HIABtx1AAbceIQG3HwEB5xyQAecd4AHnHkUB5x8BAUcMAg== - FuncGroup - 1 - LayoutID - 3 - - - IOClass - AppleHDAHardwareConfigDriver - IOMatchCategory - AppleHDAHardwareConfigDriver - IOProviderClass - AppleHDAHardwareConfigDriverLoader - - - OSBundleRequired - Root - - diff --git a/EFI/CLOVER/kexts/10.13/NightShiftUnlocker.kext/Contents/Info.plist b/EFI/CLOVER/kexts/10.13/NightShiftUnlocker.kext/Contents/Info.plist new file mode 100755 index 0000000..c432e97 --- /dev/null +++ b/EFI/CLOVER/kexts/10.13/NightShiftUnlocker.kext/Contents/Info.plist @@ -0,0 +1,79 @@ + + + + + BuildMachineOSBuild + 17A405 + CFBundleDevelopmentRegion + en + CFBundleExecutable + NightShiftUnlocker + CFBundleIdentifier + science.firewolf.NightShiftUnlocker + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + NightShiftUnlocker + CFBundlePackageType + KEXT + CFBundleShortVersionString + 2.2.1 + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 2.2.1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 8E3004b + DTPlatformVersion + GM + DTSDKBuild + 16E185 + DTSDKName + macosx10.12 + DTXcode + 0833 + DTXcodeBuild + 8E3004b + IOKitPersonalities + + science.firewolf.NightShiftUnlocker + + CFBundleIdentifier + science.firewolf.NightShiftUnlocker + IOClass + NightShiftUnlocker + IOMatchCategory + NightShiftUnlocker + IOProviderClass + IOResources + IOResourceMatch + IOKit + + + NSHumanReadableCopyright + Copyright © 2017 FireWolf. All rights reserved. + OSBundleLibraries + + as.vit9696.Lilu + 1.2.0 + com.apple.kpi.bsd + 16.6 + com.apple.kpi.dsep + 16.6 + com.apple.kpi.iokit + 16.6 + com.apple.kpi.libkern + 16.6 + com.apple.kpi.mach + 16.6 + com.apple.kpi.unsupported + 16.6 + + OSBundleRequired + Root + + diff --git a/EFI/CLOVER/kexts/10.13/NightShiftUnlocker.kext/Contents/MacOS/NightShiftUnlocker b/EFI/CLOVER/kexts/10.13/NightShiftUnlocker.kext/Contents/MacOS/NightShiftUnlocker new file mode 100755 index 0000000..e80498f Binary files /dev/null and b/EFI/CLOVER/kexts/10.13/NightShiftUnlocker.kext/Contents/MacOS/NightShiftUnlocker differ diff --git a/EFI/CLOVER/kexts/10.13/NvidiaGraphicsFixup.kext/Contents/Info.plist b/EFI/CLOVER/kexts/10.13/NvidiaGraphicsFixup.kext/Contents/Info.plist index 2567d44..bc1380a 100755 --- a/EFI/CLOVER/kexts/10.13/NvidiaGraphicsFixup.kext/Contents/Info.plist +++ b/EFI/CLOVER/kexts/10.13/NvidiaGraphicsFixup.kext/Contents/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 1.2.5 + 1.2.6 CFBundleSignature ???? CFBundleSupportedPlatforms @@ -25,7 +25,7 @@ MacOSX CFBundleVersion - 1.2.5 + 1.2.6 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild @@ -33,9 +33,9 @@ DTPlatformVersion GM DTSDKBuild - 14D125 + 17E189 DTSDKName - macosx10.10 + macosx10.13 DTXcode 0930 DTXcodeBuild diff --git a/EFI/CLOVER/kexts/10.13/NvidiaGraphicsFixup.kext/Contents/MacOS/NvidiaGraphicsFixup b/EFI/CLOVER/kexts/10.13/NvidiaGraphicsFixup.kext/Contents/MacOS/NvidiaGraphicsFixup index 5de49ca..83d2a1e 100755 Binary files a/EFI/CLOVER/kexts/10.13/NvidiaGraphicsFixup.kext/Contents/MacOS/NvidiaGraphicsFixup and b/EFI/CLOVER/kexts/10.13/NvidiaGraphicsFixup.kext/Contents/MacOS/NvidiaGraphicsFixup differ diff --git a/EFI/CLOVER/kexts/10.13/NvidiaGraphicsFixup.kext/Contents/Resources/FAQ.md b/EFI/CLOVER/kexts/10.13/NvidiaGraphicsFixup.kext/Contents/Resources/FAQ.md deleted file mode 100755 index 2238031..0000000 --- a/EFI/CLOVER/kexts/10.13/NvidiaGraphicsFixup.kext/Contents/Resources/FAQ.md +++ /dev/null @@ -1,90 +0,0 @@ -- _What are the system requirements?_ -while there are no particular limitations, this FAQ does not include the specific information regarding GPUs before Kepler (i.e. older than 6xx series). -In general it appears to be less convenient to use CPUs newer than Ivy and Haswell with NVIDIA GPUs. -For GPUs newer than Kepler (e.g. Maxwell or Pascal) you need [NVIDIA Web Driver](http://www.nvidia.com/download/driverResults.aspx/125379/en-us). Use `nv_disable=1` boot argument to install it. - -- _What is the general idea?_ -If you have builtin Intel GPU, make sure to rename it to IGPU and enable with connector-less frame first. Then choose a most suitable mac model and install NvidiaGraphicsFixup. To get hardware video decoding you are likely to need [Shiki](https://github.com/vit9696/Shiki), please read its [FAQ](https://github.com/vit9696/Shiki/blob/master/Manual/FAQ.en.md) carefully to get a good understanding. - -- _How to properly choose a mac model?_ -If you have Ivy Bridge or Haswell CPU you should go with iMac13,2 or iMac14,2. Otherwise choose the model you prefer, but keep this in mind: - * If you have Intel GPU, especially if Ivy Bridge or newer, choose the model (by `board-id`) that has `forceOfflineRenderer` set to YES (true) in /System/Library/PrivateFrameworks/AppleGVA.framework/Versions/A/Info.plist. - * Models other than iMac13,2 and iMac14,2 require patches, which are though normally automated in NvidiaGraphicsFixup (see below) - * CPUs newer than Haswell require Shiki patches for hardware video decoding (see below). - -- _Why should I use Intel GPU with a connector-less frame?_ -Nvidia GPUs newer than 2xx do not implement hardware video decoder in macOS, also starting with 10.13 dual-GPU setups often cause a bootloop. If you absolutely need your IGPU with connector-full frame you will have to use [IntelGraphicsFixup](https://sourceforge.net/projects/intelgraphicsfixup) and most likely [Shiki](https://github.com/vit9696/Shiki) with `shikigva=1` OR a model without `forceOfflineRenderer`. - -- _How to use Intel GPU with a connector-less frame?_ -Please refer to [Shiki FAQ](https://github.com/vit9696/Shiki/blob/master/Manual/FAQ.en.md) for full details. You could use SSDT to rename GFX0 to IGPU by creating a proper IGPU device and setting STA of the existing one to Zero: -``` -Scope (GFX0) { - Name (_STA, Zero) // _STA: Status -} -``` - -- _What patches do I need for mac models other than iMac13,2 and iMac14,2?_ -AppleGraphicsDisplayPolicy.kext contains a check against its Info.plist and determines which mode should be used for a specific board-id. It is dependent on the GPU which mode is suitable and is normally determined experimentally. NvidiaGraphicsFixup contains several ways to configure to set power management modes: - - kext patch enforcing `none` into ConfigMap dictionary for system board-id (ngfxpatch=cfgmap) - - kext patch disabling string comparison `` (ngfxpatch=vit9696, enabled by default) - - kext patch replacing `board-id` with `board-ix` (ngfxpatch=pikera) - -- _What patches do I need for Maxwell or Pascal GPUs?_ -Maxwell GPUs (normally 9xx and some 7xx) no longer supply a correct IOVARendererID to enable hardware video decoder. See more details: [here](https://github.com/vit9696/Shiki/issues/5). You no longer need any changes (e.g. iMac.kext) but NvidiaGraphicsFixup. This fix was added in 1.2.0 branch. Can be switched off by using boot-arg "-ngfxnovarenderer". - -- _What patches do processors newer than Haswell need?_ -Apple limits hardware video decoder with NVIDIA to only Haswell and earlier. To get hardware accelerated video decoding you need to patch AppleGVA.framework. To do so you could use [Shiki](https://github.com/vit9696/Shiki) with `shikigva=4` boot argument. On 10.13 you may currently use a temporary workaround that enables hardware video decoding only for a subset of processes via `shikigva=12` boot argument. - -- _What patches do Pascal GPUs need on 10.12?_ -On 10.12 and possibly on 10.13 Pascal GPUs need a team id unlock to avoid glitches like empty transparent windows and so on. This patch is already present in NvidiaGraphicsFixup, and the use of any other kext (e.g. NVWebDriverLibValFix.kext) is not needed. -Can be switched off by using boot-arg "-ngfxlibvalfix". - -- _How can I enable digital (HDMI audio)?_ -NvidiaGraphicsFixup will do it itself but you must esnure that you do not have any conflicting "fixes" from Clover, SSDT patches, Arbitrary and so on (e.g. FixDisplay, AddHDMI, etc.). NvidiaGraphicsFixup also renames GPU devices to GFX0 and HDAU and injects audio connectors @0,connector-type - @5,connector-type. Injection can be switched off by using boot-arg "-ngfxnoaudio" or more specific "-ngfxnoaudiocon". You can also use ioreg properties in GPU to disable respective injections: "no-audio-autofix" or "no-audio-fixconn". - -- _How can I partially fix Apple Logo during boot?_ -Inject `@X,AAPL,boot-display` GFX0 property with the main screen index instead of X, the value does not matter. - -- _Does NvidiaGraphicsFixup fix visual issues on wakeup with Pascal GPUs?_ -Not at the moment. It is also known that HDMI audio may not always work with Pascal GPUs. - -- _HDMI audio device only visible after rescan_ -[Jamie](https://sourceforge.net/p/nvidiagraphicsfixup/tickets/9/) found out through linux that nvidia graphics on laptops gtx 1060/1070 specifically, -that the audio device is disabled by default. [Bug description](https://bugs.freedesktop.org/show_bug.cgi?id=75985). -He discovered that when the 0x488 magic bit is not set, the gfx device advertises as non-multifunction. -After the bit is set, the device advertises as multi-function. -So, after setting the magic bit, removing the device will cause Linux to re-probe it during the next rescan -taking note at that point that it is a multi-function device -on linux theres a fix use: setpci -s 01:00.0 0x488.l=0x2000000:0x2000000" -on mac os he added: -``` -Device (PEG0) -{ - Name (_ADR, 0x00010000) // _ADR: Address - Method (_PRT, 0, NotSerialized) // _PRT: PCI Routing Table - { - ** Store (One, ^GFX0.NHDA)** - If (PICM) - { - Return (AR01) - } - - Return (PR01) - } -} -``` -NHDA is declared here: -``` -Scope (_SB.PCI0.PEG0) -{ - Device (GFX0) - { - Name (HDAU, Zero) - OperationRegion (PCI2, SystemMemory, 0xE0100000, 0x0500) - Field (PCI2, DWordAcc, Lock, Preserve) - { - Offset (0x48B), - , 1, - NHDA, 1 - } -``` diff --git a/EFI/CLOVER/kexts/Other/NightShiftUnlocker.kext/Contents/Info.plist b/EFI/CLOVER/kexts/Other/NightShiftUnlocker.kext/Contents/Info.plist new file mode 100755 index 0000000..c432e97 --- /dev/null +++ b/EFI/CLOVER/kexts/Other/NightShiftUnlocker.kext/Contents/Info.plist @@ -0,0 +1,79 @@ + + + + + BuildMachineOSBuild + 17A405 + CFBundleDevelopmentRegion + en + CFBundleExecutable + NightShiftUnlocker + CFBundleIdentifier + science.firewolf.NightShiftUnlocker + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + NightShiftUnlocker + CFBundlePackageType + KEXT + CFBundleShortVersionString + 2.2.1 + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 2.2.1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 8E3004b + DTPlatformVersion + GM + DTSDKBuild + 16E185 + DTSDKName + macosx10.12 + DTXcode + 0833 + DTXcodeBuild + 8E3004b + IOKitPersonalities + + science.firewolf.NightShiftUnlocker + + CFBundleIdentifier + science.firewolf.NightShiftUnlocker + IOClass + NightShiftUnlocker + IOMatchCategory + NightShiftUnlocker + IOProviderClass + IOResources + IOResourceMatch + IOKit + + + NSHumanReadableCopyright + Copyright © 2017 FireWolf. All rights reserved. + OSBundleLibraries + + as.vit9696.Lilu + 1.2.0 + com.apple.kpi.bsd + 16.6 + com.apple.kpi.dsep + 16.6 + com.apple.kpi.iokit + 16.6 + com.apple.kpi.libkern + 16.6 + com.apple.kpi.mach + 16.6 + com.apple.kpi.unsupported + 16.6 + + OSBundleRequired + Root + + diff --git a/EFI/CLOVER/kexts/Other/NightShiftUnlocker.kext/Contents/MacOS/NightShiftUnlocker b/EFI/CLOVER/kexts/Other/NightShiftUnlocker.kext/Contents/MacOS/NightShiftUnlocker new file mode 100755 index 0000000..e80498f Binary files /dev/null and b/EFI/CLOVER/kexts/Other/NightShiftUnlocker.kext/Contents/MacOS/NightShiftUnlocker differ diff --git a/EFI/CLOVER/kexts/Other/NvidiaGraphicsFixup.kext/Contents/Info.plist b/EFI/CLOVER/kexts/Other/NvidiaGraphicsFixup.kext/Contents/Info.plist index 2567d44..bc1380a 100755 --- a/EFI/CLOVER/kexts/Other/NvidiaGraphicsFixup.kext/Contents/Info.plist +++ b/EFI/CLOVER/kexts/Other/NvidiaGraphicsFixup.kext/Contents/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 1.2.5 + 1.2.6 CFBundleSignature ???? CFBundleSupportedPlatforms @@ -25,7 +25,7 @@ MacOSX CFBundleVersion - 1.2.5 + 1.2.6 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild @@ -33,9 +33,9 @@ DTPlatformVersion GM DTSDKBuild - 14D125 + 17E189 DTSDKName - macosx10.10 + macosx10.13 DTXcode 0930 DTXcodeBuild diff --git a/EFI/CLOVER/kexts/Other/NvidiaGraphicsFixup.kext/Contents/MacOS/NvidiaGraphicsFixup b/EFI/CLOVER/kexts/Other/NvidiaGraphicsFixup.kext/Contents/MacOS/NvidiaGraphicsFixup index 5de49ca..83d2a1e 100755 Binary files a/EFI/CLOVER/kexts/Other/NvidiaGraphicsFixup.kext/Contents/MacOS/NvidiaGraphicsFixup and b/EFI/CLOVER/kexts/Other/NvidiaGraphicsFixup.kext/Contents/MacOS/NvidiaGraphicsFixup differ diff --git a/EFI/CLOVER/kexts/Other/NvidiaGraphicsFixup.kext/Contents/Resources/FAQ.md b/EFI/CLOVER/kexts/Other/NvidiaGraphicsFixup.kext/Contents/Resources/FAQ.md deleted file mode 100755 index 2238031..0000000 --- a/EFI/CLOVER/kexts/Other/NvidiaGraphicsFixup.kext/Contents/Resources/FAQ.md +++ /dev/null @@ -1,90 +0,0 @@ -- _What are the system requirements?_ -while there are no particular limitations, this FAQ does not include the specific information regarding GPUs before Kepler (i.e. older than 6xx series). -In general it appears to be less convenient to use CPUs newer than Ivy and Haswell with NVIDIA GPUs. -For GPUs newer than Kepler (e.g. Maxwell or Pascal) you need [NVIDIA Web Driver](http://www.nvidia.com/download/driverResults.aspx/125379/en-us). Use `nv_disable=1` boot argument to install it. - -- _What is the general idea?_ -If you have builtin Intel GPU, make sure to rename it to IGPU and enable with connector-less frame first. Then choose a most suitable mac model and install NvidiaGraphicsFixup. To get hardware video decoding you are likely to need [Shiki](https://github.com/vit9696/Shiki), please read its [FAQ](https://github.com/vit9696/Shiki/blob/master/Manual/FAQ.en.md) carefully to get a good understanding. - -- _How to properly choose a mac model?_ -If you have Ivy Bridge or Haswell CPU you should go with iMac13,2 or iMac14,2. Otherwise choose the model you prefer, but keep this in mind: - * If you have Intel GPU, especially if Ivy Bridge or newer, choose the model (by `board-id`) that has `forceOfflineRenderer` set to YES (true) in /System/Library/PrivateFrameworks/AppleGVA.framework/Versions/A/Info.plist. - * Models other than iMac13,2 and iMac14,2 require patches, which are though normally automated in NvidiaGraphicsFixup (see below) - * CPUs newer than Haswell require Shiki patches for hardware video decoding (see below). - -- _Why should I use Intel GPU with a connector-less frame?_ -Nvidia GPUs newer than 2xx do not implement hardware video decoder in macOS, also starting with 10.13 dual-GPU setups often cause a bootloop. If you absolutely need your IGPU with connector-full frame you will have to use [IntelGraphicsFixup](https://sourceforge.net/projects/intelgraphicsfixup) and most likely [Shiki](https://github.com/vit9696/Shiki) with `shikigva=1` OR a model without `forceOfflineRenderer`. - -- _How to use Intel GPU with a connector-less frame?_ -Please refer to [Shiki FAQ](https://github.com/vit9696/Shiki/blob/master/Manual/FAQ.en.md) for full details. You could use SSDT to rename GFX0 to IGPU by creating a proper IGPU device and setting STA of the existing one to Zero: -``` -Scope (GFX0) { - Name (_STA, Zero) // _STA: Status -} -``` - -- _What patches do I need for mac models other than iMac13,2 and iMac14,2?_ -AppleGraphicsDisplayPolicy.kext contains a check against its Info.plist and determines which mode should be used for a specific board-id. It is dependent on the GPU which mode is suitable and is normally determined experimentally. NvidiaGraphicsFixup contains several ways to configure to set power management modes: - - kext patch enforcing `none` into ConfigMap dictionary for system board-id (ngfxpatch=cfgmap) - - kext patch disabling string comparison `` (ngfxpatch=vit9696, enabled by default) - - kext patch replacing `board-id` with `board-ix` (ngfxpatch=pikera) - -- _What patches do I need for Maxwell or Pascal GPUs?_ -Maxwell GPUs (normally 9xx and some 7xx) no longer supply a correct IOVARendererID to enable hardware video decoder. See more details: [here](https://github.com/vit9696/Shiki/issues/5). You no longer need any changes (e.g. iMac.kext) but NvidiaGraphicsFixup. This fix was added in 1.2.0 branch. Can be switched off by using boot-arg "-ngfxnovarenderer". - -- _What patches do processors newer than Haswell need?_ -Apple limits hardware video decoder with NVIDIA to only Haswell and earlier. To get hardware accelerated video decoding you need to patch AppleGVA.framework. To do so you could use [Shiki](https://github.com/vit9696/Shiki) with `shikigva=4` boot argument. On 10.13 you may currently use a temporary workaround that enables hardware video decoding only for a subset of processes via `shikigva=12` boot argument. - -- _What patches do Pascal GPUs need on 10.12?_ -On 10.12 and possibly on 10.13 Pascal GPUs need a team id unlock to avoid glitches like empty transparent windows and so on. This patch is already present in NvidiaGraphicsFixup, and the use of any other kext (e.g. NVWebDriverLibValFix.kext) is not needed. -Can be switched off by using boot-arg "-ngfxlibvalfix". - -- _How can I enable digital (HDMI audio)?_ -NvidiaGraphicsFixup will do it itself but you must esnure that you do not have any conflicting "fixes" from Clover, SSDT patches, Arbitrary and so on (e.g. FixDisplay, AddHDMI, etc.). NvidiaGraphicsFixup also renames GPU devices to GFX0 and HDAU and injects audio connectors @0,connector-type - @5,connector-type. Injection can be switched off by using boot-arg "-ngfxnoaudio" or more specific "-ngfxnoaudiocon". You can also use ioreg properties in GPU to disable respective injections: "no-audio-autofix" or "no-audio-fixconn". - -- _How can I partially fix Apple Logo during boot?_ -Inject `@X,AAPL,boot-display` GFX0 property with the main screen index instead of X, the value does not matter. - -- _Does NvidiaGraphicsFixup fix visual issues on wakeup with Pascal GPUs?_ -Not at the moment. It is also known that HDMI audio may not always work with Pascal GPUs. - -- _HDMI audio device only visible after rescan_ -[Jamie](https://sourceforge.net/p/nvidiagraphicsfixup/tickets/9/) found out through linux that nvidia graphics on laptops gtx 1060/1070 specifically, -that the audio device is disabled by default. [Bug description](https://bugs.freedesktop.org/show_bug.cgi?id=75985). -He discovered that when the 0x488 magic bit is not set, the gfx device advertises as non-multifunction. -After the bit is set, the device advertises as multi-function. -So, after setting the magic bit, removing the device will cause Linux to re-probe it during the next rescan -taking note at that point that it is a multi-function device -on linux theres a fix use: setpci -s 01:00.0 0x488.l=0x2000000:0x2000000" -on mac os he added: -``` -Device (PEG0) -{ - Name (_ADR, 0x00010000) // _ADR: Address - Method (_PRT, 0, NotSerialized) // _PRT: PCI Routing Table - { - ** Store (One, ^GFX0.NHDA)** - If (PICM) - { - Return (AR01) - } - - Return (PR01) - } -} -``` -NHDA is declared here: -``` -Scope (_SB.PCI0.PEG0) -{ - Device (GFX0) - { - Name (HDAU, Zero) - OperationRegion (PCI2, SystemMemory, 0xE0100000, 0x0500) - Field (PCI2, DWordAcc, Lock, Preserve) - { - Offset (0x48B), - , 1, - NHDA, 1 - } -``` diff --git a/Tools/AGDPfix-2.app/Contents/Resources/Scripts/main.scpt b/Tools/AGDPfix-2.app/Contents/Resources/Scripts/main.scpt index a45d8bb..1b11001 100755 Binary files a/Tools/AGDPfix-2.app/Contents/Resources/Scripts/main.scpt and b/Tools/AGDPfix-2.app/Contents/Resources/Scripts/main.scpt differ diff --git a/audio_cloverALC-130_v0.3.command b/audio_cloverALC-130_v0.5.command similarity index 76% rename from audio_cloverALC-130_v0.3.command rename to audio_cloverALC-130_v0.5.command index e31d8dd..46a17a0 100755 --- a/audio_cloverALC-130_v0.3.command +++ b/audio_cloverALC-130_v0.5.command @@ -1,17 +1,17 @@ #!/bin/sh # Maintained by: toleda for: github.com/toleda/audio_cloverALC -gFile="audio_cloverALC-130.command_v0.3" -# gFile="audio_pikeralphaALC-120.command_vv0.1" +gFile="audio_cloverALC-130.command_v0.5" # Credit: bcc9, RevoGirl, PikeRAlpha, SJ_UnderWater, RehabMan, TimeWalker75a, lisai9093 # -# OS X Clover Realtek ALC Onboard Audio +# macOS Clover Realtek ALC Onboard Audio # -# Enables OS X Realtek ALC onboard audio in 10.13, 10.12, 10.11, 10.10, 10.9 and 10.8, all versions +# Enables macOS Realtek ALC onboard audio in 10.13, 10.12, 10.11, 10.10, 10.9 and 10.8, all versions # 1. Supports Realtek ALC885, 887, 888, 889, 892, 898, 1150 and 1220 -# 2. Clover patched native AppleHDA.kext installed in System/Library/Extensions +# 2. Supports Intel 5/X58/6/7/X79/8/9/X99/100/200/X299/300 Series motherboards +# 3. Native AppleHDA.kext installed in System/Library/Extensions # # Requirements -# 1. OS X: 10.13/10.12/10.11/10.10/10.9/10.8, all versions +# 1. macOS: 10.13/10.12/10.11/10.10/10.9/10.8, all versions # 2. Native AppleHDA.kext (if not installed, run 10.x installer) # 3. Supported Realtek ALC on board audio codec (see above) # 4. Audio ID: 1, 2 or 3 Injection, see https://github.com/toleda/audio_ALCinjection @@ -21,7 +21,7 @@ gFile="audio_cloverALC-130.command_v0.3" # 2. Enter password at prompt # 3. For Clover/EFI, EFI partition must be mounted before running script # 4. For Clover/Legacy, answer y to Confirm Clover Legacy Install (y/n) -# 5. Confirm Realtek ALCxxx (y/n): (885, 887, 888, 889, 892, 898, 1150, 1220) +# 5. Confirm Realtek ALCxxx (y/n): (885, 887, 888, 889, 892, 898, 1150, 1220, 1220A) # 6. Clover Audio ID Injection (y/n): # If y: # 7. Use Audio ID: x (y/n): @@ -31,9 +31,12 @@ gFile="audio_cloverALC-130.command_v0.3" # 2 - 3 port (5.1) Realtek ALCxxx audio (n/a 885) # 3 - HD3000/HD4000 HDMI audio w/Realtek ALCxxx audio (n/a 885/1150/1220 & 887/888 Legacy) # 8. Select Audio ID (1, 2 or 3) -# 9. Restart +# 9. Motherboard (300/200/x299/x99/Other = n): +# 10. Restart # # Change log: +# v0.5 - 3/30/18: Fix 1220A +# v0.4 - 2/20/18: Add 300, 200, x299, x99 series audio controller, add macOS version/disabled, remove HD4600 HDMI audio patch, remove pikeralphaALC, clean up # v0.3 - 9/12/17: Audio ID validation typo # v0.2 - 8/31/17: Audio ID validation # v0.1 - 7/5/17: Alpha 10.13 support @@ -57,9 +60,8 @@ gSysVer=`sw_vers -productVersion` gSysName="Mavericks" gStartupDisk=EFI gCloverDirectory=/Volumes/$gStartupDisk/EFI/CLOVER -# gUserDirectory=/Volumes/850E-Users ## -gDesktopDirectory=/Users/$(whoami)/Desktop -gDesktopDirectory=$gUserDirectory$gDesktopDirectory +gDesktopDirectory=/Volumes/$(whoami)/Desktop +# gDesktopDirectory=/Volumes/850E-Users/Users/$(whoami)/Desktop ## gLibraryDirectory=/Library/Extensions gExtensionsDirectory=/System/Library/Extensions gHDAContentsDirectory=$gExtensionsDirectory/AppleHDA.kext/Contents @@ -69,8 +71,9 @@ gAudioid=1 gLayoutid=1 gPatch="-toledaALC" gCodec=892 -#gCodec1220S=n -gCodec1220A=n +# gCodec1220S=n +# gCodec1220A=n +gAntipop=no gLegacy=n gController=n gMake=0 @@ -81,31 +84,50 @@ gMB=0 # gCodecName # gCodec gCloverALC=1 -gPikerAlphaALC=0 gRealtekALC=0 gAudioidvalid=n gCodecvalid=n -g200SeriesAudio=n gCodecconfig=0 +ktplabel="t1-" + +function _patchconfig() +{ + +# debug + if [ $gDebug = 2 ]; then + echo "patch = $patch" + fi + +# add patches to config.plist/KernelAndKextPatches/KextsToPatch + sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:$patch'" /tmp/config-audio_cloverALC.plist -x > "/tmp/ktp.plist" + ktpcomment=$(sudo /usr/libexec/PlistBuddy -c "Print 'Comment'" "/tmp/ktp.plist") + sudo /usr/libexec/PlistBuddy -c "Set :Comment '$ktplabel$ktpcomment'" "/tmp/ktp.plist" + sudo /usr/libexec/PlistBuddy -c "Add :KernelAndKextPatches:KextsToPatch:0 dict" /tmp/config.plist + sudo /usr/libexec/PlistBuddy -c "Merge /tmp/ktp.plist ':KernelAndKextPatches:KextsToPatch:0'" /tmp/config.plist + +# exit if error +if [ "$?" != "0" ]; then + echo "Error: config.plst patch failed" + echo “Original config.plist restored” + sudo cp -X $gCloverDirectory/config-backup.plist $gCloverDirectory/config.plist + sudo rm -R /tmp/ktp.plist + sudo rm -R /tmp/config.plist + sudo rm -R /tmp/config-audio_cloverALC+.plist.zip + sudo rm -R /tmp/config-audio_cloverALC.plist + sudo rm -R /tmp/__MACOSX + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 +fi + +} # debug if [ $gDebug = 2 ]; then echo "gDebug = $gDebug - ${gDebugMode[$gDebug]}" echo "gMake = $gMake" echo "gCloverALC = $gCloverALC" - echo "gPikerAlphaALC = $gPikerAlphaALC" echo "gRealtekALC = $gRealtekALC" echo "gBetaALC = $gBetaALC" - -# while true -# do -# read -p "OK (y/n): " choice3 -# case "$choice3" in -# [yY]* ) break;; -# [nN]* ) exit;; -# * ) echo "Try again...";; -# esac -# done fi # verify system version @@ -139,7 +161,7 @@ case ${gSysVer} in ;; * ) - echo "OS X Version: $gSysVer is not supported" + echo "macOS Version: $gSysVer is not supported" echo "No system files were changed" echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." exit 1 @@ -268,8 +290,8 @@ if [ $gRealtekALC = 1 ]; then rm -R /tmp/org.chameleon.Boot.txt else -# osmosis/other +# osmosis/other while true do read -p "No Clover/Chameleon files, confirm Osmosis/other install (y/n): " choice10 @@ -528,6 +550,7 @@ else 1 ) if [ ! -f "$gCloverDirectory/config.plist" ]; then echo "Error, $gCloverDirectory/config.plist missing" + echo "Mount correct EFI partition, run cloverALC" exit 1 fi @@ -538,17 +561,13 @@ else 2 ) echo "gHDAversioninstalled = $gHDAversioninstalled" echo "gDesktopDirectory = $gDesktopDirectory" - sudo cp -R "$gDesktopDirectory/config-basic.plist" /tmp/config.plist - if [ -f "$gDesktopDirectory/config-basic.plist" ]; then - sudo cp -R "$gDesktopDirectory/config-basic.plist" /tmp/config.plist - echo "Desktop/config-basic.plist copied to /tmp/config.plist" - else + if [ ! -f "$gDesktopDirectory/config-basic.plist" ]; then echo "Error, Desktop/config-basic.plist missing" exit 1 fi - - + sudo cp -R "$gDesktopDirectory/config-basic.plist" /tmp/config.plist + echo "Desktop/config-basic.plist copied to /tmp/config.plist" ;; * ) @@ -559,7 +578,6 @@ esac fi - # exit if error if [ "$?" != "0" ]; then if [ $choice8 != "y" ]; then @@ -581,18 +599,47 @@ fi # verify ioreg/HDEF ioreg -rw 0 -p IODeviceTree -n HDEF > /tmp/HDEF.txt +audiodevice=none if [[ $(cat /tmp/HDEF.txt | grep -c "HDEF@1") != 0 ]]; then gLayoutidioreg=$(cat /tmp/HDEF.txt | grep layout-id | sed -e 's/.*//') gLayoutidhex="0x${gLayoutidioreg:6:2}${gLayoutidioreg:4:2}${gLayoutidioreg:2:2}${gLayoutidioreg:0:2}" gAudioid=$((gLayoutidhex)) + audiodevice=HDEF sudo rm -R /tmp/HDEF.txt else - echo "Error: no IOReg/HDEF; BIOS/audio/disabled or ACPI problem" + + ioreg -rw 0 -p IODeviceTree -n HDAS > /tmp/HDEF.txt + if [[ $(cat /tmp/HDEF.txt | grep -c "HDAS@1") != 0 ]]; then + echo "Error: macOS does not support dsdt/HDAS; install Clover patch or ssdt and restart" + audiodevice=HDAS + fi + + ioreg -rw 0 -p IODeviceTree -n CAVS > /tmp/HDEF.txt + if [[ $(cat /tmp/HDEF.txt | grep -c "CAVS@1") != 0 ]]; then + echo "Error: macOS does not support dsdt/CAVS; install Clover patch or ssdt and restart" + audiodevice=CAVS + fi + + ioreg -rw 0 -p IODeviceTree -n ALZA > /tmp/HDEF.txt + if [[ $(cat /tmp/HDEF.txt | grep -c "ALZA@1") != 0 ]]; then + echo "Error: macOS does not support dsdt/ALZA; install Clover patch or ssdt and restart" + audiodevice=ALZA + fi + + ioreg -rw 0 -p IODeviceTree -n AZAL > /tmp/HDEF.txt + if [[ $(cat /tmp/HDEF.txt | grep -c "AZAL@1") != 0 ]]; then + echo "Error: macOS does not support dsdt/AZAL; install Clover patch or ssdt and restart" + audiodevice=AZAL + fi + + if [ $audiodevice = "none" ]; then + echo "Error: no IOReg/HDEF; BIOS/.../HD Audio/disabled or ACPI problem" + fi echo "No system files were changed" echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." sudo rm -R /tmp/HDEF.txt -exit 1 + exit 1 fi # debug @@ -660,7 +707,7 @@ gCodecsInstalled=$(ioreg -rxn IOHDACodecDevice | grep VendorID | awk '{ print $4 gCodecsVersion=$(ioreg -rxn IOHDACodecDevice | grep RevisionID| awk '{ print $4 }') # debug -if [ $gDebug = 2 ]; then ## +# if [ $gDebug = 2 ]; then ## # if [ $gDebug = 1 ] || [ $gDebug = 2 ]; then # gCodecsInstalled=0x10ec0887 # gCodecsVersion=0x100101 @@ -668,11 +715,11 @@ if [ $gDebug = 2 ]; then ## # gCodecsVersion=0x100302 # gCodecsInstalled=0x10ec0900 # gCodecsInstalled=0x10ec1168 -gCodecsInstalled=0x10ec1220 +# gCodecsInstalled=0x10ec1220 # gCodecsVersion=0x100001 # gCodecsInstalled=0x10134206 # gCodecsVersion=0x100302 -fi +# fi if [ $gDebug = 2 ]; then echo "gCodecsInstalled = $gCodecsInstalled" @@ -796,8 +843,8 @@ if [ $realtek = y ]; then fi if [ $gCodecDevice = "1168" ]; then - gCodec1220A=y - gCodecName=1220 +# gCodec1220A=y + gCodecName=1220A fi if [ $gCodecDevice = "1220" ]; then @@ -810,18 +857,18 @@ if [ $gDebug = 2 ]; then echo "Codec identification: success" fi -if [ $gPikerAlphaALC = 1 ]; then - echo "" - echo "Note: when AppleHDA8Series asks:" - echo "Do you want to copy AppleHDA$gCodec.kext to: /System/Library/Extensions? (y/n)" - echo "Answer: n" - echo "" -fi +# if [ $gPikerAlphaALC = 1 ]; then +# echo "" +# echo "Note: when AppleHDA8Series asks:" +# echo "Do you want to copy AppleHDA$gCodec.kext to: /System/Library/Extensions? (y/n)" +# echo "Answer: n" +# echo "" +# fi # new codec # validate_realtek codec case "$gCodecName" in -269|283|885|887|888|889|892|898|1150|1220 ) +269|283|885|887|888|889|892|898|1150|1220|1220A ) # confirm codec, go button while true @@ -852,16 +899,22 @@ fi fi +if [ $gCodecName = 1220A ]; then +gCodec=1220 +fi + if [ $gCodecvalid != y ]; then # new codec -# get supported codec - echo "Supported RealtekALC codecs: 885, 887, 888, 889, 892, 898, 1150 and 1220 (0 to exit)" +# get supported codec + echo "Supported RealtekALC codecs: 885, 887, 888, 889, 892, 898, 1150, 1220 and 1220A (0 to exit)" while true do read -p "Enter codec: " choice0 case "$choice0" in - 269|283|885|887|888|889|892|898|1150|1220 ) gCodec=$choice0; break;; + 269|283|885|887|888|889|892|898|1150|1220 ) gCodec=$choice0; gCodecName=$choice0; break;; +# 1220a|1220A ) gCodec1220A=y; gCodec=1220; gCodecName=1220A; break;; + 1220a|1220A ) gCodec=1220; gCodecName=1220A; break;; 0 ) echo "No system files were changed" echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." exit 1;; @@ -869,8 +922,13 @@ if [ $gCodecvalid != y ]; then * ) echo "Try again...";; esac done -# Versionrealtekaudio=0x100302 +fi +# debug +if [ $gDebug = 2 ]; then +# echo "gCodec1220A = $gCodec1220A" + echo "gCodec = $gCodec" + echo "gCodecName = $gCodecName" fi # legacy @@ -913,56 +971,6 @@ case "$gCodec" in esac -case "$gCodec" in - -887|892|898|1150 ) - -# verify ioreg/HDAU for HD4600 HDMI audio - ioreg -rw 0 -p IODeviceTree -n HDAU > /tmp/HDAU.txt - - if [[ $(cat /tmp/HDAU.txt | grep -c "HDAU@3") != 0 ]]; then - if [[ $(cat /tmp/HDAU.txt | grep -c "0c0c") != 0 ]]; then - echo "HDAU@3 found, HD4600 HDMI audio capable" - gController=1 - fi - fi - sudo rm -R /tmp/HDAU.txt - - ioreg -rw 0 -p IODeviceTree -n B0D3 > /tmp/B0D3.txt - - if [[ $(cat /tmp/B0D3.txt | grep -c "B0D3@3") != 0 ]]; then - if [[ $(cat /tmp/B0D3.txt | grep -c "0c0c") != 0 ]]; then - echo "B0D3@3 found, HDAU edit required for HD4600 HDMI audio" - echo "dsdt edit/ssdt injection not available with this script" - gController=1 - fi - fi - sudo rm -R /tmp/B0D3.txt - - ;; - -esac - -# HD4600 HDMI audio patch] -choice2=n -if [ $gController = 1 ]; then - if [ $gCodec = 887 -a $gLegacy = y ]; then gController=n; else - case "$gCodec" in - - 887|892|898|1150 ) - while true - do - read -p "Patch AppleHDA.kext for HD4600 HDMI audio (y/n): " choice2 - case "$choice2" in - [yY]* ) gController=y; break;; - [nN]* ) gController=n; break;; - * ) echo "Try again...";; - esac - done - esac - fi -fi - # validate audio id audioid[0]="1 - 1/3/5/6 port Realtek ALCxxx audio" @@ -975,7 +983,7 @@ case "$gCodec" in gCodecconfig=1 ;; - 887|888|889|892|898|1150|1220 ) + 887|888|889|892|898|1150|1220|1220A ) gCodecconfig=2 ;; @@ -1143,55 +1151,52 @@ if [ $gDebug = 2 ]; then echo "Codec configuration: success" fi -# g200SeriesAudio -# confirm 200 series audio +# special case, unsupported audio controller: 300, 200, x299, x99 +choice2=n +# choice2a=n case "$gCodec" in -1220 ) +887|892|1150|1220 ) # while true # do -# read -p "Confirm 200 Series audio (y/n): " choice14 -# case "$choice14" in -# [yY]* ) g200SeriesAudio=y; break;; -# [nN]* ) -# echo "User termination" -# echo "No system files were changed" -# echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." -# exit 1 -# ;; -# * ) echo "Try again...";; +# read -p "300, 200, x299, x99 Series motherboard (y/n): " choice2a +# case "$choice2a" in +# [yY]* ) gController=y; break;; +# [nN]* ) gController=n; break;; +# * ) echo "Try again...";; # esac # done +# esac -if [ ${gSysVer:6:1} -lt 4 ]; then - echo "macOS supports 200 series audio with 10.12.4 and newer" - - while true - do - read -p "No audio on restart, continue (y/n): " choice15 - case "$choice15" in - [yY]* ) g200SeriesAudio=y; break;; - [nN]* ) - echo "User termination" - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 - ;; +# if [ $choice2a = y ]; then +while true +do +read -p "Motherboard (300/200/x299/x99/Other = n): " choice2 + case "$choice2" in + 300|200|x299|X299 ) gController=Kaby; break;; + x99|X99 ) gController=x99; break;; + [nN]* ) gController=n; break;; * ) echo "Try again...";; - esac - done - -fi -;; + esac +done +# fi esac -if [ $gPikerAlphaALC = 0 ]; then +# antipop fix, credit Sergey_Galan-AppleALC - bokrn +# while true +# do +# read -p "Anti-pop fix (y/n): " choice2a +# case "$choice2a" in +# [yY]* ) gAntipop=y; break;; +# [nN]* ) gAntipop=n; break;; +# * ) echo "Try again...";; +# esac +# done - -gDownloadLink="https://raw.githubusercontent.com/toleda/audio_ALC$gCodec/master/$gCodec.zip" +gDownloadLink="https://raw.githubusercontent.com/toleda/audio_ALC$gCodec/master/$gCodecName.zip" if [ $gLegacy = y ]; then Legacy=_v100202 @@ -1226,28 +1231,24 @@ if [ $gDebug = 2 ]; then echo "gCodec = $gCodec" fi -#if [ $gCodec1220S = y ]; then -# gCodec+="S" -#fi - -if [ $gCodec1220A = y ]; then - gCodec+="A" -fi - echo "" echo "Download ALC$gCodec files ..." sudo curl -o "/tmp/ALC$gCodec.zip" $gDownloadLink unzip -qu "/tmp/ALC$gCodec.zip" -d "/tmp/" +if [ $gCodec != $gCodecName ]; then + mv /tmp/$gCodec /tmp/$gCodecName +fi + # exit if error if [ "$?" != "0" ]; then - echo "Error: No Realtek ALC$gCodec Beta files" + echo "Error: No Realtek ALC$gCodec files" echo "No system files were changed" echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." exit 1 fi -fi +# fi # exit if error if [ "$?" != "0" ]; then @@ -1257,14 +1258,16 @@ if [ "$?" != "0" ]; then exit 1 fi +echo "$gCodecName files copied to /tmp/$gCodecName" # debug if [ $gDebug = 2 ]; then echo "gCloverALC = $gCloverALC" - echo "gPikerAlphaALC = $gPikerAlphaALC" +# echo "gPikerAlphaALC = $gPikerAlphaALC" echo "gRealtekALC = $gRealtekALC" fi + ###################### if [ $gCloverALC = 1 ]; then # main loop @@ -1295,8 +1298,8 @@ if [ $gDebug = 2 ]; then echo "configaudio = $configaudio" fi -if [ $gPikerAlphaALC = 0 ]; then -echo "Edit config.plist/SystemParameters/InjectKexts/YES" +# if [ $gPikerAlphaALC = 0 ]; then +echo "Edit config.plist/SystemParameters/InjectKexts/Yes" injectkexts=$(sudo /usr/libexec/PlistBuddy -c "Print ':SystemParameters:InjectKexts:'" /tmp/config.plist) @@ -1310,13 +1313,8 @@ if [ -z "${injectkexts}" ]; then echo "Edit config.plist: Add SystemParameters/InjectKexts - Fixed" fi -if [ $(sudo /usr/libexec/PlistBuddy -c "Print ':SystemParameters:InjectKexts'" /tmp/config.plist | grep -c "YES") = 0 ]; then - sudo /usr/libexec/PlistBuddy -c "Set :SystemParameters:InjectKexts YES" /tmp/config.plist -fi - -# debug -if [ $gDebug = 2 ]; then - echo "After edit. :SystemParameters:InjectKexts; = $(sudo /usr/libexec/PlistBuddy -c "Print ':SystemParameters:InjectKexts:'" /tmp/config.plist)" +if [ $(sudo /usr/libexec/PlistBuddy -c "Print ':SystemParameters:InjectKexts'" /tmp/config.plist | grep -c "Yes") = 0 ]; then + sudo /usr/libexec/PlistBuddy -c "Set :SystemParameters:InjectKexts Yes" /tmp/config.plist fi # exit if error @@ -1333,83 +1331,179 @@ if [ "$?" != "0" ]; then exit 1 fi -fi +# fi echo "Download kext patches" -if [ $gBetaALC = 0 ]; then -gDownloadLink="https://raw.githubusercontent.com/toleda/audio_cloverALC/master/config-audio_cloverALC.plist.zip" -else -gDownloadLink="https://raw.githubusercontent.com/toleda/audio_alc_test/master/config-audio_cloverALC.plist.zip" +case $gDebug in + +0|1 ) + if [ $gBetaALC = 0 ]; then + gDownloadLink="https://raw.githubusercontent.com/toleda/audio_cloverALC/master/config-audio_cloverALC+.plist.zip" + else + gDownloadLink="https://raw.githubusercontent.com/toleda/audio_alc_test/master/config-audio_cloverALC+.plist.zip" + fi + + sudo curl -o "/tmp/config-audio_cloverALC+.plist.zip" $gDownloadLink + unzip -qu "/tmp/config-audio_cloverALC+.plist.zip" -d "/tmp/" + mv /tmp/config-audio_cloverALC+.plist /tmp/config-audio_cloverALC.plist +;; + +2 ) + echo "gDesktopDirectory = $gDesktopDirectory" + + if [ -f "$gDesktopDirectory/config-audio_cloverALC+.plist" ]; then + sudo cp -R "$gDesktopDirectory/config-audio_cloverALC+.plist" /tmp/config-audio_cloverALC.plist + echo "Desktop/config-audio_cloverALC+.plist copied to /tmp/config-audio_cloverALC.plist" + else + echo "Error, Desktop/config-audio_cloverALC+.plist missing" + exit 1 + fi +;; + +esac + +# verify /tmp/config-audio_cloverALC.plist +index=0 +sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:${patch[$index]}'" /tmp/config-audio_cloverALC.plist -x > "/tmp/ktp.plist" +if [ $(sudo /usr/libexec/PlistBuddy -c "Print '::$index dict'" /tmp/ktp.plist | grep -c "AppleHDA") = 0 ]; then + echo "Error: config-audio_cloverALC.plist patches failed" + echo "Verify Insternel access" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 fi -sudo curl -o "/tmp/config-audio_cloverALC.plist.zip" $gDownloadLink -unzip -qu "/tmp/config-audio_cloverALC.plist.zip" -d "/tmp/" - -# add KernelAndKextPatches/KextsToPatch codec patches -# remove existing audio patches - -ktpexisting=$(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:'" /tmp/config.plist) +# verify config.plist/KernelAndKextPatches:KextsToPatch +ktpexisting=$(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches'" /tmp/config.plist) if [ -z "${ktpexisting}" ]; then sudo /usr/libexec/PlistBuddy -c "Add KernelAndKextPatches:KextsToPatch array" /tmp/config.plist echo "Edit config.plist: Add KernelAndKextPatches/KextsToPatch - Fixed" fi -ktpexisting=$(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:'" /tmp/config.plist | grep -c "t1-") +ktpexisting=$(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:'" /tmp/config.plist) -if [ $ktpexisting = 0 ]; then - if [ $(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:$index dict'" /tmp/config.plist | grep -c "AppleHDA") != 0 ]; then - gMB=1 - fi +if [ -z "${ktpexisting}" ]; then + sudo /usr/libexec/PlistBuddy -c "Add KernelAndKextPatches:KextsToPatch array" /tmp/config.plist + echo "Edit config.plist: Add KextsToPatch - Fixed" fi -# remove AppleHDAController patches (mb) -ktpexisting=$(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:'" /tmp/config.plist | grep -c "AppleHDAController") - -index=0 -while [ $ktpexisting -ge 1 ]; do -if [ $(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:$index dict'" /tmp/config.plist | grep -c "AppleHDAController") = 1 ]; then - if [ $(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:$index dict'" /tmp/config.plist | grep -c "x99") = 0 ]; then - sudo /usr/libexec/PlistBuddy -c "Delete ':KernelAndKextPatches:KextsToPatch:$index dict'" /tmp/config.plist - fi - ktpexisting=$(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:'" /tmp/config.plist | grep -c "AppleHDAController") - index=$((index - 1)) +# exit if error +if [ "$?" != "0" ]; then + echo "Error: config.plist/KernelAndKextPatches/KextsToPatch fix failed" + echo “Original config.plist restored” + echo “Install valid config.plist” + sudo cp -X $gCloverDirectory/config-backup.plist $gCloverDirectory/config.plist + sudo rm -R /tmp/ktp.plist + sudo rm -R /tmp/config.plist + sudo rm -R /tmp/config-audio_cloverALC+.plist.zip + sudo rm -R /tmp/config-audio_cloverALC.plist + sudo rm -R /tmp/__MACOSX + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 fi -index=$((index + 1)) + +# remove AppleHDA patches + +# ktpcomment=$(sudo /usr/libexec/PlistBuddy -c "Print 'Comment'" "/tmp/ktp.plist") +# ktpname=$(sudo /usr/libexec/PlistBuddy -c "Print 'Name'" "/tmp/ktp.plist") +# ktpname=$(sudo /usr/libexec/PlistBuddy -c "Print 'Name'" "/tmp/ktp.plist") + +# ktpexisting=$(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:'" /tmp/config.plist | grep -c "AppleHDA") +ktptotal=$(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:'" /tmp/config.plist | grep -c "Name") + # debug if [ $gDebug = 2 ]; then - echo "AppleHDAController patches (mb)" - echo "index = $index" - echo "ktpexisting = $ktpexisting" + echo "ktptotal = $ktptotal" fi -done - -# remove AppleHDA patches (mb) -ktpexisting=$(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:'" /tmp/config.plist | grep -c "AppleHDA") index=0 -while [ $ktpexisting -ge 1 ]; do -if [ $(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:$index dict'" /tmp/config.plist | grep -c "AppleHDA") != 0 ]; then - if [ $(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:$index dict'" /tmp/config.plist | grep -c "x99") = 0 ]; then - sudo /usr/libexec/PlistBuddy -c "Delete ':KernelAndKextPatches:KextsToPatch:$index dict'" /tmp/config.plist - fi - ktpexisting=$(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:'" /tmp/config.plist | grep -c "AppleHDA") - index=$((index - 1)) -fi -# gMB=1 -index=$((index + 1)) +while [ $index -lt $ktptotal ]; do # debug if [ $gDebug = 2 ]; then - echo "AppleHDA patches (mb)" echo "index = $index" - echo "ktpexisting = $ktpexisting" fi +if [ $(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:$index dict'" /tmp/config.plist | grep -c "AppleHDAController") -ge 1 ]; then + +# debug + if [ $gDebug = 2 ]; then + echo "AppleHDAController" + fi + + else + if [ $(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:$index dict'" /tmp/config.plist | grep -c "AppleHDA") -ge 1 ]; then + sudo /usr/libexec/PlistBuddy -c "Delete ':KernelAndKextPatches:KextsToPatch:$index dict'" /tmp/config.plist + index=$((index - 1)) + ktptotal=$((ktptotal - 1)) + +# debug + if [ $gDebug = 2 ]; then + echo "AppleHDA" + fi + fi +fi + +index=$((index + 1)) done +# debug +if [ $gDebug = 2 ]; then + echo "" +fi + +# antipop, credit: Sergey_Galan-AppleALC - broken +# if [ $gAntipop = "y" ]; then +# index=0 +# patch=( 12 11 ) +# _patchconfig +# patch=12 +# _patchconfig +# patch=11 +# _patchconfig +# fi + +# exit if error +if [ "$?" != "0" ]; then + echo Error: config.plst/antipop edits failed + echo “Original config.plist restored” + sudo cp -X $gCloverDirectory/config-backup.plist $gCloverDirectory/config.plist + sudo rm -R /tmp/ktp.plist + sudo rm -R /tmp/config.plist + sudo rm -R /tmp/config-audio_cloverALC.plist + sudo rm -R /tmp/$gCodecName.zip + sudo rm -R /tmp/$gCodecName + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 +fi + +# macOS version problem codec patchout +# 10.13/10.12: credit pcpaul/Riley Freeman +# 10.11: credit lisai9093 +patch=10 +_patchconfig +patch=13 +_patchconfig + +# codec zml files +patch=0 +_patchconfig + +# exit if error +if [ "$?" != "0" ]; then + echo Error: config.plst/patchout edits failed + echo “Original config.plist restored” + sudo cp -X $gCloverDirectory/config-backup.plist $gCloverDirectory/config.plist + sudo rm -R /tmp/ktp.plist + sudo rm -R /tmp/config.plist + sudo rm -R /tmp/config-audio_cloverALC.plist + sudo rm -R /tmp/$gCodecName.zip + sudo rm -R /tmp/$gCodecName + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 +fi + # set patch for codec - -case $gCodec in +case $gCodecName in # xml>znl, patch1=0 885 ) patch1=1;; 887 ) patch1=2;; @@ -1421,107 +1515,94 @@ case $gCodec in 269 ) patch1=8;; 283) patch1=9;; # el capitan only, patch1=10 -# hd4600 hdmi audio only, patch1=11 -# hd4600 hdmi audio only, patch1=12 -# high sierra/sierra only, patch1=13 -# new codecs -891 ) patch1=14;; -#1220 ) patch1=15;; # 0x1168 -#1220S ) patch1=16;; # 0x1220 -1220A ) patch1=15;; # 0x1168 -1220 ) patch1=16;; # 0x1220 -# 200 series audio only, patch1=17 +# anti pop, patch0=11 +# anti pop, patch1=12 +# high sierra/sierra only, patch0=13 +# x99 series audio only, patch1=14 +# 200/300/x299 series audio only, patch1=15 +1220A ) patch1=16;; # 0x1168 +1220 ) patch1=17;; # 0x1220 esac -# if [ $gCodec1220S = y ]; then -# patch1=16 -# fi - -patch=( 0 $patch1 ) -index=0 - -if [ $gPikerAlphaALC = 1 ]; then - index=1 +# debug +if [ $gDebug = 2 ]; then +# echo "gCodec1220A = $gCodec1220A" + echo "gCodec = $gCodec" + echo "gCodecName = $gCodecName" fi -while [ $index -lt 2 ]; do - -sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:${patch[$index]}'" /tmp/config-audio_cloverALC.plist -x > "/tmp/ktp.plist" -ktpcomment=$(sudo /usr/libexec/PlistBuddy -c "Print 'Comment'" "/tmp/ktp.plist") -sudo /usr/libexec/PlistBuddy -c "Set :Comment 't1-$ktpcomment'" "/tmp/ktp.plist" -sudo /usr/libexec/PlistBuddy -c "Add :KernelAndKextPatches:KextsToPatch:0 dict" /tmp/config.plist -sudo /usr/libexec/PlistBuddy -c "Merge /tmp/ktp.plist ':KernelAndKextPatches:KextsToPatch:0'" /tmp/config.plist - -index=$((index + 1)) -done - -case $gSysName in - -"High Sierra"|"Sierra"|"El Capitan" ) - -case $gCodecName in - -#887|888|889|892|898|1150|1220|1220S|891 ) -887|888|889|892|898|1150|1220A|1220|891 ) - -case $gSysName in - -"High Sierra"|"Sierra" ) -# codec patch out/credit pcpaul/Riley Freeman -sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:13}'" /tmp/config-audio_cloverALC.plist -x > "/tmp/ktp.plist" -;; - -"El Capitan" ) -# codec patch out/credit lisai9093 -sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:10}'" /tmp/config-audio_cloverALC.plist -x > "/tmp/ktp.plist" -;; - -esac - -esac - -ktpcomment=$(sudo /usr/libexec/PlistBuddy -c "Print 'Comment'" "/tmp/ktp.plist") -sudo /usr/libexec/PlistBuddy -c "Set :Comment 't1-$ktpcomment'" "/tmp/ktp.plist" -sudo /usr/libexec/PlistBuddy -c "Add :KernelAndKextPatches:KextsToPatch:0 dict" /tmp/config.plist -sudo /usr/libexec/PlistBuddy -c "Merge /tmp/ktp.plist ':KernelAndKextPatches:KextsToPatch:0'" /tmp/config.plist -;; - -esac - -# codec patch hd4600 hdmi audio/credit TimeWalker75a -if [ $gController = y ]; then - index=11 - - while [ $index -lt 13 ]; do - - sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:$index}'" /tmp/config-audio_cloverALC.plist -x > "/tmp/ktp.plist" - ktpcomment=$(sudo /usr/libexec/PlistBuddy -c "Print 'Comment'" "/tmp/ktp.plist") - sudo /usr/libexec/PlistBuddy -c "Set :Comment 't1-$ktpcomment'" "/tmp/ktp.plist" - sudo /usr/libexec/PlistBuddy -c "Add :KernelAndKextPatches:KextsToPatch:0 dict" /tmp/config.plist - sudo /usr/libexec/PlistBuddy -c "Merge /tmp/ktp.plist ':KernelAndKextPatches:KextsToPatch:0'" /tmp/config.plist - - index=$((index + 1)) - done - -fi - -# 200 series audio patch (temporary) - -# if [ $g200SeriesAudio = y ]; then - -# sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:17}'" /tmp/config-audio_cloverALC.plist -x > "/tmp/ktp.plist" - -# ktpcomment=$(sudo /usr/libexec/PlistBuddy -c "Print 'Comment'" "/tmp/ktp.plist") -# sudo /usr/libexec/PlistBuddy -c "Set :Comment 't1-$ktpcomment'" "/tmp/ktp.plist" -# sudo /usr/libexec/PlistBuddy -c "Add :KernelAndKextPatches:KextsToPatch:0 dict" /tmp/config.plist -# sudo /usr/libexec/PlistBuddy -c "Merge /tmp/ktp.plist ':KernelAndKextPatches:KextsToPatch:0'" /tmp/config.plist - -# fi +# codec specific patch +patch=$patch1 +_patchconfig # exit if error if [ "$?" != "0" ]; then - echo Error: config.plst edit failed + echo Error: config.plst/codec edits failed + echo “Original config.plist restored” + sudo cp -X $gCloverDirectory/config-backup.plist $gCloverDirectory/config.plist + sudo rm -R /tmp/ktp.plist + sudo rm -R /tmp/config.plist + sudo rm -R /tmp/config-audio_cloverALC.plist + sudo rm -R /tmp/$gCodecName.zip + sudo rm -R /tmp/$gCodecName + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 +fi + +# special case, x99, 200, x299, 300 +ktplabel="t0-" +case $gController in + +Kaby ) +if [ $(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:$index dict'" /tmp/config.plist | grep -c "10.10-x99") = 0 ]; then + sudo /usr/libexec/PlistBuddy -c "Delete ':KernelAndKextPatches:KextsToPatch:$index dict'" /tmp/config.plist +fi + +# index=1 +# patch=( 0 18 ) +# _patchconfig +patch=15 +_patchconfig + +echo "Kaby Lake audio controller patch" +;; + +x99 ) +if [ $(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:$index dict'" /tmp/config.plist | grep -c "10.12-Kaby") = 0 ]; then + sudo /usr/libexec/PlistBuddy -c "Delete ':KernelAndKextPatches:KextsToPatch:$index dict'" /tmp/config.plist +fi + +# index=1 +# patch=( 0 14 ) +#_patchconfig +patch=14 +_patchconfig + +echo "X99 audio controller patch" +;; + +esac + + +# exit if error +if [ "$?" != "0" ]; then + echo Error: config.plst/audio controller edits failed + echo “Original config.plist restored” + sudo cp -X $gCloverDirectory/config-backup.plist $gCloverDirectory/config.plist + sudo rm -R /tmp/ktp.plist + sudo rm -R /tmp/config.plist + sudo rm -R /tmp/config-audio_cloverALC.plist + sudo rm -R /tmp/$gCodecName.zip + sudo rm -R /tmp/$gCodecName + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 +fi + + +# exit if error +if [ "$?" != "0" ]; then + echo Error: config.plst audio edits failed echo “Original config.plist restored” sudo cp -X $gCloverDirectory/config-backup.plist $gCloverDirectory/config.plist sudo rm -R /tmp/ktp.plist @@ -1551,61 +1632,6 @@ esac sudo rm -R /tmp/ktp.plist sudo rm -R /tmp/config.plist sudo rm -R /tmp/config-audio_cloverALC.plist -sudo rm -R /tmp/config-audio_cloverALC.plist.zip - -# echo "config.plist patching finished." - -if [ $gPikerAlphaALC = 1 ]; then - -# download AppleHDA8Series.sh to /tmp/ -echo "Download Piker-Alpha/AppleHDA8Series.sh" - -curl -o /tmp/AppleHDA8Series.zip https://codeload.github.com/Piker-Alpha/AppleHDA8Series.sh/zip/master -if [ -d /tmp/AppleHDA8Series ]; then - sudo rm -R /tmp/AppleHDA8Series -fi -unzip -qu /tmp/AppleHDA8Series.zip -d /tmp/ -mv /tmp/AppleHDA8Series.sh-master /tmp/AppleHDA8Series - -# remove installed AppleHDAxxx.kext -if [ -d "$gLibraryDirectory/AppleHDA$gCodec.kext" ]; then - sudo rm -R "$gLibraryDirectory/AppleHDA$gCodec.kext" -fi - -# run AppleHDA8Series.sh -echo "Install $gLibraryDirectory/AppleHDA$gCodec.kext" -chmod +x /tmp/AppleHDA8Series/AppleHDA8Series.sh -sh /tmp/AppleHDA8Series/AppleHDA8Series.sh -a $gCodec -l $gAudioid -d $gLibraryDirectory - -# exit if error -if [ "$?" != "0" ]; then - echo Error: AppleHDA8Series.sh - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - sudo rm -R /tmp/AppleHDA8Series.zip - sudo rm -R /tmp/AppleHDA8Series - sudo rm -R /tmp/ALC$gCodec.zip - sudo rm -R /tmp/$gCodec - sudo rm -R /tmp/ConfigData-ALC$gCodec.xml - sudo rm -R /tmp/HDEF.txt - exit 1 -fi - -# clean up -sudo rm -R /tmp/AppleHDA8Series.zip -sudo rm -R /tmp/AppleHDA8Series -sudo rm -R /tmp/ALC$gCodec.zip -sudo rm -R /tmp/$gCodec -sudo rm -R /tmp/ConfigData-ALC$gCodec.xml -sudo rm -R /tmp/HDEF.txt - -else # PikerAlphaALC -# determine kexts/folder -if [ -d "$gCloverDirectory/$gSysFolder" ]; then - gSysFolder=$gSysFolder - else - gSysFolder=kexts/Other -fi if [ $gBetaALC = 0 ]; then echo "Download config kext and install ..." @@ -1617,7 +1643,6 @@ fi sudo curl -o "/tmp/realtekALC.kext.zip" $gDownloadLink unzip -qu "/tmp/realtekALC.kext.zip" -d "/tmp/" - # install realtekALC.kext if [ $gBetaALC <> 0 ]; then @@ -1648,8 +1673,8 @@ case $gMB in 0 ) # to EFI/CLOVER/kexts/ (cloverALC) - sudo cp -R "/tmp/realtekALC.kext" "$gCloverDirectory/$gSysFolder/" - echo "Install $gCloverDirectory/$gSysFolder/realtekALC.kext" + sudo cp -R "/tmp/realtekALC.kext" "$gCloverDirectory/kexts/Other/" + echo "Install $gCloverDirectory/kexts/Other/realtekALC.kext" ;; 1 ) @@ -1705,7 +1730,7 @@ case $gDebug in sudo install -m 644 -o root -g wheel /tmp/$gCodecName/layout3.xml.zlib $gHDAContentsDirectory/Resources/layout3.zml.zlib ;; -# 1150|1220|1220S|891 ) +# 1150|1220|1220S ) 1150|1220A|1220|891 ) sudo install -m 644 -o root -g wheel /tmp/$gCodecName/layout2.xml.zlib $gHDAContentsDirectory/Resources/layout2.zml.zlib ;; @@ -1713,8 +1738,8 @@ case $gDebug in ;; 1|2 ) - if [ -d $gDesktopDirectory/$gCodec-${gDebugMode[$gDebug]} ]; then - sudo rm -R $gDesktopDirectory/$gCodec-${gDebugMode[$gDebug]} + if [ -d $gDesktopDirectory/$gCodecName-${gDebugMode[$gDebug]} ]; then + sudo rm -R $gDesktopDirectory/$gCodecName-${gDebugMode[$gDebug]} fi if [ -f /tmp/$gCodecName/hdacd.plist ]; then @@ -1729,8 +1754,8 @@ case $gDebug in sudo mv $file ${file%.xml.zlib}.zml.zlib done - sudo cp -R /tmp/$gCodecName $gDesktopDirectory/$gCodec-${gDebugMode[$gDebug]} - echo "$gCodec-${gDebugMode[$gDebug]} copied to Desktop" + sudo cp -R /tmp/$gCodecName $gDesktopDirectory/$gCodecName-${gDebugMode[$gDebug]} + echo "$gCodecName-${gDebugMode[$gDebug]} copied to Desktop" echo "No system files were changed" ;; @@ -1750,8 +1775,6 @@ if [ "$?" != "0" ]; then exit 1 fi -fi # end: PikerAlphaALC - fi # end: if [ $gCloverALC = 1 ] # fix permissions and rebuild cache @@ -1796,7 +1819,7 @@ case $gDebug in ;; 1|2 ) - echo "Install finished, see Desktop/$gCodec-${gDebugMode[$gDebug]}" + echo "Install finished, see Desktop/$gCodecName-${gDebugMode[$gDebug]}" ;; esac diff --git a/audio_cloverHDMI-130_v0.6.command b/audio_cloverHDMI-130_v0.6.command deleted file mode 100755 index f013e77..0000000 --- a/audio_cloverHDMI-130_v0.6.command +++ /dev/null @@ -1,1856 +0,0 @@ -#!/bin/sh -# Maintained by: toleda for: github.com/toleda/audio_cloverHDMI -gFile="audio_cloverHDMI-130_v0.6.command" -# Credit: bcc9, RevoGirl, PikeRAlpha, RehabMan -# -# OS X Clover HDMI Audio -# -# Enables macOS HDMI audio in 10.13, 10.12, 10.11. 10.10, 10.9 and 10.8, all versions -# 1. Supports Intel integrated graphics and/or AMD and Nvidia discrete graphics -# 2. Installs HDMI audio ssdt and required framebuffer edits (Intel only) -# 3. Native CPU and GPU power management (Intel only, additonal steps required) -# -# Requirements -# 1. OS X: 10.13/10.12/10.11/10.10/10.9/10.8, all versions -# 2. AppleHDA.kext (If not installed, run 10.x.x installer) -# 3. Recognized Intel/AMD/Nvidia graphics -# 4. Clover only: 1.UEFI, mount EFI partition and 2. Clover Legacy -# -# Supports: -# 1. Intel/desktop series: 200, 100, 9, 8, 7, 6, 5 -# a. Intel/workstation series: X99, X79, X58 -# 2. Intel/graphics hd: -# Desktop: HD6x0, HD5x0, HD6200, HD4600+, HD4000, HD3000 -# BRIX/NUC: HD580, HD540, HD6100, HD6000, HD5500, HD5200, HD5000, HD4000 -# 3. AMD/default framebuffer: RX_5x0/4x0, R7/R9 3xx, R7/R9 2xx,7xxx, 6xxx, 5xxx -# Except: GCN 1.1/Hawaii/Bonaire) -# 4. Nvidia/macOS drivers: 10xx, 9xx, 7xx, 6xx, 5xx, 4xx (except 450, 550, 560) -# Required: Nvidia/Web drivers: 9xx, 750 -# -# Debug Mode (saves ssdt and config.plist to Desktop -# 1. Set audio_cloverHDMI-120.command/gDebug=1 (below) -# 2. Copy config.plist to Desktop -# 3. Continue with Installation/Step 3 -# -# Installation -# 1. Double click audio_cloverHDMI...command -# 2. Enter password at prompt -# 3. Questions (answer y or n) -# Install SSDT-HDMI-HDxxx HDMI audio ssdt (y/n) -# Verify SSDT-HDMI-HDxxx HDMI audio connector (y/n) -# Confirm DP to HDMI connector patch on port 0x5 (y/n) -# Install AMD/Nvidia HDMI audio (y/n) -# Install AMD HDMI audio ssdt (y/n) -# 4. Restart -# -# Change log -# v0.1 - 7/6/17: Initial 10.13 support -# v0.2 - 729/17: fix HD630 device_id -# v0.3 - 8/22/17: fix HD630 port calculation -# v0.4 - 8/31/17: Audio ID verification -# v0.5 - 10/12/17: Pulled, source control error -# v0.4 - 10/15/17: Fixed -echo " " -echo "Agreement" -echo "The audio_cloverHDMI script is for personal use only. Do not distribute" -echo "the patch, any or all of the files for any reason without permission." -echo "The audio_cloverHDMI script is provided as is and without any warranty." -echo " " - -# set initial variables -# debug=0 - normal install, -# debug=1 - test drive, copy config.plist to Desktop, edited config.plist and ssdt copied to Desktop -gDebug=0 - -gSysVer=`sw_vers -productVersion` -gSysName="El Capitan" -gStartupDisk=EFI -gCloverDirectory=/Volumes/$gStartupDisk/EFI/CLOVER -gDesktopDirectory=/Volumes/$(whoami)/Desktop -gssdtinstall=n -gigfxlvds=0 -gideviceid=0 -givendorid=0 -gigfxhdmicodec=0 -gigfxhdmihdau=y -gigfxportmax=7 -gigfxport5=0 -gigfxports=3 -gigfxnuc=1 -gdgfxname1=0 -gdgfxssdt=0 -gdgfxname=0 -gdgfx=0 -ghdmi=0 -gAudioid=1 - -# Terminal commands -# ioreg -rxn IGPU@2 | grep vendor-id| awk '{ print $4 }' -# ioreg -rxn IGPU@2 | grep device-id | sed -e 's/.*//' -# ioreg -rxn IGPU@2 | grep "AAPL,ig-platform-id"| awk '{ print $4 }' -# ioreg -rxn IGPU@2 | grep "hda-gfx"| awk '{ print $4 }' -# ioreg -rxn IGPU@2 | grep -c "hda-gfx" -# ioreg -rxn HDAU@0 | grep "hda-gfx"| awk '{ print $4 }' -# ioreg -rxn HDAU@0,1 | grep device-id| awk '{ print $4 }' -# ioreg -rxn P0P2@3 | grep vendor-id| awk '{ print $4 }' -# ioreg -rw 0 -p IODeviceTree -n IGPU@2 > /tmp/IGPU.txt -# ioreg -rw 0 -p IOService -n AppleIntelFramebuffer@0 > /tmp/IGPU.txt -# audioinfo=$(cat /tmp/IGPU.txt | grep -c "audio-codec-info") -# connector=$(cat /tmp/IGPU.txt | grep connector-type | sed -e 's/.*//') - -function _patchconfig() -{ -while [ $index -lt 2 ]; do - -# debug -if [ $gDebug = 2 ]; then -echo "index = $index" -echo "patch = ${patch[*]}" -fi - -# add patches to config.plist -sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:${patch[$index]}'" /tmp/config-audio_cloverHDMI.plist -x > "/tmp/ktp.plist" -ktpcomment=$(sudo /usr/libexec/PlistBuddy -c "Print 'Comment'" "/tmp/ktp.plist") -sudo /usr/libexec/PlistBuddy -c "Set :Comment 't2-$ktpcomment'" "/tmp/ktp.plist" -sudo /usr/libexec/PlistBuddy -c "Add :KernelAndKextPatches:KextsToPatch:0 dict" /tmp/config.plist -sudo /usr/libexec/PlistBuddy -c "Merge /tmp/ktp.plist ':KernelAndKextPatches:KextsToPatch:0'" /tmp/config.plist - -index=$((index + 1)) -done -} - -# verify system version -case ${gSysVer} in - - 10.13* ) gSysName="High Sierra" - gSysFolder=kexts/10.13 - gSID=$(csrutil status) - ;; - - 10.12* ) gSysName="Sierra" - gSysFolder=kexts/10.12 - gSID=$(csrutil status) - ;; - - 10.11* ) gSysName="El Capitan" - gSysFolder=kexts/10.11 - gSID=$(csrutil status) - ;; - - 10.10* ) gSysName="Yosemite" - gSysFolder=kexts/10.10 - ;; - - 10.9* ) gSysName="Mavericks" - gSysFolder=kexts/10.9 - ;; - - 10.8* ) gSysName="Mountain Lion" - gSysFolder=kexts/10.8 - ;; - - * ) - echo "OS X Version: $gSysVer is not supported" - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 - ;; - -esac - -# debug -if [ $gDebug = 2 ]; then - # gSysVer=10.9 - echo "System version: supported" - echo "gSysVer = $gSysVer" -fi - -gDebugMode[0]=Release -gDebugMode[1]=TestDrive -gDebugMode[2]=Debug - -# verify Debug setting -case $gDebug in - - 0|1|2 ) - ;; - - * ) - echo "gDebug = $gDebug not invalid, script terminating" - echo "No system files were changed" - exit 1 - :: - -esac - -echo "File: $gFile" -echo "${gDebugMode[$gDebug]} Mode" - -# credit: mfram, http://forums.macrumors.com/showpost.php?p=18302055&postcount=6 -# get startup disk name -gStartupDevice=$(mount | grep "on / " | cut -f1 -d' ') -gStartupDisk=$(mount | grep "on / " | cut -f1 -d' ' | xargs diskutil info | grep "Volume Name" | perl -an -F'/:\s+/' -e 'print "$F[1]"') - -# debug -if [ $gDebug = 2 ]; then - echo "Boot device: $gStartupDevice" - echo "Boot volume: $gStartupDisk" -fi - -# check for debug (debug=1 and 2 do not touch CLOVER folder) -case $gDebug in -0 ) - -# verify EFI install -gEFI=0 -if [ -d $gCloverDirectory ]; then - gEFI=1 -fi - -if [ $gEFI = 0 ]; then - - if [ -d '/Volumes/ESP/EFI/CLOVER' ]; then - gCloverDirectory=/Volumes/ESP/EFI/CLOVER - gEFI=1 - fi - -fi - -if [ $gEFI = 1 ]; then - echo "EFI partition is mounted" - if [ -f "$gCloverDirectory/config.plist" ]; then - cp -p "$gCloverDirectory/config.plist" "/tmp/config.plist" - if [ -f "$gCloverDirectory/config-backup.plist" ]; then - rm -R "$gCloverDirectory/config-backup.plist" - fi - cp -p "$gCloverDirectory/config.plist" "$gCloverDirectory/config-backup.plist" - else - echo "$gCloverDirectory/config.plist is missing" - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 - fi -else - echo "EFI partition not mounted" - -# confirm Clover Legacy install - gCloverDirectory=/Volumes/"$gStartupDisk"/EFI/CLOVER - if [ -d "$gCloverDirectory" ]; then - echo "$gStartupDisk/EFI folder found" - else echo "$gStartupDisk/EFI not found" - echo "EFI/CLOVER folder not available to install HDMI audio" - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 - fi - -# initialize variable - choice7=n - - while true - do - read -p "Confirm Clover Legacy Install (y/n): " choice7 - case "$choice7" in - - [yY]* ) -# gCloverDirectory=/Volumes/"$gStartupDisk"/EFI/CLOVER - if [ -d "$gCloverDirectory" ]; then - if [ -f "$gCloverDirectory/config.plist" ]; then - cp -p "$gCloverDirectory/config.plist" "/tmp/config.plist" - if [ -f "$gCloverDirectory/config-backup.plist" ]; then - rm -R "$gCloverDirectory/config-backup.plist" - fi - cp -p "$gCloverDirectory/config.plist" "$gCloverDirectory/config-backup.plist" - else - echo "$gCloverDirectory/config.plist is missing" - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 - fi - - else - echo "$gCloverDirectory not found" - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 - fi - - break - ;; - - [nN]* ) - echo "User terminated, EFI partition/folder not mounted" - echo “Mount EFI partition and Restart“ - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 - ;; - - * ) echo "Try again...";; - esac - done - fi -;; - -1|2 ) - if [ -f "Desktop/config.plist" ]; then - cp -R Desktop/config.plist /tmp/config.plist -# echo "Debug mode" -# echo "Desktop/config.plist copied to /tmp/config.plist" - else - echo "Desktop/config.plist missing, Debug mode not possible" - exit 1 - fi -;; - -esac - -# verify ioreg/HDEF -ioreg -rw 0 -p IODeviceTree -n HDEF > /tmp/HDEF.txt - -if [[ $(cat /tmp/HDEF.txt | grep -c "HDEF@1") = 0 ]]; then -echo "Error: no IOReg/HDEF; BIOS/audio/disabled or ACPI problem" - - while true - do - read -p "Continue without HDEF/onboard audio (y/n): " choice0 - case "$choice0" in - [yY]* ) break;; - [nN]* ) - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - rm -R /tmp/HDEF.txt - exit 1 - ;; - * ) echo "Try again...";; - esac - done -fi - -# HDEF/layout-id - -if [[ $(cat /tmp/HDEF.txt | grep -c "HDEF@1") != 0 ]]; then - gLayoutidioreg=$(cat /tmp/HDEF.txt | grep layout-id | sed -e 's/.*//') - gLayoutidhex="0x${gLayoutidioreg:6:2}${gLayoutidioreg:4:2}${gLayoutidioreg:2:2}${gLayoutidioreg:0:2}" - gAudioid=$((gLayoutidhex)) -fi - -# verify ioreg/GFX0 -ioreg -rw 0 -p IODeviceTree -n GFX0@2 > /tmp/IGPU.txt -if [[ $(cat /tmp/IGPU.txt | grep -c "GFX0@2") = 0 ]]; then - gigfx=0 - -# debug - if [ $gDebug = 2 ]; then - echo "GFX0 - gigfx = $gigfx" - fi - -# verify ioreg/IGPU - ioreg -rw 0 -p IODeviceTree -n IGPU@2 > /tmp/IGPU.txt - if [[ $(cat /tmp/IGPU.txt | grep -c "IGPU@2") = 0 ]]; then - gigfx=0 - -# debug - if [ $gDebug = 2 ]; then - echo "IGPU - gigfx = $gigfx" - fi - - else - gigfx=IGPU@2 - -# debug - if [ $gDebug = 2 ]; then - echo "gigfx = $gigfx" - fi - - fi - -else -gigfx=GFX0@2 - -# debug -if [ $gDebug = 2 ]; then - echo "gigfx = $gigfx" -fi - -fi - -rm -R /tmp/IGPU.txt -rm -R /tmp/HDEF.txt - -# get installed codecs -gCodecsInstalled=$(ioreg -rxn IOHDACodecDevice | grep VendorID | awk '{ print $4 }' | sed -e 's/ffffffff//') - -# debug -if [ $gDebug = 2 ]; then -# gCodecsInstalled=0x10ec0900 -# gCodecsInstalled=0x10134206 - echo "gCodecsInstalled = $gCodecsInstalled" -fi - -# no audio codecs detected -if [ -z "${gCodecsInstalled}" ]; then - echo "" - echo "No audio codec detected" - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 -fi - -# initialize variables -intelhdmi=0 -amdhdmi=0 -nvidiahdmi=0 - -# find codecs -index=0 -for codec in $gCodecsInstalled -do - -# debug -if [ $gDebug = 2 ]; then - echo "Index = $index, Codec = $codec" -fi - -# sort vendors and devices -case ${codec:2:4} in - - 8086 ) Codecintelhdmi=$codec; intelhdmi=1 - ;; - 1002 ) Codecamdhdmi=$codec; amdhdmi=1 - ;; - 10de ) Codecnvidiahdmi=$codec; nvidiahdmi=1 - ;; - -esac -index=$((index + 1)) -done - -ghdmi=$((intelhdmi+amdhdmi+nvidiahdmi)) -gdgfx=$((amdhdmi+nvidiahdmi)) - -# no hdmi codecs detected -if [ $ghdmi = 0 ]; then - - while true - do - read -p "No HDMI audio codec(s) detected, continue (y/n): " choice4 - case "$choice4" in - [yY]* ) - gdgfx=1 - break - ;; - [nN]* ) - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - rm -R /tmp/HDEF.txt - rm -R /tmp/config.plist - exit 1 - ;; - * ) echo "Try again...";; - esac - done -fi - -# debug -# if [ $gDebug != 0 ]; then - echo "HDMI audio codec(s)" - if [ $intelhdmi = 1 ]; then - echo "Intel: $Codecintelhdmi" - fi - if [ $amdhdmi = 1 ]; then - echo "AMD: $Codecamdhdmi" - fi - if [ $nvidiahdmi = 1 ]; then - echo "Nvidia: $Codecnvidiahdmi" - fi -# fi - -# debug 0 -# if [ $gDebug = 0 ]; then -# if [ $gDebug = 1 ]; then -# if [ $gDebug = 2 ]; then -# echo "" -# gigfx=0 -# gdgfx=0 -# echo "gigfx = $gigfx" -# echo "gdgfx = $gdgfx" -# fi - -if [ $gigfx = 0 ]; then # no IGFX - echo "Integrated Graphics is not installed/enabled" - gigfxnuc=0 - rm -R /tmp/config.plist -# rm -R /tmp/HDEF.txt - -else - gideviceid=$(ioreg -rxn $gigfx | grep device-id | sed -e 's/.*//') - -# debug 0 -# if [ $gDebug = 0 ]; then -# if [ $gDebug = 1 ]; then -# if [ $gDebug = 2 ]; then -# gideviceid=26010000 -# gideviceid=62010000 -# gideviceid=12040000 -# gideviceid=220d0000 -# gideviceid=16160000 -# gideviceid=12190000 -# gideviceid=26190000 -# gideviceid=12590000 -# fi - -# initialize variable -gideviceidsupported=y -gigfxindex=0 -gigfxhdmihdef=n -gigfxhdmihdau=n - -# desktop igfx ssdt parameters -case $gideviceid in - -26010000* ) -gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,snb-platform-id"| awk '{ print $4 }') -gigfxgen=2 -gigfxhdmifb=00020300 -gigfxname="HD3000" -gigfxrepo=hd3000 -gigfxfolder=ssdt_hdmi-hd3000 -gigfxzip=ssdt_hdmi-hd3000-6series-3 -gigfxssdt=SSDT-HDMI-HD3000 -gigfxindex=2 -gigfxhdmihdef=y -gigfxnuc=0 -;; - -62010000* ) -gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') -gigfxgen=3 -gigfxhdmifb=0A006601 -gigfxname="HD4000" -gigfxrepo=hd4000 -gigfxfolder=ssdt_hdmi-hd4000 -gigfxzip=ssdt_hdmi-hd4000-7series-3 -gigfxssdt=SSDT-HDMI-HD4000 -gigfxindex=5 -gigfxhdmihdef=y -gigfxnuc=0 -;; - -12040000* ) -gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') -gigfxgen=4 -gigfxhdmifb=0300220D -gigfxhdmicodec=0c0c -gigfxhdmihdau=y -gigfxname="HD4600+" -gigfxrepo=8series -gigfxfolder=ssdt_hdmi-hd4600+ -gigfxzip=ssdt_hdmi-hd4600+ -gigfxssdt=SSDT-HDMI-HD4600+ -gigfxindex=8 -gigfxnuc=0 -;; - -22160000* ) -gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') -gigfxgen=5 -gigfxhdmifb=03001216 -gigfxhdmihdau=y -gigfxname="HD6200" -gigfxrepo=9series -gigfxfolder=ssdt_hdmi-hd6000+ -gigfxzip=ssdt_hdmi-hd6200 -gigfxssdt=SSDT-HDMI-HD6200 -gigfxindex=0 -gigfxnuc=0 -;; - -12190000* ) -gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') -gigfxgen=6 -gigfxhdmifb=00001219 -gigfxhdmihdau=n -gigfxname="HD530" -gigfxrepo=100series -gigfxfolder=ssdt_hdmi_hd5x0 -gigfxzip=ssdt_hdmi-hd530 -gigfxssdt=SSDT-HDMI-HD530 -gigfxindex=14 -gigfxhdmihdef=y -gigfxport5=1 -gigfxnuc=0 -;; - -16190000* ) -gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') -gigfxgen=6 -gigfxhdmifb=00001219 -gigfxhdmihdau=n -gigfxname="HD515" -gigfxrepo=100series -gigfxfolder=ssdt_hdmi_hd5x0 -gigfxzip=ssdt_hdmi-hd515 -gigfxssdt=SSDT-HDMI-HD515 -gigfxindex=14 -gigfxhdmihdef=y -gigfxport5=1 -gigfxnuc=0 -;; - -12590000* ) -gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') -gigfxgen=7 -gigfxhdmifb=00001259 -gigfxhdmihdau=n -gigfxname="HD630" -gigfxrepo=200series -gigfxfolder=ssdt_hdmi_hd6x0 -gigfxzip=ssdt_hdmi-hd630 -gigfxssdt=SSDT-HDMI-HD630 -gigfxindex=17 -gigfxhdmihdef=y -gigfxport5=0 -gigfxnuc=0 -;; - -* ) -gideviceidsupported=n -;; - -esac - -# nuc igfx ssdt parameters -if [[ $gigfxnuc = 1 && $gideviceidsupported = n ]]; then -gigfxnuc=2 -gideviceidsupported=y -gigfxportmax=6 - -case $gideviceid in - -66010000* ) -gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') -gigfxgen=3 -gigfxhdmifb=0A006601 -gigfxname="HD4000" -gigfxrepo=hd4000 -gigfxfolder=ssdt_hdmi-hd4000 -gigfxzip=ssdt_hdmi-hd4000-7series-3 -gigfxssdt=SSDT-HDMI-HD4000 -gigfxindex=5 -gigfxhdmihdef=y -gigfxportmax=7 -;; - -260a0000* ) -gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') -gigfxgen=4 -gigfxhdmifb=0300220D -gigfxhdmihdau=y -gigfxname="HD5000" -gigfxrepo=8series -gigfxfolder=ssdt_hdmi-hd4600+ -gigfxzip=ssdt_hdmi-hd4600+ -gigfxssdt=SSDT-HDMI-HD4600+ -gigfxindex=8 -;; - -220d0000* ) -gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') -gigfxgen=4 -gigfxhdmifb=0300220D -gigfxhdmihdau=y -gigfxname="HD5200" -gigfxrepo=8series -gigfxfolder=ssdt_hdmi-hd4600+ -gigfxzip=ssdt_hdmi-hd4600+ -gigfxssdt=SSDT-HDMI-HD4600+ -gigfxindex=8 -;; - -16160000* ) -gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') -gigfxgen=5 -gigfxhdmifb=02001616 -gigfxhdmihdau=y -gigfxname="HD5500" -gigfxrepo=9series -gigfxfolder=ssdt_hdmi-hd6000+ -gigfxzip=ssdt_hdmi-hd5500 -gigfxssdt=SSDT-HDMI-HD5500 -gigfxindex=11 -;; - -26160000* ) -gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') -gigfxgen=5 -gigfxhdmifb=04002616 -gigfxhdmihdau=y -gigfxname="HD6000" -gigfxrepo=9series -gigfxfolder=ssdt_hdmi-hd6000+ -gigfxzip=ssdt_hdmi-hd6000 -gigfxssdt=SSDT-HDMI-HD6000 -gigfxindex=11 -;; - -2B160000* ) -gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') -gigfxgen=5 -gigfxhdmifb=04002B16 -gigfxhdmihdau=y -gigfxname="HD6100" -gigfxrepo=9series -gigfxfolder=ssdt_hdmi-hd6000+ -gigfxzip=ssdt_hdmi-hd6100 -gigfxssdt=SSDT-HDMI-HD6100 -gigfxindex=11 -;; - -26190000* ) -gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') -gigfxgen=6 -gigfxhdmifb=00002619 -gigfxhdmihdau=n -gigfxname="HD540" -gigfxrepo=100series -gigfxfolder=ssdt_hdmi_hd5x0 -gigfxzip=ssdt_hdmi-hd540 -gigfxssdt=SSDT-HDMI-HD540 -gigfxindex=0 -gigfxhdmihdef=y -;; - -* ) -gideviceidsupported=n -gigfxnuc=0 -;; - -esac -fi - - -if [ $gideviceidsupported = n ]; then # IGFX not supported - echo "Device ID: 0x$gideviceid not supported" - rm -R /tmp/config.plist - rm -R /tmp/HDEF.txt - - if [ $gdgfx = 0 ]; then - echo "AMD/Nvidia not found" - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 - fi -else - -# hdef ssdt audio id -gigfxhdmiaudioid=$gAudioid - -# hdef ssdt parameters -ghdefrepo=ALCInjection -ghdeffolder=ssdt_hdef - -case $gigfxname in - -HD3000|HD4000* ) - gigfxhdmiaudioid=3 - ghdefzip=ssdt_hdef-$gigfxhdmiaudioid-with_ioreg:hdef - ghdefssdt=SSDT-HDEF-$gigfxhdmiaudioid -;; - -HD515|HD530|HD540*|HD630 ) - if [ $gigfxhdmiaudioid = 3 ]; then gigfxhdmiaudioid=1; fi - ghdefzip=ssdt_hdef-$gigfxhdmiaudioid-100-hdas - ghdefssdt=SSDT-HDEF-HDAS-$gigfxhdmiaudioid -;; - -esac - -# verify IGPU hfa-gfx injection -igfxhdagfx1=$(ioreg -rxn $gigfx | grep -c "hda-gfx") - -# verify HDEF/HDAU hda-gfx injection -if [ $gigfxhdmihdau = y ]; then - igfxhdagfx2=$(ioreg -rxn HDAU@3 | grep -c "hda-gfx") -else - igfxhdagfx2=$(ioreg -rxn HDEF | grep -c "hda-gfx") -fi - -igfxhdagfx=$(($igfxhdagfx1 + $igfxhdagfx2)) - -# debug 0 -# if [ $gDebug = 0 ]; then -# if [ $gDebug = 1 ]; then -# if [ $gDebug = 2 ]; then -# echo "" -# igfxhdagfx=0 -# igfxhdagfx2=0 -# fi - -# debug -if [ $gDebug = 2 ]; then - echo "igfxhdagfx1 = $igfxhdagfx1" - echo "igfxhdagfx2 = $igfxhdagfx2" - igfxhdagfx=$(($igfxhdagfx1 + $igfxhdagfx2)) - echo "igfxhdagfx = $igfxhdagfx" -fi - -# Intel integrated graphics HDMI audio - -# initialize variable -choice1=n -choice2=n -gconnectoredit=n -gssdtinstall=n - -if [ $igfxhdagfx = 2 ]; then # ssdt working - Echo "$gigfxname HDMI audio is enabled, connector edit may be required" - while true - do - read -p "Verify $gigfxname HDMI audio connector/s (y/n): " choice1 - case "$choice1" in - [yY]* ) gconnectoredit=y; break;; - [nN]* ) gconnectoredit=n; break;; - * ) echo "Try again...";; - esac - done -else -Echo "$gigfxname HDMI audio is not enabled" - while true - do - read -p "Install $gigfxssdt HDMI audio ssdt (y/n): " choice2 - case "$choice2" in - [yY]* ) gssdtinstall=y; break;; - [nN]* ) gssdtinstall=n; break;; - * ) echo "Try again...";; - esac - done -fi - -gamdnvidia=n -if [[ $choice1 = n && $choice2 = n ]]; then -gdgfx=1 ## debug 2 -if [ $gdgfx = 0 ]; then - echo "AMD/Nvidia not found" - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 - fi -fi - -# debug -if [ $gDebug = 2 ]; then -# echo "" -# gdgfx=0 -# gamdnvidia=y -echo "gdgfx = $gdgfx" -echo "gamdnvidia = $gamdnvidia" -fi - -if [ $gssdtinstall = y ]; then # install igfx ssdt -gconnectoredit=y - if [ $gDebug = 2 ]; then - echo "if [ gssdtinstall = y ]; then # install ssdt" - echo "gdgfx = $gdgfx" - echo "gamdnvidia = $gamdnvidia" - echo "gssdtinstall = $gssdtinstall" - echo "gconnectoredit = $gconnectoredit" - echo "gigfxrepo = $gigfxrepo" - echo "gigfxfolder = $gigfxfolder" - echo "gigfxzip = $gigfxzip" - echo "gDownloadLink=https://raw.githubusercontent.com/toleda/audio_hdmi_$gigfxrepo/master/$gigfxfolder/$gigfxzip.zip" - fi - -# download igfx ssdt -echo "Download $gigfxssdt ..." -gDownloadLink="https://raw.githubusercontent.com/toleda/audio_hdmi_$gigfxrepo/master/$gigfxfolder/$gigfxzip.zip" -sudo curl -o "/tmp/$gigfxzip.zip" $gDownloadLink -unzip -qu "/tmp/$gigfxzip.zip" -d "/tmp/" - -# exit if error -if [ "$?" != "0" ]; then - echo "Error: Download failure, verify network - igfx ssdt" - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 -fi - -# debug -if [[ $gDebug = 2 && $gigfxhdmihdef = y ]]; then - echo "ghdefrepo = $ghdefrepo" - echo "ghdeffolder = $ghdeffolder" - echo "ghdefzip = $ghdefzip" - echo "gDownloadLink=hthttps://raw.githubusercontent.com/toleda/audio_$ghdefrepo/master/$ghdeffolder/$ghdefzip.zip" -fi - -# download hdef ssdt, HD3000, HD4000, HD515, HD530, HD540 -if [ $gigfxhdmihdef = y ]; then - echo "Download $ghdefssdt.aml ..." - gDownloadLink="https://raw.githubusercontent.com/toleda/audio_$ghdefrepo/master/$ghdeffolder/$ghdefzip.zip" - sudo curl -o "/tmp/$ghdefzip.zip" $gDownloadLink - unzip -qu "/tmp/$ghdefzip.zip" -d "/tmp/" -fi - -# exit if error -if [ "$?" != "0" ]; then - echo "Error: Download failure, verify network - hdef ssdt" - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 -fi - -# install igfx ssdt to EFI/CLOVER/ACPI/patched (cloverHDMI) -case $gDebug in - -0 ) - if [ -d "$gCloverDirectory/ACPI/patched/$gigfxssdt" ]; then - sudo rm -R "$gCloverDirectory/ACPI/patched/$gigfxssdt" - # echo "$gCloverDirectory/ACPI/patched/$gigfxssdt deleted" - fi - sudo cp -R "/tmp/$gigfxzip/$gigfxssdt.aml" "$gCloverDirectory/ACPI/patched/" - -# exit if error - if [ "$?" != "0" ]; then - echo Error: ssdt copy failure - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 - fi - - echo "$gCloverDirectory/ACPI/patched/$gigfxssdt installed" - - if [ $gigfxhdmihdef = y ]; then - if [ -d "$gCloverDirectory/ACPI/patched/$ghdefssdt" ]; then - sudo rm -R "$gCloverDirectory/ACPI/patched/$ghdefssdt" - # echo "$gCloverDirectory/ACPI/patched/$ghdefssdt deleted" - fi - sudo cp -R "/tmp/$ghdefzip/$ghdefssdt.aml" "$gCloverDirectory/ACPI/patched/" - -# exit if error - if [ "$?" != "0" ]; then - echo Error: ssdt copy failure - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - echo "$gigfxname HDEF audio ssdt copied to Desktop" - fi - - echo "$gCloverDirectory/ACPI/patched/$ghdefssdt installed" - fi - ;; - -1|2 ) - sudo cp -R "/tmp/$gigfxzip/$gigfxssdt.aml" "Desktop/$gigfxname-$gigfxssdt.aml" - -# exit if error - if [ "$?" != "0" ]; then - echo Error: ssdt copy failure - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 - fi -# echo "Debug mode" - echo "$gigfxname HDMI audio ssdt copied to Desktop" - - if [ $gigfxhdmihdef = y ]; then - sudo cp -R "/tmp/$ghdefzip/$ghdefssdt.aml" "Desktop/$gigfxname-$ghdefssdt.aml" - -# exit if error - if [ "$?" != "0" ]; then - echo Error: ssdt copy failure - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - echo "$gigfxname HDEF audio ssdt copied to Desktop" - fi -# echo "No system files were changed" - fi - ;; - -esac - -gssdtinstall=OK -# cleanup /tmp -sudo rm -R /tmp/$gigfxzip.zip -sudo rm -R /tmp/$gigfxzip -# sudo rm -R /tmp/IGPU.txt -# sudo rm -R /tmp/HDEF.txt -sudo rm -R /tmp/__MACOSX - -if [ $gigfxhdmihdef = y ]; then - sudo rm -R /tmp/$ghdefzip.zip - sudo rm -R /tmp/$ghdefzip -fi - -# exit if error -if [ "$?" != "0" ]; then - sudo rm -R "$gCloverDirectory/ACPI/patched/$gigfxssdt" - echo Error: ssdt install failure - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 -fi - -fi # install igfx ssdt - -# verify igfx framebuffers -if [ $gconnectoredit = y ]; then # verify framebuffers - - -index=$gigfxport5 -indexmax=$((gigfxport5 + gigfxports - 1)) -port=5 -iaudio=0 - -while [ $index -le $indexmax ]; do - -# debug -if [ $gDebug = 2 ]; then - echo "index = $index" - echo "port = $port" -fi - -# look for display(s) -ioreg -rw 0 -p IOService -n AppleIntelFramebuffer@$index > /tmp/IGPU.txt -audioinfo[$port]=$(cat /tmp/IGPU.txt | grep -c "audio-codec-info") -connector[$port]=$(cat /tmp/IGPU.txt | grep connector-type | sed -e 's/.*//') -iaudio=$(($iaudio + ${audioinfo[$port]})) - - -# debug -if [ $gDebug = 2 ]; then - echo "audioinfo = ${audioinfo[$port]}" - echo "connector = ${connector[$port]}" - echo "iaudio = $iaudio" -fi - -index=$((index + 1)) -port=$((port + 1)) -rm -R /tmp/IGPU.txt -done - -# exit if error -if [ "$?" != "0" ]; then -echo "Error: framebuffer analysis failed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 -fi - -# verify hdmi display, max 1 -# initialize variable -gamdnvidia=n - -case $iaudio in - -0 ) - echo "No display connected to $gigfxname" -gdgfx=1 ## debug 2 - if [ $gdgfx = 0 ]; then - echo "Error: patch not possible" - echo "AMD/Nvidia not found" - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 - fi - ;; - -1 ) - echo "One display connected, proceeding" - ;; - -2 ) - if [[ $gigfxgen = 4 || $gigfxgen = 5 || $gigfxgen = 6 || $gigfxgen = 7 ]]; then - echo "Two displays connected, proceeding" - else - echo "Error: more than one display connected to $gigfxname, patch not possible" - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 - fi - ;; - -3 ) - if [ $gigfxhdmihdau = y ]; then - echo "Error: more than two displays connected to $gigfxname, patch not possible" - else - echo "Error: more than one display connected to $gigfxname, patch not possible" - fi - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 - ;; - -* ) - echo Error: display analysis failed - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 - ;; - -esac - -# debug -if [ $gDebug = 2 ]; then -echo "gdgfx = $gdgfx" -echo "gamdnvidia = $gamdnvidia" -fi - -# exit if error -if [ "$?" != "0" ]; then - echo Error: display analysis failed - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 -fi - -# debug -if [ $gDebug = 2 ]; then -echo "" -# gigfxname="HD3000" -# gigfxname="HD6200" -fi - -ifbnative=0 - -case $gigfxname in - -HD3000|HD4000* ) # native HDMI connector - connector7=${connector[7]} - if [ $connector7 = "00080000" ]; then # native hdmi - echo "Native $gigfxname/port 0x7 is HDMI connector, no patch required" - ifbnative=1 - fi -;; - -HD6200|HD540* ) # connector detection, 515, 530 removed special case - echo "$gigfxname/$gigfxhdmifb detects and sets HDMI connector, no patch required" - ifbnative=1 -;; - -esac - -# no fb patch required -if [ $ifbnative = 1 ]; then # native fb - sudo rm -R /tmp/config.plist6 - rm -R /tmp/HDEF.txt - -else - -# confirm ports to edit -port=5 - -# debug -if [ $gDebug = 2 ]; then - echo "gigfxportmax = $gigfxportmax" -fi - -choice3=n -while [ $port -le $gigfxportmax ]; do - # debug - if [ $gDebug = 2 ]; then - echo "port = $port" - echo "audioinfo = ${audioinfo[$port]}" - echo "connector = ${connector[$port]}" - echo "iaudio = $iaudio" - fi - - if [ ${audioinfo[$port]} != 0 ]; then - while true; do - read -p "Confirm DP to HDMI connector edit on port 0x$port (y/n): " choice3 - case "$choice3" in - [yY]* ) echo "Patch port 0x$port"; gifgxfbedit=y; break;; - [nN]* ) echo "Ignore port 0x$port"; audioinfo[$port]=0; iaudio=$(($iaudio-1)); break;; - * ) echo "Try again...";; - esac - done - - # debug - if [ $gDebug = 2 ]; then - echo "port = $port" - echo "iaudio = $iaudio" - echo "audioinfo = ${audioinfo[$port]}" - echo "connector = ${connector[$port]}" - echo "iaudio = $iaudio" - fi - fi - -port=$(($port + 1)) -done - -# exit if error -if [ "$?" != "0" ]; then - echo "Error: config.plst edit failed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 -fi - -if [ $iaudio = 0 ]; then # no framebuffer edits - echo "No framebuffer edits requested" - rm -R /tmp/config.plist -# rm -R /tmp/HDEF.txt - -else -# download connector edits -echo "Download $gigfxname HDMI audio connector edits ..." -gDownloadLink="https://raw.githubusercontent.com/toleda/audio_cloverHDMI/master/config-audio_cloverHDMI.plist.zip" -sudo curl -o "/tmp/config-audio_cloverHDMI.plist.zip" $gDownloadLink -unzip -qu "/tmp/config-audio_cloverHDMI.plist.zip" -d "/tmp/" - -# verify AppleHDAController patches (mb/cloverALC) -ktpexisting=$(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:'" /tmp/config.plist | grep -c "AppleHDAController") - -# debug -if [ $gDebug = 2 ]; then - echo "ktpexisting - AppleHDAController = $ktpexisting" -fi - -# exit if error -if [ "$?" != "0" ]; then - echo "Error: config.plst/hd4600 codec edit failed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 -fi - -# remove 0c0c patches (mb, cloverALC, cloverHDMI) -index=0 -while [ $ktpexisting -ge 1 ]; do -if [ $(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:$index dict'" /tmp/config.plist | grep -c "AppleHDAController") = 1 ]; then - sudo /usr/libexec/PlistBuddy -c "Delete ':KernelAndKextPatches:KextsToPatch:$index dict'" /tmp/config.plist - ktpexisting=$((ktpexisting - 1)) - index=$((index - 1)) -fi -index=$((index + 1)) - -# debug -if [ $gDebug = 2 ]; then - echo "index = $index" - echo "ktpexisting = $ktpexisting" -fi -done - -# remove t2- patches (cloverHDMI) - -# verify t2 patches (mb/cloverALC) -ktpexisting=$(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:'" /tmp/config.plist | grep -c "t2-") - -# debug -if [ $gDebug = 2 ]; then - echo "ktpexisting - t2- = $ktpexisting" -fi - -index=0 -while [ $ktpexisting -ge 1 ]; do -if [ $(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:$index dict'" /tmp/config.plist | grep -c "t2-") = 1 ]; then - sudo /usr/libexec/PlistBuddy -c "Delete ':KernelAndKextPatches:KextsToPatch:$index dict'" /tmp/config.plist - ktpexisting=$((ktpexisting - 1)) - index=$((index - 1)) -fi -index=$((index + 1)) - -# debug -if [ $gDebug = 2 ]; then - echo "index = $index" - echo "ktpexisting = $ktpexisting" -fi -done - -# patch summary -# iaudio=1 # number of connector edits -# audioinfo[5]=1 # audio on port 0x5 -# audioinfo[6]=0 # audio on port 0x5 -# audioinfo[7]=0 # audio on port 0x5 -# connector[5]=00040000 # native port 0x5 connector -# connector[6]=00040000 # native port 0x6 connector -# connector[7]=00040000 # native port 0x7 connector -# config-audio_cloverHDMI.plist/.../KextsToPatch -# Item 0: 10.9-10.11-HD4600_HDMI_Audio-1of2 Item 0 + Item 1 -# Item 1: 10.9-10.11-HD4600_HDMI_Audio-2of2 -# Item 2: 10.10-10.11-SNB-Port _0x5-DP2HDMI Item 2 + Item 4 -# Item 3: 10.10-10.11-SNB-Port _0x6-DP2HDMI Item 3 + Item 4 -# Item 4: 10.10-10.11-SNB-Port _0x7-DP2HDMI -# Item 5: 10.10-10.11-Capri-Port _0x5-DP2HDMI Item 5 + Item 7 -# Item 6: 10.10-10.11-Capri-Port _0x6-DP2HDMI Item 6 + Item 7 -# Item 7: 10.10-10.11-Capri-Port _0x7-HDMI2DP -# Item 8: 10.10-10.11-Azul-Port_0x5-DP2HDMI -# Item 9: 10.10-10.11-Azul-Port_0x6-DP2HDMI -# Item 10: 10.10-10.11-Azul-Port_0x7-DP2HDMI -# Item 11: 10.10-10.11-BDW010509-Port_0x5-DP2HDM (010509) -# Item 12: 10.10-10.11-BDW010509-Port_0x5-DP2HDM (01050b) -# Item 13: 10.11.4-SKL-1912000-4_displays -# Item 14: 10.11.4-SKL-1912000-Port_0x5-DP2HDM (010509) -# Item 15: 10.11.4-SKL-1912000-Port_0x6-DP2HDM (02040a) -# Item 16: 10.11.4-SKL-1912000-Port_0x7-DP2HDM (03060a) -# Item 17: 10.12.6-KBL-5912000-Port_0x5-DP2HDM (010509) -# Item 18: 10.12.6-KBL-5912000-Port_0x6-DP2HDM (02040a) -# Item 19: 10.12.6-KBL-5912000-Port_0x7-DP2HDM (03060a) - -# debug -if [ $gDebug = 2 ]; then - echo "gigfxhdmicodec = $gigfxhdmicodec" -fi - -# codec patch hd4600 hdmi audio/credit TimeWalker75a -if [ $gigfxhdmicodec = "0c0c" ]; then - index=0 - patch=( 1 0 ) - _patchconfig -fi - -# exit if error -if [ "$?" != "0" ]; then - echo "Error: config.plst/hd4600 codec edit failed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 -fi - -# hd515,hd530 4 port edit -if [ $gigfxhdmifb = "00001219" ]; then - index=1 - patch[0]=0 - patch[1]=13 - _patchconfig - patch[1]=0 -fi - -# patch framebuffer -case $gigfxgen in - -2|3 ) - if [ ${audioinfo[5]} = 1 ]; then - patch[0]=$gigfxindex - fi - if [ ${audioinfo[6]} = 1 ]; then - patch[0]=$(($gigfxindex+1)) - fi - patch[1]=$(($gigfxindex+2)) - ;; - -4|5|6|7 ) - - index=0 - port=5 - -# debug - if [ $gDebug = 2 ]; then - echo "gigfxportmax = $gigfxportmax" - fi - - while [ $port -le $gigfxportmax ]; do - if [ ${audioinfo[$port]} != 0 ]; then - patch[$index]=$(($gigfxindex + $port - 5)) - index=$(($index + 1)) - - # debug - if [ $gDebug = 2 ]; then - echo "port = $port" - echo "gigfxindex = $gigfxindex" - echo "index = $index" - echo "patch-a = ${patch[*]}" - fi - fi - port=$(($port + 1)) - done - ;; - - * ) - echo "Intel HD Graphics Gen $gigfxgen is not supported" - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 - ;; - - -esac - -# debug -if [ $gDebug = 2 ]; then - echo "patch-b = ${patch[*]}" -fi - -# 1 patch or 2 -index=1 -case $gigfxgen in - -2|3 ) - if [ $iaudio = 1 ]; then - index=0 - fi - ;; - -esac - -# switch array values -tpatch=${patch[1]} -patch[1]=${patch[0]} -patch[0]=$tpatch - -# debug -if [ $gDebug = 2 ]; then - echo "index = $index" - echo "patch-d = ${patch[*]}" -fi - -_patchconfig - -# exit if error -if [ "$?" != "0" ]; then - echo "Error: config.plst/framebuffer edit failed" - echo “Original config.plist restored” - sudo cp -X $gCloverDirectory/config-backup.plist $gCloverDirectory/config.plist - sudo rm -R /tmp/ktp.plist - sudo rm -R /tmp/config.plist - sudo rm -R /tmp/config-audio_cloverHDMI.plist.zip - sudo rm -R /tmp/config-audio_cloverHDMI.plist - sudo rm -R /tmp/__MACOSX - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 -fi - -# install updated config.plst -case $gDebug in - -0 ) - sudo cp -R "/tmp/config.plist" "$gCloverDirectory/config.plist" - echo "HDMI audio edited $gCloverDirectory/config.plist installed" - ;; - -1|2 ) - if [ -f "Desktop/$gigfxname-config.plist" ]; then - sudo rm -R "Desktop/$gigfxname-config.plist" - fi - sudo cp -R "/tmp/config.plist" "Desktop/$gigfxname-config.plist" -# echo "Debug mode" - echo "$gigfxname HDMI audio edited config.plist copied to Desktop" -# echo "No system files were changed" - ;; - -esac - -# cleanup /tmp -sudo rm -R /tmp/config-audio_cloverHDMI.plist.zip -rm -R /tmp/config-audio_cloverHDMI.plist -rm -R /tmp/config.plist -rm -R /tmp/__MACOSX -rm -R /tmp/ktp.plist - -fi # no framebuffer edits - -fi # verify framebuffers -fi # a fb -fi # IGFX not supported -fi # no IGFX - -# debug -if [ $gDebug = 2 ]; then - echo "AMD/Nvidia discrete graphics HDMI audio" - echo "gigfx = $gigfx" - echo "gdgfx = $gdgfx" -fi - -# AMD/Nvidia discrete graphics HDMI audio - -if [ $gigfxnuc = 0 ]; then # AMD/Nvidia else nuc -# find discrete graphics card - -while true -do - read -p "Install AMD/Nvidia HDMI audio (y/n): " choice8 - case "$choice8" in - [yY]* ) gdgfxhdmi=y; break;; - [nN]* ) gdgfxhdmi=n; break;; - * ) echo "Try again...";; - esac -done - -if [ $gdgfxhdmi = y ]; then # AMD/Nvidia HDMI audio - -# get acpi pcie device name -numname1=12 -gdgfxname1[1]=PEG0@1 -gdgfxname1[2]=PEG1@1 -gdgfxname1[3]=PEGP@1 -gdgfxname1[4]=P0P1@1 -gdgfxname1[5]=P0P2@1 -gdgfxname1[6]=P0P2@3 -gdgfxname1[7]=NPE3@2 -gdgfxname1[8]=NPE3@3 -gdgfxname1[9]=NPE7@3 -gdgfxname1[10]=pci-bridge@1 -gdgfxname1[11]=pci-bridge@3 -gdgfxname1[12]=BR3A@3 - -index=1 -while [ $index -le $numname1 ]; do -dgfxpciname=$(ioreg -rxn ${gdgfxname1[$index]} | grep vendor-id| awk '{ print $4 }') - -# debug - if [ $gDebug = 2 ]; then - echo "gdgfxname1 = ${gdgfxname1[$index]}" - fi - - if [ -n "${dgfxpciname}" ]; then - dgfxindex1=$index - index=$(($numname1 + 1)) - -# debug - if [ $gDebug = 2 ]; then - echo "dgfxindex1 = $dgfxindex1" - fi - - fi - - index=$(($index + 1)) -done - -gdgfxpciname1=${gdgfxname1[$dgfxindex1]} - -# debug -if [ $gDebug = 2 ]; then - echo "gdgfxpciname1 = ${gdgfxname1[$dgfxindex1]}" - echo "gdgfxpciname1 = $gdgfxpciname1" -fi - -if [ $gdgfxpciname1 = 0 ]; then - echo "Error: discrete graphics card not found, unknown acpi PCI0 name" - echo "Names checked: ${gdgfxname1[@]}" - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 -fi - -# get acpi graphics device name -# get acpi graphics device name -numname2=8 -gdgfxname2[1]=PEGP@0 -gdgfxname2[2]=GFX0@0 -gdgfxname2[3]="display@0" -gdgfxname2[4]="pci-display@0" -gdgfxname2[5]=GFX1@0 -gdgfxname2[6]=H000@0 -gdgfxname2[7]=pci10de -gdgfxname2[8]=pci1002 - - -#find discrete graphics vendor-id -index=1 -while [ $index -le $numname2 ]; -do -dgfxvendorid=$(ioreg -rxn ${gdgfxname2[$index]} | grep vendor-id| awk '{ print $4 }') -dgfxdeviceid=$(ioreg -rxn ${gdgfxname2[$index]} | grep device-id| awk '{ print $4 }') - -if [ $gDebug = 2 ]; then - echo "gdgfxname2 = ${gdgfxname2[$index]}" -fi - -if [ -n "${dgfxvendorid}" ]; then - gdgfxpciname2=${gdgfxname2[$index]} - - index0=1 - for vendor in $dgfxvendorid - do - -# debug - if [ $gDebug = 2 ]; then - echo "index0 = $index, vendor-id = ${vendor:1:4}" - fi - -# sort discrete graphics vendors and devices - case ${vendor:1:4} in - - 0210 ) gdgfxvendorid=${vendor:1:4} - gdgfxname=AMD - ;; - - de10 ) gdgfxvendorid=${vendor:1:4} - gdgfxname=Nvidia - ;; - esac - index0=$((index0 + 1)) - done - -# find discrete graphics device-id - index0=1 - for device in $dgfxdeviceid - do - -# debug - if [ $gDebug = 2 ]; then - echo "index0 = $index, device-id = ${device:1:4}" - fi - - gdgfxdeviceid=${device:1:4} - - index0=$((index0 + 1)) - done -fi - -index=$(($index + 1)) -done - -gdgfxvendorid=${gdgfxvendorid:2:2}${gdgfxvendorid:0:2} -gdgfxdeviceid=${gdgfxdeviceid:2:2}${gdgfxdeviceid:0:2} - -# debug 0 -# if [ $gDebug = 0 ]; then -# if [ $gDebug = 1 ]; then -# if [ $gDebug = 2 ]; then -# echo "gdgfxpciname1 = $gdgfxpciname1" -# echo "gdgfxpciname2 = $gdgfxpciname2" -# echo "gdgfxvendorid = ${gdgfxvendorid}" -# echo "gdgfxdeviceid = ${gdgfxdeviceid}" -# gdgfxpciname1=BR3A@3 -# gdgfxpciname2=H060@0 -# echo "gdgfxvendorid = ${gdgfxvendorid}" -# echo "gdgfxdeviceid = ${gdgfxdeviceid}" -# gdgfxvendorid="" -# fi - - -if [ $gdgfxpciname1 = "BR3A@3" ]; then -if [[ $gdgfxpciname1 = "BR3A@3" && $gdgfxpciname2 = "H000@0" ]]; then -echo "X99 HDMI audio supported" -else - -# debug - if [ $gDebug = 2 ]; then - echo "gdgfxpciname1 = $gdgfxpciname1" - echo "gdgfxpciname2 = $gdgfxpciname2" - echo - fi - - gdgfxpciname2="Hxx0@0" - echo "NOTE:ACPI graphics name unknown, H000 installed" - echo "Verify IOReg/BR3A/graphics name, i.e., Hxx0@0 and Hxx1@0,1" - echo "Before restarting, edt EFI/CLOVER/ACPI/patched/SSDT-HDMI-...-$gdgfxpciname1" - echo "MaciASL/Edit/Find: H000/Replace: Hxx0" - echo "MaciASL/Edit/Find: H001/Replace: Hxx1" - echo "Compile/Save/Restart" - echo "More information, see Desktop/[Guide] OS X hdmi audio x99 ssdt" - - while true - do - read -p "AMD(a)/Nvidia(n) graphics (a/n): " choice6 - case "$choice6" in - [aA]* ) gdgfxname="AMD"; break;; - [nN]* ) gdgfxname="Nvidia"; break;; - * ) echo "Try again...";; - esac - done - -fi -fi - -if [ -z "${gdgfxvendorid}" ]; then - if [ $gdgfxpciname1 = "BR3A@3" ]; then - if [ $gDebug = 2 ]; then - echo "gdgfxpciname1 = $gdgfxpciname1" - echo "gdgfxvendorid = $gdgfxvendorid" - fi - - else - if [ $gdgfx != 0 ]; then - echo "AMD/Nvidia HDMI codec found" - fi - echo "AMD/Nvidia graphics not found, unknown acpi PCI0/graphics name" - echo "Names checked: ${gdgfxname2[@]}" - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit - fi -fi - -if [ $gdgfxpciname2 = "Hxx0@0" ]; then -dgfxhdagfx=0 - -else -echo "$gdgfxname discrete graphics card $gdgfxvendorid$gdgfxdeviceid found on $gdgfxpciname1/$gdgfxpciname2" - -# verify GFX0 hfa-gfx injection -dgfxhdagfx1=$(ioreg -rxn $gdgfxpciname2 | grep -c "hda-gfx") - -# verify HDAU hda-gfx injection -dgfxhdagfx2=$(ioreg -rxn HDAU@0,1 | grep -c "hda-gfx") - -dgfxhdagfx=$(($dgfxhdagfx1 + $dgfxhdagfx2)) - -# debug -if [ $gDebug = 2 ]; then - echo "dgfxhdagfx1 = $dgfxhdagfx1" - echo "dgfxhdagfx2 = $dgfxhdagfx2" - dgfxhdagfx=$(($dgfxhdagfx1 + $dgfxhdagfx2)) - echo "dgfxhdagfx = $dgfxhdagfx" -fi - -fi - -# debug 0 -# if [ $gDebug = 0 ]; then -# if [ $gDebug = 1 ]; then -# if [ $gDebug = 2 ]; then -# echo "" -# dgfxhdagfx=0 -# fi - -choice1=n -if [ $dgfxhdagfx = 2 ]; then # ssdt working - echo "$gdgfxname HDMI audio is enabled" - if [ $gdgfxname = "AMD" ]; then - echo "Frambuffer injection and connector patching may also be required" - echo "Note: AMD kext edits are not available with this script" - fi - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 -else - Echo "$gdgfxname HDMI audio is not enabled" - while true - do - read -p "Install $gdgfxname HDMI audio ssdt (y/n): " choice1 - case "$choice1" in - [yY]* ) gssdtinstall=y; break;; - [nN]* ) echo "No system files were changed"; exit;; - * ) echo "Try again...";; - esac - done -fi - -if [ $gdgfxpciname1 = "pci-bridge@1" ]; then -if [ $gDebug = 2 ]; then -echo "gdgfxpciname1 = $gdgfxpciname1" -echo -fi -gdgfxpciname1="PEGP@1" -fi - -if [ $gdgfxpciname1 = "pci-bridge@3" ]; then -if [ $gDebug = 2 ]; then -echo "gdgfxpciname1 = $gdgfxpciname1" -echo -fi -gdgfxpciname1="PEGP@3" -fi - -if [ $gDebug = 2 ]; then -echo "gdgfxpciname1 = $gdgfxpciname1" -echo -fi - -# ssdt repo, folder, file -case $gdgfxname in - -AMD* ) - -gdgfxrepo=amd-nvidia -gdgfxfolder=ssdt_hdmi-amd -gdgfxzip=ssdt_hdmi-amd-default- -gdgfxssdt=SSDT-HDMI-AMD- -;; - -Nvidia* ) - -gdgfxrepo=amd-nvidia -gdgfxfolder=ssdt_hdmi-nvidia -gdgfxzip=ssdt_hdmi-nvidia- -gdgfxssdt=SSDT-HDMI-NVIDIA- -;; - -esac - -if [ ${gdgfxpciname1:0:4} = "PEGP" ];then -gdgfxpciname1=${gdgfxpciname1:0:6} -else -gdgfxpciname1=${gdgfxpciname1:0:4} -fi - -if [ $gdgfxpciname1 = "GFX1" ];then -gdgfxpciname1="GFX0" -echo "NOTE :GFX1 is not available, GFX0 installed" -echo "Before restarting. edt EFI/CLOVER/ACPI/patched/$gdgfxzip$gdgfxpciname1" -echo "MaciASL/Edit/Find: GFX0/Replace: GFX1/Compile/Save/Restart" -fi - -# debug -if [ $gDebug = 2 ]; then - echo "gdgfxrepo = $gdgfxrepo" - echo "gdgfxfolder = $gdgfxfolder" - echo "gdgfxzip = $gdgfxzip" - echo "gDownloadLink=https://raw.githubusercontent.com/toleda/audio_hdmi_$gdgfxrepo/master/$gdgfxfolder/$gdgfxzip$gdgfxpciname1.zip" -fi - -# download ssdt -echo "Download $gdgfxssdt$gdgfxpciname1 ..." -gDownloadLink="https://raw.githubusercontent.com/toleda/audio_hdmi_$gdgfxrepo/master/$gdgfxfolder/$gdgfxzip$gdgfxpciname1.zip" - -if [ $gDebug = 2 ]; then - echo "sudo curl -o /tmp/$gdgfxzip$gdgfxpciname1.zip $gDownloadLink" - echo -fi - -sudo curl -o "/tmp/$gdgfxzip$gdgfxpciname1.zip" $gDownloadLink -unzip -qu "/tmp/$gdgfxzip$gdgfxpciname1.zip" -d "/tmp/" - -# exit if error -if [ "$?" != "0" ]; then - echo "Error: Download failure, verify network". - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 -fi - -# install dgfx ssdt to EFI/CLOVER/ACPI/patched (cloverHDMI) - -case $gDebug in - -0 ) - if [ -d "$gCloverDirectory/ACPI/patched/$gdgfxssdt$gdgfxpciname1.aml" ]; then - sudo rm -R "$gCloverDirectory/ACPI/patched/$gdgfxssdt$gdgfxpciname1.aml" - # echo "$gCloverDirectoryACPI/patched/$gdgfxssdt$gdgfxpciname1.aml deleted" - fi - sudo cp -R "/tmp/$gdgfxzip$gdgfxpciname1/$gdgfxssdt$gdgfxpciname1.aml" "$gCloverDirectory/ACPI/patched/$gdgfxssdt$gdgfxpciname1.aml" - echo "$gCloverDirectory/ACPI/patched/$gdgfxssdt$gdgfxpciname1.aml installed" - if [ $gdgfxpciname2 = "Hxx0@0" ]; then - cp -R /tmp/$gdgfxzip$gdgfxpciname1/'[Guide] OS X hdmi audio x99 ssdt.pdf' Desktop/'[Guide] OS X hdmi audio x99 ssdt' - fi -;; - -1|2 ) - sudo cp -R "/tmp/$gdgfxzip$gdgfxpciname1/$gdgfxssdt$gdgfxpciname1.aml" "Desktop/$gdgfxname-$gdgfxssdt$gdgfxpciname1.aml" -# echo "Debug mode" -# echo "No system files were changed" - echo "$gdgfxname HDMI audio ssdt copied to Desktop" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - if [ $gdgfxpciname2 = "Hxx0@0" ]; then - cp -R /tmp/$gdgfxzip$gdgfxpciname1/'[Guide] OS X hdmi audio x99 ssdt.pdf' Desktop/'[Guide] OS X hdmi audio x99 ssdt' - fi -# cleanup /tmp - sudo rm -R /tmp/$gdgfxzip$gdgfxpciname1.zip - sudo rm -R /tmp/$gdgfxzip$gdgfxpciname1 -# rm -R /tmp/config.plist - rm -R /tmp/__MACOSX -# rm -R /tmp/HDEF.txt -# rm -R /tmp/IGPU.txt - exit 0 - ;; - -esac - -# cleanup /tmp -sudo rm -R /tmp/$gdgfxzip$gdgfxpciname1.zip -sudo rm -R /tmp/$gdgfxzip$gdgfxpciname1 -sudo rm -R /tmp/__MACOSX - -fi # AMD/Nvidia HDMI audio -fi # AMD/Nvidia - -# exit if error -if [ "$?" != "0" ]; then - sudo rm -R "$gCloverDirectory/ACPI/patched/$gigfxssdt" - echo Error: ssdt install failure - echo "No system files were changed" - echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." - exit 1 -fi - -echo "" -echo "Install finished, restart required." -echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." -exit 0 - - - -exit diff --git a/audio_cloverHDMI-130_v0.8.command b/audio_cloverHDMI-130_v0.8.command new file mode 100755 index 0000000..6d93c21 --- /dev/null +++ b/audio_cloverHDMI-130_v0.8.command @@ -0,0 +1,1940 @@ +#!/bin/sh +# Maintained by: toleda for: github.com/toleda/audio_cloverHDMI +gFile="audio_cloverHDMI-130_v0.8.command" +# Credit: bcc9, RevoGirl, PikeRAlpha, RehabMan +# +# macOS Clover HDMI Audio +# +# Enables macOS HDMI audio in 10.8 and newer, all versions +# 1. Supports Intel integrated graphics and/or AMD and Nvidia discrete graphics +# 2. Installs HDMI audio ssdt and required framebuffer edits (Intel only) +# 3. Native CPU and GPU power management (Intel only, additonal steps required) +# +# Requirements +# 1. macOS: 10.13/10.12/10.11/10.10/10.9/10.8, all versions +# 2. Native AppleHDA.kext (If not installed, run 10.x.x installer) +# 3. Recognized Intel/AMD/Nvidia graphics +# 4. Clover only: 1. UEFI, mount EFI partition and 2. Clover Legacy +# +# Supports:[QUOTE="izham, post: 1693760, member: 1190658"]installed just the sound driver for ALC887 current from Multibeast 5.4.3[/QUOTE] +# 1. Intel/desktop series: 200, 100, 9, 8, 7, 6, 5 +# Intel/workstation series: X299, X99, X79, X58 +# 2. Intel Graphics HD: +# Desktop: HD6x0, HD5x0, HD6200, HD4600+, HD4000, HD3000 +# BRIX/NUC: HD580, HD540, HD6100, HD6000, HD5500, HD5200, HD5000, HD4000 +# 3. AMD/default framebuffer: RX 5x0/4x0, R7/R9 3xx, R7/R9 2xx, 7xxx, 6xxx, 5xxx +# Except: GCN 1.1/Hawaii/Bonaire) +# 4. Nvidia/macOS drivers: 10xx, 9xx, 7xx, 6xx, 5xx, 4xx (except 450, 550, 560) +# Required: Nvidia/Web drivers: 10xx, 9xx, 750 +# +# Debug Mode (saves ssdt and config.plist to Desktop +# 1. Set audio_cloverHDMI-1x0.command/gDebug=1 (below) +# 2. Copy config.plist to Desktop +# 3. Continue with Installation/Step 3 +# +# Installation +# 1. Double click audio_cloverHDMI...command +# 2. Enter password at prompt +# 3. Questions (answer y or n) +# Install SSDT-HDMI-HDxxx HDMI audio ssdt (y/n) +# Verify SSDT-HDMI-HDxxx HDMI audio connector (y/n) +# Confirm DP to HDMI connector patch on port 0x5 (y/n) +# Install AMD/Nvidia HDMI audio (y/n) +# Install AMD HDMI audio ssdt (y/n) +# 4. Restart +# +# Change log +# v0.8 - 2/14/18: Add config.plist validation, option to proceed with invalid Audio ID +# v0.7 - 2/8/18: Added X299 - PC02/PCI2 ACPI devices, updated Name property +# v0.6 - 10/15/17: Fixed +# v0.5 - 10/12/17: Pulled, source control error +# v0.4 - 8/31/17: Audio ID verification +# v0.3 - 8/22/17: fix HD630 port calculation +# v0.2 - 729/17: fix HD630 device_id +# v0.1 - 7/6/17: Initial 10.13 support +# +echo " " +echo "Agreement" +echo "The audio_cloverHDMI script is for personal use only. Do not distribute" +echo "the patch, any or all of the files for any reason without permission." +echo "The audio_cloverHDMI script is provided as is and without any warranty." +echo " " + +# set initial variables +# debug=0 - normal install, +# debug=1 - test drive, copy config.plist to Desktop, edited config.plist and ssdt copied to Desktop +gDebug=0 + +gSysVer=`sw_vers -productVersion` +gSysName="El Capitan" +gStartupDisk=EFI +gCloverDirectory=/Volumes/$gStartupDisk/EFI/CLOVER +gDesktopDirectory=/Volumes/$(whoami)/Desktop +# gDesktopDirectory=/Volumes/850E-Users/Users/$(whoami)/Desktop ## +gssdtinstall=n +gigfxlvds=0 +gideviceid=0 +givendorid=0 +gigfxhdmicodec=0 +gigfxhdmihdau=y +gigfxportmax=7 +gigfxport5=0 +gigfxports=3 +gigfxnuc=1 +gdgfxname1=0 +gdgfxssdt=0 +gdgfxname=0 +gdgfx=0 +ghdmi=0 +gAudioid=1 +validaudioid=y + +# Terminal commands +# ioreg -rxn IGPU@2 | grep vendor-id| awk '{ print $4 }' +# ioreg -rxn IGPU@2 | grep device-id | sed -e 's/.*//' +# ioreg -rxn IGPU@2 | grep "AAPL,ig-platform-id"| awk '{ print $4 }' +# ioreg -rxn IGPU@2 | grep "hda-gfx"| awk '{ print $4 }' +# ioreg -rxn IGPU@2 | grep -c "hda-gfx" +# ioreg -rxn HDAU@0 | grep "hda-gfx"| awk '{ print $4 }' +# ioreg -rxn HDAU@0,1 | grep device-id| awk '{ print $4 }' +# ioreg -rxn P0P2@3 | grep vendor-id| awk '{ print $4 }' +# ioreg -rw 0 -p IODeviceTree -n IGPU@2 > /tmp/IGPU.txt +# ioreg -rw 0 -p IOService -n AppleIntelFramebuffer@0 > /tmp/IGPU.txt +# audioinfo=$(cat /tmp/IGPU.txt | grep -c "audio-codec-info") +# connector=$(cat /tmp/IGPU.txt | grep connector-type | sed -e 's/.*//') + +function _patchconfig() +{ + +# debug +if [ $gDebug = 2 ]; then + echo "patch = $patch" +fi + +# add patches to config.plist/KernelAndKextPatches/KextsToPatch +sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:$patch'" /tmp/config-audio_cloverHDMI.plist -x > "/tmp/ktp.plist" +ktpcomment=$(sudo /usr/libexec/PlistBuddy -c "Print 'Comment'" "/tmp/ktp.plist") +sudo /usr/libexec/PlistBuddy -c "Set :Comment 't2-$ktpcomment'" "/tmp/ktp.plist" +sudo /usr/libexec/PlistBuddy -c "Add :KernelAndKextPatches:KextsToPatch:0 dict" /tmp/config.plist +sudo /usr/libexec/PlistBuddy -c "Merge /tmp/ktp.plist ':KernelAndKextPatches:KextsToPatch:0'" /tmp/config.plist + +# exit if error +if [ "$?" != "0" ]; then +echo "Error: config.plst patch failed" +echo “Original config.plist restored” +sudo cp -X $gCloverDirectory/config-backup.plist $gCloverDirectory/config.plist +sudo rm -R /tmp/ktp.plist +sudo rm -R /tmp/config.plist +sudo rm -R /tmp/config-audio_cloverALC+.plist.zip +sudo rm -R /tmp/config-audio_cloverALC.plist +sudo rm -R /tmp/__MACOSX +echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." +exit 1 +fi + +} + +# verify system version +case ${gSysVer} in + + 10.13* ) gSysName="High Sierra" + gSysFolder=kexts/10.13 + gSID=$(csrutil status) + ;; + + 10.12* ) gSysName="Sierra" + gSysFolder=kexts/10.12 + gSID=$(csrutil status) + ;; + + 10.11* ) gSysName="El Capitan" + gSysFolder=kexts/10.11 + gSID=$(csrutil status) + ;; + + 10.10* ) gSysName="Yosemite" + gSysFolder=kexts/10.10 + ;; + + 10.9* ) gSysName="Mavericks" + gSysFolder=kexts/10.9 + ;; + + 10.8* ) gSysName="Mountain Lion" + gSysFolder=kexts/10.8 + ;; + + * ) + echo "macOS Version: $gSysVer is not supported" + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + ;; + +esac + +# debug +if [ $gDebug = 2 ]; then + # gSysVer=10.9 + echo "System version: supported" + echo "gSysVer = $gSysVer" +fi + +gDebugMode[0]=Release +gDebugMode[1]=TestDrive +gDebugMode[2]=Debug + +# verify Debug setting +case $gDebug in + + 0|1|2 ) + ;; + + * ) + echo "gDebug = $gDebug not invalid, script terminating" + echo "No system files were changed" + exit 1 + :: + +esac + +echo "File: $gFile" +echo "${gDebugMode[$gDebug]} Mode" + +# credit: mfram, http://forums.macrumors.com/showpost.php?p=18302055&postcount=6 +# get startup disk name +gStartupDevice=$(mount | grep "on / " | cut -f1 -d' ') +gStartupDisk=$(mount | grep "on / " | cut -f1 -d' ' | xargs diskutil info | grep "Volume Name" | perl -an -F'/:\s+/' -e 'print "$F[1]"') + +# debug +if [ $gDebug = 2 ]; then + echo "Boot device: $gStartupDevice" + echo "Boot volume: $gStartupDisk" +fi + +# check for debug (debug=1 and 2 do not touch CLOVER folder) +case $gDebug in +0 ) + +# verify EFI install +gEFI=0 +if [ -d $gCloverDirectory ]; then + gEFI=1 +fi + +if [ $gEFI = 0 ]; then + + if [ -d '/Volumes/ESP/EFI/CLOVER' ]; then + gCloverDirectory=/Volumes/ESP/EFI/CLOVER + gEFI=1 + fi + +fi + +if [ $gEFI = 1 ]; then + echo "EFI partition is mounted" + if [ -f "$gCloverDirectory/config.plist" ]; then + cp -p "$gCloverDirectory/config.plist" "/tmp/config.plist" + if [ -f "$gCloverDirectory/config-backup.plist" ]; then + rm -R "$gCloverDirectory/config-backup.plist" + fi + cp -p "$gCloverDirectory/config.plist" "$gCloverDirectory/config-backup.plist" + else + echo "$gCloverDirectory/config.plist is missing" + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi +else + echo "EFI partition not mounted" + +# confirm Clover Legacy install + gCloverDirectory=/Volumes/"$gStartupDisk"/EFI/CLOVER + if [ -d "$gCloverDirectory" ]; then + echo "$gStartupDisk/EFI folder found" + else echo "$gStartupDisk/EFI not found" + echo "EFI/CLOVER folder not available to install HDMI audio" + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi + +# initialize variable + choice7=n + + while true + do + read -p "Confirm Clover Legacy Install (y/n): " choice7 + case "$choice7" in + + [yY]* ) +# gCloverDirectory=/Volumes/"$gStartupDisk"/EFI/CLOVER + if [ -d "$gCloverDirectory" ]; then + if [ -f "$gCloverDirectory/config.plist" ]; then + cp -p "$gCloverDirectory/config.plist" "/tmp/config.plist" + if [ -f "$gCloverDirectory/config-backup.plist" ]; then + rm -R "$gCloverDirectory/config-backup.plist" + fi + cp -p "$gCloverDirectory/config.plist" "$gCloverDirectory/config-backup.plist" + else + echo "$gCloverDirectory/config.plist is missing" + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi + + else + echo "$gCloverDirectory not found" + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi + + break + ;; + + [nN]* ) + echo "User terminated, EFI partition/folder not mounted" + echo “Mount EFI partition and Restart“ + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + ;; + + * ) echo "Try again...";; + esac + done + fi +;; + +1|2 ) + if [ -f "Desktop/config.plist" ]; then + cp -R Desktop/config.plist /tmp/config.plist +# echo "Debug mode" +# echo "Desktop/config.plist copied to /tmp/config.plist" + else + echo "Desktop/config.plist missing, Debug mode not possible" + exit 1 + fi +;; + +esac + +# verify ioreg/HDEF +ioreg -rw 0 -p IODeviceTree -n HDEF > /tmp/HDEF.txt + +if [[ $(cat /tmp/HDEF.txt | grep -c "HDEF@1") = 0 ]]; then +echo "Error: no IOReg/HDEF; BIOS/audio/disabled or ACPI problem" + + while true + do + read -p "Continue without HDEF/onboard audio (y/n): " choice0 + case "$choice0" in + [yY]* ) break;; + [nN]* ) + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + rm -R /tmp/HDEF.txt + exit 1 + ;; + * ) echo "Try again...";; + esac + done +fi + +# HDEF/layout-id + +if [[ $(cat /tmp/HDEF.txt | grep -c "HDEF@1") != 0 ]]; then + gLayoutidioreg=$(cat /tmp/HDEF.txt | grep layout-id | sed -e 's/.*//') + gLayoutidhex="0x${gLayoutidioreg:6:2}${gLayoutidioreg:4:2}${gLayoutidioreg:2:2}${gLayoutidioreg:0:2}" + gAudioid=$((gLayoutidhex)) +fi + +# verify ioreg/GFX0 +ioreg -rw 0 -p IODeviceTree -n GFX0@2 > /tmp/IGPU.txt +if [[ $(cat /tmp/IGPU.txt | grep -c "GFX0@2") = 0 ]]; then + gigfx=0 + +# debug + if [ $gDebug = 2 ]; then + echo "GFX0 - gigfx = $gigfx" + fi + +# verify ioreg/IGPU + ioreg -rw 0 -p IODeviceTree -n IGPU@2 > /tmp/IGPU.txt + if [[ $(cat /tmp/IGPU.txt | grep -c "IGPU@2") = 0 ]]; then + gigfx=0 + +# debug + if [ $gDebug = 2 ]; then + echo "IGPU - gigfx = $gigfx" + fi + + else + gigfx=IGPU@2 + +# debug + if [ $gDebug = 2 ]; then + echo "gigfx = $gigfx" + fi + + fi + +else +gigfx=GFX0@2 + +# debug + if [ $gDebug = 2 ]; then + echo "gigfx = $gigfx" + fi + +fi # found HDEF, layout-id, igfx + +rm -R /tmp/IGPU.txt +rm -R /tmp/HDEF.txt + +# verify config.plist/KernelAndKextPatches:KextsToPatch +ktpexisting=$(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches'" /tmp/config.plist) + +if [ -z "${ktpexisting}" ]; then + sudo /usr/libexec/PlistBuddy -c "Add KernelAndKextPatches:KextsToPatch array" /tmp/config.plist + echo "Edit config.plist: Add KernelAndKextPatches/KextsToPatch - Fixed" +fi + +ktpexisting=$(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:'" /tmp/config.plist) + +if [ -z "${ktpexisting}" ]; then + sudo /usr/libexec/PlistBuddy -c "Add KernelAndKextPatches:KextsToPatch array" /tmp/config.plist + echo "Edit config.plist: Add KextsToPatch - Fixed" +fi + +# exit if error +if [ "$?" != "0" ]; then + echo "Error: config.plist/KernelAndKextPatches/KextsToPatch fix failed" + echo “Original config.plist restored” + echo “Install valid config.plist” + sudo cp -X $gCloverDirectory/config-backup.plist $gCloverDirectory/config.plist + sudo rm -R /tmp/ktp.plist + sudo rm -R /tmp/config.plist + sudo rm -R /tmp/config-audio_cloverHDMI+.plist.zip + sudo rm -R /tmp/config-audio_cloverHDMI.plist + sudo rm -R /tmp/__MACOSX + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 +fi + +# get installed codecs +gCodecsInstalled=$(ioreg -rxn IOHDACodecDevice | grep VendorID | awk '{ print $4 }' | sed -e 's/ffffffff//') + +# debug +if [ $gDebug = 2 ]; then +# gCodecsInstalled=0x10ec0900 +# gCodecsInstalled=0x10134206 + echo "gCodecsInstalled = $gCodecsInstalled" +fi + +# no audio codecs detected +if [ -z "${gCodecsInstalled}" ]; then + echo "" + echo "No audio codec detected" + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 +fi + +# initialize variables +intelhdmi=0 +amdhdmi=0 +nvidiahdmi=0 + +# find codecs +index=0 +for codec in $gCodecsInstalled +do + +# debug +if [ $gDebug = 2 ]; then + echo "Index = $index, Codec = $codec" +fi + +# sort vendors and devices +case ${codec:2:4} in + + 8086 ) Codecintelhdmi=$codec; intelhdmi=1 + ;; + 1002 ) Codecamdhdmi=$codec; amdhdmi=1 + ;; + 10de ) Codecnvidiahdmi=$codec; nvidiahdmi=1 + ;; + +esac +index=$((index + 1)) +done + +ghdmi=$((intelhdmi+amdhdmi+nvidiahdmi)) +gdgfx=$((amdhdmi+nvidiahdmi)) + +# no hdmi codecs detected +if [ $ghdmi = 0 ]; then + + while true + do + read -p "No HDMI audio codec(s) detected, continue (y/n): " choice4 + case "$choice4" in + [yY]* ) + gdgfx=1 + break + ;; + [nN]* ) + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + rm -R /tmp/HDEF.txt + rm -R /tmp/config.plist + exit 1 + ;; + * ) echo "Try again...";; + esac + done +fi + +# debug +# if [ $gDebug != 0 ]; then + echo "HDMI audio codec(s)" + if [ $intelhdmi = 1 ]; then + echo "Intel: $Codecintelhdmi" + fi + if [ $amdhdmi = 1 ]; then + echo "AMD: $Codecamdhdmi" + fi + if [ $nvidiahdmi = 1 ]; then + echo "Nvidia: $Codecnvidiahdmi" + fi +# fi + +# debug ## +# if [ $gDebug = 0 ]; then +# if [ $gDebug = 1 ]; then +# if [ $gDebug = 2 ]; then +# echo "" +# gigfx=0 +# gdgfx=0 +# echo "gigfx = $gigfx" +# echo "gdgfx = $gdgfx" +# fi + +# verify igfx +if [ $gigfx = 0 ]; then # no IGFX + echo "Integrated Graphics is not installed/enabled" + gigfxnuc=0 + rm -R /tmp/config.plist +# rm -R /tmp/HDEF.txt + +else + gideviceid=$(ioreg -rxn $gigfx | grep device-id | sed -e 's/.*//') + +# debug ## +# if [ $gDebug = 0 ]; then +# if [ $gDebug = 1 ]; then +# if [ $gDebug = 2 ]; then +# gideviceid=26010000 +# gideviceid=62010000 +# gideviceid=12040000 +# gideviceid=220d0000 +# gideviceid=16160000 +# gideviceid=12190000 +# gideviceid=26190000 +# gideviceid=12590000 +# gAudioid=11 +# fi + +# initialize variable +gideviceidsupported=y +gigfxindex=0 +gigfxhdmihdef=n +gigfxhdmihdau=n + +# desktop igfx ssdt parameters + case $gideviceid in + + 26010000* ) + gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,snb-platform-id"| awk '{ print $4 }') + gigfxgen=2 + gigfxhdmifb=00020300 + gigfxname="HD3000" + gigfxrepo=hd3000 + gigfxfolder=ssdt_hdmi-hd3000 + gigfxzip=ssdt_hdmi-hd3000-6series-3 + gigfxssdt=SSDT-HDMI-HD3000 + gigfxindex=2 + gigfxhdmihdef=y + gigfxnuc=0 + ;; + + 62010000* ) + gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') + gigfxgen=3 + gigfxhdmifb=0A006601 + gigfxname="HD4000" + gigfxrepo=hd4000 + gigfxfolder=ssdt_hdmi-hd4000 + gigfxzip=ssdt_hdmi-hd4000-7series-3 + gigfxssdt=SSDT-HDMI-HD4000 + gigfxindex=5 + gigfxhdmihdef=y + gigfxnuc=0 + ;; + + 12040000* ) + gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') + gigfxgen=4 + gigfxhdmifb=0300220D + gigfxhdmicodec=0c0c + gigfxhdmihdau=y + gigfxname="HD4600+" + gigfxrepo=8series + gigfxfolder=ssdt_hdmi-hd4600+ + gigfxzip=ssdt_hdmi-hd4600+ + gigfxssdt=SSDT-HDMI-HD4600+ + gigfxindex=8 + gigfxnuc=0 + ;; + + 22160000* ) + gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') + gigfxgen=5 + gigfxhdmifb=03001216 + gigfxhdmihdau=y + gigfxname="HD6200" + gigfxrepo=9series + gigfxfolder=ssdt_hdmi-hd6000+ + gigfxzip=ssdt_hdmi-hd6200 + gigfxssdt=SSDT-HDMI-HD6200 + gigfxindex=0 + gigfxnuc=0 + ;; + + 12190000* ) + gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') + gigfxgen=6 + gigfxhdmifb=00001219 + gigfxhdmihdau=n + gigfxname="HD530" + gigfxrepo=100series + gigfxfolder=ssdt_hdmi_hd5x0 + gigfxzip=ssdt_hdmi-hd530 + gigfxssdt=SSDT-HDMI-HD530 + gigfxindex=14 + gigfxhdmihdef=y + gigfxport5=1 + gigfxnuc=0 + ;; + + 16190000* ) + gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') + gigfxgen=6 + gigfxhdmifb=00001219 + gigfxhdmihdau=n + gigfxname="HD515" + gigfxrepo=100series + gigfxfolder=ssdt_hdmi_hd5x0 + gigfxzip=ssdt_hdmi-hd515 + gigfxssdt=SSDT-HDMI-HD515 + gigfxindex=14 + gigfxhdmihdef=y + gigfxport5=1 + gigfxnuc=0 + ;; + + 12590000* ) + gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') + gigfxgen=7 + gigfxhdmifb=00001259 + gigfxhdmihdau=n + gigfxname="HD630" + gigfxrepo=200series + gigfxfolder=ssdt_hdmi_hd6x0 + gigfxzip=ssdt_hdmi-hd630 + gigfxssdt=SSDT-HDMI-HD630 + gigfxindex=17 + gigfxhdmihdef=y + gigfxport5=0 + gigfxnuc=0 + ;; + + * ) + gideviceidsupported=n + ;; + + esac + +# nuc igfx ssdt parameters + if [[ $gigfxnuc = 1 && $gideviceidsupported = n ]]; then + gigfxnuc=2 + gideviceidsupported=y + gigfxportmax=6 + + case $gideviceid in + + 66010000* ) + gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') + gigfxgen=3 + gigfxhdmifb=0A006601 + gigfxname="HD4000" + gigfxrepo=hd4000 + gigfxfolder=ssdt_hdmi-hd4000 + gigfxzip=ssdt_hdmi-hd4000-7series-3 + gigfxssdt=SSDT-HDMI-HD4000 + gigfxindex=5 + gigfxhdmihdef=y + gigfxportmax=7 + ;; + + 260a0000* ) + gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') + gigfxgen=4 + gigfxhdmifb=0300220D + gigfxhdmihdau=y + gigfxname="HD5000" + gigfxrepo=8series + gigfxfolder=ssdt_hdmi-hd4600+ + gigfxzip=ssdt_hdmi-hd4600+ + gigfxssdt=SSDT-HDMI-HD4600+ + gigfxindex=8 + ;; + + 220d0000* ) + gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') + gigfxgen=4 + gigfxhdmifb=0300220D + gigfxhdmihdau=y + gigfxname="HD5200" + gigfxrepo=8series + gigfxfolder=ssdt_hdmi-hd4600+ + gigfxzip=ssdt_hdmi-hd4600+ + gigfxssdt=SSDT-HDMI-HD4600+ + gigfxindex=8 + ;; + + 16160000* ) + gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') + gigfxgen=5 + gigfxhdmifb=02001616 + gigfxhdmihdau=y + gigfxname="HD5500" + gigfxrepo=9series + gigfxfolder=ssdt_hdmi-hd6000+ + gigfxzip=ssdt_hdmi-hd5500 + gigfxssdt=SSDT-HDMI-HD5500 + gigfxindex=11 + ;; + + 26160000* ) + gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') + gigfxgen=5 + gigfxhdmifb=04002616 + gigfxhdmihdau=y + gigfxname="HD6000" + gigfxrepo=9series + gigfxfolder=ssdt_hdmi-hd6000+ + gigfxzip=ssdt_hdmi-hd6000 + gigfxssdt=SSDT-HDMI-HD6000 + gigfxindex=11 + ;; + + 2B160000* ) + gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') + gigfxgen=5 + gigfxhdmifb=04002B16 + gigfxhdmihdau=y + gigfxname="HD6100" + gigfxrepo=9series + gigfxfolder=ssdt_hdmi-hd6000+ + gigfxzip=ssdt_hdmi-hd6100 + gigfxssdt=SSDT-HDMI-HD6100 + gigfxindex=11 + ;; + + 26190000* ) + gigfxframebuffer=$(ioreg -rxn $gigfx | grep "AAPL,ig-platform-id"| awk '{ print $4 }') + gigfxgen=6 + gigfxhdmifb=00002619 + gigfxhdmihdau=n + gigfxname="HD540" + gigfxrepo=100series + gigfxfolder=ssdt_hdmi_hd5x0 + gigfxzip=ssdt_hdmi-hd540 + gigfxssdt=SSDT-HDMI-HD540 + gigfxindex=0 + gigfxhdmihdef=y + ;; + + * ) + gideviceidsupported=n + gigfxnuc=0 + ;; + + esac + fi + + + if [ $gideviceidsupported = n ]; then # IGFX not supported + echo "Device ID: 0x$gideviceid not supported" + rm -R /tmp/config.plist + rm -R /tmp/HDEF.txt + + if [ $gdgfx = 0 ]; then + echo "AMD/Nvidia not found" + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi + else + +# verify HDEF/layout-id + + case $gAudioid in + + 1|2 ) + validaudioid=y + ;; + + 3 ) + if [[ $gigfxname = HD3000 || $gigfxname = HD4000 ]]; then + validaudioid=y + fi + ;; + + * ) + echo "Audio ID: $gAudioid is not valid" + echo "Audio ID set to Audio ID: 1" + echo "Edit EFI/CLOVER/ACPI/patched/SSDT-HDEF... to preferred Audio ID" + + while true + do + read -p "Audio ID: 1, continue (y/n): " choice5 + case "$choice5" in + [yY]* ) + gAudioid=1 + break + ;; + [nN]* ) + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + ;; + * ) echo "Try again...";; + esac + done + esac + +# hdef ssdt audio id + gigfxhdmiaudioid=$gAudioid + +# hdef ssdt parameters + ghdefrepo=ALCInjection + ghdeffolder=ssdt_hdef + + case $gigfxname in + + HD3000|HD4000* ) + gigfxhdmiaudioid=3 + ghdefzip=ssdt_hdef-$gigfxhdmiaudioid-with_ioreg:hdef + ghdefssdt=SSDT-HDEF-$gigfxhdmiaudioid + ;; + + HD515|HD530|HD540*|HD630 ) + if [ $gigfxhdmiaudioid = 3 ]; then gigfxhdmiaudioid=1; fi + ghdefzip=ssdt_hdef-$gigfxhdmiaudioid-100-hdas + ghdefssdt=SSDT-HDEF-HDAS-$gigfxhdmiaudioid + ;; + + esac + +# verify IGPU hfa-gfx injection + igfxhdagfx1=$(ioreg -rxn $gigfx | grep -c "hda-gfx") + +# verify HDEF/HDAU hda-gfx injection + if [ $gigfxhdmihdau = y ]; then + igfxhdagfx2=$(ioreg -rxn HDAU@3 | grep -c "hda-gfx") + else + igfxhdagfx2=$(ioreg -rxn HDEF | grep -c "hda-gfx") + fi + + igfxhdagfx=$(($igfxhdagfx1 + $igfxhdagfx2)) + +# debug ## +# if [ $gDebug = 0 ]; then +# if [ $gDebug = 1 ]; then +# if [ $gDebug = 2 ]; then +# echo "" +# igfxhdagfx=0 +# igfxhdagfx2=0 +# fi + +# debug + if [ $gDebug = 2 ]; then + echo "igfxhdagfx1 = $igfxhdagfx1" + echo "igfxhdagfx2 = $igfxhdagfx2" + igfxhdagfx=$(($igfxhdagfx1 + $igfxhdagfx2)) + echo "igfxhdagfx = $igfxhdagfx" + fi + +# Intel integrated graphics HDMI audio + +# initialize variable + choice1=n + choice2=n + gconnectoredit=n + gssdtinstall=n + + if [ $igfxhdagfx = 2 ]; then # ssdt working + Echo "$gigfxname HDMI audio is enabled, connector edit may be required" + while true + do + read -p "Verify $gigfxname HDMI audio connector/s (y/n): " choice1 + case "$choice1" in + [yY]* ) gconnectoredit=y; break;; + [nN]* ) gconnectoredit=n; break;; + * ) echo "Try again...";; + esac + done + else + Echo "$gigfxname HDMI audio is not enabled" + while true + do + read -p "Install $gigfxssdt HDMI audio ssdt (y/n): " choice2 + case "$choice2" in + [yY]* ) gssdtinstall=y; break;; + [nN]* ) gssdtinstall=n; break;; + * ) echo "Try again...";; + esac + done + fi + + gamdnvidia=n + if [[ $choice1 = n && $choice2 = n ]]; then + gdgfx=1 ## debug 2 + if [ $gdgfx = 0 ]; then + echo "AMD/Nvidia not found" + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi + fi + +# debug + if [ $gDebug = 2 ]; then +# echo "" +# gdgfx=0 +# gamdnvidia=y + echo "gdgfx = $gdgfx" + echo "gamdnvidia = $gamdnvidia" + fi + + if [ $gssdtinstall = y ]; then # install igfx ssdt + gconnectoredit=y + if [ $gDebug = 2 ]; then + echo "if [ gssdtinstall = y ]; then # install ssdt" + echo "gdgfx = $gdgfx" + echo "gamdnvidia = $gamdnvidia" + echo "gssdtinstall = $gssdtinstall" + echo "gconnectoredit = $gconnectoredit" + echo "gigfxrepo = $gigfxrepo" + echo "gigfxfolder = $gigfxfolder" + echo "gigfxzip = $gigfxzip" + echo "gDownloadLink=https://raw.githubusercontent.com/toleda/audio_hdmi_$gigfxrepo/master/$gigfxfolder/$gigfxzip.zip" + fi + +# download igfx ssdt + echo "Download $gigfxssdt ..." + gDownloadLink="https://raw.githubusercontent.com/toleda/audio_hdmi_$gigfxrepo/master/$gigfxfolder/$gigfxzip.zip" + sudo curl -o "/tmp/$gigfxzip.zip" $gDownloadLink + unzip -qu "/tmp/$gigfxzip.zip" -d "/tmp/" + +# exit if error + if [ "$?" != "0" ]; then + echo "Error: Download failure, verify network - igfx ssdt" + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi + +# debug + if [[ $gDebug = 2 && $gigfxhdmihdef = y ]]; then + echo "ghdefrepo = $ghdefrepo" + echo "ghdeffolder = $ghdeffolder" + echo "ghdefzip = $ghdefzip" + echo "gDownloadLink=hthttps://raw.githubusercontent.com/toleda/audio_$ghdefrepo/master/$ghdeffolder/$ghdefzip.zip" + fi + +# download hdef ssdt, HD3000, HD4000, HD515, HD530, HD540, HD630 + if [ $gigfxhdmihdef = y ]; then + echo "Download $ghdefssdt.aml ..." + gDownloadLink="https://raw.githubusercontent.com/toleda/audio_$ghdefrepo/master/$ghdeffolder/$ghdefzip.zip" + sudo curl -o "/tmp/$ghdefzip.zip" $gDownloadLink + unzip -qu "/tmp/$ghdefzip.zip" -d "/tmp/" + fi + +# exit if error + if [ "$?" != "0" ]; then + echo "Error: Download failure, verify network - hdef ssdt" + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi + +# install igfx ssdt to EFI/CLOVER/ACPI/patched (cloverHDMI) + case $gDebug in + + 0 ) + if [ -d "$gCloverDirectory/ACPI/patched/$gigfxssdt" ]; then + sudo rm -R "$gCloverDirectory/ACPI/patched/$gigfxssdt" +# echo "$gCloverDirectory/ACPI/patched/$gigfxssdt deleted" + fi + sudo cp -R "/tmp/$gigfxzip/$gigfxssdt.aml" "$gCloverDirectory/ACPI/patched/" + +# exit if error + if [ "$?" != "0" ]; then + echo Error: ssdt copy failure + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi + + echo "$gCloverDirectory/ACPI/patched/$gigfxssdt installed" + + if [ $gigfxhdmihdef = y ]; then + if [ -d "$gCloverDirectory/ACPI/patched/$ghdefssdt" ]; then + sudo rm -R "$gCloverDirectory/ACPI/patched/$ghdefssdt" +# echo "$gCloverDirectory/ACPI/patched/$ghdefssdt deleted" + fi + sudo cp -R "/tmp/$ghdefzip/$ghdefssdt.aml" "$gCloverDirectory/ACPI/patched/" + +# exit if error + if [ "$?" != "0" ]; then + echo Error: ssdt copy failure + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + echo "$gigfxname HDEF audio ssdt copied to Desktop" + fi + + echo "$gCloverDirectory/ACPI/patched/$ghdefssdt installed" + fi + ;; + + 1|2 ) + sudo cp -R "/tmp/$gigfxzip/$gigfxssdt.aml" "Desktop/$gigfxname-$gigfxssdt.aml" + +# exit if error + if [ "$?" != "0" ]; then + echo Error: ssdt copy failure + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi +# echo "Debug mode" + echo "$gigfxname HDMI audio ssdt copied to Desktop" + + if [ $gigfxhdmihdef = y ]; then + sudo cp -R "/tmp/$ghdefzip/$ghdefssdt.aml" "Desktop/$gigfxname-$ghdefssdt.aml" + +# exit if error + if [ "$?" != "0" ]; then + echo Error: ssdt copy failure + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + echo "$gigfxname HDEF audio ssdt copied to Desktop" + fi +# echo "No system files were changed" + fi + ;; + + esac + +# cleanup /tmp + sudo rm -R /tmp/$gigfxzip.zip + sudo rm -R /tmp/$gigfxzip + # sudo rm -R /tmp/IGPU.txt + # sudo rm -R /tmp/HDEF.txt + sudo rm -R /tmp/__MACOSX + + if [ $gigfxhdmihdef = y ]; then + sudo rm -R /tmp/$ghdefzip.zip + sudo rm -R /tmp/$ghdefzip + fi + +# exit if error + if [ "$?" != "0" ]; then + sudo rm -R "$gCloverDirectory/ACPI/patched/$gigfxssdt" + echo Error: ssdt install failure + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi + + fi # igfx ssdt installed + gssdtinstall=OK + +# verify igfx framebuffers + if [ $gconnectoredit = y ]; then # verify framebuffers + index=$gigfxport5 + indexmax=$((gigfxport5 + gigfxports - 1)) + port=5 + iaudio=0 + + while [ $index -le $indexmax ]; do + +# debug + if [ $gDebug = 2 ]; then + echo "index = $index" + echo "port = $port" + fi + +# look for display(s) + ioreg -rw 0 -p IOService -n AppleIntelFramebuffer@$index > /tmp/IGPU.txt + audioinfo[$port]=$(cat /tmp/IGPU.txt | grep -c "audio-codec-info") + connector[$port]=$(cat /tmp/IGPU.txt | grep connector-type | sed -e 's/.*//') + iaudio=$(($iaudio + ${audioinfo[$port]})) + + +# debug + if [ $gDebug = 2 ]; then + echo "audioinfo = ${audioinfo[$port]}" + echo "connector = ${connector[$port]}" + echo "iaudio = $iaudio" + fi + + index=$((index + 1)) + port=$((port + 1)) + rm -R /tmp/IGPU.txt + done + +# exit if error + if [ "$?" != "0" ]; then + echo "Error: framebuffer analysis failed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi + +# verify hdmi display, max 1 +# initialize variable + gamdnvidia=n + + case $iaudio in + + 0 ) + echo "No display connected to $gigfxname" + gdgfx=1 ## debug 2 + if [ $gdgfx = 0 ]; then + echo "Error: patch not possible" + echo "AMD/Nvidia not found" + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi + ;; + + 1 ) + echo "One display connected, proceeding" + ;; + + 2 ) + if [[ $gigfxgen = 4 || $gigfxgen = 5 || $gigfxgen = 6 || $gigfxgen = 7 ]]; then + echo "Two displays connected, proceeding" + else + echo "Error: more than one display connected to $gigfxname, patch not possible" + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi + ;; + + 3 ) + if [ $gigfxhdmihdau = y ]; then + echo "Error: more than two displays connected to $gigfxname, patch not possible" + else + echo "Error: more than one display connected to $gigfxname, patch not possible" + fi + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + ;; + + * ) + echo Error: display analysis failed + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + ;; + + esac + +# debug + if [ $gDebug = 2 ]; then + echo "gdgfx = $gdgfx" + echo "gamdnvidia = $gamdnvidia" + fi + +# exit if error + if [ "$?" != "0" ]; then + echo Error: display analysis failed + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi + +# debug + if [ $gDebug = 2 ]; then + echo "" + # gigfxname="HD3000" + # gigfxname="HD6200" + fi + +# verify native hdmi connector + ifbnative=0 + +case $gigfxname in + + HD3000|HD4000* ) # native HDMI connector + connector7=${connector[7]} + if [ $connector7 = "00080000" ]; then # native hdmi + echo "Native $gigfxname/port 0x7 is HDMI connector, no patch required" + ifbnative=1 + fi + ;; + + HD6200|HD540* ) # connector detection, 515, 530 removed special case + echo "$gigfxname/$gigfxhdmifb detects and sets HDMI connector, no patch required" + ifbnative=1 + ;; + + esac + +# no fb patch required + if [ $ifbnative = 1 ]; then # native fb + sudo rm -R /tmp/config.plist + rm -R /tmp/HDEF.txt + + else + +# confirm ports to edit + port=5 + +# debug + if [ $gDebug = 2 ]; then + echo "gigfxportmax = $gigfxportmax" + fi + + choice3=n + while [ $port -le $gigfxportmax ]; do +# debug + if [ $gDebug = 2 ]; then + echo "port = $port" + echo "audioinfo = ${audioinfo[$port]}" + echo "connector = ${connector[$port]}" + echo "iaudio = $iaudio" + fi + + if [ ${audioinfo[$port]} != 0 ]; then + while true; do + read -p "Confirm DP to HDMI connector edit on port 0x$port (y/n): " choice3 + case "$choice3" in + [yY]* ) echo "Patch port 0x$port"; gifgxfbedit=y; break;; + [nN]* ) echo "Ignore port 0x$port"; audioinfo[$port]=0; iaudio=$(($iaudio-1)); break;; + * ) echo "Try again...";; + esac + done + +# debug + if [ $gDebug = 2 ]; then + echo "port = $port" + echo "iaudio = $iaudio" + echo "audioinfo = ${audioinfo[$port]}" + echo "connector = ${connector[$port]}" + echo "iaudio = $iaudio" + fi + fi + + port=$(($port + 1)) + done + +# exit if error + if [ "$?" != "0" ]; then + echo "Error: config.plst edit failed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi + + if [ $iaudio = 0 ]; then # no framebuffer edits + echo "No framebuffer edits requested" + rm -R /tmp/config.plist +# rm -R /tmp/HDEF.txt + + else + +# download connector edits + case $gDebug in + + 0|1 ) + echo "Download $gigfxname HDMI audio connector edits ..." + gDownloadLink="https://raw.githubusercontent.com/toleda/audio_cloverHDMI/master/config-audio_cloverHDMI+.plist.zip" + + sudo curl -o "/tmp/config-audio_cloverHDMI+.plist.zip" $gDownloadLink + unzip -qu "/tmp/config-audio_cloverHDMI+.plist.zip" -d "/tmp/" + mv /tmp/config-audio_cloverHDMI+.plist /tmp/config-audio_cloverHDMI.plist + ;; + + 2 ) + echo "gDesktopDirectory = $gDesktopDirectory" + + if [ -f "$gDesktopDirectory/config-audio_cloverHDMI+.plist" ]; then + sudo cp -R "$gDesktopDirectory/config-audio_cloverHDMI+.plist" /tmp/config-audio_cloverHDMI.plist + echo "Desktop/config-audio_cloverHDMI+.plist copied to /tmp/config-audio_cloverHDMI.plist" + else + echo "Error, Desktop/config-audio_cloverHDMI+.plist missing" + exit 1 + fi + ;; + + esac + +# exit if error + if [ "$?" != "0" ]; then + echo "Error: config-audio_cloverHDMI.plist download failed" + echo "Verify Insternel access" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi + +# verify /tmp/config-audio_cloverHDMI.plist + index=0 + sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:${patch[$index]}'" /tmp/config-audio_cloverHDMI.plist -x > "/tmp/ktp.plist" + if [ $(sudo /usr/libexec/PlistBuddy -c "Print '::$index dict'" /tmp/ktp.plist | grep -c "AppleHDAController") = 0 ]; then + echo "Error: config-audio_cloverHDMI.plist patches failed" + echo "Verify Insternel access" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi + +# remove t2- patches (cloverHDMI) + ktpexisting=$(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:'" /tmp/config.plist | grep -c "t2-") + +# debug + if [ $gDebug = 2 ]; then + echo "ktpexisting - t2- = $ktpexisting" + fi + + index=0 + while [ $ktpexisting -ge 1 ]; do + if [ $(sudo /usr/libexec/PlistBuddy -c "Print ':KernelAndKextPatches:KextsToPatch:$index dict'" /tmp/config.plist | grep -c "t2-") = 1 ]; then + sudo /usr/libexec/PlistBuddy -c "Delete ':KernelAndKextPatches:KextsToPatch:$index dict'" /tmp/config.plist + ktpexisting=$((ktpexisting - 1)) + index=$((index - 1)) + fi + index=$((index + 1)) + +# debug + if [ $gDebug = 2 ]; then + echo "index = $index" + echo "ktpexisting = $ktpexisting" + fi + done + +# patch summary +# iaudio=1 # number of connector edits +# audioinfo[5]=1 # audio on port 0x5 +# audioinfo[6]=0 # audio on port 0x5 +# audioinfo[7]=0 # audio on port 0x5 +# connector[5]=00040000 # native port 0x5 connector +# connector[6]=00040000 # native port 0x6 connector +# connector[7]=00040000 # native port 0x7 connector + +# config-audio_cloverHDMI.plist/.../KextsToPatch +# Item 0: 10.9-10.11-HD4600_HDMI_Audio-1of2 Item 0 + Item 1 +# Item 1: 10.9-10.11-HD4600_HDMI_Audio-2of2 +# Item 2: 10.10-10.11-SNB-Port _0x5-DP2HDMI Item 2 + Item 4 +# Item 3: 10.10-10.11-SNB-Port _0x6-DP2HDMI Item 3 + Item 4 +# Item 4: 10.10-10.11-SNB-Port _0x7-DP2HDMI +# Item 5: 10.10-10.11-Capri-Port _0x5-DP2HDMI Item 5 + Item 7 +# Item 6: 10.10-10.11-Capri-Port _0x6-DP2HDMI Item 6 + Item 7 +# Item 7: 10.10-10.11-Capri-Port _0x7-HDMI2DP +# Item 8: 10.10-10.11-Azul-Port_0x5-DP2HDMI +# Item 9: 10.10-10.11-Azul-Port_0x6-DP2HDMI +# Item 10: 10.10-10.11-Azul-Port_0x7-DP2HDMI +# Item 11: 10.10-10.11-BDW010509-Port_0x5-DP2HDM (010509) +# Item 12: 10.10-10.11-BDW010509-Port_0x5-DP2HDM (01050b) +# Item 13: 10.11.4-SKL-1912000-4_displays +# Item 14: 10.11.4-SKL-1912000-Port_0x5-DP2HDM (010509) +# Item 15: 10.11.4-SKL-1912000-Port_0x6-DP2HDM (02040a) +# Item 16: 10.11.4-SKL-1912000-Port_0x7-DP2HDM (03060a) +# Item 17: 10.12.6-KBL-5912000-Port_0x5-DP2HDM (010509) +# Item 18: 10.12.6-KBL-5912000-Port_0x6-DP2HDM (02040a) +# Item 19: 10.12.6-KBL-5912000-Port_0x7-DP2HDM (03060a) + +# debug + if [ $gDebug = 2 ]; then + echo "gigfxhdmicodec = $gigfxhdmicodec" + fi + +# codec patch hd4600 audio controller/credit TimeWalker75a + if [ $gigfxhdmicodec = "0c0c" ]; then + patch=1 + _patchconfig + patch=0 + _patchconfig + fi + +# exit if error + if [ "$?" != "0" ]; then + echo "Error: config.plst/.../hd4600 audio controller edit failed" + echo “Original config.plist restored” + sudo cp -X $gCloverDirectory/config-backup.plist $gCloverDirectory/config.plist + sudo rm -R /tmp/ktp.plist + sudo rm -R /tmp/config.plist + sudo rm -R /tmp/config-audio_cloverHDMI+.plist.zip + sudo rm -R /tmp/config-audio_cloverHDMI.plist + sudo rm -R /tmp/__MACOSX + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi + +# hd515,hd530 4 port edit + if [ $gigfxhdmifb = "00001219" ]; then + patch=13 + _patchconfig + fi + +# exit if error + if [ "$?" != "0" ]; then + echo "Error: config.plst/.../4 port edit failed" + echo “Original config.plist restored” + sudo cp -X $gCloverDirectory/config-backup.plist $gCloverDirectory/config.plist + sudo rm -R /tmp/ktp.plist + sudo rm -R /tmp/config.plist + sudo rm -R /tmp/config-audio_cloverHDMI+.plist.zip + sudo rm -R /tmp/config-audio_cloverHDMI.plist + sudo rm -R /tmp/__MACOSX + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi + +# patch framebuffer + case $gigfxgen in + + 2|3 ) + if [ ${audioinfo[5]} = 1 ]; then + patch[0]=$gigfxindex + fi + if [ ${audioinfo[6]} = 1 ]; then + patch[0]=$(($gigfxindex+1)) + fi + patch[1]=$(($gigfxindex+2)) + ;; + + 4|5|6|7 ) + + index=0 + port=5 + +# debug + if [ $gDebug = 2 ]; then + echo "gigfxportmax = $gigfxportmax" + fi + +# add frameuffer patch to config.plist + while [ $port -le $gigfxportmax ]; do + if [ ${audioinfo[$port]} != 0 ]; then + index=$(($index + 1)) + patch=$(($gigfxindex + $port - 5)) + _patchconfig + fi + port=$(($port + 1)) + done + ;; + + * ) + echo "Intel HD Graphics Gen $gigfxgen is not supported" + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + ;; + + esac + +# exit if error + if [ "$?" != "0" ]; then + echo "Error: config.plst/.../framebuffer edit failed" + echo “Original config.plist restored” + sudo cp -X $gCloverDirectory/config-backup.plist $gCloverDirectory/config.plist + sudo rm -R /tmp/ktp.plist + sudo rm -R /tmp/config.plist + sudo rm -R /tmp/config-audio_cloverHDMI+.plist.zip + sudo rm -R /tmp/config-audio_cloverHDMI.plist + sudo rm -R /tmp/__MACOSX + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi + +# install updated config.plst + case $gDebug in + + 0 ) + sudo cp -R "/tmp/config.plist" "$gCloverDirectory/config.plist" + echo "HDMI audio edited $gCloverDirectory/config.plist installed" + ;; + + 1|2 ) + if [ -f "Desktop/$gigfxname-config.plist" ]; then + sudo rm -R "Desktop/$gigfxname-config.plist" + fi + sudo cp -R "/tmp/config.plist" "Desktop/$gigfxname-config.plist" + echo "$gigfxname HDMI audio edited config.plist copied to Desktop" + ;; + + esac + +# cleanup /tmp + sudo rm -R /tmp/config.plist + sudo rm -R /tmp/ktp.plist +# sudo rm -R /tmp/config-audio_cloverHDMI+.plist.zip + sudo rm -R /tmp/config-audio_cloverHDMI.plist +# sudo rm -R /tmp/__MACOSX + + + fi # no framebuffer edits + + fi # verify framebuffers + fi # a fb +fi # IGFX not supported +fi # no IGFX + +# debug +if [ $gDebug = 2 ]; then + echo "AMD/Nvidia discrete graphics HDMI audio" + echo "gigfx = $gigfx" + echo "gdgfx = $gdgfx" +fi + +# AMD/Nvidia discrete graphics HDMI audio + +if [ $gigfxnuc = 0 ]; then # AMD/Nvidia else nuc + +while true +do + read -p "Install AMD/Nvidia HDMI audio (y/n): " choice8 + case "$choice8" in + [yY]* ) gdgfxhdmi=y; break;; + [nN]* ) gdgfxhdmi=n; break;; + * ) echo "Try again...";; + esac +done + +if [ $gdgfxhdmi = y ]; then # AMD/Nvidia HDMI audio + +# get acpi pcie device name + numname1=14 + gdgfxname1[1]=PEG0@1 + gdgfxname1[2]=PEG1@1 + gdgfxname1[3]=PEGP@1 + gdgfxname1[4]=P0P1@1 + gdgfxname1[5]=P0P2@1 + gdgfxname1[6]=P0P2@3 + gdgfxname1[7]=NPE3@2 + gdgfxname1[8]=NPE3@3 + gdgfxname1[9]=NPE7@3 + gdgfxname1[10]=pci-bridge@1 + gdgfxname1[11]=pci-bridge@3 + gdgfxname1[12]=BR3A@3 + gdgfxname1[13]=PC02@3 + gdgfxname1[14]=PC12@3 + + index=1 + while [ $index -le $numname1 ]; do + dgfxpciname=$(ioreg -rxn ${gdgfxname1[$index]} | grep vendor-id| awk '{ print $4 }') + +# debug + if [ $gDebug = 2 ]; then + echo "gdgfxname1 = ${gdgfxname1[$index]}" + fi + + if [ -n "${dgfxpciname}" ]; then + dgfxindex1=$index + index=$(($numname1 + 1)) + +# debug + if [ $gDebug = 2 ]; then + echo "dgfxindex1 = $dgfxindex1" + fi + + fi + + index=$(($index + 1)) + done + + gdgfxpciname1=${gdgfxname1[$dgfxindex1]} + +# debug + if [ $gDebug = 2 ]; then + echo "gdgfxpciname1 = ${gdgfxname1[$dgfxindex1]}" + echo "gdgfxpciname1 = $gdgfxpciname1" + fi + + if [ $gdgfxpciname1 = 0 ]; then + echo "Error: discrete graphics card not found, unknown acpi PCI0 name" + echo "Names checked: ${gdgfxname1[@]}" + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi + +# get acpi graphics device name + numname2=8 + gdgfxname2[1]=PEGP@0 + gdgfxname2[2]=GFX0@0 + gdgfxname2[3]="display@0" + gdgfxname2[4]="pci-display@0" + gdgfxname2[5]=GFX1@0 + gdgfxname2[6]=H000@0 + gdgfxname2[7]=pci10de + gdgfxname2[8]=pci1002 + +#find discrete graphics vendor-id + index=1 + while [ $index -le $numname2 ]; + do + dgfxvendorid=$(ioreg -rxn ${gdgfxname2[$index]} | grep vendor-id| awk '{ print $4 }') + dgfxdeviceid=$(ioreg -rxn ${gdgfxname2[$index]} | grep device-id| awk '{ print $4 }') + + if [ $gDebug = 2 ]; then + echo "gdgfxname2 = ${gdgfxname2[$index]}" + fi + + if [ -n "${dgfxvendorid}" ]; then + gdgfxpciname2=${gdgfxname2[$index]} + + index0=1 + for vendor in $dgfxvendorid + do + +# debug + if [ $gDebug = 2 ]; then + echo "index0 = $index, vendor-id = ${vendor:1:4}" + fi + +# sort discrete graphics vendors and devices + case ${vendor:1:4} in + + 0210 ) gdgfxvendorid=${vendor:1:4} + gdgfxname=AMD + ;; + + de10 ) gdgfxvendorid=${vendor:1:4} + gdgfxname=Nvidia + ;; + esac + index0=$((index0 + 1)) + done + +# find discrete graphics device-id + index0=1 + for device in $dgfxdeviceid + do + +# debug + if [ $gDebug = 2 ]; then + echo "index0 = $index, device-id = ${device:1:4}" + fi + + gdgfxdeviceid=${device:1:4} + + index0=$((index0 + 1)) + done + fi + + index=$(($index + 1)) + done + +# dgfx found + gdgfxvendorid=${gdgfxvendorid:2:2}${gdgfxvendorid:0:2} + gdgfxdeviceid=${gdgfxdeviceid:2:2}${gdgfxdeviceid:0:2} + +# debug ## +# if [ $gDebug = 0 ]; then +# if [ $gDebug = 1 ]; then +# if [ $gDebug = 2 ]; then +# echo "gdgfxpciname1 = $gdgfxpciname1" +# echo "gdgfxpciname2 = $gdgfxpciname2" +# echo "gdgfxvendorid = ${gdgfxvendorid}" +# echo "gdgfxdeviceid = ${gdgfxdeviceid}" +# gdgfxpciname1=BR3A@3 +# gdgfxpciname2=H060@0 +# echo "gdgfxvendorid = ${gdgfxvendorid}" +# echo "gdgfxdeviceid = ${gdgfxdeviceid}" +# gdgfxvendorid="" +# fi + + + if [ $gdgfxpciname1 = "BR3A@3" ]; then + if [[ $gdgfxpciname1 = "BR3A@3" && $gdgfxpciname2 = "H000@0" ]]; then + echo "X99 HDMI audio supported" + else + +# debug + if [ $gDebug = 2 ]; then + echo "gdgfxpciname1 = $gdgfxpciname1" + echo "gdgfxpciname2 = $gdgfxpciname2" + echo + fi + + gdgfxpciname2="Hxx0@0" + echo "NOTE:ACPI graphics name unknown, H000 installed" + echo "Verify IOReg/BR3A/graphics name, i.e., Hxx0@0 and Hxx1@0,1" + echo "Before restarting, edt EFI/CLOVER/ACPI/patched/SSDT-HDMI-...-$gdgfxpciname1" + echo "MaciASL/Edit/Find: H000/Replace: Hxx0" + echo "MaciASL/Edit/Find: H001/Replace: Hxx1" + echo "Compile/Save/Restart" + echo "More information, see Desktop/[Guide] macOS hdmi audio x99 ssdt" + + while true + do + read -p "AMD(a)/Nvidia(n) graphics (a/n): " choice6 + case "$choice6" in + [aA]* ) gdgfxname="AMD"; break;; + [nN]* ) gdgfxname="Nvidia"; break;; + * ) echo "Try again...";; + esac + done + + fi + fi + + if [ -z "${gdgfxvendorid}" ]; then + if [ $gdgfxpciname1 = "BR3A@3" ]; then + if [ $gDebug = 2 ]; then + echo "gdgfxpciname1 = $gdgfxpciname1" + echo "gdgfxvendorid = $gdgfxvendorid" + fi + + else + if [ $gdgfx != 0 ]; then + echo "AMD/Nvidia HDMI codec found" + fi + echo "AMD/Nvidia graphics not found, unknown acpi PCI0/graphics name" + echo "Names checked: ${gdgfxname2[@]}" + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit + fi + fi + + if [ $gdgfxpciname2 = "Hxx0@0" ]; then + dgfxhdagfx=0 + + else + echo "$gdgfxname discrete graphics card $gdgfxvendorid$gdgfxdeviceid found on $gdgfxpciname1/$gdgfxpciname2" + +# verify GFX0 hfa-gfx injection + dgfxhdagfx1=$(ioreg -rxn $gdgfxpciname2 | grep -c "hda-gfx") + +# verify HDAU hda-gfx injection + dgfxhdagfx2=$(ioreg -rxn HDAU@0,1 | grep -c "hda-gfx") + + dgfxhdagfx=$(($dgfxhdagfx1 + $dgfxhdagfx2)) + +# debug + if [ $gDebug = 2 ]; then + echo "dgfxhdagfx1 = $dgfxhdagfx1" + echo "dgfxhdagfx2 = $dgfxhdagfx2" + dgfxhdagfx=$(($dgfxhdagfx1 + $dgfxhdagfx2)) + echo "dgfxhdagfx = $dgfxhdagfx" + fi + + fi + +# debug ## +# if [ $gDebug = 0 ]; then +# if [ $gDebug = 1 ]; then +# if [ $gDebug = 2 ]; then +# echo "" +# dgfxhdagfx=0 +# fi + +# dgfx hdmi audio enabled? + choice1=n + if [ $dgfxhdagfx = 2 ]; then # ssdt working + echo "$gdgfxname HDMI audio is enabled" + if [ $gdgfxname = "AMD" ]; then + echo "Frambuffer injection and connector patching may also be required" + echo "Note: AMD kext edits are not available with this script" + fi + echo "Script exits when another HDMI audio method is installed" + echo "Remove existing HDMI audio method, restart, run cloverHDMI" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 0 + else + Echo "$gdgfxname HDMI audio is not enabled" + while true + do + read -p "Install $gdgfxname HDMI audio ssdt (y/n): " choice1 + case "$choice1" in + [yY]* ) gssdtinstall=y; break;; + [nN]* ) echo "No system files were changed"; exit;; + * ) echo "Try again...";; + esac + done + fi + + if [ $gdgfxpciname1 = "pci-bridge@1" ]; then + +# debug + if [ $gDebug = 2 ]; then + echo "gdgfxpciname1 = $gdgfxpciname1" + echo + fi + gdgfxpciname1="PEGP@1" + fi + + if [ $gdgfxpciname1 = "pci-bridge@3" ]; then + +# debug + if [ $gDebug = 2 ]; then + echo "gdgfxpciname1 = $gdgfxpciname1" + echo + fi + gdgfxpciname1="PEGP@3" + fi + +# debug + if [ $gDebug = 2 ]; then + echo "gdgfxpciname1 = $gdgfxpciname1" + echo + fi + +# ssdt repo, folder, file + case $gdgfxname in + + AMD* ) + gdgfxrepo=amd-nvidia + gdgfxfolder=ssdt_hdmi-amd + gdgfxzip=ssdt_hdmi-amd-default- + gdgfxssdt=SSDT-HDMI-AMD- + ;; + + Nvidia* ) + gdgfxrepo=amd-nvidia + gdgfxfolder=ssdt_hdmi-nvidia + gdgfxzip=ssdt_hdmi-nvidia- + gdgfxssdt=SSDT-HDMI-NVIDIA- + ;; + + esac + + if [ ${gdgfxpciname1:0:4} = "PEGP" ];then + gdgfxpciname1=${gdgfxpciname1:0:6} + else + gdgfxpciname1=${gdgfxpciname1:0:4} + fi + + if [ $gdgfxpciname1 = "GFX1" ];then + gdgfxpciname1="GFX0" + echo "NOTE :GFX1 is not available, GFX0 installed" + echo "Before restarting. edt EFI/CLOVER/ACPI/patched/$gdgfxzip$gdgfxpciname1" + echo "MaciASL/Edit/Find: GFX0/Replace: GFX1/Compile/Save/Restart" + fi + +# debug + if [ $gDebug = 2 ]; then + echo "gdgfxrepo = $gdgfxrepo" + echo "gdgfxfolder = $gdgfxfolder" + echo "gdgfxzip = $gdgfxzip" + echo "gDownloadLink=https://raw.githubusercontent.com/toleda/audio_hdmi_$gdgfxrepo/master/$gdgfxfolder/$gdgfxzip$gdgfxpciname1.zip" + fi + +# download ssdt + echo "Download $gdgfxssdt$gdgfxpciname1 ..." + gDownloadLink="https://raw.githubusercontent.com/toleda/audio_hdmi_$gdgfxrepo/master/$gdgfxfolder/$gdgfxzip$gdgfxpciname1.zip" + +# debug + if [ $gDebug = 2 ]; then + echo "sudo curl -o /tmp/$gdgfxzip$gdgfxpciname1.zip $gDownloadLink" + echo + fi + + sudo curl -o "/tmp/$gdgfxzip$gdgfxpciname1.zip" $gDownloadLink + unzip -qu "/tmp/$gdgfxzip$gdgfxpciname1.zip" -d "/tmp/" + +# exit if error + if [ "$?" != "0" ]; then + echo "Error: Download failure, verify network". + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 + fi + +# install dgfx ssdt to EFI/CLOVER/ACPI/patched (cloverHDMI) + + case $gDebug in + + 0 ) + if [ -d "$gCloverDirectory/ACPI/patched/$gdgfxssdt$gdgfxpciname1.aml" ]; then + sudo rm -R "$gCloverDirectory/ACPI/patched/$gdgfxssdt$gdgfxpciname1.aml" + # echo "$gCloverDirectoryACPI/patched/$gdgfxssdt$gdgfxpciname1.aml deleted" + fi + sudo cp -R "/tmp/$gdgfxzip$gdgfxpciname1/$gdgfxssdt$gdgfxpciname1.aml" "$gCloverDirectory/ACPI/patched/$gdgfxssdt$gdgfxpciname1.aml" + echo "$gCloverDirectory/ACPI/patched/$gdgfxssdt$gdgfxpciname1.aml installed" + if [ $gdgfxpciname2 = "Hxx0@0" ]; then + cp -R /tmp/$gdgfxzip$gdgfxpciname1/'[Guide] macOS hdmi audio x99 ssdt.pdf' Desktop/'[Guide] macOS hdmi audio x99 ssdt' + fi + ;; + + 1|2 ) + sudo cp -R "/tmp/$gdgfxzip$gdgfxpciname1/$gdgfxssdt$gdgfxpciname1.aml" "Desktop/$gdgfxname-$gdgfxssdt$gdgfxpciname1.aml" + echo "$gdgfxname HDMI audio ssdt copied to Desktop" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + if [ $gdgfxpciname2 = "Hxx0@0" ]; then + cp -R /tmp/$gdgfxzip$gdgfxpciname1/'[Guide] macOS hdmi audio x99 ssdt.pdf' Desktop/'[Guide] macOS hdmi audio x99 ssdt' + fi + echo "No system files were changed" +# cleanup /tmp + sudo rm -R /tmp/$gdgfxzip$gdgfxpciname1.zip + sudo rm -R /tmp/$gdgfxzip$gdgfxpciname1 + # rm -R /tmp/config.plist + rm -R /tmp/__MACOSX + # rm -R /tmp/HDEF.txt + # rm -R /tmp/IGPU.txt + exit 0 + ;; + + esac + +# cleanup /tmp + sudo rm -R /tmp/$gdgfxzip$gdgfxpciname1.zip + sudo rm -R /tmp/$gdgfxzip$gdgfxpciname1 + sudo rm -R /tmp/__MACOSX + +fi # AMD/Nvidia HDMI audio +fi # AMD/Nvidia + +# exit if error +if [ "$?" != "0" ]; then + sudo rm -R "$gCloverDirectory/ACPI/patched/$gigfxssdt" + echo Error: ssdt install failure + echo "No system files were changed" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + exit 1 +fi + +case $gDebug in + 0 ) + echo "" + echo "Install finished, restart required." + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + ;; + + 1|2 ) + echo "" + echo "To install HDMI audio, set gDebug=0, save, run cloverHDMI" + echo "To save a Copy of this Terminal session: Terminal/Shell/Export Text As ..." + ;; + +esac + +exit 0