Jump to content

AppleALC — dynamic AppleHDA patching


vit9696
5,390 posts in this topic

Recommended Posts

@MacPeet Could you please help me with getting the audio working with MSI MPG B550 Gaming Edge Wifi board. I have tried all the layout ids available in the doc. I took a codec dump from linux and tried patching AppleAPLC.text with ConfigData generated from the dump using pin configurator but no luck. The motherboard spec says it uses ALC1200 but in fact its using ALCS1200A as per the codec dump.

 

Btw, the patched kext gave a static crackling noise when anything was played at max volume.

 

I have attached the codec dump and also DSDT if required.

codec_dump.txtDSDT.dslDSDT.aml

Edited by SolidMecury
Link to comment
Share on other sites

Today I noticed that the audio is working with the kext I have patched but it works only when I do cold start. I have a dual boot configuration with Windows. When I restart from windows and boot into Mac OS, audio doesn't work though all the output devices are listed. But when I shutdown completely and then boot to Mac OS, audio works fine. Found couple of old threads where users have suggested not to use Realtek driver in windows and use the windows default driver or always do cold start. How can I fix this properly?

Edited by SolidMecury
Link to comment
Share on other sites

The problem is known on some computers. Windows writes values into the nvram (SystemAudioVolume and SystemAudioVolumeDB) that macOS cannot work with. Use the cold start or try to enter SystemAudioVolume and SystemAudioVolumeDB in OC / nvram / Delete.

Link to comment
Share on other sites

18 hours ago, MacPeet said:

@mengshi

 

Your codec dump and id99 has SPDIF on 17-16
ID1 and ID7 have SPDIF at 30-6

 

try this with id 7 (30-6 changed to 17-16):

 

AppleALC.kext.zip 1.19 MB · 1 download


USB audio has nothing to do with AppleALC.

 

@Macpeet

 

Thanks so much but unfortunately it doesn't work.

 

Let me show a few screencaps.

 

1. With unmodified AppleALC, id-1, digital out doesn't work. USB works and can detect both USB devices

 

 

 

902592496_Screenshot2021-05-15at5_30_39PM.png.2ffd378ab07aec530de5e36c74dc7ec2.png

 

 

 

 

2. With your modified AppleALC, id-7, digital doesn't work, both USB devices detected and work. Essentially behaves identical to id-1.

 

820169806_Screenshot2021-05-15at5_35_50PM.png.4d9bc8f8c8b26a8a3f30c13d4a8b29dc.png

 

 

 

3. With unmodified AppleALC, id-99, digital out works, USB Audioengine D1 doesn't work (this device has both USB and optical SPDIF input -changing it to usb input doesn't work, optical input works), Meizu HiFi Dac USB works.

 

 

1513591957_Screenshot2021-05-15at5_43_11PM.png.fed7b9aebbf6a3bb40496f819037d7e2.png  

 

Note the number of outputs changed.

 

---------------------------------------

 

Pin configurator from codec dump:

 

1849810705_Screenshot2021-05-15at2_17_09PM.png.ff47f4e662fb89c76060dcb1a1887e6b.png

 

 

 

id-99 works the best. I can live with this.

 

 

Thanks for helping.

 

 

Edited by mengshi
grammar
Link to comment
Share on other sites

  • 2 weeks later...

@matgeo  I've made some progress with the TRRS jack issue, but not completely  fixed, I will upload a sample if it's fixed.

 

On 5/14/2021 at 2:37 AM, ellaosx said:

It has an internal speaker.

 

With 16, same issue.

With 17, Headphone did not show up even i plug it. Only Internal Speaker is visible but i lost sound this time .

Do you have a codec dump? I have an Optiplex that has the same issue and has been fixed. It has internal speakers, line-out and headphones, does yours have the same?

Link to comment
Share on other sites

Thanks in advance, I'm having a problem with my CX8400 codec and I believe the problem is caused by power management and was wondering if there's a method for patching that using AppleALC.

 

The problem is that the speaker output stops working randomly, and by switching to headphones and back to speaker, audio returns for a few seconds, then again silence. There are no errors reported anywhere, and as far as the system is concerned it thinks there's audio coming out of the speaker.

After a lot of hair pulling, I believe the problem is most likely related to something that AppleHDA is doing when it knows the laptop is under battery power.

 

If the laptop doesn't have a working battery manager kext, then the audio codec and speaker out work as expected.

Under AC power and as long as the laptop doesn't go to sleep, the audio codec works as expected, but if the battery is discharged past a certain spot, and the battery manager does a full poll, then the speaker output starts muting again.

 

VoodooHDA doesn't use AppleHDA and doesn't present these problems at all under battery power or after sleep, So it's only the combo "working battery" and AppleHDA that create the problem, so I suspect a power saving "feature" gone bad.

Anyone knows of a patch that will bypass this "feature" so I can test?

 

Cheers!

Link to comment
Share on other sites

12 hours ago, theroadw said:

Thanks in advance, I'm having a problem with my CX8400 codec and I believe the problem is caused by power management and was wondering if there's a method for patching that using AppleALC.

 

The problem is that the speaker output stops working randomly, and by switching to headphones and back to speaker, audio returns for a few seconds, then again silence. There are no errors reported anywhere, and as far as the system is concerned it thinks there's audio coming out of the speaker.

After a lot of hair pulling, I believe the problem is most likely related to something that AppleHDA is doing when it knows the laptop is under battery power.

 

If the laptop doesn't have a working battery manager kext, then the audio codec and speaker out work as expected.

Under AC power and as long as the laptop doesn't go to sleep, the audio codec works as expected, but if the battery is discharged past a certain spot, and the battery manager does a full poll, then the speaker output starts muting again.

 

VoodooHDA doesn't use AppleHDA and doesn't present these problems at all under battery power or after sleep, So it's only the combo "working battery" and AppleHDA that create the problem, so I suspect a power saving "feature" gone bad.

Anyone knows of a patch that will bypass this "feature" so I can test?

 

Cheers!

Have the same problem with my Acer IceLake 1035G1 and Conexant CX8400 audio codec.

Any help is very welcome.

Link to comment
Share on other sites

12 hours ago, wern apfel said:

try this kext, layout 15, 16 and 17, they are different configured.

15 = No sound coming from Internal Speaker & Headphones 

16 = Internal Speaker is OK. No Headphones

17 = No Output visible

Link to comment
Share on other sites

On 5/30/2021 at 5:15 AM, ellaosx said:

15 = No sound coming from Internal Speaker & Headphones 

16 = Internal Speaker is OK. No Headphones

17 = No Output visible

In a previous post you said that you only have speakers and headphones, but the dump also shows me line-out. What's the device name? Does it work with VoodooHDA?

Link to comment
Share on other sites

Hi,

i'm struggling to create a custom setup for my laptop. I've tried already all the layoutid already present in AppleALC. If i use id 76 i have speakers working but when i connect earspeaker i've a distorted audio.

I've tried to use pin configurator to build a patch and then compile a new AppleALC version but i ended up with a not working speakers and the same distortion when using earspeker.

Could someone please give a look at my linux dump and help me out ?

Thanks

Mattia

 

 

dump.txt.zip

Edited by tmbt
Link to comment
Share on other sites

On 5/23/2021 at 10:55 PM, wern apfel said:

@matgeo  I've made some progress with the TRRS jack issue, but not completely  fixed, I will upload a sample if it's fixed.

 

Could you push a commit for the changes you made for ALC256 layout 21 to Acidanthera , so as to keep those changes with latest releases?

Latest commits may fix the problem with the audio from speakers working only after sleep.

Link to comment
Share on other sites

have successfully gotten big sur to run on this aliexpress special kllisre x79 m2 motherboard with a c204 chipset

last piece of hardware seems to be audio, I can see it uses a realtek alc662 chipset from a visual inspection and in windows it appears to utilise the alc662 drivers

ioreg/ioname for the hdef device appears to be pci8086,1c20

i've loaded up applealc as per normal and have run through all of the possible layout id's without any luck

 

any one able to shed any light on this?

Link to comment
Share on other sites

×
×
  • Create New...