Jump to content

AppleALC — dynamic AppleHDA patching


vit9696
5,390 posts in this topic

Recommended Posts

Hi, I need some help with my custom layout for CX8400, After spending many many days, I was finally able to figure out my long standing speaker amp muting issue. The issue was as suspected, where one of the (speaker output) nodes was powering off to D3 power mode. but since it was a default connection, it didn't have to be in the platforms.xml to push signal through, so after adding said node to my custom platforms.xml, the speaker now works as expected.

 

Now I need help with the inputs.

In the custom layout I pushed to acidantera github repo, everything "works", but the (headset) line-in only works correctly after wake. this is because I'm sending the verb command 01970724 on wake to have the vref switched to 80. If I add that command to pinconfigs, or if I add a MuteGPIO to the layout.xml file, then only the built in mic shows up.
I believe I tried every permutation possible and there's just something I'm not quite understanding as to why the input disappears if the vref is switched at boot.

Codec-Dump.png

Codec-Dump-Dec.txt voodoo_dump.txt codec_dump.txt verbs.txt

Link to comment
Share on other sites

Thank you for your help @MacPeet I will test later today.

I recently got the laptop back from my wife, (and it is for sale and could leave my hands any moment), but before that happened I just wanted to see if I could fix that long standing audio muting issue, and I did, and since the rest of the config "worked" with a bit of sleep, (the built in mic worked, the HP worked, the speaker worked, and the headset line-in worked after wake or issuing the pin switch command using alcverb)

 

I knew it was not ideal to PR but it was 1000 times better than what we had before, and I was afraid I wouldn't get a chance to keep testing further, and at least that way It would possibly help someone down the line. As luck would have it, the laptop is still home, and with your help we can hopefully figure the input side and leave a 100% working solution.

 

  • Like 1
Link to comment
Share on other sites

Sorry, my mistake.

ID15 should work now too.

This is a trial for HP Elite X2 G3.

With ID12 in the release, the speakers break after 2 minutes in battery mode, with my trials everything was fine.

Combination sockets in switch mode are often difficult.

 

Archiv.zip

Link to comment
Share on other sites

Posted (edited)
2 hours ago, MacPeet said:

Sorry, my mistake.

ID15 should work now too.

This is a trial for HP Elite X2 G3.

With ID12 in the release, the speakers break after 2 minutes in battery mode, with my trials everything was fine.

Combination sockets in switch mode are often difficult.

 

Archiv.zip 1.68 MB · 1 download

 

ID15 = only internal mic works, headset/line in never appears | speaker and headphone sound ok no autoswitch

ID16 = only internal mic works, headset/line in never appears | speaker (no sound) /headphone (ok) autoswitch ok

 

This codec is very frustrating, everything happens internally and there is no indication (other than working/not working) as to how to set inputs/outputs beyond the obvious, but that doesn't really work, so some switching must occur when plug detect happens and the inputs reconfigure internally. the way it kinda works is by letting the pins map, and then switching using vref so it is now an input, and somehow the routing works, so it is internally patched, like the speaker out. but if we do that before appleHDA maps the pins, then the node is disabled. I just installed Catalina and I'm trying VoodoHDA and see if it can give some insight into how the headset mic works, but by default both mics are plugged to the same input node 19, so the headset node is disabled at boot by voodoohda. I'll try to patch it so internal mic defaults to node 20 and maybe voodoohda will give us a clue.

Edited by theroadw
more info added
Link to comment
Share on other sites

Posted (edited)

Thank you for your effort.

 

Edit:

 

@theroadw

 

The user with HP Elite X2 G3 has now tested your pull request, it works well. He had problems with ID12. Your ID14 is better. 👍

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

I have done extensive testing and just can't figure out why the node can't be in the correct state on boot AND be recognized by MacOS.

The workaround is simple enough, to have a shell script execute "alcverb 0x19 0x707 0x24" on boot, or perform a sleep/wake cycle.

Everything else works, and I can't put more time into this.

Link to comment
Share on other sites

16 hours ago, theroadw said:

Everything else works, and I can't put more time into this.

 

It's not necessary. The important devices work. Other users can continue to develop. Thank you for your efforts.

Link to comment
Share on other sites

1 hour ago, MacPeet said:

 

It's not necessary. The important devices work. Other users can continue to develop. Thank you for your efforts.

Thanks @MacPeet for your help.

 

For future development, I found that the conexant codecs are similar across many models in the linux driver, so my layout may work on many other CX codecs.

 

https://github.com/torvalds/linux/blob/master/sound/pci/hda/patch_conexant.c

 

Also an autoswitch program like ALCPlugFix could help with automatic input select using the patches from the above llnk.

Link to comment
Share on other sites

Linux is not macOS. Some things are often different or cannot be configured that way.
I'm not a big fan of VoodooHDA, even if it often works there, but a lot of things have to be set up correctly and the quality is often worse. I've often looked at VoodooHDA dumps, but it's not always possible for macOS.
I'm also not a big fan of additional ALCPlugFix.
On my Lenovo there was an ID28, which only had noise on HP. ALCPlugFix seems to have fixed this, but then I developed a manual mode where everything worked without ALCPlugFix.
All in all, these combo sockets are just difficult. In the past, with a separate socket, this was never a problem.

Link to comment
Share on other sites

@theroadw

 

If you haven't sold yet...
With SwitchMode inputs 19-26 and 19-25, Line-In is displayed.
The boost entries may still be too high or unnecessary.

 

switch.thumb.png.30230bd731d26d3422b1b2161930d4a9.png

 

Line.thumb.png.3065262f51a6ac40ce9a6cddfc1182e7.png

 

  • Like 1
Link to comment
Share on other sites

Posted (edited)
5 hours ago, MacPeet said:

@theroadw

 

If you haven't sold yet...
With SwitchMode inputs 19-26 and 19-25, Line-In is displayed.
The boost entries may still be too high or unnecessary.

 

 

 

 

 

@MacPeet you are a genius!

 

Adjusted my layout to use node 19 on both inputs and it works perfectly, also added the vref node to pinconfigs, everything works! if headphones are plugged, internal mic stays on, if headset is plugged, mic switches to line input and sound is correct. Audio out works perfectly in headphones/headset and speakers and also across sleep/wake and battery power. So I would call this a 100% solution.

My quicktime audio test recordings using both inputs sound ok, so I left the boost as it was.

 

Thank you!

Edited by theroadw
  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

Hello, I was hoping to get some help adding a new laptop to be supported with Apple ALC

I have the following information:

 

1. Laptop model/Motherboard model

Razer Blade 16 (2024)

 

2. Codec name

ALC0298

\FUNC_01&VEN_10EC&DEV_0298&SUBSYS_1A58300A&REV_1001\5&14f0b3c4&0&0001

 

3. Layout used with the info what works for you (ideally if you try them all)

I have tried all, and have had no luck

 

4. OS X versions you tried

14.1.1 (23B81)

 

5. Autogenerated Info.plist made with the help of this utility.
I have included it here.


I realize this info to include was on page 1 and now we are on page 216, so there might be more information that I need to share. Please let me know what I can do.

Thanks for the help
 

Info.plist

Link to comment
Share on other sites

×
×
  • Create New...