Jump to content

AppleALC — dynamic AppleHDA patching


vit9696
5,371 posts in this topic

Recommended Posts

We need a manual to find unknown codecs that AppleALC currently does not support so we can make the necessary files needed to add the support to AppleALC.

 

The first step in a new codec is getting a codec_dump from a Linux live.
Then convert the codec_dump with codecgraph.
Then take the values ​​from verbs.txt and create the PinConfig with PinConfigurator.
Then from codec_dump_dec.txt and codec_dump_dec.txt.svg find the nodes chains and create the files layout??.xml.zlib and Platforms??.xml.zlib.
?? = free layoutID found in AppleALC for your chip type.
 
Take a look at my old german manual!
 
These are just examples, not a solution for everything.
All apps (PinConfigurator, codecgraph,...) can be found there in Tool_Paket_patch_AppleHDA.zip.
Some steps in the manual (binary patch, etc.) are no longer required for AppleALC.
I do not patch AppleHDA anymore. I add layout, Platforms and PinConfig only in AppleALC. My Thread patch AppleHDA is older, but the first steps are always the same.
 
If PinConfig is complete then insert the new entry in "AppleALC-master/Resources/PinConfigs.kext/Contents/Info.plist".
The finished layout??.xml.zlib and Platforms??.xml.zlib you copy into the respective ALC folder in "AppleALC-master/Resources/Folder??".
In this folder edit the "Info.plist" and add new entries for Files/Layouts and Files/Platforms.
 

 

Then compile AppleALC with xcode and try ...
  • Like 3
Link to comment
Share on other sites

 

The first step in a new codec is getting a codec_dump from a Linux live.
Then convert the codec_dump with codecgraph.
Then take the values ​​from verbs.txt and create the PinConfig with PinConfigurator.
Then from codec_dump_dec.txt and codec_dump_dec.txt.svg find the nodes chains and create the files layout??.xml.zlib and Platforms??.xml.zlib.
?? = free layoutID found in AppleALC for your chip type.
 
Take a look at my old german manual!
 
These are just examples, not a solution for everything.
All apps (PinConfigurator, codecgraph,...) can be found there in Tool_Paket_patch_AppleHDA.zip.
Some steps in the manual (binary patch, etc.) are no longer required for AppleALC.
I do not patch AppleHDA anymore. I add layout, Platforms and PinConfig only in AppleALC. My Thread patch AppleHDA is older, but the first steps are always the same.
 
If PinConfig is complete then insert the new entry in "AppleALC-master/Resources/PinConfigs.kext/Contents/Info.plist".
The finished layout??.xml.zlib and Platforms??.xml.zlib you copy into the respective ALC folder in "AppleALC-master/Resources/Folder??".
In this folder edit the "Info.plist" and add new entries for Files/Layouts and Files/Platforms.
 

 

Then compile AppleALC with xcode and try ...

 

 

Thanks MacPeet for this clear how, i just want to know how to get codec dump from Linux, so i'll can try my first attempt for this Laptop, if done, i can begin the work for others ^_^ ?  

Edited by ammoune78
  • Like 2
Link to comment
Share on other sites

On my Dell Optiplex 780 with DP Beta 1 or 2 HS 10.13.4 Lilu + AppleALC is no longer working. I have tried version 1.2.2 and 1.2.1 and the latest versions of Clover 4392, 4411 and 4414.

In kextstat Lilu and AppleALC are loaded. HDMI audio works.
 
What do these messages mean in the bootlog?
 
2018-02-11 10:43:48.843230+0100 0x73       Default     0x0                  0      0    kernel: calling mpo_policy_init for Lilu
2018-02-11 10:43:48.843790+0100 0x73       Default     0x0                  0      0    kernel: Security policy loaded: Lilu Kernel Extension 1.2.1 (Lilu)
 
This message is apparently normal.
 
Funny, I can not find a mistake.
My Lappi with Beta1 / 2 works ALC / Lilu without problems.
 
:wallbash:
Link to comment
Share on other sites

 

The first step in a new codec is getting a codec_dump from a Linux live.
Then convert the codec_dump with codecgraph.
Then take the values ​​from verbs.txt and create the PinConfig with PinConfigurator.
Then from codec_dump_dec.txt and codec_dump_dec.txt.svg find the nodes chains and create the files layout??.xml.zlib and Platforms??.xml.zlib.
?? = free layoutID found in AppleALC for your chip type.
 
Take a look at my old german manual!
 
These are just examples, not a solution for everything.
All apps (PinConfigurator, codecgraph,...) can be found there in Tool_Paket_patch_AppleHDA.zip.
Some steps in the manual (binary patch, etc.) are no longer required for AppleALC.
I do not patch AppleHDA anymore. I add layout, Platforms and PinConfig only in AppleALC. My Thread patch AppleHDA is older, but the first steps are always the same.
 
If PinConfig is complete then insert the new entry in "AppleALC-master/Resources/PinConfigs.kext/Contents/Info.plist".
The finished layout??.xml.zlib and Platforms??.xml.zlib you copy into the respective ALC folder in "AppleALC-master/Resources/Folder??".
In this folder edit the "Info.plist" and add new entries for Files/Layouts and Files/Platforms.
 

 

Then compile AppleALC with xcode and try ...

 

 

Hi Macpeet,

i'm currently trying to add support for my ALC662 codec in a Lenovo M83 SFF to AppleALC. I have calculated the verbs and pathmaps according to your guide (and a couple of others) and i started editing layout.xml and platform.xml.

 

However, i'm unsure what to do with the output of pinconfig. My modified verbs are in the format:

 

<01471c10 01471d01 01471e13 01471f99 01470c02

01871c20 01871d10 01871ea1 01871f04

01971c30 01971d01 01971ea3 01971f99

02171c40 02171d10 02171e21 02171f04>

 

However, when i open AppleALC-master\Resources\Pinconfigs.kext\Contents\Info.plist and look at the "ConfigData" section for the existing codecs, they have a different format, like:

 

IUccECFHHUAhRx4RIUcfASGHHCAhhx2QIYce

oCGHH5AhlxxgIZcdkCGXHqEhlx8CIaccQCGn
HTAhpx6BIacfASG3HFAhtx1AIbceISG3HwIh
5xwwIecdYSHnHksh5x8B
 
Do i have to perform some kind of conversion before inserting the configdata into Pinconfigs.kext?
 
Regards
Link to comment
Share on other sites

How can I make green rear and green front to be hot-plug?

Now I can change between green rear and headphones(green front) from volume icon or system preferences, but how can I make them hot-plug to change automatically.

Link to comment
Share on other sites

 

@donflexus

 
No, do not convert.
 
Open AppleALC-master\Resources\Pinconfigs.kext\Contents\Info.plist with "PlistEdit_Pro" or "TextWrangler"!
 
Example with PlistEdit_Pro:
 

 

Ah, I see. Thanks. I opened Info.plist with a different editor at work today, which seems to mess up the values. When I open in PlistEdit it looks right.

  • Like 1
Link to comment
Share on other sites

 

@donflexus

 
No, do not convert.
 
Open AppleALC-master\Resources\Pinconfigs.kext\Contents\Info.plist with "PlistEdit_Pro" or "TextWrangler"!
 
Example with PlistEdit_Pro:
 

 

I finished editing Platforms.xml, layout.xml, pinconfigs.kext etc and am ready to build, but xcode fails at building the kext due to missing Lilu.kext in the AppleALC-folder. I've also seen errors for missing a "SDK"-subfolder in the AppleALC-folder. Both of these are not included on github.

 

Could you (or somebody else wise enough) provide me with specific instructions for rebuilding the kext in xcode? I have never used xcode (or any other IDE for that matter) before.

Thanks!

 

Link to comment
Share on other sites

1. Open Lilu.xcodeproj in xcode

2. then in xcode menu bar "Product -> Build For -> Running"
3. If it is complete, navigate to the xcode menu bar "File -> Project Settings":
 
post-1358580-0-01330000-1518714666_thumb.png
 
then navigate in the Finder "DerivedData / Lilu ..... / Build / Products / Debug / Lilu.kext"
 
4. Copy this Lilu.kext to AppleALC-master folder
5. then open AppleALC.xcodeproj in xcode
6. then in xcode menu bar "Product -> Build For -> Running"
...
...
...
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

@vandroiy2012

 
some new experiences:
Since beta2 and beta3 10.13.4, AppleALC + Lilu has stopped working on my Dell with the Analog Device AD1984A. According to kextstat both are loaded. Only HDMI audio works.
Today I tried a little. A rollback original AppleHDA of 10.13.3 and everything works again.
Apple is trying again here a blockade in the new AppleHDA's? Is something known to you?
Link to comment
Share on other sites

1. Lenovo Ideapad 510s-14ISK
2. 0x10ec0236
3. 15 (already tried them all, and 15 works the best)
4. 10.13.3
5. Attached

Problem: There are two internal mics in my laptop, but the right mic is the only one which works, the second one (the left mic) doesn't. Also it can't detect external mic.

Can you help me with this problem?

Info.plist.zip

Link to comment
Share on other sites

 

@vandroiy2012

 
some new experiences:
Since beta2 and beta3 10.13.4, AppleALC + Lilu has stopped working on my Dell with the Analog Device AD1984A. According to kextstat both are loaded. Only HDMI audio works.
Today I tried a little. A rollback original AppleHDA of 10.13.3 and everything works again.
Apple is trying again here a blockade in the new AppleHDA's? Is something known to you?

 

 

Sorry, no... My ALC887 is working well...

Link to comment
Share on other sites

Hopefully this is correct place to post this.

Sometimes when i boot macOS High Sierra on my Laptop i do not get audio but running a kextstat shows that Lilu and AppleALC are both loaded

48    0 0xffffff7f8375c000 0xca000    0xca000    as.vit9696.AppleALC (1.2.2) C581E250-A491-3949-93D7-1EFBF529898F <43 7 5 4 3 2 1>

Shanes-MBP:~ shane$ kextstat | grep Lilu

   43    3 0xffffff7f83730000 0x19000    0x19000    as.vit9696.Lilu (1.2.2) 68CEBC95-F953-329A-9951-8A63F214C171 <7 5 4 3 2 1>

I have also attached my ioreg of this happening, ie when i have no audio.

Hopefully someone can assist. This is not something that happens every boot but maybe every second or third boot / reboot i lose audio.

post-1083558-0-51284600-1519891128_thumb.png

Shane’s MacBook Pro.ioreg.zip

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

I have a little problem with my sound on the ASUS X541UAK with ALC 256 codec. The thing is that I put layout-id 56 made by someone else and the headphone jack outputs the sound but the internal laptop speakers does not (no sound with laptop speakers but it's working with headphones). The question is: there is any guide what should I patch in the DSDT or add a new layout id in your kext ?

I am somewhat confused because the headphone jack is outputting sound but the laptop speakers doesn't so the kext is working but something else is the problem.

I will attach a IOREG,config.plist and DSDT maybe there is something wrong on my side.

The layout-id is defined in the DSDT.

Thanks a lot !

Debug files for Audio.zip

Link to comment
Share on other sites

No input or output devices

1. Vaio SVE15155FXS --- HM76 chipset
2. 0x80861E20, 0x104D90AB, 0x10EC0269, 0x0202, Realtek ALC269
3. layout 1, 3, 29 in DSDT. 
4. 10.13.2, 10.13.3

Latest versions of both Lilu and AppleALC injected by clover. 

First time trying Lilu. Am I doing something wrong?

 

EDIT: Installed to system. Didn't make a difference. 

Edited by Dr. Hurt
Link to comment
Share on other sites

Hey, guys! I need some help here.
Already tried to patch AppleALC and AppleHDA but could not fix my problem.

I have Lenovo E530 laptop with CX20671 (CX20590) codec.
AppleALC gives me audio with layout 0x0C and 0x1C, but neither of there works fine.
The first one does not have an automatic microphone switch (internal/external), the second one does not have Mute option for output. Both does not allow to adjust internal microphone volume, and other layouts have even more problems - microphone does not work at all, no internal audio, etc.

And also my volume levels and audio format (2 Chanels, 24 bits, 95 kHz) are forgotten after sleep/restart. I was told that this is due to wrong layoud/codec-id.

I also already tried to change layout28 and Platforms, accordantly to my codec dumps, no luck.

So I assume that I just can't do this on my own and need a community help.

My codec dump is attached to this post.

Pls, help.

codec_dump.txt

Link to comment
Share on other sites

Hello there,

 

First, thanks for the developpers of AppleALC.kext. Second, thanks for MacPeet for the ALC280 codec support, done for Dell PowerEdge T20.

Now, I have this same chipset on my Dell Optiplex 9020 Mini-Tower. Using layout-id 13 or 15, I get lower volume on the rear jacks. Do you think it is by design inside the chip or something in AppleALC could solve the issue.

 

Thanks,

 

Patrice

 

EDIT: Sound is lower too on the rear under Windows 10. However, maximum sound is louder in Win 10 so headphone outs at max is dangerous but rear output is fine (but louder than OSX). So, nothing could be done I would think (except louder overall sound for ALC280 under OSX, is it possible??). Thanks anyway.

Edited by brousseau6933
Link to comment
Share on other sites

On 2/9/2018 at 8:19 AM, MacPeet said:

The first step in a new codec is getting a codec_dump from a Linux live.

Hey MacPeet, i've tried that with live CD Ubuntu, but the terminal always return nothing or shows invalid command prompt such as Cat: Codec: No such file or directory, i don't know how to deal with it, do you have any suggestion?

Got it, and now i'll begin other steps :D

Didn't get the 2nd step, google translation doesn't translate from German perfectly

Edited by ammoune78
Don't need to make another post
Link to comment
Share on other sites

×
×
  • Create New...