Contribute
Register

ALC 668 only works well after restarting from Windows

Status
Not open for further replies.
Joined
Jan 3, 2015
Messages
66
Motherboard
Asus ROG GL502VS
CPU
Core i7-9750H
Graphics
Intel UHD 630
Mobile Phone
  1. Android
Why if i reboot from windows to El Capitan i got working headphones and mic. but if i try to shutdown and boot directly to El Capitan, Mic doesn't work and headphones got noisy.
i use AppleHDA Patcher for AppleHDA.kext, but i modifying it with my codec_dump verbs from Ubuntu Live CD. I use CodecCommander.kext too
 

Attachments

  • macbookpro.ioreg
    6.5 MB · Views: 160
  • CLOVER2.zip
    2 MB · Views: 120
  • codec_dump.txt
    11.3 KB · Views: 152
  • verbs.txt
    2.4 KB · Views: 158
Why if i reboot from windows to El Capitan i got working headphones and mic. but if i try to shutdown and boot directly to El Capitan, Mic doesn't work and headphones got noisy.
i use AppleHDA Patcher for AppleHDA.kext, but i modifying it with my codec_dump verbs from Ubuntu Live CD. I use CodecCommander.kext too

Use config_dump.sh in CodeCommander to see if your pinconfigs are different in the working scenario vs. non-working.

Post output here.
 
I did that, but it has same? check this

working config
Node 0x12 [Pin Complex] : Pin Config 0x90a60030
Port Connectivity: FixedFunction (0x2)
Location: (0x4)
Default Device: MicIn (0xa)
Connection Type: OtherDigital (0x6)
Color: Unknown (0x0)
Misc: NoJackOverride (0x0)
Default Association: (0x3)
Sequence: (0x0)
Node 0x14 [Pin Complex] : Pin Config 0x90170010
Port Connectivity: FixedFunction (0x2)
Location: (0x4)
Default Device: Speaker (0x1)
Connection Type: OtherAnalog (0x7)
Color: Unknown (0x0)
Misc: NoJackOverride (0x0)
Default Association: (0x1)
Sequence: (0x0)
Node 0x15 [Pin Complex] : Pin Config 0x04211020
Port Connectivity: Connected (0x0)
Location: (0x0)
Default Device: HPOut (0x2)
Connection Type: .125 (0x1)
Color: Black (0x1)
Misc: NoJackOverride (0x0)
Default Association: (0x2)
Sequence: (0x0)
Node 0x16 [Pin Complex] : Pin Config 0x40000000
Port Connectivity: NotConnected (0x1)
Location: (0x2)
Default Device: LineOut (0x0)
Connection Type: Unknown (0x0)
Color: Unknown (0x0)
Misc: NoJackOverride (0x0)
Default Association: (0x0)
Sequence: (0x0)
Node 0x18 [Pin Complex] : Pin Config 0x411111f0
Port Connectivity: NotConnected (0x1)
Location: (0x2)
Default Device: Speaker (0x1)
Connection Type: .125 (0x1)
Color: Black (0x1)
Misc: JackOverride (0x1)
Default Association: (0xf)
Sequence: (0x0)
Node 0x19 [Pin Complex] : Pin Config 0x411111f0
Port Connectivity: NotConnected (0x1)
Location: (0x2)
Default Device: Speaker (0x1)
Connection Type: .125 (0x1)
Color: Black (0x1)
Misc: JackOverride (0x1)
Default Association: (0xf)
Sequence: (0x0)
Node 0x1a [Pin Complex] : Pin Config 0x411111f0
Port Connectivity: NotConnected (0x1)
Location: (0x2)
Default Device: Speaker (0x1)
Connection Type: .125 (0x1)
Color: Black (0x1)
Misc: JackOverride (0x1)
Default Association: (0xf)
Sequence: (0x0)
Node 0x1b [Pin Complex] : Pin Config 0x411111f0
Port Connectivity: NotConnected (0x1)
Location: (0x2)
Default Device: Speaker (0x1)
Connection Type: .125 (0x1)
Color: Black (0x1)
Misc: JackOverride (0x1)
Default Association: (0xf)
Sequence: (0x0)
Node 0x1d [Pin Complex] : Pin Config 0x40c7836d
Port Connectivity: NotConnected (0x1)
Location: (0x2)
Default Device: SPDIFIn (0xc)
Connection Type: OtherAnalog (0x7)
Color: Purple (0x8)
Misc: JackOverride (0x3)
Default Association: (0x6)
Sequence: (0xd)
Node 0x1e [Pin Complex] : Pin Config 0x411111f0
Port Connectivity: NotConnected (0x1)
Location: (0x2)
Default Device: Speaker (0x1)
Connection Type: .125 (0x1)
Color: Black (0x1)
Misc: JackOverride (0x1)
Default Association: (0xf)
Sequence: (0x0)
Node 0x1f [Pin Complex] : Pin Config 0x411111f0
Port Connectivity: NotConnected (0x1)
Location: (0x2)
Default Device: Speaker (0x1)
Connection Type: .125 (0x1)
Color: Black (0x1)
Misc: JackOverride (0x1)
Default Association: (0xf)
Sequence: (0x0)
Node 0x12 [Pin Complex] : Pin Config 0x90a60030
Port Connectivity: FixedFunction (0x2)
Location: (0x4)
Default Device: MicIn (0xa)
Connection Type: OtherDigital (0x6)
Color: Unknown (0x0)
Misc: NoJackOverride (0x0)
Default Association: (0x3)
Sequence: (0x0)
Node 0x14 [Pin Complex] : Pin Config 0x90170010
Port Connectivity: FixedFunction (0x2)
Location: (0x4)
Default Device: Speaker (0x1)
Connection Type: OtherAnalog (0x7)
Color: Unknown (0x0)
Misc: NoJackOverride (0x0)
Default Association: (0x1)
Sequence: (0x0)
Node 0x15 [Pin Complex] : Pin Config 0x04211020
Port Connectivity: Connected (0x0)
Location: (0x0)
Default Device: HPOut (0x2)
Connection Type: .125 (0x1)
Color: Black (0x1)
Misc: NoJackOverride (0x0)
Default Association: (0x2)
Sequence: (0x0)
Node 0x16 [Pin Complex] : Pin Config 0x40000000
Port Connectivity: NotConnected (0x1)
Location: (0x2)
Default Device: LineOut (0x0)
Connection Type: Unknown (0x0)
Color: Unknown (0x0)
Misc: NoJackOverride (0x0)
Default Association: (0x0)
Sequence: (0x0)
Node 0x18 [Pin Complex] : Pin Config 0x411111f0
Port Connectivity: NotConnected (0x1)
Location: (0x2)
Default Device: Speaker (0x1)
Connection Type: .125 (0x1)
Color: Black (0x1)
Misc: JackOverride (0x1)
Default Association: (0xf)
Sequence: (0x0)
Node 0x19 [Pin Complex] : Pin Config 0x411111f0
Port Connectivity: NotConnected (0x1)
Location: (0x2)
Default Device: Speaker (0x1)
Connection Type: .125 (0x1)
Color: Black (0x1)
Misc: JackOverride (0x1)
Default Association: (0xf)
Sequence: (0x0)
Node 0x1a [Pin Complex] : Pin Config 0x411111f0
Port Connectivity: NotConnected (0x1)
Location: (0x2)
Default Device: Speaker (0x1)
Connection Type: .125 (0x1)
Color: Black (0x1)
Misc: JackOverride (0x1)
Default Association: (0xf)
Sequence: (0x0)
Node 0x1b [Pin Complex] : Pin Config 0x411111f0
Port Connectivity: NotConnected (0x1)
Location: (0x2)
Default Device: Speaker (0x1)
Connection Type: .125 (0x1)
Color: Black (0x1)
Misc: JackOverride (0x1)
Default Association: (0xf)
Sequence: (0x0)
Node 0x1d [Pin Complex] : Pin Config 0x40c7836d
Port Connectivity: NotConnected (0x1)
Location: (0x2)
Default Device: SPDIFIn (0xc)
Connection Type: OtherAnalog (0x7)
Color: Purple (0x8)
Misc: JackOverride (0x3)
Default Association: (0x6)
Sequence: (0xd)
Node 0x1e [Pin Complex] : Pin Config 0x411111f0
Port Connectivity: NotConnected (0x1)
Location: (0x2)
Default Device: Speaker (0x1)
Connection Type: .125 (0x1)
Color: Black (0x1)
Misc: JackOverride (0x1)
Default Association: (0xf)
Sequence: (0x0)
Node 0x1f [Pin Complex] : Pin Config 0x411111f0
Port Connectivity: NotConnected (0x1)
Location: (0x2)
Default Device: Speaker (0x1)
Connection Type: .125 (0x1)
Color: Black (0x1)
Misc: JackOverride (0x1)
Default Association: (0xf)
Sequence: (0x0)

But i see working and non working IOReg has different size in bytes. see in attachment for working mic and good headphone...
 

Attachments

  • macbookpro-work.ioreg
    6.5 MB · Views: 206
I did that, but it has same? check this

Then it is not a pinconfig difference...

But i see working and non working IOReg has different size in bytes. see in attachment for working mic and good headphone...

No real difference in ioreg/HDEF from post #1 to here...

You should dump other nodes with node_dump.sh and compare. Then experiment with hda-verb to see if you can fix the problem...
 
This is the fix (in the linux kernel) to your problem with reboot from windows vs cold boot: https://github.com/torvalds/linux/commit/f3f9185f3e49c748e952dd579357048a42e89398

The best way to initialize that many registers is to init via the ConfigData in your
AppleHDAHardwareConfigDriver kext info.plist (technically you could also do it via codeccommander if you feel like writing a whole lot of ssdt code).

If you want to try using my applehda injector for alc668 which includes the fix above, clone the repo at https://github.com/vbourachot/Dell-XPS13-9333-DSDT-Patch. Then use make apple_hda; sudo make install_hda. You will need a vanilla AppleHDA kext in SLE for this to work. Furthermore, no guarantees it will work as some guy asked me once to help him with his asus alc 668 laptop and he couldn't get it to work (my laptop is a dell). Not sure if there's an actual difference or if it was user error. You can check my codec dumps for differences in the same repo.

If you want to do the changes to your existing applehda (requires some knowledge of applehda patching), this commit should help you understand how to proceed: https://github.com/vbourachot/Dell-...mmit/b7ff1f0443b0917ce24fb238c6d99caae23bbbf9 (in particular the notes in the file linux_sound/alc668_coefs.txt)
 
(technically you could also do it via codeccommander if you feel like writing a whole lot of ssdt code).

FYI: "for experts only"...

Here is the SSDT for CodecCommander...
Code:
// generated from: /Users/RehabMan/Projects/codec.git/gen_ahhcd.sh ALC668
DefinitionBlock ("", "SSDT", 2, "hack", "ALC668", 0)
{
    External(_SB.PCI0.HDEF, DeviceObj)
    Name(_SB.PCI0.HDEF.RMCF, Package()
    {
        "CodecCommander", Package()
        {
            "Disable", ">y",
        },
        "CodecCommanderPowerHook", Package()
        {
            "Disable", ">y",
        },
        "CodecCommanderProbeInit", Package()
        {
            "Version", 0x020600,
            "10ec_0668", Package()
            {
                "PinConfigDefault", Package()
                {
                    Package(){},
                    Package()
                    {
                        "LayoutID", 1,
                        "PinConfigs", Package()
                        {
                            Package(){},
                            0x12, 0x90a00101,
                            0x14, 0x90170102,
                            0x15, 0x032b1003,
                            0x16, 0x400000f0,
                            0x18, 0x400000f0,
                            0x19, 0x400000f0,
                            0x1a, 0x400000f0,
                            0x1b, 0x038b1004,
                            0x1d, 0x400000f0,
                            0x1e, 0x400000f0,
                            0x1f, 0x400000f0,
                        },
                    },
                },
                "Custom Commands", Package()
                {
                    Package(){},
                    Package()
                    {
                        "LayoutID", 1,
                        "Command", Buffer()
                        {
                            0x01, 0x47, 0x0c, 0x02,
                            0x01, 0x57, 0x0c, 0x02,
                            0x02, 0x05, 0x00, 0x01,
                            0x02, 0x04, 0xbe, 0xbe,
                            0x02, 0x05, 0x00, 0x02,
                            0x02, 0x04, 0xaa, 0xaa,
                            0x02, 0x05, 0x00, 0x03,
                            0x02, 0x04, 0x00, 0x00,
                            0x02, 0x05, 0x00, 0x04,
                            0x02, 0x04, 0x01, 0x80,
                            0x02, 0x05, 0x00, 0x06,
                            0x02, 0x04, 0x00, 0x00,
                            0x02, 0x05, 0x00, 0x07,
                            0x02, 0x04, 0x0f, 0x80,
                            0x02, 0x05, 0x00, 0x08,
                            0x02, 0x04, 0x00, 0x31,
                            0x02, 0x05, 0x00, 0x0a,
                            0x02, 0x04, 0x00, 0x60,
                            0x02, 0x05, 0x00, 0x0b,
                            0x02, 0x04, 0x00, 0x00,
                            0x02, 0x05, 0x00, 0x0c,
                            0x02, 0x04, 0x7c, 0xf7,
                            0x02, 0x05, 0x00, 0x0d,
                            0x02, 0x04, 0x10, 0x80,
                            0x02, 0x05, 0x00, 0x0e,
                            0x02, 0x04, 0x7f, 0x7f,
                            0x02, 0x05, 0x00, 0x0f,
                            0x02, 0x04, 0xcc, 0xcc,
                            0x02, 0x05, 0x00, 0x10,
                            0x02, 0x04, 0xdd, 0xcc,
                            0x02, 0x05, 0x00, 0x11,
                            0x02, 0x04, 0x00, 0x01,
                            0x02, 0x05, 0x00, 0x13,
                            0x02, 0x04, 0x00, 0x00,
                            0x02, 0x05, 0x00, 0x14,
                            0x02, 0x04, 0x2a, 0xa0,
                            0x02, 0x05, 0x00, 0x17,
                            0x02, 0x04, 0xa9, 0x40,
                            0x02, 0x05, 0x00, 0x19,
                            0x02, 0x04, 0x00, 0x00,
                            0x02, 0x05, 0x00, 0x1a,
                            0x02, 0x04, 0x00, 0x00,
                            0x02, 0x05, 0x00, 0x1b,
                            0x02, 0x04, 0x00, 0x00,
                            0x02, 0x05, 0x00, 0x1c,
                            0x02, 0x04, 0x00, 0x00,
                            0x02, 0x05, 0x00, 0x1d,
                            0x02, 0x04, 0x00, 0x00,
                            0x02, 0x05, 0x00, 0x1e,
                            0x02, 0x04, 0x74, 0x18,
                            0x02, 0x05, 0x00, 0x1f,
                            0x02, 0x04, 0x08, 0x04,
                            0x02, 0x05, 0x00, 0x20,
                            0x02, 0x04, 0x42, 0x00,
                            0x02, 0x05, 0x00, 0x21,
                            0x02, 0x04, 0x04, 0x68,
                            0x02, 0x05, 0x00, 0x22,
                            0x02, 0x04, 0x8c, 0xcc,
                            0x02, 0x05, 0x00, 0x23,
                            0x02, 0x04, 0x02, 0x50,
                            0x02, 0x05, 0x00, 0x24,
                            0x02, 0x04, 0x74, 0x18,
                            0x02, 0x05, 0x00, 0x27,
                            0x02, 0x04, 0x00, 0x00,
                            0x02, 0x05, 0x00, 0x28,
                            0x02, 0x04, 0x8c, 0xcc,
                            0x02, 0x05, 0x00, 0x2a,
                            0x02, 0x04, 0xff, 0x00,
                            0x02, 0x05, 0x00, 0x2b,
                            0x02, 0x04, 0x80, 0x00,
                            0x02, 0x05, 0x00, 0xa7,
                            0x02, 0x04, 0xff, 0x00,
                            0x02, 0x05, 0x00, 0xa8,
                            0x02, 0x04, 0x80, 0x00,
                            0x02, 0x05, 0x00, 0xaa,
                            0x02, 0x04, 0x2e, 0x17,
                            0x02, 0x05, 0x00, 0xab,
                            0x02, 0x04, 0xa0, 0xc0,
                            0x02, 0x05, 0x00, 0xac,
                            0x02, 0x04, 0x00, 0x00,
                            0x02, 0x05, 0x00, 0xad,
                            0x02, 0x04, 0x00, 0x00,
                            0x02, 0x05, 0x00, 0xae,
                            0x02, 0x04, 0x2a, 0xc6,
                            0x02, 0x05, 0x00, 0xaf,
                            0x02, 0x04, 0xa4, 0x80,
                            0x02, 0x05, 0x00, 0xb0,
                            0x02, 0x04, 0x00, 0x00,
                            0x02, 0x05, 0x00, 0xb1,
                            0x02, 0x04, 0x00, 0x00,
                            0x02, 0x05, 0x00, 0xb2,
                            0x02, 0x04, 0x00, 0x00,
                            0x02, 0x05, 0x00, 0xb3,
                            0x02, 0x04, 0x00, 0x00,
                            0x02, 0x05, 0x00, 0xb4,
                            0x02, 0x04, 0x00, 0x00,
                            0x02, 0x05, 0x00, 0xb5,
                            0x02, 0x04, 0x10, 0x40,
                            0x02, 0x05, 0x00, 0xb6,
                            0x02, 0x04, 0xd6, 0x97,
                            0x02, 0x05, 0x00, 0xb7,
                            0x02, 0x04, 0x90, 0x2b,
                            0x02, 0x05, 0x00, 0xb8,
                            0x02, 0x04, 0xd6, 0x97,
                            0x02, 0x05, 0x00, 0xb9,
                            0x02, 0x04, 0x90, 0x2b,
                            0x02, 0x05, 0x00, 0xba,
                            0x02, 0x04, 0xb8, 0xba,
                            0x02, 0x05, 0x00, 0xbb,
                            0x02, 0x04, 0xaa, 0xab,
                            0x02, 0x05, 0x00, 0xbc,
                            0x02, 0x04, 0xaa, 0xaf,
                            0x02, 0x05, 0x00, 0xbd,
                            0x02, 0x04, 0x6a, 0xaa,
                            0x02, 0x05, 0x00, 0xbe,
                            0x02, 0x04, 0x1c, 0x02,
                            0x02, 0x05, 0x00, 0xc0,
                            0x02, 0x04, 0x00, 0xff,
                            0x02, 0x05, 0x00, 0xc1,
                            0x02, 0x04, 0x0f, 0xa6
                        },
                    },
                },
            },
        },
    })
}
//EOF

And here's how it is created:
Code:
SPEEDY-OSX:~ RehabMan$ cd Projects/
SPEEDY-OSX:Projects RehabMan$ git clone https://github.com/vbourachot/Dell-XPS13-9333-DSDT-Patch.git xps9333.git
Cloning into 'xps9333.git'...
remote: Counting objects: 435, done.
remote: Total 435 (delta 0), reused 0 (delta 0), pack-reused 435
Receiving objects: 100% (435/435), 10.29 MiB | 1.98 MiB/s, done.
Resolving deltas: 100% (212/212), done.
Checking connectivity... done.
SPEEDY-OSX:Projects RehabMan$ cd xps9333.git/
SPEEDY-OSX:xps9333.git RehabMan$ ls Resources/
ahhcd.plist    layout
SPEEDY-OSX:xps9333.git RehabMan$ cp -R Resources Resources_ALC668
SPEEDY-OSX:xps9333.git RehabMan$ mv Resources_ALC668/layout/* Resources_ALC668/
SPEEDY-OSX:xps9333.git RehabMan$ rmdir Resources_ALC668/layout
SPEEDY-OSX:xps9333.git RehabMan$ ls Resources_ALC668/
Platforms.xml        ahhcd.plist        layout1.xml.zlib
Platforms.xml.zlib    layout1.xml
SPEEDY-OSX:xps9333.git RehabMan$ ~/Projects/codec.git/gen_ahhcd.sh ALC668
using plist: Resources_ALC668/ahhcd.plist
Generating SSDT-ALC668_out.dsl...
generating: "10ec_0668"
SPEEDY-OSX:xps9333.git RehabMan$ open SSDT-ALC668_out.dsl

Note that I didn't need to "write" any SSDT code... I just used the conversion script (gen_ahhcd.sh).
 
Neat! i didn't know you had written a script to do this, nor did I know you could stuff more than one command per buffer (that's why I was assuming it would create a big ssdt). The pinconfig from codeccomander is pretty cool too and I didn't know that was feasible either.

Minor note: ALC6668 also needs the onwake commands which are in the info.plist to fix headphone noise after sleep. If SSDT configuration is a complete override instead of a merge with the info.plist configuration, whoever uses the SSDT above will need to add the commands from the info.plist to the SSDT.
 
Neat! i didn't know you had written a script to do this, nor did I know you could stuff more than one command per buffer (that's why I was assuming it would create a big ssdt). The pinconfig from codeccomander is pretty cool too and I didn't know that was feasible either.

The pinconfig support in CodecCommander allows you to get rid of the AppleHDAHardwareConfigDriver stuff...

Minor note: ALC6668 also needs the onwake commands which are in the info.plist to fix headphone noise after sleep. If SSDT configuration is a complete override instead of a merge with the info.plist configuration, whoever uses the SSDT above will need to add the commands from the info.plist to the SSDT.

This is mainly just override for CodecCommanderProbeInit. Other data still coming from Info.plist.

If you need normal CodecCommander functionality on wake,etc, just set Disable=false, or remove that section:
(I should probably make the script generate some comments here)
Code:
        "CodecCommander", Package()
        {
            "Disable", ">n",
        },
        "CodecCommanderPowerHook", Package()
        {
            "Disable", ">n",
        },

Note: Is better to delete that section as you probably don't want to enable CodecCommander for HDMI audio codecs...
 
Last edited:

Now i have mic works, thanks. But still headphone noise...

This is the fix (in the linux kernel) to your problem with reboot from windows vs cold boot: https://github.com/torvalds/linux/commit/f3f9185f3e49c748e952dd579357048a42e89398

The best way to initialize that many registers is to init via the ConfigData in your
AppleHDAHardwareConfigDriver kext info.plist (technically you could also do it via codeccommander if you feel like writing a whole lot of ssdt code).

If you want to try using my applehda injector for alc668 which includes the fix above, clone the repo at https://github.com/vbourachot/Dell-XPS13-9333-DSDT-Patch. Then use make apple_hda; sudo make install_hda. You will need a vanilla AppleHDA kext in SLE for this to work. Furthermore, no guarantees it will work as some guy asked me once to help him with his asus alc 668 laptop and he couldn't get it to work (my laptop is a dell). Not sure if there's an actual difference or if it was user error. You can check my codec dumps for differences in the same repo.

If you want to do the changes to your existing applehda (requires some knowledge of applehda patching), this commit should help you understand how to proceed: https://github.com/vbourachot/Dell-...mmit/b7ff1f0443b0917ce24fb238c6d99caae23bbbf9 (in particular the notes in the file linux_sound/alc668_coefs.txt)

I have working mic now with your config, thanks. But how to fix headphone noise? for information, i have 1 x Audio In Combo Jack
 
Status
Not open for further replies.
Back
Top