XPS9530-OSX icon indicating copy to clipboard operation
XPS9530-OSX copied to clipboard

ALC668 proper init

Open vbourachot opened this issue 8 years ago • 6 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: https://github.com/torvalds/linux/commit/f3f9185f3e49c748e952dd579357048a42e89398

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: https://github.com/vbourachot/Dell-XPS13-9333-DSDT-Patch/commit/b7ff1f0443b0917ce24fb238c6d99caae23bbbf9 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!

vbourachot avatar Feb 12 '16 01:02 vbourachot

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.

syscl avatar Feb 12 '16 03:02 syscl

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.

animator013 avatar Dec 17 '16 10:12 animator013

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.

the-darkvoid avatar Dec 21 '16 15:12 the-darkvoid

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.

animator013 avatar Dec 21 '16 15:12 animator013

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

syscl

syscl avatar Dec 21 '16 15:12 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.

animator013 avatar Dec 21 '16 15:12 animator013