Skip to content
This repository has been archived by the owner on Oct 11, 2021. It is now read-only.

ALC668 proper init #11

Open
vbourachot opened this issue Feb 12, 2016 · 6 comments
Open

ALC668 proper init #11

vbourachot opened this issue Feb 12, 2016 · 6 comments

Comments

@vbourachot
Copy link

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!

@syscl
Copy link

syscl commented Feb 12, 2016

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.

@animator013
Copy link

animator013 commented Dec 17, 2016

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.

@the-darkvoid
Copy link
Owner

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.

@animator013
Copy link

animator013 commented Dec 21, 2016

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.

@syscl
Copy link

syscl commented Dec 21, 2016

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

syscl

@animator013
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants