Jump to content

AppleALC — dynamic AppleHDA patching


vit9696
5,390 posts in this topic

Recommended Posts

1 hour ago, matxpa said:

I don't have 10.6, 10.8 SDKs (since a long time i suppose) only 10.15 and 11.3.

MacOSX.sdk and MacOSX11.sdk are two MacOSX11.3.sdk's links

 

lrwxr-xr-x  1 root  wheel   14 27 avr 10:49 MacOSX.sdk -> MacOSX11.3.sdk

drwxr-xr-x  8 root  wheel  256 27 avr 10:50 MacOSX10.15.sdk

drwxr-xr-x  7 root  wheel  224 16 mar 15:03 MacOSX11.3.sdk

lrwxr-xr-x  1 root  wheel   14 27 avr 10:48 MacOSX11.sdk -> MacOSX11.3.sdk

 

Attached

/Library/Developer/CommandLineTools/SDKs on SB 11.3.1 and 

/Library/Developer/CommandLineTools/SDKs on Mojave 10.14.6

 

And i checked WEG.xcodeproj with Xcode and "MACOSX_DEPLOYMENT_TARGET = 10.8;" don't avoid compilation with OCBuilder.app and with Xcode compilation is OK with same warnings as AppleALC but finished.

 

May be AppleALC build constraints have changed or it's a BS 11.3.1 or Xcode 12.5 problem.

 

 

MY BAD, I'm confused, AppleALC build is more than 10 minutes, I remember it was long but not so long.

 

 

Capture d’écran 2021-05-10 à 16.27.59.png

Capture d’écran 2021-05-10 à 16.44.27.png

I'm not sure if you need these SDKs, maybe MacKernelSDK will replaced theml. AppleALC is not compatible with 10.6

Link to comment
Share on other sites

53 minutes ago, wern apfel said:

 

AppleALC.kext.zip 1.21 MB · 2 downloads

Try the kext from that post

Getting worse. With both layouts there is a high noise from external speakers at startup and there is no auto switch between internal/external speakers.

 

Whenever line in is present there is that high noise. My bet is that is better without it.

 

Best alc version so far is the attached with layout 21. Only problem that sound from external speakers works only after sleep.

 

AppleALC.kext.zip

Link to comment
Share on other sites

6 hours ago, wern apfel said:

Is the internal speakers, first device, not working? 

Here's a kext where it is missing

AppleALC.kext.zip 1.21 MB · 2 downloads

 

Still not saving. Both headphone & internal speaker are working. The only issue is it does not save the chosen output (internal speaker). It goes back to headphone after restart or from shutdown.

Link to comment
Share on other sites

On 5/10/2021 at 9:23 PM, matgeo said:

Getting worse. With both layouts there is a high noise from external speakers at startup and there is no auto switch between internal/external speakers.

 

Whenever line in is present there is that high noise. My bet is that is better without it.

 

Best alc version so far is the attached with layout 21. Only problem that sound from external speakers works only after sleep.

 

AppleALC.kext.zip 1.21 MB · 0 downloads

@wern apfel, any progress?

Link to comment
Share on other sites

On 4/14/2020 at 10:05 PM, MacPeet said:

@mengshi

 

this ID 7:

 

7.png.dc6b99dfcc7daba50006259383e63d6d.png

 

this is ID 99:

 

99.png.3682bb079997aba52e8888820004325d.png

 

Both have configured SPDIF-Out with nodes 30-6.
Maybe ID 7 has a conflict with two "orange" ?!

Please do a codec dump with a Linux Live version (example Ubuntu) for more details! This is better for a new codec for you.

 

 

 

Here is my codec dump. This one if the issue with the ALC887. In particular:

 

id-1, id-7 all ports work except for SPDIF. USB sound works.

 

id-99 - SPDIF and internal ports work but all USB sounds don'r work.

 

Thanks.

 

 

 

 

 

codec_dump.txt.zip

Link to comment
Share on other sites

On 5/11/2021 at 1:37 AM, ellaosx said:

Still not saving. Both headphone & internal speaker are working. The only issue is it does not save the chosen output (internal speaker). It goes back to headphone after restart or from shutdown.

Layout 16 is configured for two internal speakers. It's a bit confusing, I think it's configured to have a real internal speaker and also LineOUT 1 as internal speakers. A Linux codec dump could be useful. You can also run the script from the attachment. 

 

12 hours ago, matgeo said:

@wern apfel, any progress?

Copy hda-verb to "usr/local/bin" make sure CodecCommander(not the one I uploaded) is loaded, run the script, show me the output. It may not work as expect it's only a quick edit from a script for the Creative codec, but I'll try to improve it.

 

Regarding the headset: You can use one from a smartphone.

realtek.sh.zip

Link to comment
Share on other sites

1 hour ago, wern apfel said:

Copy hda-verb to "usr/local/bin" make sure CodecCommander(not the one I uploaded) is loaded, run the script, show me the output. It may not work as expect it's only a quick edit from a script for the Creative codec, but I'll try to improve it.

 

Regarding the headset: You can use one from a smartphone.

realtek.sh.zip 1.07 kB · 2 downloads

 

output.txt

Link to comment
Share on other sites

2 hours ago, wern apfel said:

Layout 16 is configured for two internal speakers. It's a bit confusing, I think it's configured to have a real internal speaker and also LineOUT 1 as internal speakers. A Linux codec dump could be useful. You can also run the script from the attachment. 

Both Layout 16 & 17 works. its just that it doesnt save my chosen output which is Internal Speaker.

So i dump both using your script.

 

Thank you so much for consideration.

Ellaosx.zip

 

Link to comment
Share on other sites

1 hour ago, ellaosx said:

Both Layout 16 & 17 works. its just that it doesnt save my chosen output which is Internal Speaker.

So i dump both using your script.

 

Thank you so much for consideration.

Ellaosx.zip 2.24 kB · 1 download

 

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

Link to comment
Share on other sites

31 minutes ago, wern apfel said:

It should work when unsolicited enable for headphones is 83. Is that value the same before and after sleep?

Yes it is the same value.

 

What can I do about "unsolicited enable for headphones 83" ?

 

Update...

Other values are diffirent before and after sleep.

after sleep.txt at boot.txt

Edited by matgeo
Link to comment
Share on other sites

8 minutes ago, wern apfel said:

Is it 83 even if the headphones do not work? The Power management also seems to affect the result. Run the script while Musik is playing.

I added the power state to the script.

realtek.sh.zip 1.22 kB · 1 download

Yes , it is the same 83 , even at boot when sound from external speakers is not working.

Attached new outputs.

 

after boot.txt after sleep.txt

Link to comment
Share on other sites

12 minutes ago, matgeo said:

Yes , it is the same 83 , even at boot when sound from external speakers is not working.

Attached new outputs.

 

after boot.txt 468 B · 0 downloads after sleep.txt 466 B · 0 downloads

Reboot and run this commands "hda-verb 0x1 0x717 0x0", "hda-verb 0x1 0x716 0x0" does it enable HP/ext.Spk?

Also run this "hda-verb 0x19 0x707 0x24" and then the script.

 

We are just trying to get the external output up and running?

Link to comment
Share on other sites

14 minutes ago, wern apfel said:

Reboot and run this commands "hda-verb 0x1 0x717 0x0", "hda-verb 0x1 0x716 0x0" does it enable HP/ext.Spk?

Also run this "hda-verb 0x19 0x707 0x24" and then the script.

 

We are just trying to get the external output up and running?

The only problem with attached appealc (and layout 21) is that sound from external speakers/headphones is now working right after boot , but only after sleep. After boot I have no sound from external speakers but after sleep everything is OK and it keeps after several sleep cycles till I reboot.

 

Do I have to run these commands with codeccommander loaded or not?

AppleALC.kext.zip

Link to comment
Share on other sites

16 minutes ago, matgeo said:
34 minutes ago, wern apfel said:

Reboot and run this commands "hda-verb 0x1 0x717 0x0", "hda-verb 0x1 0x716 0x0" does it enable HP/ext.Spk?

Also run this "hda-verb 0x19 0x707 0x24" and then the script.

 

We are just trying to get the external output up and running?

Run with codecocmmander enabled.

The first 2 commands not working.

The command "hda-verb 0x19 0x707 0x24" starts sound from extrnal speaker.

Here is the output.

new.txt

Link to comment
Share on other sites

2 hours ago, matgeo said:

The command "hda-verb 0x19 0x707 0x24" starts sound from extrnal speaker.

It seems that this command also changes the power state of the pins to D0, maybe the codec needs a reset. So the question is why it works with CC and not when we send the command via AppleALC. Probably the loading order. AppleHDAController can be loaded with a delay, I'll try that later.

Link to comment
Share on other sites

17 minutes ago, wern apfel said:

It seems that this command also changes the power state of the pins to D0, maybe the codec needs a reset. So the question is why it works with CC and not when we send the command via AppleALC. Probably the loading order. AppleHDAController can be loaded with a delay, I'll try that later.

Tried the command without CC , and it didn't work. It shows error that it needs CC. Maybe that is the problem?

 

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.

Maybe that helps?

Here is the output after the command (changed hda-verb to alc-verb to run it)

 

Pin Control:

LineIN 1 = 20

LineIN 2 = 00

 

LineOUT 1  = 00

LineOUT 2  = 00

LineOUT 3  = 00

Headphones = 00

 

GPIO:

Direction = 01

Enable    = 01

Data      = 00

 

Unsolicited Enable:

LineOUT 1  = 00

LineOUT 2  = 00

LineOUT 3  = 00

Headphones = 83

 

LineIN 1 = 00

LineIN 2 = 00

 

Power State:

LineOUT 1  = 33

LineOUT 2  = 00

LineOUT 3  = 00

Headphones = 33

 

LineIN 1 = 33

LineIN 2 = 33

Link to comment
Share on other sites

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

×
×
  • Create New...