Jump to content

AppleALC — dynamic AppleHDA patching


vit9696
5,371 posts in this topic

Recommended Posts

1 hour ago, wern apfel said:

AppleHDAController can be loaded with a delay, I'll try that later.

This makes no sense, since HDAController is anyway loaded after AppleALC.

 

50 minutes ago, matgeo said:

Tried also something else , without CC loaded.

Started with boot argument alcverbs=1 (as per AppleALC guide) , copied alc-verb to usr/local/bin,  executed the command "alc-verb 0x19 0x707 0x20" and sound from external speakers is back.

This is the same, hda-verb is a client of CodecCommnder alc-verb of AppleALC.

I ordered an Intel NUC which also has this TRRS jack, then I can do some more tests. It seems that it works with CC because it's loaded later.

This script is adapted to your codec.

realtek256.sh.zip

Link to comment
Share on other sites

39 minutes ago, wern apfel said:

 

This script is adapted to your codec.

realtek256.sh.zip 1.19 kB · 0 downloads

Channel/StreamID:

DAC 1 = 00

DAC 2 = 00

 

Pin Control:

IntMic   = 00

ExtMic   = 25

 

IntSpeaker = 00

Headphones = 00

 

GPIO:

Direction = 00

Enable    = 00

Data      = 00

 

Unsolicited Enable:

IntSpeaker = 00

Headphones = 83

 

IntMic   = 00

ExtMic   = 85

 

Power State:

IntSpeaker = 30

Headphones = 33

 

IntMic   = 30

ExtMic   = 30

Link to comment
Share on other sites

9 hours ago, wern apfel said:

Does this computer have a physical internal speaker?

Try layout 16, no autoswitch mode anymore, maybe it work this way? Also try layout 17.

AppleALC.kext.zip 1.21 MB · 1 download

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 .

Link to comment
Share on other sites

On 1/4/2021 at 7:52 AM, mengshi said:

 

 

Just out of curiosity, I had a look at the XML of ID-99 and ID-7 - they look completely different! So I have no idea how or who got it to work (It was added in 1.1.2).

 

I also took screenshots of the pin info from Hackintool of ID-7 vs ID-99 below:

 

 

 

ID-7 Pin Pg1.png

ID-7 Pin Pg2.png

ID-7 Pin Pg 3.png

ID-99 Pin .png

ID-99 Sound settings.png

 

 

 

 

@MacPeet

codec_dump.txt.zip

 

 

Any thoughts ?

 

This is inregarding ALC887 - id 1,7 etc vs id-99.

 

id-99 SPDIF (digital out) works but USB sound doesn't, whereas  id 1,7 etc - Digital out don't work but USB does.

 

If only id-99 can somehow merge with id-1,7 etc.

 

 

 

Link to comment
Share on other sites

@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

×
×
  • Create New...