Jump to content

AppleALC — dynamic AppleHDA patching


vit9696
5,371 posts in this topic

Recommended Posts

Audio always worked here with all methods I tried :D

I mean that you should not touch AppleHDA.kext if possible.

Ok, you have /System/Library/Origin/AppleHDA.kext with correct permissions.... but should be in /System/library/Extensions/ only (with correct permissions) otherwise will never be loaded, not by OSX .. not by any known bootloaders. When in the correct place with permissions repaired, you have to rebuild the cache so if you boot with the prelinkedkernel AppleHDA will be loaded (not otherwise).

Link to comment
Share on other sites

Audio always worked here with all methods I tried :D

I mean that you should not touch AppleHDA.kext if possible.

Ok, you have /System/Library/Origin/AppleHDA.kext with correct permissions.... but should be in /System/library/Extensions/ only (with correct permissions) otherwise will never be loaded, not by OSX .. not by any known bootloaders. When in the correct place with permissions repaired, you have to rebuild the cache so if you boot with the prelinkedkernel AppleHDA will be loaded (not otherwise).

I know this. I'm just saying that I got the original one and if you got some new methods I'd be willing to try them (in a single reboot).

Link to comment
Share on other sites

Ok. 

Looking better at your ioreg I can now see that AppleALC is loaded, so you have to use only one method. With more than one method (as you demostrated here:             #370            ) I'm sure that will not work and no one can help you, sorry (is not possible :( ).

"more than one method"? 2.ioreg is ALC with original HDA. 3.ioreg is patched HDA without ALC.

Are you saying that my laptop could only use VoodooHDA?

Link to comment
Share on other sites

normally AppleHDA print all the ids in ioreg (IOHDACodecDevice) even if not working (as in a fresh installation), so it comes to mind that you have not vanilla files, but if not as is, you have some problems. Then I Can't say witch... BTW once I see this section empty with bad bios settings

Link to comment
Share on other sites

2. A aDummyHDA.kext usable with Clover (need KextsToPatch to works for unsupported codecs).This leave AppleHDA.kext totally untouched!

Comes the doubt. And Mirone said use a "botched AppleHDA".

I didn't add KextsToPatch, and still not working.

 

you are connecting your notebook to
an external monitor?
I suggest you do a new installation,

confirms that you have no AppleHDADisabler installed.

Link to comment
Share on other sites

Why reinstalling? This is not Windows))) kextstat in terminal would be enough to see if AppleHDADisabler exists... Ioreg also shows AppleHDADisabler. My opinion he have to try inject HDA properties through custom DSDT. 

@I2dy: Can u give your clean ACPI Tables (F4 in Clover GUI) from EFI/Clover/ACPI/Origin (I need whole folder Origin) .

  • Like 1
Link to comment
Share on other sites

 

you are connecting your notebook to
an external monitor?
I suggest you do a new installation,

confirms that you have no AppleHDADisabler installed.

 

Yes, I'm using an external monitor. I did a new installation yesterday and didn't install VoodooHDA or any Disabler since.

Why reinstalling? This is not Windows))) kextstat in terminal would be enough to see if AppleHDADisabler exists... Ioreg also shows AppleHDADisabler. My opinion he have to try inject HDA properties through custom DSDT. 

@I2dy: Can u give your clean ACPI Tables (F4 in Clover GUI) from EFI/Clover/ACPI/Origin (I need whole folder Origin) .

aml files in OEM folder. These are from Linux.

Link to comment
Share on other sites

Hi Mate,

 

I checked your DSDT and patched it for:

- Onboard Audio with Layout-ID 3 (hopefully)

- HDMI Audio

- Battery Management (use ACPIBatteryManager.kext)

- Inject LAN and WIFI

- Prepare USB for ElCapitan

- Add DTGP-Function

and some small stuff more...

 

This means you should not use any DSDT-Patches in Clover, since all the necessary stuff should be in the DSDT.aml file

DSDT.aml.zip

Link to comment
Share on other sites

Hi Mate,

 

I checked your DSDT and patched it for:

- Onboard Audio with Layout-ID 3 (hopefully)

- HDMI Audio

- Battery Management (use ACPIBatteryManager.kext)

- Inject LAN and WIFI

- Prepare USB for ElCapitan

- Add DTGP-Function

and some small stuff more...

 

This means you should not use any DSDT-Patches in Clover, since all the necessary stuff should be in the DSDT.aml file

I got this ioreg only once. Haven't got it since a reboot after it. Didn't change ACPI/patched directory or config.plist, tried to rebuild kernel cache. I have no idea why it worked and stopped working...

May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) init @ boot arguments disabled 0, debug 1
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) init @ initialising AppleALC with policy mode
May  8 12:31:29 localhost kernel[0]: calling mpo_policy_init for AppleALC
May  8 12:31:29 localhost kernel[0]: Security policy loaded: AppleALC Kernel Module (AppleALC)
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) init @ policy hit
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) init @ initialising enabler
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ MachInfo asKernel 1 object constructed
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ Address of interrupt 80 stub is 0x<ptr>
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ Found kernel mach-o header address at <ptr>
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ Found executable at path: /System/Library/Kernels/kernel
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ header processing found TEXT
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ header processing found LINKEDIT
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ header processing found SYMTAB
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ Address of interrupt 80 stub is 0x<ptr>
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ Found kernel mach-o header address at <ptr>
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ aslr/load slide is 0x10000000
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ MachInfo asKernel 0 object constructed
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ Found executable at path: /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAController.kext/Contents/MacOS/AppleHDAController
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ header processing found TEXT
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ header processing found LINKEDIT
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ header processing found SYMTAB
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) patcher @ loaded kinfo com.apple.driver.AppleHDAController at 1u index
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ Found symbol _OSKextLoadedKextSummariesUpdated at 0x<ptr> (non-aslr 0x<ptr>)
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) patcher @ _OSKextLoadedKextSummariesUpdated address <ptr> value 2E66C35DE5894855
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ Found symbol _gLoadedKextSummaries at 0x<ptr> (non-aslr 0x<ptr>)
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) patcher @ _gLoadedKextSummaries address <ptr>
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) patcher @ diff <ptr> argument 81D7177B
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ MachInfo asKernel 0 object constructed
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ Found executable at path: /System/Library/Extensions/AppleIntelFramebufferAzul.kext/Contents/MacOS/AppleIntelFramebufferAzul
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ header processing found TEXT
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ header processing found LINKEDIT
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ header processing found SYMTAB
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) patcher @ loaded kinfo com.apple.driver.AppleIntelFramebufferAzul at 2u index
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ MachInfo asKernel 0 object constructed
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ Found executable at path: /System/Library/Extensions/AppleHDA.kext/Contents/MacOS/AppleHDA
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ header processing found TEXT
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ header processing found LINKEDIT
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ header processing found SYMTAB
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) patcher @ loaded kinfo com.apple.driver.AppleHDA at 3u index
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ MachInfo asKernel 0 object constructed
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ Found executable at path: /System/Library/Extensions/AppleIntelFramebufferCapri.kext/Contents/MacOS/AppleIntelFramebufferCapri
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ header processing found TEXT
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ header processing found LINKEDIT
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) mach @ header processing found SYMTAB
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) patcher @ loaded kinfo com.apple.driver.AppleIntelFramebufferCapri at 4u index
May  8 12:31:29 localhost kernel[0]: AppleALC: (DEBUG) init @ policy hit
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) patcher @ invoked at kext loading/unloading
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) patcher @ last kext is <ptr> and its name is com.apple.iokit.IOAcceleratorFamily2
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) patcher @ invoked at kext loading/unloading
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) patcher @ last kext is <ptr> and its name is com.apple.AppleGraphicsDeviceControl
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) patcher @ invoked at kext loading/unloading
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) patcher @ last kext is <ptr> and its name is com.apple.driver.AppleIntelFramebufferAzul
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) patcher @ caught the right kext at <ptr>, invoking handler
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) mach @ aslr/load slide is 0x<ptr>
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) ioutil @ failed to find IGPU
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) ioutil @ failed to find HDAU
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) util @ getOSData vendor-id has 8086 value
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) util @ getOSData device-id has 8C20 value
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) util @ getOSData revision-id has 5 value
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) util @ getOSData layout-id was not found
May  8 12:31:33 localhost kernel[0]: AppleALC: alc @ layout-id was not provided by controller at HDEF
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) patcher @ invoked at kext loading/unloading
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) patcher @ last kext is <ptr> and its name is com.apple.iokit.IONDRVSupport
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) patcher @ invoked at kext loading/unloading
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) patcher @ last kext is <ptr> and its name is com.apple.vecLib.kext
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) patcher @ invoked at kext loading/unloading
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) patcher @ last kext is <ptr> and its name is com.apple.iokit.IOAudioFamily
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) patcher @ invoked at kext loading/unloading
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) patcher @ last kext is <ptr> and its name is com.apple.iokit.IOHDAFamily
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) patcher @ invoked at kext loading/unloading
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) patcher @ last kext is <ptr> and its name is com.apple.driver.AppleHDAController
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) patcher @ caught the right kext at <ptr>, invoking handler
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) mach @ aslr/load slide is 0x<ptr>
May  8 12:31:33 localhost kernel[0]: AppleALC: (DEBUG) alc @ failed to find a suitable codec, we have nothing to do

Edited by l2dy
Link to comment
Share on other sites

Where did you put the AppleALC.kext?

/EFI/CLOVER/kexts/"YourOSXVersion" or /System/Library/Extensions?

 

If in Clover, what is written in the "SystemParameters"-key of you config.plist?

<key>InjectKexts</key>
<string>Detect</string>

or 

<key>InjectKexts</key>
<string>Yes</string>
  • Like 1
Link to comment
Share on other sites

 

Where did you put the AppleALC.kext?

/EFI/CLOVER/kexts/"YourOSXVersion" or /System/Library/Extensions?

 

If in Clover, what is written in the "SystemParameters"-key of you config.plist?

<key>InjectKexts</key>
<string>Detect</string>

or 

<key>InjectKexts</key>
<string>Yes</string>

 

In /Volumes/EFI/EFI/CLOVER/kexts/Other. In config.plist, it is

        <dict>
                <key>InjectKexts</key>
                <string>Detect</string>
        </dict>
Link to comment
Share on other sites

First, DSDT patches aren't working for me as log says "kernel[0]: AppleALC: (DEBUG) util @ getOSData layout-id was not found".

 

Second, I think I've found one of the problems. In "AppleALC/kern_resources.cpp", the last few lines got an array of ControllerModInfo. And there isn't one for my laptop.

00:1b.0 Audio device [0403]: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller [8086:8c20] (rev 05)
5/8/16 5:18:13.000 PM kernel[0]: AppleALC: (DEBUG) util @ getOSData vendor-id has 8086 value
5/8/16 5:18:13.000 PM kernel[0]: AppleALC: (DEBUG) util @ getOSData device-id has 8C20 value
5/8/16 5:18:13.000 PM kernel[0]: AppleALC: (DEBUG) util @ getOSData revision-id has 5 value
5/8/16 5:18:13.000 PM kernel[0]: AppleALC: (DEBUG) util @ getOSData layout-id has 3 value
5/8/16 5:18:13.000 PM kernel[0]: AppleALC: (DEBUG) util @ getOSData AAPL,ig-platform-id was not found
5/8/16 5:18:13.000 PM kernel[0]: AppleALC: (DEBUG) alc @ found 1u audio controllers
5/8/16 5:18:13.000 PM kernel[0]: AppleALC: (DEBUG) alc @ validating 0u controller 8086:8C20:5
5/8/16 5:18:13.000 PM kernel[0]: AppleALC: (DEBUG) alc @ comparing to 0u mod 8086:8CA0
5/8/16 5:18:13.000 PM kernel[0]: AppleALC: (DEBUG) alc @ comparing to 1u mod 8086:C0C
5/8/16 5:18:13.000 PM kernel[0]: AppleALC: (DEBUG) alc @ comparing to 2u mod 8086:8D20
5/8/16 5:18:13.000 PM kernel[0]: AppleALC: (DEBUG) alc @ comparing to 3u mod 8086:412
5/8/16 5:18:13.000 PM kernel[0]: AppleALC: (DEBUG) alc @ comparing to 4u mod 8086:166
5/8/16 5:18:13.000 PM kernel[0]: AppleALC: (DEBUG) alc @ comparing to 5u mod 8086:166
5/8/16 5:18:13.000 PM kernel[0]: AppleALC: (DEBUG) alc @ comparing to 6u mod 8086:166
5/8/16 5:18:13.000 PM kernel[0]: AppleALC: (DEBUG) alc @ missing ControllerModInfo for 0u controller

ControllerModInfo controllerMod[] {
	{ "Z97 HDEF controller", 0x8086, 0x8CA0, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches52, 1 },
	{ "HD4600 controller", 0x8086, 0xC0C, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches53, 5 },
	{ "X99 HDEF controller", 0x8086, 0x8D20, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches54, 1 },
	{ "Intel HD4600 HDMI (ig-platform-id 0x0d220003)", 0x8086, 0x412, nullptr, 0, 220332035, IOUtil::ComputerModel::ComputerDesktop, patches55, 1 },
	{ "Intel HD4000 HDMI (ig-platform-id 0x01660003)", 0x8086, 0x166, nullptr, 0, 23461891, IOUtil::ComputerModel::ComputerLaptop, patches56, 1 },
	{ "Intel HD4000 HDMI (ig-platform-id 0x01660009)", 0x8086, 0x166, nullptr, 0, 23461897, IOUtil::ComputerModel::ComputerLaptop, patches57, 1 },
	{ "Intel HD4000 HDMI (ig-platform-id 0x0166000A) Desktop only", 0x8086, 0x166, nullptr, 0, 23461898, IOUtil::ComputerModel::ComputerDesktop, patches58, 1 },
};
Edited by l2dy
Link to comment
Share on other sites

I see...

Somehow I injected the HD4600 for Desktops not for Laptops...

 

I corrected this in attached DSDT... Sorry... :)

5/9/16 7:09:09.000 AM kernel[0]: AppleALC: (DEBUG) util @ getOSData layout-id was not found
5/9/16 7:09:09.000 AM kernel[0]: AppleALC: alc @ layout-id was not provided by controller at HDEF

This is why I wanted to use Clover to do layout-id injection. I'm sticking to Clover on this now.

 

Also, since no ControllerMod for my laptop (0x8086, 0x8C20) exists, I think AppleALC's code needs to be changed before I can continue trying it.

Link to comment
Share on other sites

Do not attempt to explain things you do not understand. Controller mods may not exist if no modifications are meant to be done for a certain controller.

Okay, I got it, the message "missing ControllerModInfo for 0u controller" is harmless. I reinstalled the system, don't have DSDT.aml in ACPI/patched, have DropOEM_DSM/HDA set to true, Audio/Inject set to 3, log tells me so too and so on. But I'm still getting "failed to find a suitable codec, we have nothing to do" for the Conexant CX20757, what to do now?

Link to comment
Share on other sites

So the message "missing ControllerModInfo for 0u controller" is harmless?

Correct

I reinstalled the system, don't have DSDT.aml in ACPI/patched, have DropOEM_DSM/HDA set to true, Audio/Inject set to 3, log tells me so too. What to do now?

Well, I guess you should now choose/write/create the necessary resources for your codec?

You could paste the log here just in case something indeed went wrong.

Link to comment
Share on other sites

Hi vit9696 and Insanely Crew,

 

What an amazing project ! Bravo !

 

I have a Gigabyte GA-Z170X Gaming7 MB. with a Creative Labs SC inside: CA0132.  I'm using a patched AppleHDA,kext ( with layout-ID = 1 ) that's working like a charm.

 

I need to run the patch on the fly from Clover to get an Apple Update proof driver.

 

I have attached the needed files I know about from the AppleALC Wiki. ( and the patched AppleHDA)

 

Just tell me if there is something missing, I'll add it.

 

Can you help me to make my ca0132 working ?

 

Thanks alot guys

 

Resources.zip

AppleHDA.kext.zip

Link to comment
Share on other sites

Hi, yassinex. Thanks for your kind words. Creative audio and many other codecs would be nice to have supported.

———

Unfortunately audio edits are not my specialty, and I am mostly working on other projects at the moment. I do have time to merge a pull-request and I likely will deal with AppleALC bugs, but I may not dig into users' resources, sorry.

Fortunately there are enthusiasts who maintain AppleALC, all from applelife ;p, in particular vandroiy2012 who answers in the topic. If you beg him he might help in case he has free time. Otherwise you could read the wiki in more detail and get your data work after trial and error.

 

This is addressed to all those who need help.

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...