the-darkvoid / XPS9530-OSX

OS X patches for Dell XPS 9530 (Haswell)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ALC668 proper init

vbourachot opened this issue · comments

Not an issue, just a heads up - feel free to close this at anytime.

Not sure if you have this too but I always had some distortion in the headphones at high volume. After patching another codec which ended up sounding perfect, I decided to revisit the ALC668 to see if I could fix the distortion. Turns out there's a commit in patch_realtek.c which initializes a whole bunch of registers in node 0x20 for ALC668 on boot: torvalds/linux@f3f9185

I turned this into ConfigData values for ahhcd and it fixed the hp distortion. It should also solve any issue on a warm reboot to OSX from windows (can't test this though since I don't have windows on this laptop). My changes are in this commit: vbourachot/Dell-XPS13-9333-DSDT-Patch@b7ff1f0 There are some other changes in this commit to the layout and platforms file, but I don't think they're needed. The updated ConfigData should be all that's required to fix the issue.

You could obviously do the same with CodecCommander OnInit commands, but since there's 59 registers to initialize and each init takes 2 verbs, that would be a hellish plist :)

Note that this still doesn't fix the no sound through hp if you boot with hp plugged in. This one's still a mystery.

While I'm here, thanks again for your work on CodecCommander and porting hda-verb.. invaluable tool to debug/test things out!

commented

Hi, vbourachot. I've merge your new patch into my git and test wether the injected headphone will lose sound after a fresh boot. Unfortunately, the problem still appears. Any idea?

Here's my git: https://github.com/syscl/M3800 and the audio repo is https://github.com/syscl/M3800/tree/M3800/Kexts/audio.

I think we all face issues with sleep wake... Sometimes after wake from sleep internal speakers just do not work. They start to work after connecting HP and disconnecting.

I tried to debug with hda-verb. I found out that

hda-verb 0x14 GET_CONNECT_SEL 0x0

will output

nid = 0x14, verb = 0xf01, param = 0x0
command 0x014f0100 --> result = 0x00000001

When it's working. But when i wake from sleep and run this command i get this result:

nid = 0x14, verb = 0xf01, param = 0x0
command 0x014f0100 --> result = 0x00000000

I tried to activate it:

hda-verb 0x14 SET_CONNECT_SEL 0x0 1

But it always set it to 0, also when I run it while the speakers are working it also sets it to 0... And turn off speakers.

Don't know if this is helpful somehow, but maybe someone can shine some light into this. Thank you all.

If plugging and removing the headphone fixes the problem I am sure it can be fixed through an EAPD commander profile.
Best to dump the entire codec status before and after plugging the headphones and see the differences.

I've made a complete diff. And did all the hda-verbs to remove the diffs. After all diffs has been removed speakers are still dead. I've made the nodedumps.

commented

I've tried hda-verbs method to correct the nid number long time ago, but still no go...

syscl

Also this is happening only when i sleep on AC adapter (always after first sleep). When I go to sleep on battery the speakers wake up normally.