Jump to content

AppleALC - Need help on custom layout for ALC255


swissblade27
 Share

48 posts in this topic

Recommended Posts

hello, i recently made a custom layout for my laptop (layout=69 in ALC255) and it got merged into the main repo. i had an annoying issue with my layout (headsets produced white noise when the power state changed from AC to BAT), but i recently fixed it with new ConfigData and i will make a new pull request to main repo.

 

now i have another strange problem. after the computer sleeps and wakes up, when the internal microphone (node 0x12) is used and after it enters sleep state, headsets (node 0x19) no longer produce sound after some time. i need to unplug and then plug headsets back in order to get working sound. they continue to work even if internal microphone enters sleep state after unplugging & plugging procedure. this problem also doesn't happen on cold boot.

 

can anyone help me solve this problem? this is the only remaining bug in my hackintosh :(

 

my laptop specs and EFI: https://github.com/juniorcaesar/OC-A315-56-327T

my cloned AppleALC repo: https://github.com/juniorcaesar/AppleALC

 

pin control states in my config, current configdata, and codec dumps from linux & opencore are attached below.

 

thanks in advance!

pin control info.png

linux_card0-codec#0.txt opencore_Codec0.txt PinConfig.rtf

Link to comment
Share on other sites

  • 4 weeks later...

I'm running a "similar" problem with my laptop alc256 - layout 13, everything works but after sleep kernel process uses 50% CPU and power log show its applehda interrupts. So I made a new layout and if I remove the mic in node, everything is happy before and after sleep, but everything I've tried keeping the plug (headset) mic enabled creates glitches.

If I reinit all or some of the the eapd nodes then the input defaults to line in, and I have to change the coefficients to change back to built in mic default, but now the problem is there is an idle sleep preventing task with apple hdef output, if I don't reinit the nodes, then high kernel activity.

I've compared the coefficients using this method.

 

https://github.com/acidanthera/AppleALC/wiki/Dumping-processing-coefficients

 

And they are mostly the same before and after sleep. Only one changed coefficient and changing it only makes input go back to internal mic, but sleep issue is still there.

 

Just can't figure out why if I have a plug-in mic node present there are kernel or sleep issues.

 

I've tried resetting the codec using the values for reset sleep/wake in https://github.com/hackintosh-stuff/ComboJack

But it only changes the input to internal mic on wake but the sleep issue persists.

 

Maybe some of the stuff I've tried will help you, or someone who knows more can help us?

Edited by theroadw
Adding more information
  • Like 1
Link to comment
Share on other sites

21 hours ago, theroadw said:

I'm running a "similar" problem with my laptop alc256 - layout 13, everything works but after sleep kernel process uses 50% CPU and power log show its applehda interrupts. So I made a new layout and if I remove the mic in node, everything is happy before and after sleep, but everything I've tried keeping the plug (headset) mic enabled creates glitches.

If I reinit all or some of the the eapd nodes then the input defaults to line in, and I have to change the coefficients to change back to built in mic default, but now the problem is there is an idle sleep preventing task with apple hdef output, if I don't reinit the nodes, then high kernel activity.

I've compared the coefficients using this method.

 

https://github.com/acidanthera/AppleALC/wiki/Dumping-processing-coefficients

 

And they are mostly the same before and after sleep. Only one changed coefficient and changing it only makes input go back to internal mic, but sleep issue is still there.

 

Just can't figure out why if I have a plug-in mic node present there are kernel or sleep issues.

 

I've tried resetting the codec using the values for reset sleep/wake in https://github.com/hackintosh-stuff/ComboJack

But it only changes the input to internal mic on wake but the sleep issue persists.

 

Maybe some of the stuff I've tried will help you, or someone who knows more can help us?

 

thank you for your response! i decided to use the internal mic because whenever i send the verbs to enable headset mic, there will be popping sounds when any sound is playing which is super annoying.

however, applealc acts even more weird now on my computer. even though the headsets didn't produce glitched sound when the power state changed from AC to BAT with my latest changes, i left my computer powered off for 2 weeks and they broke again. i really have no idea what causes those problems in the first place, guess our codecs need some special treatment :D 

for now, headset works properly when i put my computer into sleep and wake it after 4-5 seconds. when i send the wake-up verbs with alc-verb (01470c02 02170c02 02170883 01970722) it doesn't get fixed. it's super annoying (i've been trying to fix this problem since november) and i don't know what to do honestly. maybe it has to do something with my EFI.

 

18 hours ago, Slice said:

What do you prefer to stay without sound or to try voodoohda?

 

i can try voodoohda if i can't fix these problems since i want native audio. do "restricted enabled SIP" cause any inconveniences in the system?

Link to comment
Share on other sites

I don't want to jinx it, but I believe I may have fixed mine, I removed EAPD from all but the speaker node and I'm just waking the speaker node. Then I added to my sleepwatcher script

cd /usr/local/sbin
./hda-verb 0x20 0x500 0x1b
./hda-verb 0x20 0x400 0x0c4b

And the input reverts back to internal Mic input.

Speaker works, headphones and headset selection work, no sleep issues, no high kernel process so far.
So just need to do more tests on longer sleeps, and see if all nodes are behaving correctly after those and multiple sleep/wake cycles.

 

@swissblade27are you using Combojack or ALCPlugFix-Swift to automate plug behavior?

 

edit:

After many more tests, and even warm reboot from windows, everything seems to be working correctly, so looks like my solution was to send those control coefficients.

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

3 hours ago, swissblade27 said:

 

i can try voodoohda if i can't fix these problems since i want native audio. do "restricted enabled SIP" cause any inconveniences in the system?

What is native audio? Is it hackintosh? "Native" for Apple's chip? No, you have not. You have third party chip and may use third party driver which works much better then native applehda.

  • Like 1
Link to comment
Share on other sites

On 2/18/2023 at 4:44 PM, theroadw said:

I don't want to jinx it, but I believe I may have fixed mine, I removed EAPD from all but the speaker node and I'm just waking the speaker node. Then I added to my sleepwatcher script

cd /usr/local/sbin
./hda-verb 0x20 0x500 0x1b
./hda-verb 0x20 0x400 0x0c4b

And the input reverts back to internal Mic input.

Speaker works, headphones and headset selection work, no sleep issues, no high kernel process so far.
So just need to do more tests on longer sleeps, and see if all nodes are behaving correctly after those and multiple sleep/wake cycles.

 

@swissblade27are you using Combojack or ALCPlugFix-Swift to automate plug behavior?

 

edit:

After many more tests, and even warm reboot from windows, everything seems to be working correctly, so looks like my solution was to send those control coefficients.

 

glad that you fixed your problem :)  and no i don't use any automated programs / daemons to send verbs because my problem only appears after unplugging AC power (which programs like ALCPlugFix-Swift does not have support for.) however, i found the culprit.

 

it seems like my codec sends verbs depending on the power state to change the VREF values of the nodes (specifically 0x19 (Line-In)), as you can see in the screenshot below. fresh boot assigns the Pin Sense of 0x19 to 0x22 (i believe that's the value for VREF_50.) on AC power, when no sound is playing and / or there's a continuous playback, this value gets replaced by 0x24 (VREF_80). this seems nice and all but when i pull out the charger, all hell breaks loose; after approximately 2+ minutes of silence, Pin Sense of 0x12 (Internal Mic), 0x21 (Headphones) resets to 0x00 and 0x19 resets to 0x02, resulting in white noise. when i remove the headset at this point, my laptop can't detect the change and doesn't switch to the speakers. 

 

this problem gets solved when i send the verb 0x19 0x707 0x22.

 

i tried sending the changed coefs according to the linux dump but they have no effect.

 

i use Apple EarPods as the headset. i have no idea what causes this, i tried adding AFGLowPowerState entry in my config.plist but it didn't help. any help is appreciated!

 

 

SCR-20230222-ui4.png

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

That is very weird, reminds me of my Zbook G5 problem, using AppleALC everything worked but on wake from sleep, the speaker would play for 10 seconds and then go silent. switching outputs would get me speaker again for another 10 seconds then silence. It was very annoying and couldn't figure it out, ended up using VoodooHDA.

Seeing the details of your problem gave me some ideas as to what could be happening on the Zbook.

 

Have you looked in your DSDT at device _AC to see if power change notifications get sent to HDEF or so?

 

I guess this doesn't happen in Linux or Windows, so maybe use debug versions of smcbattery, virtualsmc, lilu, applealc, etc... and maybe in console something may log a power state change error or something?

Link to comment
Share on other sites

10 hours ago, theroadw said:

That is very weird, reminds me of my Zbook G5 problem, using AppleALC everything worked but on wake from sleep, the speaker would play for 10 seconds and then go silent. switching outputs would get me speaker again for another 10 seconds then silence. It was very annoying and couldn't figure it out, ended up using VoodooHDA.

Seeing the details of your problem gave me some ideas as to what could be happening on the Zbook.

 

Have you looked in your DSDT at device _AC to see if power change notifications get sent to HDEF or so?

 

I guess this doesn't happen in Linux or Windows, so maybe use debug versions of smcbattery, virtualsmc, lilu, applealc, etc... and maybe in console something may log a power state change error or something?

 

i don't have any HDEF device in my DSDT. i looked at the EC0 section but couldn't find any reference to the audio changes. and no i don't have any issues in Linux or in Windows. i will attach my DSDT files if you want to take look at it.

 

i want to add that i tried using the pin configs that are used in Linux in my custom layout but it doesn't change anything.

 

anyways, i started watching logs on Console application and as i suspected, kernel gives command to the IOAudioDevice to change its power state when it's not in use. at that point, all 4 pin senses resets to 0x00 / 0x02 and headset produces garbled / white noise.

 

do debug versions of the kexts that you mentioned log what's happening when i use macOS, rather than on the OpenCore boot sequence? if that's the case, i will try that also.

 

 

SCR-20230223-kzv.thumb.png.74ce8d41efc26e149fcd63a174ec3949.png

DSDT.aml DSDT.dsl

Link to comment
Share on other sites

I can see that under device ACAD (AC power plug) you have OSYS dependent calls, but in your config you're patching OSI calls correctly, also on HDAS (Sound) you have the potentially troublesome (GPRW)  0x6D, 0x04e where MacOS expects 0x6D, 0x00. But I believe these are all red herrings, I bet it's a power state change triggered by AppleHDA directly that is somehow messing with the codec directly, I would try Combojack's reset patches.

914578028_ScreenShot2023-02-24at8_16_31AM.png.e822e0e5e3107e6dc42bbbff133bf46b.png

 

OR

 

349266862_ScreenShot2023-02-24at8_17_03AM.thumb.png.794e95cd71fb4832eb34a22e02164f7b.png

 

 

Can you share you pin_ctrl_dump script to do some tests on my zbook?

 

Edited by theroadw
  • Thanks 1
Link to comment
Share on other sites

first of all, thank you for your help! 

 

1 hour ago, theroadw said:

also on HDAS (Sound) you have the potentially troublesome (GPRW)  0x6D, 0x04e where MacOS expects 0x6D, 0x00. 
 

 

i do have an GPRW to XPRW patch enabled, but when i check the System DSDT, it doesn't appear to be patched (i don't know if it's supposed to, I'm kinda new to the hackintosh scene :))

 

SCR-20230224-ofx.thumb.png.27fd7a3756f8ff0d9bbc13098ec50fee.png

 

1 hour ago, theroadw said:

But I believe these are all red herrings, I bet it's a power state change triggered by AppleHDA directly that is somehow messing with the codec directly, I would try Combojack's reset patches.

914578028_ScreenShot2023-02-24at8_16_31AM.png.e822e0e5e3107e6dc42bbbff133bf46b.png

 

 

i tried using ComboJack's patches via alc-verb couple months ago and i believe these commands are used to reset the microphone detection on the headsets as these commands enable EarPods':

 

image.thumb.png.54b753fa767d0ddc59a82c004ce3696e.png

 

however, when i send these verbs headset produces loud pop sound whenever a sound is playing so i prefer not to use headset's mic and not to send those verbs (as internal mic works "fine"). 

 

also, in the first screenshot you posted,  i have no idea what "1<<14" part stands for in the "WRITE_COEFEX" command so i couldn't send it before.

as for the second screenshot, i already use those verbs to enable pin sense for Line-In (0x19) (i just use lower VREF value as it's assigned on BAT power / cold boot, 22 instead of 24) and headphone detection (0x21) in my layout:

 

image.thumb.png.63fe2c860a8ca9f7014165747520f918.png

 

i attached the script that i use, it's made by @wern apfel as far as i'm aware, i found it somewhere on the internet and just renamed a section to use alc-verb instead of hda-verb. all rights goes to them :) 

pin_ctrl_dump_mod.sh

Link to comment
Share on other sites

so i made couple of tests and here's what i've found:

 

1-) i found out that changing VREF values are set by the MuteGPIO value on layout-xx.xml file. i had the VREF_80 value for the Pin 25 (0x19) as MuteGPIO, so whenever i plug in the charger, it was resetting the Pin-ctrl for 0x19 to 24. somehow setting MuteGPIO value to VREF_80+ Pin 24 (0x18) solved this problem, my VREF values stay unchanged on AC power. however this didn't solve the garbled sound problem because the sound nodes goes to sleep (as they are unused after AC power) nonetheless. i believe that's the intended behavior of AppleHDA. 

 

2-) i tried disabling unnecessary SSDT patches, including FixHPET (only enabled the essential ones.) it didn't make a difference.

 

3-) i tried enabling alc-delay argument (1000 and 3000), it didn't make a difference.

 

4-) i tried another layout (71), either that or something else set new Pin-ctrls on fresh boot (0x19's Pin Widget Control was 0x22, now it's 0x20 regardless of layout.) unfortunately, same garbled sound problem exists here. 

 

5-) i tried using Node 24 (0x18) as the Line-In, but it resulted in unbalanced audio (i don't know how to describe it honestly. it sounds like if you plugged in an unsupported 4 pole headset into 3 pin headphone jack.) so i went back to using 0x19 as Line-In.

i should note something important here. if i send "alc-verb 0x19 0x707 0x20/21/22/24" here, Node 25 (0x19) does not go to sleep regardless of the power state (AC or BAT). it stays powered up, so no sound problems arise.

 

image.thumb.png.6498630ea633d0d043a9d8945f518fc4.png

 

i tried sending that same verb manually on my normal pin-config but it doesn't solve the problem.

 

6-) i tried adding Node 24 (0x18) and 26 (0x1A) alongside Node 25 (0x19, set as the Line-In). it didn't solve the problem and made it much worse (in this instance, speakers produced that garbled sound :D ).

 

7-) i tried tweaking Amp values in Platforms-69.xml (MuteInputAmp, PublishMute, ...) but i believe it didn't change anything. there are no clear explanation on what they do, or to what values should they be set according to the codec dump (different tutorials say different things about them.)

 

8-) i tried using the Pin configs that are used in Linux, same result.

 

 

 

So in summary, this problem is neither related to the pin configs, nor the layout or platforms.xml. when i send one of the following verbs:

 

alc-verb 0x19 0x707 0x00

alc-verb 0x19 0x707 0x01

alc-verb 0x19 0x707 0x02

 

they all produce that garbled sound. when i send:

 

alc-verb 0x19 0x707 0x20

alc-verb 0x19 0x707 0x21

alc-verb 0x19 0x707 0x22

alc-verb 0x19 0x707 0x24

 

then the sound works properly.

 

somehow i need to keep the Node 25 alive regardless of the power state of the laptop, in order to keep my ears from tinnitus :D. unfortunately i couldn't find anything regarding this.

 

EDIT: FIXED (kinda), see my reply below.

 

 

Edited by swissblade27
removed the tag, removed misinformation
Link to comment
Share on other sites

I FIXED IT! 

 

Well, sort of...

 

On 2/28/2023 at 11:16 PM, swissblade27 said:

5-) i tried using Node 24 (0x18) as the Line-In, but it resulted in unbalanced audio (i don't know how to describe it honestly. it sounds like if you plugged in an unsupported 4 pole headset into 3 pin headphone jack.) so i went back to using 0x19 as Line-In.

i should note something important here. if i send "alc-verb 0x19 0x707 0x20/21/22/24" here, Node 25 (0x19) does not go to sleep regardless of the power state (AC or BAT). it stays powered up, so no sound problems arise.

 

I was right, when a node doesn't exist in the PinConfig.kext, Platforms.xml and layout.xml files, it's powered down infinitely since AppleALC doesn't send its verbs and specs to AppleHDA to initiate it. I did remove Line-In connection entirely on Pin configs, layout69.xml, Platforms69.xml (Node 25) and when i send "alc-verb 0x19 0x707 0x24", it stays powered up across all power states and sound works perfectly! However, when I add the verb "01970724" to the PinConfigs it doesn't get applied. In that instance, Pin Control Widget of Node 25 becomes 0x04, I don't know why. 

 

With this new config I tried ComboJack again, but that popping sound problem was still there when nodes are activated after macOS turns them off (this doesn't happen on Linux btw, all of the amps stay powered up all the time.) I couldn't use the headset mic anyway so I deleted it.

 

Instead, I use ALCPlugFix-Swift to automate that verb sending process, so far so good. It sends the verb when the system boots and wakes up.

 

Additionally, I needed to add the verb 02170883 to my PinConfig & WakePinConfig in order to get headphone detection working.

 

This forum post also confirms my findings: https://www.hackintosh-forum.de/forum/thread/55405-alc255-combo-jack-mittels-codec-dump-fixen-acer-aspire-5-a515-51g-512p/?pageNo=1

 

 

 

 

Finally, I can finally enjoy my music without any interruptions!...

 

... Or so I thought.

 

 

Now, I have the exact same problem in the first post, again!

 

On 1/22/2023 at 5:49 PM, swissblade27 said:

after the computer sleeps and wakes up, when the internal microphone (node 0x12) is used and after it enters sleep state, headphones (Pin 0x21, Node 33*) no longer produce sound after some time. i need to unplug and then plug the headphone back in order to get working sound. they continue to work even if internal microphone enters sleep state after unplugging & plugging procedure. this problem also doesn't happen on cold boot.

 

I looked at the changed coeffs in Node 0x20 but sending the correct ones doesn't bring the sound back. I tried tweaking Amp values in the Platforms69.xml, but it has no effect.

 

I don't know what Acer was thinking when they manufactured this exact model or why they put this specific janky ComboJack, but I don't like it a bit :D 

 

 

Platforms69.xml layout69.xml ALC255.plist Verbs.rtf

Edited by swissblade27
Fixed typos & added files
Link to comment
Share on other sites

  • 1 year later...

@swissblade27 Hello, hope you have a nice day.

 

Congratulations on successfully fixing the headphones on your device. I also encountered the same situation as you. you can check it out here: https://www.insanelymac.com/forum/topic/358981-dell-latitude-7400-alc295-headphones-do-not-work-trying-to-fix/#comment- 2818154

And can you give me some suggestions or instructions? Thank you very much

Link to comment
Share on other sites

  • 4 weeks later...

Hi can anyone share the script you used to monitor your pins? I need it to fix my alc2295 codec for my acer nitro 5 an 515-55-51QY.

 

The problem I am facing is that after a clean boot when I plug my headphones via the combo jack they don't work but only give ma a constant white noise but when I put my mackintosh to sleep then wake it up the noise problem completely disappears and the output becomes perfectly functional. I think its a problem involving the verbs.

 

Thanks in advance

Link to comment
Share on other sites

Hi can anyone share the script you used to monitor your pins? I need it to fix my alc2295 codec for my acer nitro 5 an 515-55-51QY.

 

The problem I am facing is that after a clean boot when I plug my headphones via the combo jack they don't work but only give ma a constant white noise but when I put my mackintosh to sleep then wake it up the noise problem completely disappears and the output becomes perfectly functional. I think its a problem involving the verbs.

 

Thanks in advance

Link to comment
Share on other sites

After weeks of fruitless research, thanks to @Mirone providing me a tool to monitor the states of the pins I found out that setting the 0x19's pin widget control to 0x24 stops the hissing noise issue I was having (see my post), in my headset.

 

Now before trying to make the changes permanent I would like to find a way to switch from the internal microphone to the Headsets'. Because for now the external microphone is not detected when the headset jack is plugged in contrast to the headset output. it's like the jack sense is misconfigured or at least the command that is sent if the codec detects the plugged jack.

 

Although I found a way to fix this noise issue I don't understand the reason why it is working. And I think this is important to understand before dealing with the microphone switching issue.

 

According to my codec' schematic the 0x19 Pin should control the jack input, and the 0x21 pin the jack output so I was expecting to tweak the later and not the former to solve the noise issue.

 

It may be trivial for you confirmed devs, but I'm a newbie with a lot of questions and I try to find a solution that could help me and the (huge number of) acer nitro hackintoshers. 

 

I'd appreciate any kind of help on the matter

 

thanks in advance

Edited by iwissem
proper mention, and issue info
  • Like 1
Link to comment
Share on other sites

@iwissem,

This script is not mine, I just grabbed it a few posts back and posted it to you because you asked, so the credits go to whoever wrote it. Regarding your codec issue, it could be several factors. When you mention External Microphone, are you referring to the ComboJack? Are you using AppleALC? If yes, could you tell me which layout-id?

 

A few years ago, I wrote this: https://www.olarila.com/topic/5586-guide-how-to-activate-microphone-on-conexant-codecs-and-others/ it might still work, I can't say for sure. 

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

By external microphone I mean the one of my headset, it's an hyper x cloud II with a single jack (combojack).

 

Yes I am only using AppleALC and so far sticked to using layout-id 13. 

 

Ive also tested all the layouts, you can see the results in this table I made https://github.com/iwissemben/Hackintosh-Opencore-Acer-Nitro-5-AN515-55-51QY/blob/readme/Documentation/Audio research/audio layout testing final.pdf

 

But I have a good news! I was looking on the apple ALC repo and the pull requests and I saw Lorys89's layout submission for layout 33 here https://github.com/acidanthera/AppleALC/pull/898. I tried it and it made my headsets mic work out of the box! After comparing the files of the layout with the ones of 13 I think that what fixed it was the ConfigData.

 

But it didn't fix the noise issue in the headset's output. and sadly setting the 0x19's pin widget control to 0x24 don't fix it anymore.

 

I've also tried playing with the processing caps of my node 0x20 using a dump I made on linux (with the headset plugged) and macOS and also one I made on windows (I don't remember if the headphones where plug at that time though) but it led to nothing. I just learned that 

RtHDDump.txt

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...