Jump to content

AppleALC — dynamic AppleHDA patching


vit9696
5,375 posts in this topic

Recommended Posts

21 hours ago, insanelyDeepak said:

Hi 

i checked codec_dump , layout 15 in AppleALC is completely suitable for you 
if appleALC not working try this one 

https://github.com/insanelydeepak/cloverHDA-for-Mac-OS-Sierra-10.12/blob/master/Laptop/ALC295:3254.zip

 

Thanks a lot. The AppleALC still refuses to work for some reason but the cloverHDA you linked has solved the problem for me. Both headphones and speakers are working flawlessly now and the sleep issue is gone as well. I'm truly grateful. 

  • Like 1
Link to comment
Share on other sites

On 8/8/2018 at 6:38 PM, MacPeet said:

@arsradu

 

for sound after sleep try ResetHDA in Clover or CodecCommander.kext or EAPDFix.kext

 

try this with layoutID 11

trial1_alc892_layoutID11_for_MSi_Z97S_SLI_Krait_Edition.zip

(boot flags Mojave -alcbeta -lilubetaall)

 

I have configured:

 

Speaker (LineOut rear green) in SwitchMode with HP (front green)
3 more LineOut's back for 5.1 via MidiSetup
Mic front pink configured as LineIn
LineIn blue back

 

config.png.eee484a0eb4370c0f5e7b2d60d4e038b.png

 

Hi man,

 

Many thanks! And sorry for the late reply. I was on vacation. :) 

 

Sound works fine with Layout ID 11, but it still looks like this

.126598871_Screenshot2018-08-23at20_11_01.png.fac18f98270dfbd74c4749d9d7fbaa52.png

 

And...there's no sound after sleep with this layout, although there was with Layout 28 I was using before (ResetHDA was checked at all time). Is EAPD added to this layout? Cause for as far as I could see, there is definitely support for it in the codec dump.

 

With these kext, sound after sleep doesn't work anymore, even with Layout ID 28.

Update: now there is no sound after sleep with Layout ID 28 even with the old kexts... I don't get it...

 

EDIT: @MacPeet Please, disregard my post above... That was a noob mistake on my side. Sorry about that.

 

Layout 11 looks exactly as you said. And everything works as expected! So, I just wanna say: many, many thanks for that!!!

 

3806519_Screenshot2018-08-24at19_23_23.png.99d886b49a0d9c0bf1f056fd63f7df23.png

 

 

 

Could you, please, post these changes to git so I can use the latest AppleALC updates? I still don't know...was any of the things I've done ok? Did you use any of that, or you had to start from scratch?

 

Also, should there be another microphone there at node 24?

 

NID 0x18/24  [Jack] Mic at Ext Rear (Pink)
NID 0x19/25  [Jack] Mic at Ext Front (Pink)

 

Also, how did you select 7 for node 23? My PinConfigurator only goes up to [6], after that I've got [f]. Same for 8 and 9 in nodes 25 and 26.

 

The motherboard's ports look like this (just for reference).

 

1548589907_Screenshot2018-07-07at22_59_00.thumb.png.e2ed0b0d1a7b7fba62436b1398395ce2.png

 

Edited by arsradu
Link to comment
Share on other sites

On 8/23/2018 at 1:09 PM, gujiangjiang said:

 

I still have problem with AppleALC1.3.0 and cant deal with it.

 

What your said change layout-id to 7?

My layout-id was 13 and it cant use when update to AppleALC1.3.0 but the others dont have this problem and i post this problem manytimes.

 

The target layout-id of 7 may not work for your system ...

 

What worked for me ...

  1. Remove any injection of alc-layout-id in Clover and install AppleALC 1.2.8
  2. Configure Clover to inject a working layout-id in Devices -> Audio -> Inject
  3. if/when Audio is working use IOREG Explorer and search for the HDEF device
  4. You should see that alc-layout-id is set to the value that you set in Clover in step 2, make a note of it
  5. Its quite likely that AppleALC will have re-mapped it which is what layout-id will be set to, make a note of it
  6. install AppleALC 1.3.1
  7. Remove all Clover audio layout-id injection references in Devices -> Audio -> Inject
  8. Copy the the SSDT code I posted in my above post into MaciASL
  9. Edit the SSDT code and set alc-layout-id to the working layout from step 4 (or one that you know should work in the newer release)
  10. Edit the SSDT code and set layout-id to the one from step 5
  11. Compile the SSDT and save it as SSDT-HDEF.aml in your  /EFI/Clover/ACPI/Patched folder
  12. If al looks good Reboot

I don't know why the automatic layout-id re-mapping in version 1.3.1 is not working for me, as it worked in 1.2.8. But this method allowed me to get version 1.3.1 working which is progress . . .

It might be possible for you to use Clovers Custom Device Properties Injection rather than use a SSDT (you should try that first) but it did not work for me.

 

Warning: This is an un-official method so it may not work for others and i'm sure the AppleALC devs will comment on this, however this was the only way i was able to get AppleALC 1.3.0++ working.

 

Update: SSDT Method now depreciated see THIS post for how i got Clover Custom Properties working

 

Good Luck

Jay

 

 

Edited by jaymonkey
  • Like 1
Link to comment
Share on other sites

 
The target layout-id of 7 may not work for your system ...
 
What worked for me ...
  1. Remove any injection of alc-layout-id in Clover and install AppleALC 1.2.8
  2. Configure Clover to inject a working layout-id in Devices -> Audio -> Inject
  3. if/when Audio is working use IOREG Explorer and search for the HDEF device
  4. You should see that alc-layout-id is set to the value that you set in Clover in step 2, make a note of it
  5. Its quite likely that AppleALC will have re-mapped it which is what layout-id will be set to, make a note of it
  6. install AppleALC 1.3.1
  7. Remove all Clover audio layout-id injection references in Devices -> Audio -> Inject
  8. Copy the the SSDT code I posted in my above post into MaciASL
  9. Edit the SSDT code and set alc-layout-id to the working layout from step 4 (or one that you know should work in the newer release)
  10. Edit the SSDT code and set layout-id to the one from step 5
  11. Compile the SSDT and save it as SSDT-HDEF.aml in your  /EFI/Clover/ACPI/Patched folder
  12. If al looks good Reboot
I don't know why the automatic layout-id re-mapping in version 1.3.1 is not working for me, as it worked in 1.2.8. But this method allowed me to get version 1.3.1 working which is progress . . .
It might be possible for you to use Clovers Custom Device Properties Injection rather than use a SSDT but it did not work for me.
 
I don't think this is an official method so it may not work for you and i'm sure the AppleALC devs will comment on this.
 
Good Luck
Jay
 
 



thanks for your exhaustive answer.

I have problem with remap layout is when update to AppleALC1.3.0 but I have a question I am using macOS 10.13 and this version don’t need remap the layout id.

I will try your method and test it.

You add “layout id” and “all-layout-Id” both into the SSDT-HDEF?


从我的 iPhone 发送,使用 Tapatalk
Link to comment
Share on other sites

2 hours ago, gujiangjiang said:

thanks for your exhaustive answer.
I have problem with remap layout is when update to AppleALC1.3.0 but I have a question I am using macOS 10.13 and this version don’t need remap the layout id.
I will try your method and test it.
You add “layout id” and “all-layout-Id” both into the SSDT-HDEF

 

 

 

Even though 10.13.X does not need the re-mapping AppleALC 1.2.8 does it regardless, i think it was a test release to check that the re-mapping code worked.

 

Cheers

Jay

Edited by jaymonkey
Link to comment
Share on other sites

 
Even though 10.13.X does not need the re-mapping AppleALC 1.2.8 does it, i think it was a test release to check that the re-mapping code worked.
Just change the values in the SSDT code for layout-id and alc-layout-id
 
Cheers
Jay


Very thanks to you and the AppleALC1.3.0 works for me.

It is simply to change layoutid to alclayoutid in ssdt-hdef and it works for me.


从我的 iPhone 发送,使用 Tapatalk
Link to comment
Share on other sites

So the AppleALC have problem in remap Layout-ID to Alc-Layout-ID with AppleALC1.3.0 and newer but in AppleALC1.2.8 the remap was works well.

Now I can inject layout-Id and alc-layout-id manually to make AppleALC1.3.0 work.

I hope to fix this bug in the future of the AppleALC because some people have same problem with me and don’t know how to do.


从我的 iPhone 发送,使用 Tapatalk

Link to comment
Share on other sites

11 hours ago, TessereKt said:

 

Thanks a lot. The AppleALC still refuses to work for some reason but the cloverHDA you linked has solved the problem for me. Both headphones and speakers are working flawlessly now and the sleep issue is gone as well. I'm truly grateful. 

Great :thumbsup_anim:

enjoy good sound 

Link to comment
Share on other sites

@All,

 

As per Andrey1970 post above I have continued to try and get AppleALC 1.3.1 working without using a SSDT and use custom Clover Device Properties.

 

This time rather than me adding the properties i decided to try the latest build of HDPatcher with the audio option checked in the patch tab and let it generate the patches for me which resulted in two PCI path keys  ...

 

 1831526836_ScreenShot2018-08-24at14_59_31.thumb.png.f82b9df4407b2d673bece4cac4ba52ba.png

 

The full code it produced is as follows :-

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Devices</key>
	<dict>
		<key>Properties</key>
		<dict>
			<key>PciRoot(0x0)/Pci(0x1f,0x3)</key>
			<dict>
				<key>layout-id</key>
				<data>
				AAAAAA==
				</data>
			</dict>
			<key>PciRoot(0x0)/Pci(0x2,0x0)</key>
			<dict>
				<key>AAPL,ig-platform-id</key>
				<data>
				AAAWWQ==
				</data>
				<key>device-id</key>
				<data>
				FlkAAA==
				</data>
			</dict>
		</dict>
	</dict>
</dict>
</plist>

 

This was a surprise as i thought all the properties would be on the same path as the Intel IGPU (PciRoot(0x0)/Pci(0x2,0x0))  .... which is what i have done (it seems mistakenly) in all previous attempts to use Clover to set the layout-is'd ...., maybe this was where i was going wrong ? ..... I copy and pasted the generated code into my config.plist and checked it using Clover Configurator :-

 

522193661_ScreenShot2018-08-24at15_06_26.thumb.png.fb26cd2b8f70117cb73037170e56a868.png

 

445787432_ScreenShot2018-08-24at16_21_34.thumb.png.90de24c7d2ae67caf432333554519443.png

 

All looked good so removed my SSDT-HDEF hotpatch from /EFI/Clover/ACPI/Patched and rebooted.

Unfortunately it resulted in a grey speaker icon and no sound devices just like all previous attempts.

So I added alc-layout-id as a custom property :-

 

350490149_ScreenShot2018-08-24at15_15_22.thumb.png.cd8e7f197662abf9e2ad53b25d3503c6.png

 

I changed layout-id to 7 (which is what AppleALC 1.2.8 re-mapped the injected layout to) and set alc-layout-id to 3, saved the changes and re-booted.

 

This time it worked .... at last :)

 

So the upshot of it all of this is that in my case I was adding the layout-id's to the wrong PCI Root address ... :wallbash::wallbash:

 

To those of you struggling maybe give the latest build of headkaze's HDPatcher a go which can be downloaded at http://headsoft.com.au/download/mac/FBPatcher.zip

Click on the patch tab and check the audio option then click on the Generate patch button (see HDPatcher screen grab above)

Copy the code into your config.plist making sure you keep the code structure correct.

 

I hope this might help some of you who like me have been having trubble getting AppleALC Version 1.3.1 working.

 

Clearly something has changed in AppleALC's code between version 1.2.8 which re-mapped the injected layout automatically without any need for Custom Properties and versions 1.3.0 & 1.3.1.

I suspect that there is a problem on some systems where the automatic re-mapping does not work correctly and the solution is to inject layout-id and set to the target layout-id AppleHDA will use (and be patched by AppleALC) which I derived from using AppleALC 1.2.8) and alc-layout-id which should be set to the correct patched layout you want to use for your codec (supported layouts can be derived by looking at the AppleALC sources)

 

The only remaining issue i have is that the external MIC is not working but this should be fixable by creating a new ALC295 layout with custom pin-config data,

 

Big thanks goes out to headkaze and the AppleALC Devs for all their work in the Hackingtosh community ...

 

Cheers

Jay

 

Update 3rd Sept 2018: Today I have been working with Vit9696 to identify the root cause of the automatic layout=id re-mapping not working with the latest version of AppleALC. I'm happy to report that the problem has been identified as an issue with Lilu NOT AppleALC. The issue is caused by the class code of the HDEF device not being parsed correctly by Lilu on some systems. Vlt9696 has fixed the problem in the latest build of Lilu (version 1.2.7). If your find that the automatic layout-id remapping is not working for you then try downloading the latest Lilu and AppleALC source's from their receptive git hub repo's, compile and install the builds. Remove any manual injection of layout-id and alc-layout-id device properties and use Clover - Device/Audio/Inject to set a layout ... Hopefully you'll find that the problem is now resolved. 

 

Big thanks goes out to Vit9696 for taking the time to work with me on identifying and resolving the issue.

 

 

Edited by jaymonkey
Update info
  • Like 1
Link to comment
Share on other sites

8 hours ago, Andrey1970 said:

Do not use an alc-layout-id
Use only a layout-id
Use the last versions Lilu and AppleALC. Surely from a clover, not from LE or SLE.

If to you it is difficult with Properties, use boot argument alcid=layout.

For example: alcid=3

 

Unfortunately as I stated in my last post just injecting layout-id as a Custom Device Property did not work. I had to Inject both.

I tried removing the Device Properties and used the boot arg alcid=3 but that also did not work.

The only way for me to get AppleALC 1.3.1 to work is to Inject Device Properties for layout-id and alc-layout-id either one on its own does not work for me it has to be both.

 

I completely understand that current releases of AppleALC are supposed to read just layout-id and automatically re-map it to a alternative/supported layout-id if necessary (for Mojave support) and alc-layout-id will inherit the original injected layout-id value. It works fine for me using version 1.2.8 but both versions 1.3.0 and 1.3.1 do not work unless i inject both properties which is why i have been reporting it as a possible issue that only effects some systems.

 

Cheers

Jay

 

 

Edited by jaymonkey
  • Thanks 1
Link to comment
Share on other sites

14 hours ago, Andrey1970 said:

Do not use an alc-layout-id
Use only a layout-id
Use the last versions Lilu and AppleALC. Surely from a clover, not from LE or SLE.

If to you it is difficult with Properties, use boot argument alcid=layout.

For example: alcid=3

 

This is only can used in AppleALC1.2.8.

 

When i update to AppleALC1.3.0 and 1.3.1 the layout-id with no function and i try to inject layout-id by [Clover][properties][SSDT]and all with no function and with a grey icon.

We can only inject alc-layout-id to make it works when updated to AppleALC1.3.0 or newer so i post many times on this topic about this problem but no one reply.

 

I have test AppleALC1.3.0 and 1.3.1 on my Xiaomi Pro with SSDT inject layout-id and with no problem but with same method my XPS with no function so i think this problem is related with some laptops.

 

I have try my best to inject only layout-id without inject alc-layout-id but all have grey icon when update to AppleALC1.3.0 but AppleALC1.2.8 with no problem.

 

Actually the AppleALC1.2.8 have support layout remap and it done well in remap and with no problem so i said many times the AppleALC1.3.0 have problem with some devices will cause grey icon problems.

 

I don't know what code happend ahead 1.2.8 so i could only post my log to clearfy this problem.

 

 

 

Throughout my test on some laptops it will clarify that if you laoptop with no problem you can inject layoutid via clover or ssdt they will all work.On those laptops who have problems no matter inject layout-id via Clover or SSDT they will all be no use and in this laptop can downgrade to AppleALC1.2.8 or inject alc-layout-id to make it works.

 

So i confirm AppleALC1.3.0 or newer have layout remap problem in some devices but no all have this problem but AppleALC1.2.8 without this problem.

 

Thanks for your work!

 

Link to comment
Share on other sites

16 minutes ago, cecekpawon said:

@gujiangjiang I do love your spirit man. Do you have something like fixdsdt: fixhda / hdmi set to on? They seems do inject "layout-id" with some conditions to your dsdt, as Andrey said you should avoid it. Check the source.

 

I have no one fixdsdt in my config and i have checked many times and i tried to fixhda and fixhdmi plus inject layoutid to clover but still no use.

 

I have tried all i can imaged to solve this problem since AppleALC1.3.0 till now but still cant solve this problem.

 

Yesterday i have tried to inject alc-layout-id via ssdt and the sounds back but the alc-layout-id maybe automatical generated by AppleALC why should we inject it munully?

 

AppleALC1.2.8 + SSDT-HDEF inject layout-id only and IOREG showed the HDEF have layout-id apple-layout-id and alc-layout-id and sounds works well.

AppleALC1.3.0 + SSDT-HDEF Inject layout-id only and IOREG showed the HDEF have only layout-id with no alc-layout-id and sounds going to grey icon.

AppleALC1.3.0 + SSDT-HDEF inject alc-laout-id only and IOREG showed the HDEF have layout-id=00000000 and alc-layout-id but sounds works well in macOS 10.13.6.

AppleALC1.3.0 + SSDT-HDEF inject layout-id=7 and alc-layout-id and IOREG showed the HDEF have layout-id=7 and alc-layout-id but have no apple-layout-id and the sounds works well.

 

[All the tests with same config same dsdt same other ssdt and same kexts.]

 

So after these tests i can confirm that the AppleALC have generate alc-layout-id failed in some laptops such as XPS or some laptops by HP and ASUS from AppleALC1.3.0 and newer.

 

So i hope to fix this.

 

I know we should inject layout-id by ourselves and let AppleALC to generate alc-layout-id but some laptops cant generate alc-layout-id by AppleALC so we must inject this value to make sounds work sine AppleALC1.3.0 or downgrade to AppleALC1.2.8 and AppleALC1.2.8 with no problem in generate alc-layout-id from layout-id by AppleALC.

 

Thanks for your help with this problem.

Edited by gujiangjiang
Link to comment
Share on other sites

8 minutes ago, gujiangjiang said:

So i hope to fix this.

 

Yes brother, hope so. I had problem in the past with injected FirmwareVendor, in case you / anyone who have it. The output should not be "Apple". Credit to @STLVNUB for the command.

echo $(ioreg -l -pIODeviceTree | grep firmware-vendor | awk '{print $5}' | sed 's/_/ /g' | tr -d "<\">" | xxd -r -p)

 

Link to comment
Share on other sites

1 minute ago, cecekpawon said:

 

Yes brother, hope so. I had problem in the past with injected FirmwareVendor, in case you / anyone who have it. The output should not be "Apple". Credit to @STLVNUB for the command.


echo $(ioreg -l -pIODeviceTree | grep firmware-vendor | awk '{print $5}' | sed 's/_/ /g' | tr -d "<\">" | xxd -r -p)

 

 

American Megatrends

QQ20180825-154732@2x.png

  • Like 1
Link to comment
Share on other sites

16 minutes ago, cecekpawon said:

 

Yes brother, hope so. I had problem in the past with injected FirmwareVendor, in case you / anyone who have it. The output should not be "Apple". Credit to @STLVNUB for the command.


echo $(ioreg -l -pIODeviceTree | grep firmware-vendor | awk '{print $5}' | sed 's/_/ /g' | tr -d "<\">" | xxd -r -p)

 

 

So we can use BiosVendro=Apple to make it works?

 

I will try it later and thanks for your help.

Link to comment
Share on other sites

1 minute ago, cecekpawon said:

 

Pfft NO, you should avoid it, please leave it as is (American Megatrends) ... Your problem is somewhere else ;)

I have found the code related with this.

 

AppleALC1.3.0 first commit.:(

 

Waiting for fix hah.

QQ20180825-161646@2x.png

Link to comment
Share on other sites

I'm trying to enable DisplayPort Audio with Nvidia GTX1050. HDAU is listed in IORegistryExplorer. And as far as I understood the debug logging of AppleALC 1.3.1 it's patched to a valid device id. But still sound prefs do not show my Monitor as Sound device. Intel onboard Audio (HDEF) seems to be configured as well (plus ALC1220 which is working through ordinary headphone jack).

 

OS: 10.13.6

MoBo: MSI Z370 Gaming Pro Carbon

GFX: Nvidia GTX 1050

Clover 4658

Monitor: Dell U2717 connected via DP

IOReg.png

boot.log

HDEF.png

Link to comment
Share on other sites

Hi guys,

Is normal that audio, stops working after sometime with lilu 1.2.4 e alc 1.2.8? Starting today my audio in High Sierra, started to have problems, start stop, distorted all the time until I finished hearing music...

The problem is because I haven't updated lilu and alc kexts?

But the updated versions solve or create more problems?

Thanks

PS:

Sorry guys, my bad, after changing headphones, the sound is clear and good as usual, the problem must be with bluetooth, because the problem was when I used my AirPods...

Thanks Again

Captura de ecrã 2018-08-26, às 22.49.10.png

Captura de ecrã 2018-08-26, às 22.48.43.png

Captura de ecrã 2018-08-26, às 22.46.57.png

Captura de ecrã 2018-08-26, às 22.46.37.png

Edited by MorenoAv
Link to comment
Share on other sites

@jaymonkey

I answer here because I can not upload via PM.
Your problem is the combo jack. This is very difficult to configure with Hackintosh. It works with some computers, not with others.
Try new codecs for 295 from @hieplpvip layoutID 12 and @InsanelyDeepak layoutID 14 and 15 !!! LayoutID 15 corresponds to your codec_dump.

trial_alc295_alc1.3.1_Lilu1.2.6.zip

I wonder, what do you expect? Internal speaker and internal mic works and HP external, right? It sure works for FaceTime and Skype, right? HP for the output, internal mic for input with these apps.

Hackintosh is not Windows or Linux.

Link to comment
Share on other sites

22 hours ago, MacPeet said:

@jaymonkey
Your problem is the combo jack. This is very difficult to configure with Hackintosh. It works with some computers, not with others.
Try new codecs for 295 from @hieplpvip layoutID 12 and @InsanelyDeepak layoutID 14 and 15 !!! LayoutID 15 corresponds to your codec_dump.

 

Hi MacPeet,

 

Many thanks for the new build/upload ....

 

I don't think Apple MacBooks have ever used Comb-Jacks so I can understand why they can be a troublesome ...

 

I tried Layout 15 in the new build but unfortunately it did not work, I also tried layouts 1,13,14 & 28 which are the other ALC295 layouts included in the latest build of AppleALC but these also did not work.

In all of these cases I get the grey speaker icon and no audio devices in System Pres --> Sound.

 

The only layout that worked is layout 3 but without the ext mic working ..... which has always been the case in all HDA solutions i have tried.

 

22 hours ago, MacPeet said:

I wonder, what do you expect? Internal speaker and internal mic works and HP external, right? It sure works for FaceTime and Skype, right? HP for the output, internal mic for input with these apps.

Hackintosh is not Windows or Linux.

 

I use face time a lot and the microphone on my headset is much more localised than the built in Mic on the laptop which tends to pick up a lot of background sound even though I have the option for Ambient Noise Reduction enabled. The only reason i mentioned that it works in Linux and Windows was to confirm that the jack and headset microphone do actually work ok.

 

If it can't be made to work then so be it ..... Hackingtosh system always have to have some compromises but it was worth a shot.

I'll look into getting a bluetooth headset which should work well as I have replaced the stock WiFi/BT card with a BCM43602/BCM20450 combo card which works natively with MacOS.

 

Many thanks for your efforts and teh work you do for the community.

 

Cheers

Jay

Link to comment
Share on other sites

×
×
  • Create New...