Jump to content
vit9696

AppleALC — dynamic AppleHDA patching

3,387 posts in this topic

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
Posted (edited)

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

Share this post


Link to post
Share on other sites
Posted (edited)
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

Share this post


Link to post
Share on other sites

I would like to request someone to get the CX20641 supported. Is there any guide on how get the codec_dump from a Linux live cd and how to submit it to someone who can update AppleALC to support it ?

Share this post


Link to post
Share on other sites
1 hour ago, jin2k9 said:

I would like to request someone to get the CX20641 supported. Is there any guide on how get the codec_dump from a Linux live cd and how to submit it to someone who can update AppleALC to support it ?

How to: In this Post

 

Share this post


Link to post
Share on other sites
Posted (edited)
14 hours ago, jin2k9 said:

I would like to request someone to get the CX20641 supported. Is there any guide on how get the codec_dump from a Linux live cd and how to submit it to someone who can update AppleALC to support it ?

I have the CX20642 on a Fujitsu desktop board, which I assume is not much different from that one, and I've been trying on and off for the last two weeks on my own to get this thing working without VoodooHDA, and nothing. Could anyone more knowledgeable please have a look at my codec? Thanks.

codec_dump.txt

Edited by junoir

Share this post


Link to post
Share on other sites
17 hours ago, ammoune78 said:

How to: In this Post

 

Thanx for the info. I checked out the post and followed the link to the German blog text. I don’t really understand German that well,  at least not enough to follow that guide. However I did the first Linux Live CD command and got the codec dump. If some one that actually know how to patch in support for codecs based on the codec dump can update AppleALC to support the CX20641 that would be great. Thanks in advance.

 

codec_dump.txt

Share this post


Link to post
Share on other sites
On 2016/3/8 at 6:46 AM, vit9696 said:

Hello,

This is going to be a support/discussion topic of AppleALC on InsanelyMac. 
AppleALC is a kernel extension allowing you to enable native apple HD audio without any filesystem modifications. It dynamically injects the necessary modifications to AppleHDA (and other kexts) including the

layouts, and makes your audio work starting from the OS installation.

 

It should be noted that AppleALC starting with version 1.1.0 requires Lilu.kext to be put in the same folder as AppleALC.kext. See this topic for more details.

 

For quite some time we are trying to obtain the necessary information about AppleALC codec compatibility. If you use something, please, consider checking the compatibility table (do not worry, it is in English), and report (here) on your codec. We are also looking for all the possible revisions of the codec, if we do not have the revisions listed for your codec please report as well. Thanks for understanding. 

 

The report is meant to contain:

1. Laptop model/Motherboard model
2. Codec name
3. Layout used with the info what works for you (ideally if you try them all)
4. OS X versions you tried
5. Autogenerated Info.plist made with the help of this utility.

 
All the details including the source code are available on github:
https://github.com/vit9696/AppleALC
Some short wiki articles explaining the usage are included.
 
As for now the project is relatively immature without practically any codec support. But it should be pretty easy to add more of them, I am hoping for the support of the "community" :)
If you have any issues, better report them on github for structural reasons.

Great jobs man!

i have a laptop pc with alc662 @ intel 5 series board. I can boot 10.12.6 correct and loaded applealc & lilu & IOHDAFamily & AppleHDAController. but i can't see any input or output devices in the volume control。

I use layout of 13 and clover as bootloader. when i check the system log, there is no error appear.

please help me!

 

codec-0.txt

DSDT.dsl

Share this post


Link to post
Share on other sites
Great jobs man!
i have a laptop pc with alc662 @ intel 5 series board. I can boot 10.12.6 correct and loaded applealc & lilu & IOHDAFamily & AppleHDAController. but i can't see any input or output devices in the volume control。
I use layout of 13 and clover as bootloader. when i check the system log, there is no error appear.
please help me!
 

codec-0.txt

DSDT.dsl
Try other layouts.
You can use 5, 7, 11, 12 and 13.

Sent from my SM-G930F using Tapatalk Pro

Share this post


Link to post
Share on other sites

@vit9696 Would you be able to help get this working on AMD boards? I've got ALC892 and I've tried a few times to get AppleALC working but not managed it. I've tried different layouts and I've added HDEF to my DSDT. Would like to get this working. Here's a dump from Darwin Dumper with modified DSDT, AppleALC and Lilu injected. If you need something else let me know and I can upload. Specs are in my signature.

https://www.dropbox.com/s/lo7xpey3pcn8gs5/DarwinDumper_3.0.4_21.03_19.06.05_MacPro6%2C1_Clover_X64_4392_High Sierra_17D102_shaneee.zip?dl=0

 

Share this post


Link to post
Share on other sites
Posted (edited)
2 hours ago, Shaneee said:

@vit9696 Would you be able to help get this working on AMD boards? I've got ALC892 and I've tried a few times to get AppleALC working but not managed it. I've tried different layouts and I've added HDEF to my DSDT. Would like to get this working. Here's a dump from Darwin Dumper with modified DSDT, AppleALC and Lilu injected. If you need something else let me know and I can upload. Specs are in my signature.

https://www.dropbox.com/s/lo7xpey3pcn8gs5/DarwinDumper_3.0.4_21.03_19.06.05_MacPro6%2C1_Clover_X64_4392_High Sierra_17D102_shaneee.zip?dl=0

 

Hey Shaneee! I think you should delete that actual HDEF Device you just added into the DSDT, and start renaming SBAZ to HDEF using clover patch, then rename the two SBAZ in the DSDT to HDEF, then apply on it your patch! If you look at your iOREG and LSPCI they both reports that the: (1002:4383) is the Audio Device!

Also you maybe have to rename other devices such as: LPC0 to LPC, SMB0 to SBUS, TMR to TIMR, PIC to IPIC, DMA1 to DMAC, USB's as well

Edited by ammoune78

Share this post


Link to post
Share on other sites
31 minutes ago, ammoune78 said:

Hey Shaneee! I think you should delete that actual HDEF Device you just added into the DSDT, and start renaming SBAZ to HDEF using clover patch, then rename the two SBAZ in the DSDT to HDEF, then apply on it your patch! If you look at your iOREG and LSPCI they both reports that the: (1002:4383) is the Audio Device!

Also you maybe have to rename other devices such as: LPC0 to LPC, SMB0 to SBUS, TMR to TIMR, PIC to IPIC, DMA1 to DMAC, USB's as well

Ok I got a fresh DSDT and renamed SBAZ to HDEF and added the layout. I've renamed other devices too but still noting. Here's an updated dump of IOREG, LSPCI and audio. Any suggestions?

https://www.dropbox.com/s/nuwl2rbmwg7bgsn/DarwinDumper_3.0.4_21.03_22.26.43_MacPro6%2C1_Clover_X64_4392_High Sierra_17D102_shaneee.zip?dl=0

Share this post


Link to post
Share on other sites
Posted (edited)

Excuse me i forgot, you should rename LPC0 to LPCB, another thing is that your device HDEF is placed in the: 00140002 address instead of 001B0000! But if you use clover you have that patch section under ACPI that allows you to rename devices, because your board maybe have some other SSDT's and that aren't extracted with clover or any other app, so when you use clover patches, it search on the entire UEFI image to find that specific name!

So my suggestion is, trying clover patches for SBAZ to HDEF, renaming SBAZ to HDEF in the DSDT, will help to avoid any other SSDT that have SBAZ on it and who can stop AppleALC to use that HDEF. Also try to change that address from 00140002 to 001B0000 and also if you want change that 

Spoiler

Device (HDEF)
            {
                Name (_ADR, 0x00140002)  // _ADR: Address
                OperationRegion (PCI, PCI_Config, Zero, 0x0100)
                Field (PCI, AnyAcc, NoLock, Preserve)
                {
                    Offset (0x42), 
                    DNSP,   1, 
                    DNSO,   1, 
                    ENSR,   1
                }

                Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
                {
                    0x1B, 
                    0x04
                })
                Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                {
                    If (LEqual (Arg2, Zero))
                    {
                        Return (Buffer (One)
                        {
                             0x03
                        })
                    }

                    Return (Package (0x06)
                    {
                        "layout-id", 
                        Buffer (0x04)
                        {
                             0x01, 0x00, 0x00, 0x00
                        }, 

                        "PinConfigurations", 
                        Buffer (Zero) {}, 
                        "hda-gfx", 
                        Buffer (0x0A)
                        {
                            "onboard-1"
                        }
                    })
                }
            }

To something like that:

Spoiler

Device (HDEF)
            {
                Name (_ADR, 0x001B0000)  // _ADR: Address
                OperationRegion (HDAR, PCI_Config, 0x4C, 0x10)
                Field (HDAR, WordAcc, NoLock, Preserve)
                {
                    DCKA,   1, 
                    Offset (0x01), 
                    DCKM,   1, 
                        ,   6, 
                    DCKS,   1, 
                    Offset (0x08), 
                    Offset (0x09), 
                    PMEE,   1, 
                        ,   6, 
                    PMES,   1
                }

                Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
                {
                    0x1B, 
                    0x04
                })
                Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                {
                    If (LEqual (Arg2, Zero))
                    {
                        Return (Buffer (One)
                        {
                             0x03
                        })
                    }

                    Return (Package (0x06)
                    {
                        "layout-id", 
                        Buffer (0x04)
                        {
                             0x01, 0x00, 0x00, 0x00
                        }, 

                        "PinConfigurations", 
                        Buffer (Zero) {}, 
                        "hda-gfx", 
                        Buffer (0x0A)
                        {
                            "onboard-1"
                        }
                    })
                }
            }

and try other layouts

For my desktop, I use this patch:

Spoiler

#
# HDEF ALC887
# Fix HDEF device for the Realtek ALC887 audio codec
into device label HDEF insert begin
Method (_DSM, 4, NotSerialized)\n
{\n
    Store (Package () {\n
        "device_type", Buffer () {"Realtek ALC887"},\n
        "codec-id", Buffer () {0x87,0x08,0xEC,0x10},\n
        "layout-id", Buffer () {0x01,0x00,0x00,0x00},\n
        "PinConfigurations", Buffer (Zero) {},\n
        "MaximumBootBeepVolume", Buffer(One) {0x00},\n
        "MultiEQDevicesPresence", Buffer () {0x00,0x00,0x01,0x00},\n
    }, Local0)\n
    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))\n
    Return (Local0)\n
}\n
end;

 

Edited by ammoune78

Share this post


Link to post
Share on other sites
11 hours ago, ammoune78 said:

Excuse me i forgot, you should rename LPC0 to LPCB, another thing is that your device HDEF is placed in the: 00140002 address instead of 001B0000! But if you use clover you have that patch section under ACPI that allows you to rename devices, because your board maybe have some other SSDT's and that aren't extracted with clover or any other app, so when you use clover patches, it search on the entire UEFI image to find that specific name!

So my suggestion is, trying clover patches for SBAZ to HDEF, renaming SBAZ to HDEF in the DSDT, will help to avoid any other SSDT that have SBAZ on it and who can stop AppleALC to use that HDEF. Also try to change that address from 00140002 to 001B0000 and also if you want change that 

  Reveal hidden contents

To something like that:

  Reveal hidden contents

and try other layouts

For my desktop, I use this patch:

  Reveal hidden contents

 

Still can't get it working. Here is my DSDT, the original DSDT and my config. Can you have a look and work some magic? DSDT isn't my strong point lol

 

Shaneee_.zip

Share this post


Link to post
Share on other sites
Posted (edited)

 

24 minutes ago, Shaneee said:

Still can't get it working. Here is my DSDT, the original DSDT and my config. Can you have a look and work some magic? DSDT isn't my strong point lol

 

Shaneee_.zip

Before trying something, can you remove the AppleHDA patches from the "KernelAndKextPatches and Devices>Audio>Inject + ResetHDA" in Config.plist, also remove any existing VoodooHDA or any AudioKext? keep only AppleALC in the EFI/Clover/Kexts/Other folder and Original AppleHDA in S/L/E

Edited by ammoune78

Share this post


Link to post
Share on other sites
12 minutes ago, ammoune78 said:

 

Before trying something, can you remove the AppleHDA patches from the "KernelAndKextPatches and Devices>Audio>Inject + ResetHDA" in Config.plist, also remove any existing VoodooHDA or any AudioKext? keep only AppleALC in the EFI/Clover/Kexts/Other folder and Original AppleHDA in S/L/E

Ok I've removed those and still nothing. I'd already removed VoodooHDA and AppleHDA hasn't been touched.

Share this post


Link to post
Share on other sites

Hi guys, I have one question about the latest version of the AppleALC 1.2.3,i see the changelog say "Added automatic rename for HDEF device',so I use the latest version,and i removed the dsdt patch HDAS-HDEF in the config.plist , then reboot, but audio does't work ! So I check the dsdt.aml and I found AppleALC hasn't rename the audio device name to HDEF,i was confuse, may I miss something?:(

Share this post


Link to post
Share on other sites
22 minutes ago, vandroiy2012 said:

It's ONLY for Ioreg. AppleALC doesn't affect on ACPI. 

Oh,i got it,thank you for reply。:D

Share this post


Link to post
Share on other sites

I've got HDEF showing in the IOREG now and I think it's correct. AppleALC and Lilu are loaded but nothing else :(

Screenshot 2018-03-22 13.47.01.png

Share this post


Link to post
Share on other sites
1 hour ago, Shaneee said:

Ok I've removed those and still nothing. I'd already removed VoodooHDA and AppleHDA hasn't been touched.

I did renaming USB's to UHCX, LPC0 to LPCB, SMB0 to SBUS, SBAZ to HDEF with changing it's OperationRegion, COPR to MATH, PIC to IPIC, DMA1 to DMAC, TMR to TIMR! Also added BUS0, LPCB, HDEF, GFX1 with HDAU _DSM with DTGP and the second with SATA patch

 

Shaneee DSDT aml:dsl.zip

Shaneee DSDT + SATA aml:dsl.zip

12 minutes ago, Shaneee said:

I've got HDEF showing in the IOREG now and I think it's correct. AppleALC and Lilu are loaded but nothing else :(

Screenshot 2018-03-22 13.47.01.png

Try other Layout ID's supported for ALC892

Share this post


Link to post
Share on other sites
16 minutes ago, ammoune78 said:

I did renaming USB's to UHCX, LPC0 to LPCB, SMB0 to SBUS, SBAZ to HDEF with changing it's OperationRegion, COPR to MATH, PIC to IPIC, DMA1 to DMAC, TMR to TIMR! Also added BUS0, LPCB, HDEF, GFX1 with HDAU _DSM with DTGP and the second with SATA patch

 

Shaneee DSDT aml:dsl.zip

Shaneee DSDT + SATA aml:dsl.zip

Try other Layout ID's supported for ALC892

 

Still a no go. I've tried layouts 1, 2, 3 and 5. What others are supported? Also with the DSDT you made HDEF disappeared from the IOREG.

Share this post


Link to post
Share on other sites

Did you tried other layout's with the DSDT from where you got this iOREG?

15 minutes ago, Shaneee said:

 

Still a no go. I've tried layouts 1, 2, 3 and 5. What others are supported? Also with the DSDT you made HDEF disappeared from the IOREG.

 

Share this post


Link to post
Share on other sites

I think it's just an _DSM Method that need to be changed with the DSDT for iOREG you showed, change that _DSM because I had same thing for my Laptop when I changed the _DSM the HDEF reappeared and worked with AppleALC, you can see it in few posts ago here!

Share this post


Link to post
Share on other sites
Posted (edited)

@jin2k9

Try this:

Trial_CX20641_LayoutID11_(0B).zip

AppleALC and Lilu in Clovers /other folder
original AppleHDA in S/L/E is required
delete all VoodooHDA files
KextInject "YES" in Clover

Inject via Clover:
Inject 11 and set FixHDA

Inject via DSDT:
DSDT / HDEF is 0B (= 11) not set FixHDA in Clover

your dump:

CX20641.png.aaae2dad42b1dba91e47017f0142f7b0.png

Nodes:

28 - 16
25 - 17
20 - 26
21 - 27

@junoir

Try this:

Trial_CX20642_LayoutID11_(0B).zip

AppleALC and Lilu in Clovers /other folder
original AppleHDA in S/L/E is required
delete all VoodooHDA files
KextInject "YES" in Clover

Inject via Clover:
Inject 11 and set FixHDA

Inject via DSDT:
DSDT / HDEF is 0B (= 11) not set FixHDA in Clover

your dump:

CX20642.png.5e4831cb3d957e0fbe45b0c0c43be397.png

Nodes:

28 - 16
25 - 17
20 - 26
21 - 29


Both first attempts in ManualMode!
If it works later in SwitchMode configuration!

have fun :D

Edited by MacPeet

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×