Jump to content

AppleALC — dynamic AppleHDA patching


vit9696
5,390 posts in this topic

Recommended Posts

Update 1

 

With layout 21 initially after boot I don't have sound from external speakers/heaphones.

But after waking from sleep sound is fine.

Maybe we can fix it?

 

Update 2

With layout 21 initially after boot I don't have sound from external speakers/heaphones.

If I execute "alc-verb 0x19 0x707 0x20" sound from headphones is back

Edited by matgeo
Link to comment
Share on other sites

7 hours ago, matgeo said:

Update 1

 

With layout 21 initially after boot I don't have sound from external speakers/heaphones.

But after waking from sleep sound is fine.

Maybe we can fix it?

 

Update 2

With layout 21 initially after boot I don't have sound from external speakers/heaphones.

If I execute "alc-verb 0x19 0x707 0x20" sound from headphones is back

This is a known behaviour on Headset jacks(TRRS). What value do you have after a restart "hda-verb 0x19 0xf07 0x0"? Does it also work with "hda-verb 0x1a 0x707 0x20"?

I'll upload later a new ALC for testing.

Link to comment
Share on other sites

24 minutes ago, wern apfel said:

This is a known behaviour on Headset jacks(TRRS).

What value do you have after a restart "hda-verb 0x19 0xf07 0x0"? Does it also work with "hda-verb 0x1a 0x707 0x20"?

I'll upload later a new ALC for testing.

I used to have the opposite problem. Sound from headphones working on boot and lost after sleep.

I prefer your version of ALC , having sound after sleep is great.

If only you can fix the boot sound.

 

"hda-verb 0x19 0xf07 0x0" returns 

nid = 0x0, verb = 0x19, param = 0xf07
0x00000000

 

"hda-verb 0x1a 0x707 0x20" doesn't do anything.

Link to comment
Share on other sites

3 hours ago, matgeo said:

I used to have the opposite problem. Sound from headphones working on boot and lost after sleep.

I prefer your version of ALC , having sound after sleep is great.

If only you can fix the boot sound.

 

"hda-verb 0x19 0xf07 0x0" returns 

nid = 0x0, verb = 0x19, param = 0xf07
0x00000000

 

"hda-verb 0x1a 0x707 0x20" doesn't do anything.

CodecCommander can run that command on startup.

 

Here is the kext, try both 11, 21

AppleALC.kext.zip

Link to comment
Share on other sites

1 hour ago, wern apfel said:

CodecCommander can run that command on startup.

 

Here is the kext, try both 11, 21

AppleALC.kext.zip 1.21 MB · 1 download

Same problem for layout 21 , worse on 11.

 

layout 21

internal speakers: OK

internal mic : OK

external speakers/headphones : sound only after sleep

 

layout 11

 

layout 21

internal speakers: OK

internal mic : OK

external speakers/headphones : no sound at all.

 

Added CodecCommander but nothing changed.

 

You are very close with layout 21. Just a minor problem is left , having sound from headphones right after boot.

Wish you can solve it.

 

Thank you again for your help.

Link to comment
Share on other sites

21 hours ago, matgeo said:

Same problem for layout 21 , worse on 11.

 

layout 21

internal speakers: OK

internal mic : OK

external speakers/headphones : sound only after sleep

 

layout 11

 

layout 21

internal speakers: OK

internal mic : OK

external speakers/headphones : no sound at all.

 

Added CodecCommander but nothing changed.

 

You are very close with layout 21. Just a minor problem is left , having sound from headphones right after boot.

Wish you can solve it.

 

Thank you again for your help.

CodecCommander needs a profile for your codec to work, try this one. I'll upload another ALC for testing.

CodecCommander.kext.zip

Link to comment
Share on other sites

20 minutes ago, wern apfel said:

Have you tried it with the new CC?

 

If you have an headset, can you make a dump with  Linux while the headset is connected?

 

Here is a new sample, try both layouts.

AppleALC.kext.zip 1.2 MB · 0 downloads

I tried CC but still no sound after boot. 

Attached the dump with external speakers connected.

I will try the new ALC and let you know.

codec_dump linux.txt

 

Update...

Something is broken with the new ALC. On both 11 and 21 there is sound from both internal and external speakers even after waking from sleep.

 

Screen Shot 2021-05-08 at 22.48.29.pdf Screen Shot 2021-05-08 at 22.50.39.pdf

Edited by matgeo
Link to comment
Share on other sites

48 minutes ago, wern apfel said:

You're right this happens when you build a debug kext, here's the release kext.

AppleALC.kext.zip 1.21 MB · 1 download

Getting close..

 

Layout 21

internal speakers: OK

internal mic : Not working , no option for internal mic , identifying as line in.

external speakers/headphones : Working fine , both on boot and after sleep.

 

Layout 11

internal speakers: OK

internal mic : Not working , identifying as internal mic

external speakers/headphones : Sound working on boot but lost after sleep.

 

I think we are getting very close to layout 21 , sound from speraker is great , left only the mic.

52 minutes ago, wern apfel said:

Does the microphone from the headset work?

 

If you mean on Linux , I will have to check it out and let you know.

Link to comment
Share on other sites

7 hours ago, matgeo said:

Getting close..

 

Layout 21

 

internal speakers: OK

internal mic : Not working , no option for internal mic , identifying as line in.

external speakers/headphones : Working fine , both on boot and after sleep.

 

Layout 11

internal speakers: OK

internal mic : Not working , identifying as internal mic

external speakers/headphones : Sound working on boot but lost after sleep.

 

I think we are getting very close to layout 21 , sound from speraker is great , left only the mic.

If you mean on Linux , I will have to check it out and let you know.

I was wrong. I forgot codeccommander.kext anabled.

Without it sound from external speakers is not enabled after boot.

So new alc is a step backwards.

Sorry about that.

 

As far as microphone from headset , I cannot test it. I use a wifislax live version and I don't know how to test microphone.

Link to comment
Share on other sites

@vit9696

 

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)

 

Regards

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

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

Edited by matxpa
Link to comment
Share on other sites

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.

Im currently using a launchagent script so it would go back to internal speaker.

I have a working NVRAM. Is there a proper fix for this?

 

 

1 hour ago, matxpa said:

@vit9696

 

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)

 

Regards

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

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

Warnings can be ignored

Edited by ellaosx
Link to comment
Share on other sites

30 minutes 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.

Im currently using a launchagent script so it would go back to internal speaker.

I have a working NVRAM. Is there a proper fix for this?

 

 

Warnings can be ignored

 

Warnings sure but an infinite compilation process of AppleALC. Does the compilation need always "Lilu.kext" and MacKernelSDK ?

 

PS: Console commande line "xcodebuild -arch x86_64 -configuration Release " works fine on local AppleALC project Directory.

Edited by matxpa
Link to comment
Share on other sites

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

×
×
  • Create New...