Contribute
Register

[solved] Patched AppleHDA maxing out CPU utilization

Status
Not open for further replies.
Joined
Jun 14, 2013
Messages
120
Motherboard
Asus Z97-M Plus
CPU
i7-4790K
Graphics
GTX960
Mac
  1. MacBook Pro
Mobile Phone
  1. iOS
--UPDATE--

This problem was solved for those who want the solution this disrupt guy managed to write a very simple step by step, the problem comes down simply to a conflict in the driver with the combo headphone jack, the solution is to remove the line in entry from the path maps therefore resolving the issue.

I've had similar issue on a Acer E5-575-51GG laptop too, and solved using the same method. The codec is also ALC255.

I'll write down the detailed steps below, in case someone got to this thread via Google search too:
  1. Run AppleHDA Patcher & follow instructions. I used Clover with aDummyHDA.kext + KextsToPatch + DSDT patching. After reboot, audio kind of works, but the headphone outputs distorted sound, and kernel_task is consuming very high CPU and RAM
  2. Install CodedCommander.kext. It seems to alleviate the issue a bit but kernel_task is still running wild
  3. Edit layout3.zlib (decompress with https://github.com/RehabMan/Intel-NUC-DSDT-Patch/blob/master/tools/zlib, or https://github.com/Mirone/Zlib) inside aDummyHDA.kext and remove "LineIn" under PathMapRef.Inputs, and the entire "LineIn" entry under PathMapRef. Then everything worked as expected after a reboot

----------

Hello everybody, hope ya'll having a great day.

So I have my hack going very well so far, got almost everything working great, GPU, brightness, trackpad, keyboard, battery etc..

now I'm struggling with Audio, I patched my AppleHDA with AppleHDA Patcher 1.6, my audio codec is ALC255, I installed the patched kext, injected the audio ID 3 inside clover, patched IRQ andHDEF on my DSDT and boom, audio working, but there is a problem. my cpu gets to 100% utilization by "Kernel task" all the time, making my system very slow and toasty.
Also whenever I plug a headphone in, the system detects it, but it only outputs noise to it and no sound, don't know if this is related to the issue.

at first I thought it was a PM problem, so I followed the guide on getting native PM working, with that Script, generated my SSDT and put it in my clover patched ACPI folder.

And it didn't work, so I turned off audio layout id injection on clover, and audio stopped working, but my cpu utilization came back to normal, but im still with my AppleHDA kext patched installed.

Also as a side note there is some minor problems going on that I will list here too and if they have a known solution I would be happy to go for it.

My laptop has a "feature" that if it is not turned off "graciously" it start up on hardware selftest mode, and it does that sometimes after rebooting my hack, not sure if there is an issue with my reboot/shutdown sequence, it doesn't seem to be KP but also it is kind of weird, cuz some times it takes a while and other is almost instant, I applied the "Shutdown FIX v2" patch from Rehabs man Repo, but it didn't change anything, on my desktop whenever Im rebooting or shutting down, it shows that spinning thing with a black screen, but in my laptop it doesn't.

Also the startup sequence is complete, my trackpad and keyboard, freeze for like 30 seconds, sometimes more than 1 time, but it goes on normal after that, don't know it that is normal, or its something I did wrong, I believe this started happening after I changed my SMBIOS to MacBook Pro 12,1.

Laptop specs on my signature.

Also as always, thanks in forehand.
 

Attachments

  • Post 2.zip
    2 MB · Views: 169
Last edited:
Hello everybody, hope ya'll having a great day.

So I have my hack going very well so far, got almost everything working great, GPU, brightness, trackpad, keyboard, battery etc..

now I'm struggling with Audio, I patched my AppleHDA with AppleHDA Patcher 1.6, my audio codec is ALC255, I installed the patched kext, injected the audio ID 3 inside clover, patched IRQ andHDEF on my DSDT and boom, audio working, but there is a problem. my cpu gets to 100% utilization by "Kernel task" all the time, making my system very slow and toasty.
Also whenever I plug a headphone in, the system detects it, but it only outputs noise to it and no sound, don't know if this is related to the issue.

at first I thought it was a PM problem, so I followed the guide on getting native PM working, with that Script, generated my SSDT and put it in my clover patched ACPI folder.

And it didn't work, so I turned off audio layout id injection on clover, and audio stopped working, but my cpu utilization came back to normal, but im still with my AppleHDA kext patched installed.

Also as a side note there is some minor problems going on that I will list here too and if they have a known solution I would be happy to go for it.

My laptop has a "feature" that if it is not turned off "graciously" it start up on hardware selftest mode, and it does that sometimes after rebooting my hack, not sure if there is an issue with my reboot/shutdown sequence, it doesn't seem to be KP but also it is kind of weird, cuz some times it takes a while and other is almost instant, I applied the "Shutdown FIX v2" patch from Rehabs man Repo, but it didn't change anything, on my desktop whenever Im rebooting or shutting down, it shows that spinning thing with a black screen, but in my laptop it doesn't.

Also the startup sequence is complete, my trackpad and keyboard, freeze for like 30 seconds, sometimes more than 1 time, but it goes on normal after that, don't know it that is normal, or its something I did wrong, I believe this started happening after I changed my SMBIOS to MacBook Pro 12,1.

Laptop specs on my signature.

Also as always, thanks in forehand.

Usually ALC255 requires CodecCommander.kext. You didn't install it.
There might be something wrong in the XML you used to patch AppleHDA...
You still have work to do with regards to patching ACPI.
Your reboot on shutdown might be because your USB is not configured correctly.

https://www.tonymacx86.com/threads/guide-patching-laptop-dsdt-ssdts.152573/
https://www.tonymacx86.com/threads/guide-10-11-usb-changes-and-solutions.173616/

If a certain SMBIOS causes problems, try a different one.
 
Usually ALC255 requires CodecCommander.kext. You didn't install it.
There might be something wrong in the XML you used to patch AppleHDA...
You still have work to do with regards to patching ACPI.
Your reboot on shutdown might be because your USB is not configured correctly.

https://www.tonymacx86.com/threads/guide-patching-laptop-dsdt-ssdts.152573/
https://www.tonymacx86.com/threads/guide-10-11-usb-changes-and-solutions.173616/

If a certain SMBIOS causes problems, try a different one.

Thanks for the hint Rehab Man, I installed the CodecCommander.kext from the generated mironeaudio folder, but it didn't work, but im not sure if it loaded cuz when I touched the kernel it didn't complained about the signature of this one, I think im cutting corners with this AppleHDA Patcher, I restored the original AppleHDA.kext from my Sierra install Usb /S/L/E/ and I will try a manual patch via Clover following this guide:

http://www.insanelymac.com/forum/topic/295001-guide-to-patch-applehda-for-your-codec/#entry1980947

its just that this is as very involved patch with a lot of points of failure, I tried following it multiple times and never got it working, thats why I always end up with the HDA Patcher, but this time its not working very well to me as you can tell.

Also, you said that I still have work to do with my ACPI, what exactly do you mean with this? is there any patches missing on my DSDT?
 
Thanks for the hint Rehab Man, I installed the CodecCommander.kext from the generated mironeaudio folder, but it didn't work, but im not sure if it loaded cuz when I touched the kernel it didn't complained about the signature of this one, I think im cutting corners with this AppleHDA Patcher,

CodeCommander is on my github.

its just that this is as very involved patch with a lot of points of failure, I tried following it multiple times and never got it working, thats why I always end up with the HDA Patcher, but this time its not working very well to me as you can tell.

Probably best to start with XML files that are close, then tweak.

Also, you said that I still have work to do with my ACPI, what exactly do you mean with this? is there any patches missing on my DSDT?

Just noticed that GFX0->IGPU rename (IGPU PM) not done. B0D3->HDAU not done (HDMI audio). USB not configured correctly. You should probably read the ACPI patching guide and/or FAQ.
 
CodeCommander is on my github.



Probably best to start with XML files that are close, then tweak.



Just noticed that GFX0->IGPU rename (IGPU PM) not done. B0D3->HDAU not done (HDMI audio). USB not configured correctly. You should probably read the ACPI patching guide and/or FAQ.

Hello again,

So my journey continues, I installed CodecCommander.kext from your repo, and now it loaded correctly, but still after I rebooted my machine it still was still getting to 100% all the time, so I decided to do IGPU PM and HDMI audio with the renames as you said me to.

I used the patched C0D3->HDAU and GFX0->IGPU on my main DSDT, as well as on SSDT-0 and SSDT-8, since those are the only ones that I found such reference. SSDT-0 went well, but SSDT-8 gave me erros after the patch, about external references, so I removed those scopes compiled and put it on my ACPI patched folder, after that my system stopped booting.

it wasn't giving me KP, but it complained about some methods failing, but I could not read it properly since it went by too fast.

at this point I decided to give up and redo my DSDT stuff, so thats what I did.

I got a clean DSDT and re-pached everything from scratch. and what do you know, audio its working and im no longer pinned at 100% but my system is still warm to the touch, without the layout injected it gets cooler, so I thing it might me related to IGPU PM as tou said.

on the attached file, I also put a folder called "Last try patch" there is my old DSDT and SSDTs.

So Botton line, do you think my audio will be OK now or does it need more work?
And could you please help me with my IGPU PM patch?

[UPDATE]

My audio is still broken, after watching some videos, Kernel task went crazy again. I attached some screenshots of it, as you can wee it is allocating crazy amounts of RAM, and threads.
 

Attachments

  • Post.zip
    2.2 MB · Views: 171
  • Captura de Tela 2017-01-09 às 20.16.18.png
    Captura de Tela 2017-01-09 às 20.16.18.png
    208.7 KB · Views: 352
  • Captura de Tela 2017-01-09 às 20.16.33.png
    Captura de Tela 2017-01-09 às 20.16.33.png
    67.4 KB · Views: 259
Last edited:
I used the patched C0D3->HDAU and GFX0->IGPU on my main DSDT, as well as on SSDT-0 and SSDT-8, since those are the only ones that I found such reference. SSDT-0 went well, but SSDT-8 gave me erros after the patch, about external references, so I removed those scopes compiled and put it on my ACPI patched folder, after that my system stopped booting.

Sounds like lots of mistakes...

on the attached file, I also put a folder called "Last try patch" there is my old DSDT and SSDTs.

Your edits to SSDT-8 are completely wrong. You can't randomly delete things...

So Botton line, do you think my audio will be OK now or does it need more work?
And could you please help me with my IGPU PM patch?

Your ioreg shows IGPU PM not implemented (need GFX0->IGPU rename).
It also shows HDMI audio not implemented (see guide linked from FAQ).
 
Sounds like lots of mistakes...
Ah man you crack me up :lol:

Your edits to SSDT-8 are completely wrong. You can't randomly delete things...

i found out what the problem was, the patch wasnt renaming one instance of a Scope, so i manually changed it, and the errors were fixed.

Your ioreg shows IGPU PM not implemented (need GFX0->IGPU rename).
It also shows HDMI audio not implemented (see guide linked from FAQ).

So after a lot of discipline and patience i managed to figure out what i was doing wrong, i carefully read the DSDT patching guide and noticed that if i provide SSDTs i have to DROP_OEM SSDTs, after a did that AND patched y SSDT-8 correctly my system booted up normally, now i have HDMI audio and IGPU PM, and my system still gets maxed out when i inject audio.

But i discovered a new thing, the kernel_task only starts to freak-out when some audio starts playing, that might lead us to find what the cause might be.

So tell me, what i did this time is right? regarding HDMI audio and IGPU PM, if so, what else can be causing this problem?
 

Attachments

  • Post 3.zip
    2 MB · Views: 156
Last edited:
But i discovered a new thing, the kernel_task only starts to freak-out when some audio starts playing, that might lead us to find what the cause might be.

Since you're using fully patched AppleHDA.kext... the problem is likely the AppleHDA.kext you're using itself. Perhaps it was not patched from AppleHDA that corresponds to the version of macOS that you're running?

ACPI/patched is missing SSDT-1.aml and SSDT-4.aml.
 
Since you're using fully patched AppleHDA.kext... the problem is likely the AppleHDA.kext you're using itself. Perhaps it was not patched from AppleHDA that corresponds to the version of macOS that you're running?

ACPI/patched is missing SSDT-1.aml and SSDT-4.aml.

I belive it is right, i used AppleHDA Pather 1.6, i belive it patched the current AppleHDA installed on my System, after i noticed the problem on kernel_task i decided to restore the original AppleHDA.kext, but turns out im an idiot and forgot to back it up before patching, so i did a little research, in some thread i found that i could extract my AppleHDA.kext from /S/L/E/ from my macOS Install USB.

It is the same 10.12.2 installer i used to install my system, and since i didnt update anything i tought it would not be a problem.

What do you think i should do?

Maybe a clean install, then try to patch AppleHDA through clover instead of using the Patched Kext? or do you think the Kext i got from /S/L/E is fine?

Also i didn't put SSDT-1.aml because it was Full of errors, and you said on your DSDT/SSDT patching guide that i would be fine without it. since it is PTID or something, do i need to fix it and inject it?
 
Maybe a clean install, then try to patch AppleHDA through clover instead of using the Patched Kext? or do you think the Kext i got from /S/L/E is fine?

Likely to be the same result, but always worth a try.
The problem is likely in the XML for the patched AppleHDA.
You could see if there is better XML available (check in AppleALC project).
Or there is something else causing your problem. Use google.

Also i didn't put SSDT-1.aml because it was Full of errors, and you said on your DSDT/SSDT patching guide that i would be fine without it. since it is PTID or something, do i need to fix it and inject it?

Probably not needed then. But if it needs no patches, then there is no need to recompile it... you can just copy the one from origin.
 
Status
Not open for further replies.
Back
Top