Jump to content

AppleALC — dynamic AppleHDA patching


vit9696
5,371 posts in this topic

Recommended Posts

16 hours ago, matgeo said:

Layout 21

 

 identifying as line in.

With headphones connected? Thats what I'm trying to do, it should auto switch from internal mic to line in.

 

5 hours ago, ellaosx said:

AppleALC already has codeccommander afaik

No, AppleALC can send verbs on wakeup but not on startup. CC can also send commands before sleep.

 

2 hours ago, matxpa said:

Hi all

 

On a Laptop IVy Bridge with BS 11.3.1 (20E241) and Xcode Version 12.5 (12E262)

AppleALC (v1.6.1) can't be compiled with OCBuilder (app) nor with Xcode  (MACOSX_DEPLOYMENT_TARGET = 10.6; or MACOSX_DEPLOYMENT_TARGET = 10.8; in project.pbxproj)

Do you have the SDKs for 10.6, 10.8?

 

 

Link to comment
Share on other sites

8 minutes ago, wern apfel said:

With headphones connected? Thats what I'm trying to do, it should auto switch from internal mic to line in.

 

 

 

 

Yes , with headphones connected. And there is another problem with latest alc. If i disconnect headphones it doesn't auto switch to internal speakers.

Link to comment
Share on other sites

40 minutes ago, matgeo said:

Yes , with headphones connected. And there is another problem with latest alc. If i disconnect headphones it doesn't auto switch to internal speakers.

Another one

 

1 hour ago, ellaosx said:

Hi

I have 2 outputs, Internal speaker & headphones on my ALC662 ID 16.

If select internal speaker to be the default, it goes back to headphone  everytime I restart, or even shutdown.

Are the internal speakers the second device? You can also try this kext

AppleALC.kext.zip

Link to comment
Share on other sites

1 hour ago, wern apfel said:

...

Do you have the SDKs for 10.6, 10.8?

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.

 

Quote

 

 

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

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

Edited by matxpa
Link to comment
Share on other sites

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

×
×
  • Create New...