Jump to content

AppleALC — dynamic AppleHDA patching


vit9696
5,390 posts in this topic

Recommended Posts

18 minutes ago, Rodion2010 said:

both seems to be very similar

Node 0x18 [Pin Complex] wcaps 0x40048b: Stereo Amp-In
  Control: name="Headset Mic Boost Volume", index=0, device=0

Node 0x1a [Pin Complex] wcaps 0x40058f: Stereo Amp-In Amp-Out
  Control: name="Headphone Mic Boost Volume", index=0, device=0

what is Headset and what is Headphone Mic?

 

If the Nid's are hard-coded to be 0x19 and 0x1a then I could just check for name="Headset Mic Boost Volume" and name="Headphone Mic Boost Volume" and then convert them?

 

I'm not sure why @insanelyDeepak changed the 0x1a to 0x18 in his example though?

Edited by headkaze
  • Like 1
Link to comment
Share on other sites

10 minutes ago, headkaze said:

 

If the Nid's are hard-coded to be 0x19 and 0x1a then I could just check for name="Headset Mic Boost Volume" and name="Headphone Mic Boost Volume" and then convert them?

 

I'm not sure why @insanelyDeepak changed the 0x1a to 0x18 in his example though?

I dont know (( my Hack and my friends Hacks are desktop PCs, not Notebook

no "Headsets" there, just Mic/LineIn and Headphones

Link to comment
Share on other sites

10 minutes ago, headkaze said:

@insanelyDeepak can you show me an example of a 0x19 / Headset Mic converted verb?

01271C10 01271D01 01271EA6 01271F90 
01471C30 01471D01 01471E17 01471F90 
01971C00 01971D10 01971E8B 01971F04 
02171C20 02171D10 02171E2B 02171F04 01470C02 

Node 0x19 is Internal Mic

Node 0x12 is internal mic
You can change A6 to A0 to set Ambient Noise
This is for ALC285 of Lenovo X1 Carbon 6H,, you can chek in AppleALC.kext layout21 for ALC285.

dump_codec.txt

Edited by Andres ZeroCross
Link to comment
Share on other sites

14 minutes ago, headkaze said:

@insanelyDeepak can you show me an example of a 0x19 / Headset Mic converted verb?

Quote

 Headphone Mic=0x1a he is referring to is the Nid. So in this one he's referring to 0x1a.

i'm refering to 1a bcoz this NID is connected to headphone as per linux 

 

Quote

0x19 / Headset Mic

 is external line-in but no mic jack in laptop , may be laptop has external line-in jack option in codec but vendor hasn't given more jack only combojack 

 

 

16 minutes ago, Rodion2010 said:

I dont know (( my Hack and my friends Hacks are desktop PCs, not Notebook

no "Headsets" there, just Mic/LineIn and Headphones

me too but most of my friend has notebook 

29 minutes ago, headkaze said:

 

If the Nid's are hard-coded to be 0x19 and 0x1a then I could just check for name="Headset Mic Boost Volume" and name="Headphone Mic Boost Volume" and then convert them?

 

I'm not sure why @insanelyDeepak changed the 0x1a to 0x18 in his example though?

 

you have to just look for name="Headphone Mic Boost Volume" if it exist and enable then change this to line-in as you do with external mic 

Edited by insanelyDeepak
Link to comment
Share on other sites

7 minutes ago, insanelyDeepak said:

i'm refering to 1a bcoz this NID is connected to headphone as per linux

 

is external line-in but no mic jack in laptop , may be laptop has external line-in jack option in codec but vendor hasn't given more jack only combojack

 

 

me too but most of my friend has notebook

 

you have to just look for name="Headphone Mic Boost Volume" if it exist and enable then change this to line-in as you do with external mic

if you are talking about 0x19 from dump then she has Pin Widget Control=0x00

Link to comment
Share on other sites

2 minutes ago, tyufhl said:

if you are talking about 0x19 from dump then she has Pin Widget Control=0x00

no i'm talking about Node 1a 

 

because each codec_dump has has different nodes so just need to look for name="Headphone Mic Boost Volume" thats it , if this line node is 18 , 15 , 19 ,20 , 1a ,1b etc just need to use it 

 

that's all 

Link to comment
Share on other sites

2 hours ago, insanelyDeepak said:

no i'm talking about Node 1a 

 

because each codec_dump has has different nodes so just need to look for name="Headphone Mic Boost Volume" thats it , if this line node is 18 , 15 , 19 ,20 , 1a ,1b etc just need to use it 

 

that's all 

Okay thanks for the clarification.

 

So I have implemented this but there are some potential issues.

1. Is it okay to have G=15 / P=0 for both Headphone / Headset?

2. When clicking "Apply Fix" these two rules effect the Headset Mic entry:

8. 71e / 71f - First Microphone Port set to Internal + Jack / Connector set to Unknown (Enables DSP Noise Reduction - Rodion2010)
9. 71e - Second Microphone Device set to Line In / Connector set to Unknown (Ext Mic doesn't work on Hackintoshes - Rodion2010)

Since it's the second Microphone in the list it will change Device from Microphone to Line In / Connector to Unknown

 

Please try the attached version and please advise on solving the above issues.

 

Edited by headkaze
  • Like 1
Link to comment
Share on other sites

22 minutes ago, headkaze said:

Okay thanks for the clarification.

 

So I have implemented this but there are some potential issues.

1. Is it okay to have G=15 / P=0 for both Headphone / Headset?

2. When clicking "Apply Fix" these two rules effect the Headset Mic entry:


8. 71e / 71f - First Microphone Port set to Internal + Jack / Connector set to Unknown (Enables DSP Noise Reduction - Rodion2010)
9. 71e - Second Microphone Device set to Line In / Connector set to Unknown (Ext Mic doesn't work on Hackintoshes - Rodion2010)

Since it's the second Microphone in the list it will change Device from Microphone to Line In / Connector to Unknown

 

Please try the attached version and please advise on solving the above issues.

PinConfigurator.zip

all is good but node 18 is unnecessary 1a is good enough

1151043070_ScreenShot2019-02-10at9_34_17PM.png.6daa93c61ab9682efc80e994c6936036.png

 

 

i'm explaining again : 

all new laptops having rebrand audio chips like alc298 aka ALC3266 , these chips can have many input outputs as chips allow but it's vendor who decide what option to give in laptops 

Now if laptop has 2 Mic also seperate Jacks then you won't see  "Headphone Mic Boost Volume" node bcoz these model don't have combojack

late 2017 laptop has combojack but in codec_dump they still has seperate node id for external mic again you won't see "Headphone Mic Boost Volume" , app is doing good you don't have to worry about 

Now come to latest laptops they have "Headphone Mic Boost Volume"  and "Headset Mic " , but we need to care for "Headphone Mic Boost Volume" only , so just ignore "Headset Mic

 

 

8. 71e / 71f - First Microphone Port set to Internal + Jack / Connector set to Unknown (Enables DSP Noise Reduction - Rodion2010)
9. 71e - Second Microphone Device set to Line In / Connector set to Unknown (Ext Mic doesn't work on Hackintoshes - Rodion2010)

 

these are essential standards so use as is 

 

 

Quote

Is it okay to have G=15 / P=0 for both Headphone / Headset?

personally speaking G has no effect on device you can have 0 for all etc , it's looks good when have 1,2,3,4,5,6 numerical order 

 

1830208923_ScreenShot2019-02-10at9_53_38PM.thumb.png.c790ac5d4b311af628dd7ce2a091dc75.png

 

 

 

Edited by insanelyDeepak
Link to comment
Share on other sites

2 hours ago, insanelyDeepak said:

all is good but node 18 is unnecessary 1a is good enough

 

personally speaking G has no effect on device you can have 0 for all etc , it's looks good when have 1,2,3,4,5,6 numerical order 

Okay thanks again. I've uploaded Pin Configurator v2.0.2 with these changes and I've put back all original sanitizing from verbit even if only cosmetic.

 

If you get some time please test it is working as expected.

  • Like 1
Link to comment
Share on other sites

5 hours ago, insanelyDeepak said:

@headkaze final feature if you add generating codec_dump_dec.txt.svg  as codecgraph does, then it will be full fledge codec configurator 

 

also you add option to export text file like verbs.txt , so it will easy compare if app fails sometimes

I think it would take quite a bit of work to convert the codecgraph.py source over to Objective C. I'm not sure I can justify spending the time on it to be honest.

  • Like 1
Link to comment
Share on other sites

On 2/8/2019 at 2:48 AM, Andres ZeroCross said:

You need CodecCommander.kext in Library/Extensions and use SSDT.aml or custom info.plist of codeccommander to set Pin Widget of your External Mic

 

Hello!

 

I have CodeCommander in L/E, I placed the SSDT-CX8200.aml in the ACPI/Patches folder int EFI. After fixing permissions and rebuilding kext cache, the mac crashes during reboot or few seconds after (tried it a few times)

 

Is there something I can do?

 

Linux Pins:

image.png.fe76f03704487776fac3ff53329f8ed8.png

 

image.png.2f120993f32de232de5118bb5c62816a.png

 

I tried replacing the ConfigData in AppleALC.kext Info Plist. After fixing permissions, rebuilding cache and rebooting, the sound options said Output is unknown and it has no controls. So actually internal speaker stopped working. After rerolling it was working again.

image.png.d9a83576f23ebcca9743bb0f5a7f1a1c.png

 

image.png.51623dc07634750435ffca7e3e55e6bb.png

Thank you in advance for your help

 

Edited by sweet
Link to comment
Share on other sites

3 hours ago, Rodion2010 said:

simple script that shows PinConfigurations from IORegistry

That script inspired me to add support for importing IORegistry data into Pin Configurator. But it's made me discover an issue. When I import my own data I have a "HDMI" node. If I click on "Apply Fix" then it will remove this port. My guess is I need this port for the DisplayPort audio out to my monitor. So it looks like I need to remove the automatic "HDMI" port removal or perhaps skip the ones that have Port marked as Internal?

IOReg.png

Edited by headkaze
Link to comment
Share on other sites

8 hours ago, headkaze said:

I think it would take quite a bit of work to convert the codecgraph.py source over to Objective C. I'm not sure I can justify spending the time on it to be honest.

i can understand , may be i could do help you in free time 

 

import verbs.txt file like verbit does will be a good option , can you do that ? 

Edited by insanelyDeepak
Link to comment
Share on other sites

4 hours ago, Rodion2010 said:

simple script that shows PinConfigurations from IORegistry

1136649198_2019-02-111_12_52.png.c3f295f10b4725b24fba67d3a4db844a.png

 

 

PinConfig-Info.zip

seems good but it shows many devices which is not present in my system , also headphone RCA instead 1/8

 

Quote

Last login: Mon Feb 11 08:51:59 on ttys000

iMac:~ deepak$ /Users/deepak/Downloads/PinConfig-Info

 

Pin     : Gr Device     Connector       Port         Location Color    Misc

 

00003340: 00 CD         ATAPI internal  Int.& Jack   N/A      Unknown  0

f0111141: f0 Speaker    1/8"            Int.& Jack   Rear     Black    1

10401191: 10 Speaker    1/8"            Int.& Jack   Rear     Green    0

f0111141: f0 Speaker    1/8"            Int.& Jack   Rear     Black    1

f0111141: f0 Speaker    1/8"            Int.& Jack   Rear     Black    1

f0111141: f0 Speaker    1/8"            Int.& Jack   Rear     Black    1

3090a191: 30 Mic In     1/8"            Int.& Jack   Rear     Pink     0

40918192: 40 Line In    1/8"            Int.& Jack   Front    Pink     1

3f308101: 3f Line In    1/8"            Jack         Rear     Blue     0

20402102: 20 HP Out     1/8"            Jack         Front    Green    0

f0111141: f0 Speaker    1/8"            Int.& Jack   Rear     Black    1

01c62440: 01 HP Out     RCA             Int.& Jack   N/A      Reserved 1

f0111141: f0 Speaker    1/8"            Int.& Jack   Rear     Black    1

f0111141: f0 Speaker    1/8"            Int.& Jack   Rear     Black    1

iMac:~ deepak$

 

 

9 hours ago, headkaze said:

Okay thanks again. I've uploaded Pin Configurator v2.0.2 with these changes and I've put back all original sanitizing from verbit even if only cosmetic.

 

If you get some time please test it is working as expected.

done , all is good now

 

1475914717_ScreenShot2019-02-11at9_01_25AM.png.a305b0e21a801f970a9f61248cdaf517.png 

 

 

Link to comment
Share on other sites

2 hours ago, headkaze said:

My guess is I need this port for the DisplayPort audio out to my monitor. So it looks like I need to remove the automatic "HDMI" port removal or perhaps skip the ones that have Port marked as Internal?

 

HDMI and analog codec are two different devices

partial dump

HdaCodecDump start
Codec: NVIDIA (Unknown)
AFG Function Id: 0x1 (unsol 0)
Vendor ID: 0x10DE0042
Revision ID: 0x100100
Default PCM: N/A
Default Amp-In caps: N/A
Default Amp-Out caps: N/A
Node 0x04 [Pin Complex] wcaps 0x407381: Stereo Digital
  Pincap 0x09000094: OUT Detect HBR HDMI DP
  Pin Default 0x185600F0: [Jack] Digital Out at Int Special
    Conn = Digital, Color = Unknown
    DefAssociation = 0xF, Sequence = 0x0
Pin-ctls: 0x00:
  Connection: 4
     0x08 0x09 0x0A 0x0B

———— skip ———

Codec: Analog Devices AD1988B
AFG Function Id: 0x1 (unsol 0)
Vendor ID: 0x11D4198B
Revision ID: 0x100400
Default PCM:
    rates [0x7FF]: 8000 11025 16000 22050 32000 44100 48000 88200 96000 176400 192000
    bits [0xE]: 16 20 24
    formats [0x1]: PCM
Default Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x mute=0
Default Amp-Out caps: ofs=0x27, nsteps=0x27, stepsize=0x mute=5
Node 0x02 [Audio Output] wcaps 0x30311: Stereo Digital
  Connection: 1
     0x1D

—— skip ——

all pinconfigurations discussed here are related with analog codec setup only

so HDMI data must be removed or ignored

  • Like 1
Link to comment
Share on other sites

6 hours ago, Rodion2010 said:

 

HDMI and analog codec are two different devices

partial dump


HdaCodecDump start
Codec: NVIDIA (Unknown)
AFG Function Id: 0x1 (unsol 0)
Vendor ID: 0x10DE0042
Revision ID: 0x100100
Default PCM: N/A
Default Amp-In caps: N/A
Default Amp-Out caps: N/A
Node 0x04 [Pin Complex] wcaps 0x407381: Stereo Digital
  Pincap 0x09000094: OUT Detect HBR HDMI DP
  Pin Default 0x185600F0: [Jack] Digital Out at Int Special
    Conn = Digital, Color = Unknown
    DefAssociation = 0xF, Sequence = 0x0
Pin-ctls: 0x00:
  Connection: 4
     0x08 0x09 0x0A 0x0B

———— skip ———

Codec: Analog Devices AD1988B
AFG Function Id: 0x1 (unsol 0)
Vendor ID: 0x11D4198B
Revision ID: 0x100400
Default PCM:
    rates [0x7FF]: 8000 11025 16000 22050 32000 44100 48000 88200 96000 176400 192000
    bits [0xE]: 16 20 24
    formats [0x1]: PCM
Default Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x mute=0
Default Amp-Out caps: ofs=0x27, nsteps=0x27, stepsize=0x mute=5
Node 0x02 [Audio Output] wcaps 0x30311: Stereo Digital
  Connection: 1
     0x1D

—— skip ——

all pinconfigurations discussed here are related with analog codec setup only

so HDMI data must be removed or ignored

correct

  • Like 1
Link to comment
Share on other sites

8 hours ago, Rodion2010 said:

HDMI and analog codec are two different devices

Is there a way to differentiate between the two from the "Pin Default" value alone? When you import from IORegistry HDEF/PinConfigurations value all you have is the pin data.

 

In other words will the only way I know it's a HDMI node is by checking for "HDMI" in the "Pincap" line?

Link to comment
Share on other sites

9 hours ago, insanelyDeepak said:

i can understand , may be i could do help you in free time 

That would be great. If you can port it to C/C++ or Objective C I can easily integrate it.

9 hours ago, insanelyDeepak said:

i can understand , may be i could do help you in free time 

 

import verbs.txt file like verbit does will be a good option , can you do that ? 

Do you mean export verbs.txt? It can already import raw verb data. If you mean export this info then it shouldn't be too hard to do that.

  • Like 1
Link to comment
Share on other sites

11 minutes ago, headkaze said:

That would be great. If you can port it to C/C++ or Objective C I can easily integrate it.

yes, i have good experience with Obj and Swift but no python yet , will give it a try 

 

11 minutes ago, headkaze said:

Do you mean export verbs.txt? It can already import raw verb data. If you mean export this info then it shouldn't be too hard to do that.

 

yeah my bad i mean export

Edited by insanelyDeepak
Link to comment
Share on other sites

1 hour ago, headkaze said:

Is there a way to differentiate between the two from the "Pin Default" value alone? When you import from IORegistry HDEF/PinConfigurations value all you have is the pin data.

 

In other words will the only way I know it's a HDMI node is by checking for "HDMI" in the "Pincap" line?

from IORegistry

 

ioreg -rw 0 -p IODeviceTree -n HDEF | grep PinConfigurations
      "PinConfigurations" = <3040210210401001f0111751219080022e308101121010012090a09122113399f011f791f0f14501f0f1c5411160100114201001>
ioreg -rw 0 -p IODeviceTree -n HDAU | grep PinConfigurations
      "PinConfigurations" = <e0005628> // it is HDMI

 

Link to comment
Share on other sites

×
×
  • Create New...