Closed erdemoney closed 4 years ago
I have a similar problem. The audio randomly cuts at times and the only thing that solves it is going to System Preferences > Sound > Input and switching from Line In to Built-In Microphone. Then, after a few seconds, it cuts again. Happens with both loudspeakers and headphones, but I can't find the exact steps to reproduce it.
Yeah, I just found out yesterday that I can fix my issue by selecting βline inβ in the same settings panel so our issues are probably related. Mine seems to stay working after changing the setting but I havenβt done any real testing.
I have experienced the same problem as @notthebee several times, after sleep. It doesn't happen every-time however. I have also experienced entire system crashes, which seem tied to the audio (only has happened while playing music. The entire system freezes, and I can hear a small clip repeating until I force-shutdown the laptop. This might be unrelated, possibly from overheating or something.
Same problem on T490 platform. Seems like problem with interrupts
I have both headphone interference and audio cuts on a T480. It seems to happen only after waking up from sleep but not immediately, it takes like 1 hour or so to stop working. The built in mic also stops working. Restarting solves the problem.
The audio randomly cuts at times and the only thing that solves it is going to System Preferences > Sound > Input and switching from Line In to Built-In.
Keep System Preferences open at the Input submenu. That'll make the output keep working as far as you keep System Preferences open. Still not a great solution but can help you in case you can't restart immediately.
Offtopic: I love your videos. I decided to get a T480 just because of your advices, best laptop I've ever had, so far π.
It may be the same problems like those which are solved here: https://github.com/acidanthera/AppleALC/pull/571#issue-434129924
I've asked for some help/advise :)
Got much help from @fewtarius and have a test-build with a maybe fixed layout 21 for you. He, the magician of ALC-codecs, throwed some voodoo on it and it may be fixed and could work natively now.
I would love to get some testing and feedback from you before posting a merge request to http://github.com/acidanthera/AppleALC.
So: If you are brave enough, simply take the build attached to this post, remove every alc_fix, CodecCommander or similar, set your LayoutId to 21 and do some testing!
If it succeeds or fails, please report back!
I'll test it later today. I've already replaced AppleALC.kext and layout-id on config.plist but I can't restart right now. I'm I missing anything? I have a T480 and I'm using EETagent's EFI.
@TheQuetz if you don't have any additional tools in place to fix audio, thats it. If you are on Catalina a "sudo kextcache -i /" to rebuild the kextcache won't hurt, but may be unnecessary.
@benbender Just swapped out my AppleALC with the fixed one this morning. No issues so far! Seems to be working!
@benbender Removed ALCPlugFix and tested your AppleALC, no problems so far after 3-4 sleep cycles. I think after a few more days, it'll be safe to say that the changes can be made into a PR upstream. Meanwhile I'll push your kext into the repo and advise to remove existing ALCPlugFix.
Thank you @fewtarius for helping out!
@benbender @fewtarius
It switches output automatically too once headphones are plugged, that's awesome! Do you guys still have the instructions/steps? If possible, I'd like for that to be posted here in case someone else stumbles onto this issue with a different audio layout.
I have saved the conversation. If it's fine for @fewtarius, I'll give it to you. But it surely will need some serious edit to be helpful.
@benbender Removed ALCPlugFix and tested your AppleALC, no problems so far after 3-4 sleep cycles. I think after a few more days, it'll be safe to say that the changes can be made into a PR upstream. Meanwhile I'll push your kext into the repo and advise to remove existing ALCPlugFix.
Thank you @fewtarius for helping out!
If you're curious, as to how we resolved this, here's what we did.
We started by downloading the AppleALC source code and making sure we could do a test build. Next we looked at your codec dump, specifically your headphone jack input and output and your internal speaker out. We wanted to verify that the output supported EAPD, and the input supported JackSense. We confirmed both. The outputs supported EAPD (EAPD Detect), and the jack mic supported JackSense (In Detect).
Node 0x14 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
Control: name="Speaker Playback Switch", index=0, device=0
ControlAmp: chs=3, dir=Out, idx=0, ofs=0
Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
Amp-Out vals: [0x00 0x00]
Pincap 0x00010014: OUT EAPD Detect
EAPD 0x2: EAPD
Pin Default 0x90170110: [Fixed] Speaker at Int N/A
Conn = Analog, Color = Unknown
DefAssociation = 0x1, Sequence = 0x0
Misc = NO_PRESENCE
Pin-ctls: 0x40: OUT
Unsolicited: tag=00, enabled=0
Power states: D0 D1 D2 D3 EPSS
Power: setting=D0, actual=D0
Connection: 1
0x02
Node 0x21 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
Control: name="Headphone Playback Switch", index=0, device=0
ControlAmp: chs=3, dir=Out, idx=0, ofs=0
Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
Amp-Out vals: [0x80 0x80]
Pincap 0x0001001c: OUT HP EAPD Detect
EAPD 0x2: EAPD
Pin Default 0x04211020: [Jack] HP Out at Ext Right
Conn = 1/8, Color = Black
DefAssociation = 0x2, Sequence = 0x0
Pin-ctls: 0xc0: OUT HP
Unsolicited: tag=01, enabled=1
Power states: D0 D1 D2 D3 EPSS
Power: setting=D0, actual=D0
Connection: 2
0x02* 0x03
Node 0x19 [Pin Complex] wcaps 0x40048b: Stereo Amp-In
Control: name="Mic Boost Volume", index=0, device=0
ControlAmp: chs=3, dir=In, idx=0, ofs=0
Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0
Amp-In vals: [0x00 0x00]
Pincap 0x00003724: IN Detect
Vref caps: HIZ 50 GRD 80 100
Pin Default 0x04a11040: [Jack] Mic at Ext Right
Conn = 1/8, Color = Black
DefAssociation = 0x4, Sequence = 0x0
Pin-ctls: 0x24: IN VREF_80
Unsolicited: tag=02, enabled=1
Power states: D0 D1 D2 D3 EPSS
Power: setting=D0, actual=D0
Once we had this data, we inspected the pin config data in AppleALC for ALC285 layout 21 (AppleALC/Resources/PinConfigs.kext/Contents/Info.plist) with ProperTree and learned that the EAPD signal was only being sent to the internal speakers, and no pin widget control signal was being sent to the jack mic. This means the jack was not being put into the proper state after a wake event. To remedy this we needed to update the ConfigData and the WakeConfigData to send the proper signals.
Original ConfigData:
01271C10 01271D01 01271EA6 01271F90 01471C30 01471D01 01471E17 01471F90 01971C00 01971D10 01971E8B 01971F04 02171C20 02171D10 02171E2B 02171F04 01470C02
Original WakeConfigData:
01470C02
Each of the bytes above represent a pin complex, you can break the pin complex down like this:
0 19 707 25
β ββ¬β ββ¬β ββ¬β
β β β β
β β β β
β β β β
β β β ββββββ Instruction
β β βββββββ Verb
β ββββββββ Node Location
βββββββββ Codec # (Usually 0)
Each of the verbs that can be sent to the codec are documented in the Intel HDA specification manual, but we know that the EAPD verb is 70C and the Pin Widget Control verb is 707.
Looking at the data above we can quickly see that we're missing both the pin widget control verb and EAPD on the headphone switch. To correct this we simply add the verbs to the configuration data, and recompile AppleALC.
To correct EAPD, we add 02170C02 which sends the EAPD enable signal to node 21. To correct the jack mic, we add 01970725 which sends the Pin Widget Control signal to node 19. We add the EAPD verb to both the ConfigData, and the WakeConfigData and the Pin Widget Control signal to the WakeConfigData. ConfigData is used by AppleALC on initialization, and WakeConfigData is used on each wake event. We used ProperTree to update the data.
Corrected ConfigData:
01271C10 01271D01 01271EA6 01271F90 01471C30 01471D01 01471E17 01471F90 01971C00 01971D10 01971E8B 01971F04 02171C20 02171D10 02171E2B 02171F04 01470C02 02170C02
Corrected WakeConfigData:
01470C02 02170C02 01970725
After we've updated the pin config for this codec and layout, we simply compile and test to ensure everything works on wake. We also want to make sure that we remove VerbStub, CodecCommander, ALCWakeFix, and any other helper that may be installed as those helpers can clobber the fix.
I have saved the conversation. If it's fine for @fewtarius, I'll can give it to you. But it surely will need some serious edit to be helpful.
I was already typing it up. :)
Additional links for in depth documentation/learning:
@benbender
If you want to make that PR now, I'll go ahead and endorse it on the ticket.
@benbender
If you want to make that PR now, I'll go ahead and endorse it on the ticket.
Glad to hear the patch is working out for you all. π
I'll do as soon as I finished my other small Hackintosh project. Thanks again everyone - especially @fewtarius. It was a pleasure!
PR on the way: https://github.com/acidanthera/AppleALC/pull/612
The eagle has landed: https://github.com/acidanthera/AppleALC/commit/41106026cf9bb093d88090bc3c207b9ffde0ef6b π
I haven't tried any patches yet but just asking, is there a similar fix for a T480? ALC 257?
Describe the bug After sleep audio through the headphone jack its muted and distorted. I'm using AppleALC.kext and alc_fix from the patches directory. I just ran the install.sh. I'm assuming that's all you have to do for it to work. I've tried using alcid 11, 21, and 31 with no change. I checked the pin config in Hackintool and it matches yours so I don't think there should be an issue there.
alc_fix seems to be working
To Reproduce Steps to reproduce the behavior:
Expected behavior Undistored audio through headphones