Skip to content

Instantly share code, notes, and snippets.

@lamperez
Last active November 11, 2024 11:16
Show Gist options
  • Save lamperez/862763881c0e1c812392b5574727f6ff to your computer and use it in GitHub Desktop.
Save lamperez/862763881c0e1c812392b5574727f6ff to your computer and use it in GitHub Desktop.
CS35L41 amplifiers in an ASUS Zenbook on linux

Asus Zenbook UX3402 speakers on Linux

Important

THIS IS NOW OBSOLETE WITH KERNEL VERSIONS ≥ 6.7.0

A recent announcement in the kernel mail list by Cirrus developers will solve the problem described here. Therefore, the proposed solutions will be soon obsolete. See this comment (thanks, @flukejones, for the tip).

I got the speakers working on my Asus Zenbook 14 OLED UX3402, the one with Intel CPU and the two CS35L41 audio amplifiers connected over SPI (not the UM3402YA, with AMD and I²C). The amplifiers are supported by the snd_hda_scodec_cs35l41 module in recent kernel versions, but they require some model-specific configuration paramaters, that should be provided by the BIOS, via ACPI. Of course, they are missing. It seems that the Windows drivers have those parameters somehow hardcoded, instead of using ACPI (bad idea, but who am I to criticise). Since Asus has been nasty and refused/was not able to update the BIOS with the missing data, I have patched the ACPI tables myself.

Warning

As stated by Cirrus developers, if you try this there is a non-zero (low, I hope) possibility of blowing your speakers. Take into account that this procedure is not just configuring your box, it is hardware-level hacking with very scarce information about the hardware (thank you, ASUS, and thank you, Cirrus, for not publishing the CS35L41 datasheet and making it only available by request). Additionally, You should know how to work with DSDT or SSDT files (I have a brief guide here) and how to recover from a non booting system. You are on your own. You have been warned.

Note

I have used the patch for some months, and everything seems OK. As you can see, the most recent versions do not require electrical parameters to be specified, just providing the functions of several GPIO pins, that are already present in the original BIOS, and the behavior associated to them. I am almost sure that the patch is totally safe.

My BIOS is the most recent one (version 310). I have added two _DSD objects in the SSDT file (ssdt_csc3551.dsl, or its already assembled version, ssdt_csc3551.aml):

  • One inside the SPK1 device, providing the missing "cirrus,dev-index" and other properties, just like the I2C models. You can also provide these properties by patching the kernel module (the linux/sound/pci/hda/cs35l41_hda.c file).

  • Another one, after the SPK1 device, with the chip select GPIOs, "cs-gpios", required by the SPI bus (the somehow simpler I²C bus does not use chip select pins, but addresses). Without this _DSD object, only one amplifier can be addressed and activated. In this case, the driver refuses to load even for this single working amplifier.

Obsolete: DSDT patch

Instead of applying a SSDT file, you may patch the full DSDT dissassembled DSDT file (dsdt.dsl). This was my original solution (thanks to @thor2002ro for pointing to the simpler, nicer SSDT solution, see the comment, especially if you use grub). The patch is available for reference, just apply the SSDT file.

Obsolete: internal boost

I keep the old, original patch, that produced AMP short error messages when the volume was high enough, for reference. Please try first the simpler patch with external boost, that seems to work without flaws (thanks to @bdandy, see the comment).

Boot log

Output from journalctl -b -g CSC3551 --output short-monotonic after the old patch:

[5.358062] zenbook kernel: Serial bus multi instantiate pseudo device driver CSC3551:00: Instantiated 2 SPI devices.
[5.643640] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: Cirrus Logic CS35L41 (35a40), Revision: B2
[5.680302] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Cirrus Logic CS35L41 (35a40), Revision: B2
[5.996217] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: Falling back to default firmware.
[5.996608] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: Firmware version: 3
[5.996611] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: cirrus/cs35l41-dsp1-spk-prot.wmfw: Fri 24 Jun 2022 14:55:56 GMT Daylight Time
[6.069598] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: Firmware: 400a4 vendor: 0x2 v0.58.0, 2 algorithms
[6.070173] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: 0: ID cd v29.78.0 XM@94 YM@e
[6.070185] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: 1: ID f20b v0.1.0 XM@17c YM@0
[6.070192] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: spk-prot: e:\workspace\workspace\tibranch_release_playback_6.76_2\ormis\staging\default_tunings\internal\CS35L53\Fixed_Attenuation_Mono_48000_29.78.0\full\Fixed_Attenuation_Mono_48000_29.78.0_full.bin
[6.083485] zenbook kernel: snd_hda_codec_realtek ehdaudio0D0: bound spi1-CSC3551:00-cs35l41-hda.0 (ops cs35l41_hda_comp_ops [snd_hda_scodec_cs35l41])
[6.083899] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Falling back to default firmware.
[6.083962] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: Firmware version: 3
[6.083966] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: cirrus/cs35l41-dsp1-spk-prot.wmfw: Fri 24 Jun 2022 14:55:56 GMT Daylight Time
[6.145224] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: Firmware: 400a4 vendor: 0x2 v0.58.0, 2 algorithms
[6.145817] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: 0: ID cd v29.78.0 XM@94 YM@e
[6.145828] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: 1: ID f20b v0.1.0 XM@17c YM@0
[6.145834] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: spk-prot: e:\workspace\workspace\tibranch_release_playback_6.76_2\ormis\staging\default_tunings\internal\CS35L53\Fixed_Attenuation_Mono_48000_29.78.0\full\Fixed_Attenuation_Mono_48000_29.78.0_full.bin
[6.161484] zenbook kernel: snd_hda_codec_realtek ehdaudio0D0: bound spi1-CSC3551:00-cs35l41-hda.1 (ops cs35l41_hda_comp_ops [snd_hda_scodec_cs35l41])

The "Falling back to default firmware" disappears if spk-id-gpios are provided (the block is commented in the patch). As a result, a different firmware is loaded, resulting in very low volume and strong distortion. If the new patch is used, that uses external boost, the sound is correct, and the log is

[0.004000] zenbook kernel: ACPI: Table Upgrade: install [SSDT-CUSTOM- CSC3551]
[0.004000] zenbook kernel: ACPI: SSDT 0x00000000368FD000 0001A0 (v01 CUSTOM CSC3551  00000001 INTL 20200925)
[5.607253] zenbook kernel: Serial bus multi instantiate pseudo device driver CSC3551:00: Instantiated 2 SPI devices.
[5.906936] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: Cirrus Logic CS35L41 (35a40), Revision: B2
[5.907354] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Reset line busy, assuming shared reset
[5.938136] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Cirrus Logic CS35L41 (35a40), Revision: B2
[6.239406] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: Firmware version: 3
[6.239415] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: cirrus/cs35l41-dsp1-spk-prot-10431e02.wmfw: Fri 27 Aug 2021 14:58:19 W. Europe Daylight Time
[6.313109] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: Firmware: 400a4 vendor: 0x2 v0.43.1, 2 algorithms
[6.313524] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: 0: ID cd v29.63.1 XM@94 YM@e
[6.313530] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: 1: ID f20b v0.1.0 XM@176 YM@0
[6.313535] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: spk-prot: C:\Users\tyang\Desktop\Product Setting\SmartAMP\ASUS\ASUS_Zenbook\UX3402\Tuning Release\220304\ASUS_UX3402_L_tuning_IDYC_ReDc_PICL_RTL_0304.bin
[6.337211] zenbook kernel: snd_hda_codec_realtek ehdaudio0D0: bound spi1-CSC3551:00-cs35l41-hda.0 (ops cs35l41_hda_comp_ops [snd_hda_scodec_cs35l41])
[6.337534] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: Firmware version: 3
[6.337540] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: cirrus/cs35l41-dsp1-spk-prot-10431e02.wmfw: Fri 27 Aug 2021 14:58:19 W. Europe Daylight Time
[6.399070] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: Firmware: 400a4 vendor: 0x2 v0.43.1, 2 algorithms
[6.399612] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: 0: ID cd v29.63.1 XM@94 YM@e
[6.399623] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: 1: ID f20b v0.1.0 XM@176 YM@0
[6.399629] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: spk-prot: C:\Users\tyang\Desktop\Product Setting\SmartAMP\ASUS\ASUS_Zenbook\UX3402\Tuning Release\220304\ASUS_UX3402_R_tuning_IDYC_ReDc_PICL_RTL_0304.bin
[6.427637] zenbook kernel: snd_hda_codec_realtek ehdaudio0D0: bound spi1-CSC3551:00-cs35l41-hda.1 (ops cs35l41_hda_comp_ops [snd_hda_scodec_cs35l41])
--- dsdt.dsl.old 2023-03-26 01:06:48.845795666 +0100
+++ dsdt.dsl 2023-03-26 12:00:45.643851841 +0200
@@ -18,7 +18,7 @@
* Compiler ID "INTL"
* Compiler Version 0x20200717 (538969879)
*/
-DefinitionBlock ("", "DSDT", 2, "_ASUS_", "Notebook", 0x01072009)
+DefinitionBlock ("", "DSDT", 2, "_ASUS_", "Notebook", 0x0107200A)
{
/*
* iASL Warning: There were 233 external control methods found during
@@ -90642,7 +90642,48 @@
Method (_DIS, 0, NotSerialized) // _DIS: Disable Device
{
}
+
+ Name (_DSD, Package () // _DSD: Device-Specific Data
+ {
+ ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+ Package ()
+ {
+ Package () { "cirrus,dev-index", Package () { Zero, One }},
+ Package () { "reset-gpios", Package () {
+ SPK1, One, Zero, Zero,
+ SPK1, One, Zero, Zero,
+ } },
+ // Package () { "spk-id-gpios", Package () {
+ // SPK1, 0x02, Zero, Zero,
+ // SPK1, 0x02, Zero, Zero,
+ // } },
+ Package () { "cirrus,speaker-position", Package () { Zero, One } },
+ Package () { "cirrus,gpio1-func", Package () { Zero, Zero } },
+ Package () { "cirrus,gpio2-func", Package () { 0x02, 0x02 } },
+ // boost-type: 0 internal, 1 external
+ Package () { "cirrus,boost-type", Package () { Zero, Zero } },
+ // boost-peak-milliamp: 1600 to 4500, increments of 50 mA
+ Package () { "cirrus,boost-peak-milliamp", Package () { 4500, 4500 } },
+ // boost-ind-nanohenry: 1000 | 1200 | 1500 | 2200 nH
+ Package () { "cirrus,boost-ind-nanohenry", Package () { 1000, 1000 } },
+ // boost-cap-microfarad: rounded to the nearest integer
+ Package () { "cirrus,boost-cap-microfarad", Package () { 24, 24 } },
+ },
+ })
}
+
+ Name (_DSD, Package ()
+ {
+ ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+ Package ()
+ {
+ Package () { "cs-gpios", Package () {
+ Zero, // Native CS
+ SPK1, Zero, Zero, Zero // GPIO CS
+ } }
+ }
+ })
+
}
Scope (_SB.PC00.LPCB)
--- dsdt.dsl.old 2023-03-26 01:06:48.845795666 +0100
+++ dsdt.dsl 2023-03-26 12:00:45.643851841 +0200
@@ -18,7 +18,7 @@
* Compiler ID "INTL"
* Compiler Version 0x20200717 (538969879)
*/
-DefinitionBlock ("", "DSDT", 2, "_ASUS_", "Notebook", 0x01072009)
+DefinitionBlock ("", "DSDT", 2, "_ASUS_", "Notebook", 0x0107200A)
{
/*
* iASL Warning: There were 233 external control methods found during
@@ -90642,7 +90642,43 @@
Method (_DIS, 0, NotSerialized) // _DIS: Disable Device
{
}
+
+ Name (_DSD, Package () // _DSD: Device-Specific Data
+ {
+ ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+ Package ()
+ {
+ Package () { "cirrus,dev-index", Package () { Zero, One }},
+ Package () { "reset-gpios", Package () {
+ SPK1, One, Zero, Zero,
+ SPK1, One, Zero, Zero,
+ } },
+ Package () { "spk-id-gpios", Package () {
+ SPK1, 0x02, Zero, Zero,
+ SPK1, 0x02, Zero, Zero,
+ } },
+ Package () { "cirrus,speaker-position", Package () { Zero, One } },
+ // gpioX-func: 0 not used, 1 VPSK_SWITCH, 2: INTERRUPT, 3: SYNC
+ Package () { "cirrus,gpio1-func", Package () { One, One } },
+ Package () { "cirrus,gpio2-func", Package () { 0x02, 0x02 } },
+ // boost-type: 0 internal, 1 external
+ Package () { "cirrus,boost-type", Package () { One, One } },
+ },
+ })
}
+
+ Name (_DSD, Package ()
+ {
+ ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+ Package ()
+ {
+ Package () { "cs-gpios", Package () {
+ Zero, // Native CS
+ SPK1, Zero, Zero, Zero // GPIO CS
+ } }
+ }
+ })
+
}
Scope (_SB.PC00.LPCB)
DefinitionBlock ("", "SSDT", 1, "CUSTOM", "CSC3551", 0x00000001)
{
External (_SB_.PC00.SPI0, DeviceObj)
External (_SB_.PC00.SPI0.SPK1, DeviceObj)
Scope (_SB.PC00.SPI0.SPK1)
{
Name (_DSD, Package ()
{
ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package ()
{
Package () { "cirrus,dev-index", Package () { Zero, One }},
Package () { "reset-gpios", Package () {
SPK1, One, Zero, Zero,
SPK1, One, Zero, Zero
} },
Package () { "spk-id-gpios", Package () {
SPK1, 0x02, Zero, Zero,
SPK1, 0x02, Zero, Zero
} },
Package () { "cirrus,speaker-position", Package () { Zero, One } },
// gpioX-func: 0 not used, 1 VPSK_SWITCH, 2: INTERRUPT, 3: SYNC
Package () { "cirrus,gpio1-func", Package () { One, One } },
Package () { "cirrus,gpio2-func", Package () { 0x02, 0x02 } },
// boost-type: 0 internal, 1 external
Package () { "cirrus,boost-type", Package () { One, One } }
}
})
}
Scope (_SB.PC00.SPI0)
{
Name (_DSD, Package ()
{
ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package ()
{
Package () { "cs-gpios", Package () {
Zero, // Native CS
SPK1, Zero, Zero, Zero // GPIO CS
} }
}
})
}
}
@StevenBrons
Copy link

StevenBrons commented Sep 4, 2023

Thanks everyone in this thread! After a lot of iterations I managed to supply my Asus Zenbook 15 UM3504DA with working speakers!

For anyone facing the same issue with the Zenbook 15, give me a message; the working steps included

DefinitionBlock ("", "SSDT", 1, "CUSTOM", "CSC3551", 0x00000001)
{
    External (_SB.I2CB, DeviceObj)
    External (_SB.I2CB.SPKR, DeviceObj)

    Scope (_SB.I2CB.SPKR)
    {

        Method (_DIS, 0, NotSerialized)  // _DIS: Disable Device
        {
        }
        Name (_DSD, Package ()   // _DSD: Device-Specific Data
        {
            ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
            Package ()
            {
                Package () { "cirrus,dev-index", Package () { 0x0040, 0x0041 }},
                Package () { "reset-gpios", Package () {
                    SPKR, Zero, Zero, Zero,
                    SPKR, Zero, Zero, Zero,
                } },
                Package () { "spk-id-gpios", Package () {
                    SPKR, 0x02, Zero, Zero,
                    SPKR, 0x02, Zero, Zero,
                } },
                Package () { "cirrus,speaker-position",     Package () { Zero, One } },
                // gpioX-func: 0 not used, 1 VPSK_SWITCH, 2: INTERRUPT, 3: SYNC
                Package () { "cirrus,gpio1-func",           Package () { One, One } },
                Package () { "cirrus,gpio2-func",           Package () { 0x02, 0x02 } },
                // boost-type: 0 internal, 1 external
                Package () { "cirrus,boost-type",           Package () { One, One } },
                // boost-peak-milliamp: 1600 to 4500, increments of 50 mA
                //Package () { "cirrus,boost-peak-milliamp",  Package () { 3000, 3000 } },
                // boost-ind-nanohenry: 1000 | 1200 | 1500 | 2200 nH
                //Package () { "cirrus,boost-ind-nanohenry",  Package () { 1000, 1000 } },
                // boost-cap-microfarad: rounded to the nearest integer
                //Package () { "cirrus,boost-cap-microfarad", Package () { 15, 15 } },
            },
        })
    }


}

I am very greatful for all the guides and especially the asus-linux website.

Some problems I encountered along the way:

  • The asus-linux website does not provide any information the needed kernel patch; I found that in the comments here
  • The 6.5 kernel does have the patch for some models, but not mine
  • There are many versions of the .dsl file floating around, I still don't know what is correct

@AlirezaDadrass
Copy link

AlirezaDadrass commented Sep 5, 2023

Hi @AlirezaDadrass, have you tried this patch? https://gist.github.com/lamperez/862763881c0e1c812392b5574727f6ff?permalink_comment_id=4639491#gistcomment-4639491

Hi
No I didn't.
there is a command 'sudo update-grub'
sudo: update-grub: command not found

@talentlessguy
Copy link

@AlirezaDadrass might be that you have systemd-boot and not GRUB, check /efi/loader

@AlirezaDadrass
Copy link

Hi @AlirezaDadrass, have you tried this patch? https://gist.github.com/lamperez/862763881c0e1c812392b5574727f6ff?permalink_comment_id=4639491#gistcomment-4639491

Hello again.
I tried this solution and build the kernel and installed it. nothing happen

@AlirezaDadrass
Copy link

@AlirezaDadrass might be that you have systemd-boot and not GRUB, check /efi/loader

no i have grub2 and /boot folder

@AlirezaDadrass
Copy link

I got
journalctl -b -g CSC3551 --output short-monotonic:
[ 0.013636] fedora kernel: ACPI: SSDT 0x0000000047E9ECA2 0002D6 (v01 CUSTOM CSC3551 00000002 INTL 20220331) [ 7.091287] fedora kernel: Serial bus multi instantiate pseudo device driver CSC3551:00: Instantiated 2 SPI devices. [ 7.635535] fedora kernel: cs35l41-hda spi0-CSC3551:00-cs35l41-hda.0: Cirrus Logic CS35L41 (35a40), Revision: B2 [ 7.636909] fedora kernel: cs35l41-hda spi0-CSC3551:00-cs35l41-hda.1: Reset line busy, assuming shared reset [ 7.725514] fedora kernel: cs35l41-hda spi0-CSC3551:00-cs35l41-hda.1: Cirrus Logic CS35L41 (35a40), Revision: B2
after re build and reinstalling kernel.
but issue is not resolved

@Messier104
Copy link

Got it working by applying kernel patch on asus ux3402VA

SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS UX3402", ALC245_FIXUP_CS35L41_SPI_2),

Is there any chance you could elaborate or redirect me to a source on how to apply this? I would love to get this working. Thank you!

b

@fermino
Copy link

fermino commented Sep 6, 2023

@Messier104 that patch is already added on the kernel so there's no need to patch it manually unless you're using an old kernel. It would be a lot easier though to just update it. What distro and kernel version are you using?

@AlirezaDadrass same thing :) You need to have a kernel with the patches and then add the ssdt to the grub config. What kernel are you using currently? Let's get one thing figured out at a time ;)

uname -a

@Messier104
Copy link

Messier104 commented Sep 6, 2023

@Messier104 that patch is already added on the kernel so there's no need to patch it manually unless you're using an old kernel. It would be a lot easier though to just update it. What distro and kernel version are you using?

I'm using Kubuntu 22.04.3 (latest lts) and the kernel was 6.2, I have now also tried the latest one available, 6.5.1 but it does not seem to be fixed. Would you have any pointers?

@fermino
Copy link

fermino commented Sep 6, 2023

I'm using Kubuntu 22.04.3 (latest lts) and the kernel was 6.2, I have now also tried the latest one available, 6.5.1 but it does not seem to be fixed. Would you have any pointers?

@Messier104 I have an UX3402 with kernel 6.1 (working sound), so 6.2 should be just fine.
Check this one out: https://github.com/thor2002ro/asus_zenbook_ux3402za/tree/main/Sound
That's what I'm using currently. You're going to have to install some tools (like iasl), and you might have to tweak some things depending on if you're using grub or another bootloader, but if you're using grub that should do just fine. Make sure the paths are right as it may vary a bit depending on the distro. If you need any help with it just reach out :)

@Messier104
Copy link

I'm using Kubuntu 22.04.3 (latest lts) and the kernel was 6.2, I have now also tried the latest one available, 6.5.1 but it does not seem to be fixed. Would you have any pointers?

@Messier104 I have an UX3402 with kernel 6.1 (working sound), so 6.2 should be just fine. Check this one out: https://github.com/thor2002ro/asus_zenbook_ux3402za/tree/main/Sound That's what I'm using currently. You're going to have to install some tools (like iasl), and you might have to tweak some things depending on if you're using grub or another bootloader, but if you're using grub that should do just fine. Make sure the paths are right as it may vary a bit depending on the distro. If you need any help with it just reach out :)

I have tried that, as far as my understanding goes the paths are also correct but I'm not 100% confident how I can be sure. Are you using the ux3402va model or the ux3402za model? I have the first one, could this be a problem? Would you be available to chat a bit on discord maybe? I would be very grateful! (Piño Palladiño#4084)

@fermino
Copy link

fermino commented Sep 6, 2023

@Messier104 I'll text you there. I do have the UX3402ZA. If we get it working then we can post it here for other people :)

@ctrlzero
Copy link

ctrlzero commented Sep 6, 2023

this is getting to be a lengthy conversation. perhaps it would be more beneficial (and productive) to start a discord server or something?

@BillOTei
Copy link

BillOTei commented Sep 6, 2023 via email

@AlirezaDadrass
Copy link

@Messier104 that patch is already added on the kernel so there's no need to patch it manually unless you're using an old kernel. It would be a lot easier though to just update it. What distro and kernel version are you using?

@AlirezaDadrass same thing :) You need to have a kernel with the patches and then add the ssdt to the grub config. What kernel are you using currently? Let's get one thing figured out at a time ;)

uname -a
Hello again!
I'm using :
Linux fedora 6.4.13-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 30 17:07:31 UTC 2023 x86_64 GNU/Linux

@Messier104
Copy link

Messier104 commented Sep 7, 2023

@Messier104 that patch is already added on the kernel so there's no need to patch it manually unless you're using an old kernel. It would be a lot easier though to just update it. What distro and kernel version are you using?

I'm using kubuntu 22.04.3 LTS (ubuntu with kde plasma). For kernels I've used 6.5.1 (and before also 6.2). My version of the zenbook is ux3402VA (not ZA) if that makes a difference.

Above in the thread people talked about changing this line (I think in the kernel source code)

SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS UX3402", ALC245_FIXUP_CS35L41_SPI_2),

Here the second hex number is different then standard for the VA w.r.t. ZA version (I think). I managed to find how to change this but when I tried compiling the kernel I can't get it to boot (it does show up in grub). I'm a bit of a newbie in regard to this kind of stuff though :/

edit:

I have finally managed to fix it!

For the UX3402VA version, it is really required to change the second hex number to 0x16a3 as in the line above (which can be found in the source of the kernel in "sound/pci/hda/patch_realtek.c" and then build and install the kernel. If you are an ultimate newbie in this regard and are on Ubuntu; following this step-by-step works: https://askubuntu.com/questions/1435591/correct-way-to-build-kernel-with-hardware-support-fix-patches-ubuntu-22-04-lts

@winstonma
Copy link

winstonma commented Sep 8, 2023

Hi @lamperez I am using Zenbook S13 OLED using the same chip. The driver is working but the volume is too low. I would like to amplify the volume. Not sure if I need to use the DSDT method or just need to modify some value in /sys folder.

Also I just use the DSDT without any modification and got the

ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PC00.SPI0.SPK1], AE_NOT_FOUND (20230331/dswload2-162)

Not sure how could I troubleshoot and modify your file to get my device with the right amplification value. Thanks.

EDIT:

It turns out the audio on my laptop is supported by the kernel. The only needed thing is to put the firmware into the system (link). Now the volume is larger.

@armeldemarsac92
Copy link

armeldemarsac92 commented Sep 17, 2023

Thanks everyone in this thread! After a lot of iterations I managed to supply my Asus Zenbook 15 UM3504DA with working speakers!

For anyone facing the same issue with the Zenbook 15, give me a message; the working steps included

* Following the guide on the asus-linux website:  [here](https://asus-linux.org/wiki/cirrus-amps/)

* This very helpful comment, thanks! https://gist.github.com/lamperez/862763881c0e1c812392b5574727f6ff?permalink_comment_id=4582983#gistcomment-4582983

* building my own linux kernel with the patch from that comment

* changing the dsl config a number of times until I ended up on the following:
DefinitionBlock ("", "SSDT", 1, "CUSTOM", "CSC3551", 0x00000001)
{
    External (_SB.I2CB, DeviceObj)
    External (_SB.I2CB.SPKR, DeviceObj)

    Scope (_SB.I2CB.SPKR)
    {

        Method (_DIS, 0, NotSerialized)  // _DIS: Disable Device
        {
        }
        Name (_DSD, Package ()   // _DSD: Device-Specific Data
        {
            ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
            Package ()
            {
                Package () { "cirrus,dev-index", Package () { 0x0040, 0x0041 }},
                Package () { "reset-gpios", Package () {
                    SPKR, Zero, Zero, Zero,
                    SPKR, Zero, Zero, Zero,
                } },
                Package () { "spk-id-gpios", Package () {
                    SPKR, 0x02, Zero, Zero,
                    SPKR, 0x02, Zero, Zero,
                } },
                Package () { "cirrus,speaker-position",     Package () { Zero, One } },
                // gpioX-func: 0 not used, 1 VPSK_SWITCH, 2: INTERRUPT, 3: SYNC
                Package () { "cirrus,gpio1-func",           Package () { One, One } },
                Package () { "cirrus,gpio2-func",           Package () { 0x02, 0x02 } },
                // boost-type: 0 internal, 1 external
                Package () { "cirrus,boost-type",           Package () { One, One } },
                // boost-peak-milliamp: 1600 to 4500, increments of 50 mA
                //Package () { "cirrus,boost-peak-milliamp",  Package () { 3000, 3000 } },
                // boost-ind-nanohenry: 1000 | 1200 | 1500 | 2200 nH
                //Package () { "cirrus,boost-ind-nanohenry",  Package () { 1000, 1000 } },
                // boost-cap-microfarad: rounded to the nearest integer
                //Package () { "cirrus,boost-cap-microfarad", Package () { 15, 15 } },
            },
        })
    }


}

I am very greatful for all the guides and especially the asus-linux website.

Some problems I encountered along the way:

* The asus-linux website does not provide any information the needed kernel patch; I found that in the comments here

* The 6.5 kernel does have the patch for some models, but not mine

* There are many versions of the .dsl file floating around, I still don't know what is correct

Hi stevens, thanks for your contribution ! I have exactly the same laptop as you and tried following the instructions but still no sound, I remove pulseaudio as it was creating some pbs to use pipewire. Could you provide me with a rundown of everything you did to enable the speakers again ? The instructions are a bit unclear for a newbie like me. Thanks a lot :)

Here is what I did 👍

  1. mkdir cirrus && cd cirrus
    sudo cat /sys/firmware/acpi/tables/DSDT > dsdt.dat
    iasl -d dsdt.dat

  2. I created the patch by copying and pasting your code snippet in a file I created and called "ssdt_csc3551.dsl"

3.iasl -tc ssdt_csc3551.dsl
mkdir -p kernel/firmware/acpi
cp ssdt_csc3551.aml kernel/firmware/acpi
find kernel | cpio -H newc --create > patched_cirrus_acpi.cpio
sudo cp patched_cirrus_acpi.cpio /boot/patched_cirrus_acpi.cpio

4.I added this line "GRUB_EARLY_INITRD_LINUX_CUSTOM="patched_cirrus_acpi.cpio" to my grub file "/etc/default/grub"

5.I updated the grub config with "sudo grub2-mkconfig -o /etc/grub2-efi.cfg"

6.Reboot but still no sound, here is the dmseg :
dmesg |grep CSC3551
[ 6.024384] Serial bus multi instantiate pseudo device driver CSC3551:00: Instantiated 2 I2C devices.
[ 6.278538] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: Error: ACPI _DSD Properties are missing for HID CSC3551.
[ 6.278545] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: error -EINVAL: Platform not supported
[ 6.278574] cs35l41-hda: probe of i2c-CSC3551:00-cs35l41-hda.0 failed with error -22
[ 6.278700] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.1: Error: ACPI _DSD Properties are missing for HID CSC3551.
[ 6.278703] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.1: error -EINVAL: Platform not supported
[ 6.278723] cs35l41-hda: probe of i2c-CSC3551:00-cs35l41-hda.1 failed with error -22

I am surely missing something as there was a lot of options in the tutorias you linked.

@PoSayDone
Copy link

Users of ux3402va, I finally submitted a fix for our model to the kernel so that we don't need to use kernel patches!
https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/commit/?id=07058dceb038a4b0dd49af07118b6b2a685bb4a6

@rainydaysavings
Copy link

Hey guys, I have a G634JZ (Rog Strix Scar 16 2023), using following ssdt(dsdt shows SPI3 and SPK1):

DefinitionBlock ("", "SSDT", 1, "CUSTOM", "CSC3551", 0x00000001)
{
    External (_SB_.PC00.SPI3, DeviceObj)
    External (_SB_.PC00.SPI3.SPK1, DeviceObj)

    Scope (_SB.PC00.SPI3.SPK1)
    {
        Name (_DSD, Package ()   // _DSD: Device-Specific Data
        {
            ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
            Package ()
            {
                Package () { "cirrus,dev-index", Package () { Zero, One }},
                Package () { "reset-gpios", Package () {
                                        SPK1, Zero, Zero, Zero,
                                        SPK1, Zero, Zero, Zero,
                } },
                Package () { "spk-id-gpios", Package () {
                                        SPK1, 0x02, Zero, Zero,
                                        SPK1, 0x02, Zero, Zero,
                } },
                Package () { "cirrus,speaker-position",     Package () { Zero, One } },
                // gpioX-func: 0 not used, 1 VPSK_SWITCH, 2: INTERRUPT, 3: SYNC
                Package () { "cirrus,gpio1-func",           Package () { One, One } },
                Package () { "cirrus,gpio2-func",           Package () { 0x02, 0x02 } },
                // boost-type: 0 internal, 1 external
                Package () { "cirrus,boost-type",           Package () { One, One } },
            },
        })
    }

    Scope (_SB.PC00.SPI3)
    {
        Name (_DSD, Package ()
        {
            ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
            Package ()
            {
                Package () { "cs-gpios", Package () {
                    Zero,                    // Native CS
                    SPK1, Zero, Zero, Zero   // GPIO CS
                } }
            }
        })
    }
}

The dmesg shows:

λ sudo dmesg|grep CSC3551
[    0.018409] ACPI: Table Upgrade: install [SSDT-CUSTOM- CSC3551]
[    0.018410] ACPI: SSDT 0x0000000039A7D000 0001A0 (v01 CUSTOM CSC3551  00000001 INTL 20221020)
[    5.780873] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: Reset line busy, assuming shared reset
[    5.884861] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: Failed waiting for OTP_BOOT_DONE: -110
[    5.897583] cs35l41-hda: probe of spi1-CSC3551:00-cs35l41-hda.0 failed with error -110
[    5.899702] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Reset line busy, assuming shared reset
[    6.003547] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Failed waiting for OTP_BOOT_DONE: -110
[    6.024392] cs35l41-hda: probe of spi1-CSC3551:00-cs35l41-hda.1 failed with error -110
[    6.024574] Serial bus multi instantiate pseudo device driver CSC3551:00: Instantiated 2 SPI devices.

The kernel patch of this device (1043:1caf) seems in the linux-g14 kernel patch code, which I'm using.

So anyone happened to fix the OTP_BOOT_DONE?

Can confirm this patch also works with the ROG Strix G814JZ model!
Appreciate it!

$ sudo dmesg | grep CSC3551                                                                                                                                                                                                 
[    0.018977] ACPI: Table Upgrade: install [SSDT-CUSTOM- CSC3551]
[    0.018979] ACPI: SSDT 0x00000000392AF000 0001A0 (v01 CUSTOM CSC3551  00000001 INTL 20220331)
[   35.442408] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.0: Reset line busy, assuming shared reset
[   35.482909] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.0: Cirrus Logic CS35L41 (35a40), Revision: B2
[   35.486857] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.1: Reset line busy, assuming shared reset
[   35.530909] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.1: Cirrus Logic CS35L41 (35a40), Revision: B2
[   35.532929] Serial bus multi instantiate pseudo device driver CSC3551:00: Instantiated 2 SPI devices.

@JYInMyHeart
Copy link

Hey guys. Does ROG Strix G614JV spport? I Just find G614J and G614JI.

@AlirezaDadrass
Copy link

I solved my problem with https://github.com/badgers-ua/asus_zenbook_ux5304va_sound.
Thank you all.
But i have to do the whole process after each kernel update. I hope fedora team insert path in next version

@Mikchel
Copy link

Mikchel commented Sep 26, 2023

For anyone having issues with the ASUS ROG STRIX G17 (2023) G713PV:

I've used the following dsl patch:

DefinitionBlock ("", "SSDT", 1, "CUSTOM", "CSC3551", 0x00000001)
{
    External (_SB_.I2CD, DeviceObj)
    External (_SB_.I2CD.SPKR, DeviceObj)

    Scope (_SB.I2CD.SPKR)
    {
        Name (_DSD, Package ()   // _DSD: Device-Specific Data
        {
            ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
            Package ()
            {
                Package () { "cirrus,dev-index", Package () { 0x0040, 0x0041 }},
                Package () { "reset-gpios", Package () {
                   SPKR, Zero, Zero, Zero,
                   SPKR, Zero, Zero, Zero,
                } },
                Package () { "spk-id-gpios", Package () {
                   SPKR, 0x02, Zero, Zero,
                   SPKR, 0x02, Zero, Zero,
                } },
                Package () { "cirrus,speaker-position",     Package () { Zero, One } },
                // gpioX-func: 0 not used, 1 VPSK_SWITCH, 2: INTERRUPT, 3: SYNC
                Package () { "cirrus,gpio1-func",           Package () { One, One } },
                Package () { "cirrus,gpio2-func",           Package () { 0x02, 0x02 } },
                // boost-type: 0 internal, 1 external
                Package () { "cirrus,boost-type",           Package () { One, One } },
            },
        })
    }
}

The following works with grub: Compile it with: iasl -tc speaker_amplifier_fix_patch.dsl, copy the resulting speaker_amplifier_fix_patch.aml file file to the boot partition (mostly /boot). Then add the entry acpi speaker_amplifier_fix_patch.aml to the grub config, e.g. to the /etc/grub.d/40_custom file. Don't forget to regenerate your grub config (sudo grub-mkconfig -o /boot/grub/grub.cfg on Arch).

You also need the newest linux-firmware version (20230804) (on arch as of writing only available via AUR linux-firmware-git). Also the newest kernel version (6.4.8) is necessary.

It is possible to get it working with older kernel by adding some modprobe options to snd-hda-intel, but I don't know which exactly. Instead of using the newest linux-firmware you can also create links to all files in /lib/firmware/cirrus containing -10431503- by replacing it with -10431d1f-, e.g. cs35l41-dsp1-spk-prot-10431d1f-spkid0-l0.bin -> cs35l41-dsp1-spk-prot-10431503-spkid0-l0.bin

Thanks to this gist and the information in https://asus-linux.org/wiki/cirrus-amps/#create-the-ssdt-patch

I can confirm that this works on ASUS ROG G713PV. Thank you
The only thing that i noticed notebook started to heat too match. It is very strange that one mp3 track playing on VLC force to heat notebook which is expecting to spread 300W (AMD 7845 + NVIDIA 4060).
Probably something wrong inside of schematic because of that patch.
Also sometimes VLC is playing with big noise.
So, yes, that works. But with some strange effects affected to notebook hardware

@kureta
Copy link

kureta commented Sep 28, 2023

I solved my problem with https://github.com/badgers-ua/asus_zenbook_ux5304va_sound. Thank you all. But i have to do the whole process after each kernel update. I hope fedora team insert path in next version

I have been trying to get this to work for 2 days now. I patched and compiled the kernel. I use systemd-boot so I followed those instructions, made a patched.cpio, added it as an initrd flag in boot config, added it into the mkinitcpio. This is what I get when I boot my machine after doing everything.

❯ sudo dmesg | grep CSC3551
[sudo] password for kureta:
[    0.014530] ACPI: Table Upgrade: install [SSDT-CUSTOM- CSC3551]
[    0.014532] ACPI: SSDT 0x000000004F164000 0002D6 (v01 CUSTOM CSC3551  00000002 INTL 20230628)
[    3.033166] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: Error: ACPI _DSD Properties are missing for HID CSC3551.
[    3.033174] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: error -EINVAL: Platform not supported
[    3.033179] cs35l41-hda: probe of spi1-CSC3551:00-cs35l41-hda.0 failed with error -22
[    3.054463] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Error: ACPI _DSD Properties are missing for HID CSC3551.
[    3.054469] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: error -EINVAL: Platform not supported
[    3.054473] cs35l41-hda: probe of spi1-CSC3551:00-cs35l41-hda.1 failed with error -22
[    3.054513] Serial bus multi instantiate pseudo device driver CSC3551:00: Instantiated 2 SPI devices.

I can also grep ACPI but that is a huge wall of text.

@lamperez
Copy link
Author

@kureta, you are applying the patch (ACPI: Table Upgrade: ...), but clearly the patch is not ok. Maybe the identifier in the Scope blocks are different for your computer model. You have to disassemble your ACPI, search for "CSC3551" and find the corresponding Scope block.

@kureta
Copy link

kureta commented Sep 29, 2023

This is from my disassembled ACPI:

DefinitionBlock ("", "SSDT", 1, "_ASUS_", "SPKRAMPS", 0x00000002)
{
    External (_SB_.GPI0, DeviceObj)
    External (_SB_.PC00.SPI1, DeviceObj)

    Scope (\_SB.PC00.SPI1)
    {
        Device (SPK1)
        {
            Name (_HID, "CSC3551")  // _HID: Hardware ID
            Name (_SUB, "104316D3")  // _SUB: Subsystem ID
            Name (_UID, One)  // _UID: Unique ID
            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                Name (SBUF, ResourceTemplate ()
                {
                    SpiSerialBusV2 (0x0000, PolarityLow, FourWireMode, 0x08,
                        ControllerInitiated, 0x003D0900, ClockPolarityLow,
                        ClockPhaseFirst, "\\_SB.PC00.SPI1",
                        0x00, ResourceConsumer, , Exclusive,
                        )
                    SpiSerialBusV2 (0x0001, PolarityLow, FourWireMode, 0x08,
                        ControllerInitiated, 0x003D0900, ClockPolarityLow,
                        ClockPhaseFirst, "\\_SB.PC00.SPI1",
                        0x00, ResourceConsumer, , Exclusive,
                        )
                    GpioIo (Exclusive, PullUp, 0x0000, 0x0000, IoRestrictionOutputOnly,
                        "\\_SB.GPI0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x0017
                        }
                    GpioIo (Exclusive, PullDown, 0x0000, 0x0000, IoRestrictionOutputOnly,
                        "\\_SB.GPI0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x0131
                        }
                    GpioIo (Exclusive, PullUp, 0x0000, 0x0000, IoRestrictionInputOnly,
                        "\\_SB.GPI0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x012E
                        }
                    GpioIo (Shared, PullUp, 0x0064, 0x0000, IoRestrictionInputOnly,
                        "\\_SB.GPI0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x012F
                        }
                    GpioInt (Edge, ActiveBoth, Shared, PullUp, 0x0064,
                        "\\_SB.GPI0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x012F
                        }
                })
                Return (SBUF) /* \_SB_.PC00.SPI1.SPK1._CRS.SBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                Return (0x0F)
            }

            Method (_DIS, 0, NotSerialized)  // _DIS: Disable Device
            {
            }
        }
    }
}

and this is the patch I am using:

DefinitionBlock ("", "SSDT", 1, "CUSTOM", "CSC3551", 0x00000002)
{
    External (_SB_.GPI0, DeviceObj)
    External (_SB_.PC00.SPI1, DeviceObj)

    Scope (\_SB.PC00.SPI1)
    {
        Device (SPK1)
        {
            Name (_HID, "CSC3551")  // _HID: Hardware ID
            Name (_SUB, "104316D3")  // _SUB: Subsystem ID
            Name (_UID, One)  // _UID: Unique ID
            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                Name (SBUF, ResourceTemplate ()
                {
                    SpiSerialBusV2 (0x0000, PolarityLow, FourWireMode, 0x08,
                        ControllerInitiated, 0x003D0900, ClockPolarityLow,
                        ClockPhaseFirst, "\\_SB.PC00.SPI1",
                        0x00, ResourceConsumer, , Exclusive,
                        )
                    SpiSerialBusV2 (0x0001, PolarityLow, FourWireMode, 0x08,
                        ControllerInitiated, 0x003D0900, ClockPolarityLow,
                        ClockPhaseFirst, "\\_SB.PC00.SPI1",
                        0x00, ResourceConsumer, , Exclusive,
                        )
                    GpioIo (Exclusive, PullUp, 0x0000, 0x0000, IoRestrictionOutputOnly,
                        "\\_SB.GPI0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x0017
                        }
                    GpioIo (Exclusive, PullDown, 0x0000, 0x0000, IoRestrictionOutputOnly,
                        "\\_SB.GPI0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x0131
                        }
                    GpioIo (Exclusive, PullUp, 0x0000, 0x0000, IoRestrictionInputOnly,
                        "\\_SB.GPI0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x012E
                        }
                    GpioIo (Shared, PullUp, 0x0064, 0x0000, IoRestrictionInputOnly,
                        "\\_SB.GPI0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x012F
                        }
                    GpioInt (Edge, ActiveBoth, Shared, PullUp, 0x0064,
                        "\\_SB.GPI0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x012F
                        }
                })
                Return (SBUF) /* \_SB_.PC00.SPI1.SPK1._CRS.SBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                Return (0x0F)
            }

            Method (_DIS, 0, NotSerialized)  // _DIS: Disable Device
            {
            }

            Method (_DSD, 0, NotSerialized)  // _DSD: Device Specific Data
            {
                Return (Package ()
                    {
                        ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
                        Package ()
                        {
                            Package () { "cirrus,dev-index", Package () { Zero, One }},
                            Package () { "reset-gpios", Package () {
                            SPK1, One, Zero, Zero,
                            SPK1, One, Zero, Zero
                            } },
                            Package () { "spk-id-gpios", Package () {
                                SPK1, 0x02, Zero, Zero,
                                SPK1, 0x02, Zero, Zero,
                            } },
                            Package () { "cirrus,speaker-position", Package () { Zero, One } },
                            Package () { "cirrus,gpio1-func", Package () { One, One } },
                            Package () { "cirrus,gpio2-func", Package () { 0x02, 0x02 } },
                            // boost-type: 0 internal, 1 external
                            Package () { "cirrus,boost-type", Package () { One, One } },
                            // boost-peak-milliamp: 1600 to 4500, increments of 50 mA
                            //Package () { "cirrus,boost-peak-milliamp",  Package () { 3000, 3000 } },
                            // boost-ind-nanohenry: 1000 | 1200 | 1500 | 2200 nH
                            //Package () { "cirrus,boost-ind-nanohenry",  Package () { 1000, 1000 } },
                            // boost-cap-microfarad: rounded to the nearest integer
                            //Package () { "cirrus,boost-cap-microfarad", Package () { 15, 15 } },
                        }
                    }) /* \_SB_.PC00.SPI0.SPK1._DSD */
            }
        }

        Method (_DSD, 0, NotSerialized)  // _DSD: Device Specific Data
        {
            Return (Package ()
                {
                    ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
                    Package ()
                    {
                        Package () { "cs-gpios", Package () { 
                            Zero,                    // Native CS
                            SPK1, Zero, Zero, Zero   // GPIO CS
                        } }
                    }
                }) /* \_SB_.PC00.SPI0.SPK1._DSD */
        }
    }
}

and these are the commands I use to apply it all:

iasl -sa ssdt_csc3551.dsl
mkdir -p kernel/firmware/acpi
cp ssdt_csc3551.aml kernel/firmware/acpi/ssdt_csc3551.aml
find kernel | cpio -H newc --create >acpi_override
sudo cp acpi_override /boot/
sudo mkinitcpio -p linux65-tkg-cfs

I cannot find the problem.

@kureta
Copy link

kureta commented Sep 29, 2023

I have finally found the problem and it's working. Only the first lines were different. So I changed the patch to DefinitionBlock ("", "SSDT", 1, "_ASUS_", "SPKRAMPS", 0x00000003). Apparently the last number is OEM revision number and it should be incremented. now it works! Thank you everyone in this thread!

@isle9
Copy link

isle9 commented Sep 29, 2023

I solved my problem with https://github.com/badgers-ua/asus_zenbook_ux5304va_sound. Thank you all. But i have to do the whole process after each kernel update. I hope fedora team insert path in next version

Hey I get page not found when I try to open your link.

@kureta
Copy link

kureta commented Sep 29, 2023

@mypsik
Copy link

mypsik commented Oct 16, 2023

Working ssdt-csc3551.dsl for ASUS Zenbook UM3402Y (the speakers are connected to I2C, not SPI).
Follow the rest from https://github.com/badgers-ua/asus_zenbook_ux5304va_sound

DefinitionBlock ("", "SSDT", 1, "CUSTOM", "CS3551", 0x0000300A)
{

    External (_SB_.I2CD, DeviceObj)
    External (_SB_.I2CD.SPKR, DeviceObj)

    Scope (_SB.I2CD.SPKR)
    {
        Method (_DSD, 0, NotSerialized)  // _DSD: Device Specific Data
        {
            Return (Package ()
                {
                    ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
                    Package ()
                    {
                        Package () { "cirrus,dev-index", Package () { 0x0040, 0x0041 }},
                        Package () { "reset-gpios", Package () {
                           SPKR, Zero, Zero, Zero,
                           SPKR, Zero, Zero, Zero
                        } },
                        Package () { "spk-id-gpios", Package () {
                             SPKR, 0x02, Zero, Zero,
                             SPKR, 0x02, Zero, Zero,
                        } },
                        Package () { "cirrus,speaker-position", Package () { Zero, One } },
                        Package () { "cirrus,gpio1-func", Package () { One, One } },
                        Package () { "cirrus,gpio2-func", Package () { 0x02, 0x02 } },
                        // boost-type: 0 internal, 1 external
                        Package () { "cirrus,boost-type", Package () { One, One } },
                        // boost-peak-milliamp: 1600 to 4500, increments of 50 mA
                        //Package () { "cirrus,boost-peak-milliamp",  Package () { 3000, 3000 } },
                        // boost-ind-nanohenry: 1000 | 1200 | 1500 | 2200 nH
                        //Package () { "cirrus,boost-ind-nanohenry",  Package () { 1000, 1000 } },
                        // boost-cap-microfarad: rounded to the nearest integer
                        //Package () { "cirrus,boost-cap-microfarad", Package () { 15, 15 } },
                    }
                })
        }
    }

    Scope (_SB.I2CD)
    {
        Method (_DSD, 0, NotSerialized)  // _DSD: Device Specific Data
        {
            Return (Package ()
                {
                    ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
                    Package ()
                    {
                        Package () { "cs-gpios", Package () { 
                            Zero,                    // Native CS
                            SPKR, Zero, Zero, Zero   // GPIO CS
                        } }
                    }
                })
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment