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
} }
}
})
}
}
@lamperez
Copy link
Author

lamperez commented Apr 11, 2023

@thor2002ro Many thanks for the SSDT patch. I have learned something new.

@bdandy
Copy link

bdandy commented Apr 12, 2023

Guys, do you also have an issue with headphones on\off ?
I had to restart spotify and pipewire so sound get back work again.
Though might be reset gpio for second amp incorrect in ssdt.

PS. Thanks for SSDT too, much cleaner than patching DSDT

@fantaziskee
Copy link

Guys, do you also have an issue with headphones on\off ? I had to restart spotify and pipewire so sound get back work again. Though might be reset gpio for second amp incorrect in ssdt.

PS. Thanks for SSDT too, much cleaner than patching DSDT

Perhaps I have something similar. For example, when I switch videos on YouTube, the video freezes until I restart pulseaudio. Right now, I'm looking into the possibility that I made a mistake somewhere during installation/configuration, but I don't have this issue on my other computers.

@fermino
Copy link

fermino commented Apr 12, 2023

Hi again, for some reason it stopped working :( I think it might have to do with a pulseaudio update though. I'll update this when I find something.

@fermino
Copy link

fermino commented Apr 12, 2023

A cold boot fixed it. I made sure to unplug the headphones first. Not sure if that had anything to do...

@risemiv
Copy link

risemiv commented Apr 15, 2023

Hi! I, too, have a UX3402Z OLED and I tried to apply the SSDT file (both lamperez's and thor2002ro's version, there seems to be slight differences between the two) using the suggested guide, which is similar to the one on ArchWiki linked by vyacheslav25, to create a cpio file for initrd. (For some reason, the other method of using GRUB to load the custom ACPI tables didn't work for me.) However, after either of the two versions of them are loaded, the system doesn't boot and the Caps Lock key starts flashing like it's being spammed and I have to force shut down. My notebook is running openSuSE Tumbleweed (kernel 6.2.9-1-default) and has the latest BIOS version (310). I would be grateful if you could give me any guidance.

Update: The same happens if I apply the DSDT patch.

@lamperez
Copy link
Author

Hello. As a test, you can try to disassemble and reassemble the DSDT, without applying the patch, and then trying to load it following the corresponding procedure, the grub one, or the initrd one, depending on your boot manager (I think that OpenSuse uses grub2). Basically, you are reloading your own ACPI from a file. If it does not work, the problem is not the patch, but the disassembling/assembling/booting process.

Also, check if secure boot is disabled in your UEFI. I haven't checked it, but I suppose that it is required: our files are not signed at all.

Once solved this, you could try the patch, or better, the SSDT file.

@risemiv
Copy link

risemiv commented Apr 18, 2023

Thank you! You were right. It was my fault, the correct order is:

linux	 /boot/vmlinuz
initrd   /boot/acpi_override /boot/initrd

The following works for openSUSE (kernel 6.2.9-1-default):

iasl -sa ssdt.dsl
mkdir -p kernel/firmware/acpi
cp ssdt.aml kernel/firmware/acpi
find kernel | cpio -H newc --create > /boot/acpi_override
echo GRUB_EARLY_INITRD_LINUX_CUSTOM=\"acpi_override\" >> /etc/default/grub
grub2-mkconfig -o /boot/grub2/grub.cfg

Generating grub configuration file ...
Found theme: /boot/grub2/themes/openSUSE/theme.txt
Found linux image: /boot/vmlinuz-6.2.9-1-default
Found initrd image: /boot/acpi_override /boot/initrd-6.2.9-1-default
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Adding boot menu entry for UEFI Firmware Settings ...
done

There is no need to disable Secure Boot.

@lcompare
Copy link

@thor2002ro thanks a lot! Your ssdt patch worked for me on a UX3402ZA.

https://github.com/thor2002ro/asus_zenbook_ux3402za/tree/main/Sound

I just had a hard time at the beginning understanding the README in github :)
I would separate the comments from the commands for example with a code block.
I was able to understand it after cloning the repo and doing cat to the README.

Thank again!

@thor2002ro
Copy link

@thor2002ro thanks a lot! Your ssdt patch worked for me on a UX3402ZA.

https://github.com/thor2002ro/asus_zenbook_ux3402za/tree/main/Sound

I just had a hard time at the beginning understanding the README in github :) I would separate the comments from the commands for example with a code block. I was able to understand it after cloning the repo and doing cat to the README.

Thank again!

there.... better? I was just lazy.....

@cabradiaz
Copy link

YEAAAAAAAAA GUUUYSS!!!! THANKS !! I waited like 6 months for this !!!

@lcompare
Copy link

@thor2002ro thanks a lot! Your ssdt patch worked for me on a UX3402ZA.
https://github.com/thor2002ro/asus_zenbook_ux3402za/tree/main/Sound
I just had a hard time at the beginning understanding the README in github :) I would separate the comments from the commands for example with a code block. I was able to understand it after cloning the repo and doing cat to the README.
Thank again!

there.... better? I was just lazy.....

Looks great now. It will help a lot of people. Thanks

@plamen-kolev
Copy link

plamen-kolev commented May 1, 2023

Has anyone managed to get it working under UX3402VA
No errors, but my output looks significantly shorter?
Also curious to know, which bios version are you running ?

─$ journalctl -b -g CSC3551 --output short-monotonic
[    0.009843] devlab2 kernel: ACPI: SSDT 0x00000000193432AE 0001A0 (v01 CUSTOM CSC3551  00000001 INTL 20221020)
[   14.541722] devlab2 kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: Cirrus Logic CS35L41 (35a40), Revision: B2
[   14.542859] devlab2 kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Reset line busy, assuming shared reset
[   14.581103] devlab2 kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Cirrus Logic CS35L41 (35a40), Revision: B2
[   14.581144] devlab2 kernel: Serial bus multi instantiate pseudo device driver CSC3551:00: Instantiated 2 SPI devices.

@B4rb4r0ss4
Copy link

Hi, I use garuda linux on my UX3004Za, after putting this dsdt patch sound works, but only for short time, however after running for example browser sound is broken again :( Is any way to repair it?

@fermino
Copy link

fermino commented May 3, 2023

Hi, I use garuda linux on my UX3004Za, after putting this dsdt patch sound works, but only for short time, however after running for example browser sound is broken again :( Is any way to repair it?

@B4rb4r0ss4 what BIOS version are you running? Try the ssdt patch, that should be cleaner and easier to install. Have you noticed any triggers when the sound stops working? Like a sudden spike in volume, a volume change, or something alike?

@fermino
Copy link

fermino commented May 3, 2023

Has anyone managed to get it working under UX3402VA No errors, but my output looks significantly shorter? Also curious to know, which bios version are you running ?

@plamen-kolev BIOS version for my UX3402ZA. By the way, for what I see in your output the circuit for the amps seems to be the same as in the ZA, right? (SPI and not I2C).

BIOS Information
	Vendor: American Megatrends International, LLC.
	Version: UX3402ZA.310
	Release Date: 12/14/2022

System Information
	Manufacturer: ASUSTeK COMPUTER INC.
	Product Name: Zenbook UX3402ZA_UX3402ZA

@B4rb4r0ss4
Copy link

Hi, I use garuda linux on my UX3004Za, after putting this dsdt patch sound works, but only for short time, however after running for example browser sound is broken again :( Is any way to repair it?

@B4rb4r0ss4 what BIOS version are you running? Try the ssdt patch, that should be cleaner and easier to install. Have you noticed any triggers when the sound stops working? Like a sudden spike in volume, a volume change, or something alike?

Nope, just stop working, after repatching there is sound for a moment again and then stop working, and I use the newest bios probably 310

@fermino
Copy link

fermino commented May 3, 2023

Hi, I use garuda linux on my UX3004Za, after putting this dsdt patch sound works, but only for short time, however after running for example browser sound is broken again :( Is any way to repair it?

@B4rb4r0ss4 what BIOS version are you running? Try the ssdt patch, that should be cleaner and easier to install. Have you noticed any triggers when the sound stops working? Like a sudden spike in volume, a volume change, or something alike?

Nope, just stop working, after repatching there is sound for a moment again and then stop working, and I use the newest bios probably 310

What do you mean by repatching? The patch should be loaded on boot only, it is not necessary to re-compile it. By the way, I had some strange issues at some point, but a cold boot (powering the notebook completely off, waiting a bit and powering it on again) fixed those. Maybe give it a try?

@B4rb4r0ss4
Copy link

@B4rb4r0ss4
Copy link

Hi, I use garuda linux on my UX3004Za, after putting this dsdt patch sound works, but only for short time, however after running for example browser sound is broken again :( Is any way to repair it?

@B4rb4r0ss4 what BIOS version are you running? Try the ssdt patch, that should be cleaner and easier to install. Have you noticed any triggers when the sound stops working? Like a sudden spike in volume, a volume change, or something alike?

Nope, just stop working, after repatching there is sound for a moment again and then stop working, and I use the newest bios probably 310

What do you mean by repatching? The patch should be loaded on boot only, it is not necessary to re-compile it. By the way, I had some strange issues at some point, but a cold boot (powering the notebook completely off, waiting a bit and powering it on again) fixed those. Maybe give it a try?

I mean making update-grub

@B4rb4r0ss4
Copy link

B4rb4r0ss4 commented May 3, 2023

Hi, I use garuda linux on my UX3004Za, after putting this dsdt patch sound works, but only for short time, however after running for example browser sound is broken again :( Is any way to repair it?

@B4rb4r0ss4 what BIOS version are you running? Try the ssdt patch, that should be cleaner and easier to install. Have you noticed any triggers when the sound stops working? Like a sudden spike in volume, a volume change, or something alike?

Nope, just stop working, after repatching there is sound for a moment again and then stop working, and I use the newest bios probably 310

What do you mean by repatching? The patch should be loaded on boot only, it is not necessary to re-compile it. By the way, I had some strange issues at some point, but a cold boot (powering the notebook completely off, waiting a bit and powering it on again) fixed those. Maybe give it a try?

Ok I tried "cold boot" and situation looks similar I had sound for a few seconds, then the sound doesn't work again

@fermino
Copy link

fermino commented May 3, 2023

Ok I tried "cold boot" and situation looks similar I had sound for a few seconds, then the sound doesn't work again

Anything in your dmesg / journalctl logs?

I'm guessing it could be related to the max current setting, reading through the comments it seems it could be related: https://www.reddit.com/r/ASUS/comments/10iv09h/comment/jdv0o22/

Edit: If it is, you should be able to see the "amp short" error in the logs.

@B4rb4r0ss4
Copy link

Ok, I fixed it, now everything works, there were some errors with pulseaudio, I replaced it with pipewire and everything works as never thank you, finally after 0.5 year I have sound :D

@fermino
Copy link

fermino commented May 3, 2023

Awesome! Glad it works, I've been waiting for someone to post a fix for this for quite some time too :)
Thanks @lamperez and @thor2002ro

@plamen-kolev
Copy link

plamen-kolev commented May 3, 2023

@fermino Thanks for sharing the bios string, mine model is slightly different (UX3402VA_UX3402VA) and latest version is 300.
This is probably why it's not working
Will hope 310 gets rolled out to us unlucky folks, or the new kernel will work
Also using 6.2.13 kernel

@plamen-kolev
Copy link

plamen-kolev commented May 4, 2023

Can someone with working speakers also post the ouput for alsa-info Subsystem Id:. Looks like this line
SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402", ALC245_FIXUP_CS35L41_SPI_2) < the first 2 hex numbers have to match it

@bdandy
Copy link

bdandy commented May 4, 2023

BTW this model has external boost type so amperage settings are obsolete.

Codec: Realtek ALC294
Address: 0
AFG Function Id: 0x1 (unsol 1)
Vendor Id: 0x10ec0294
Subsystem Id: 0x10431e02
Revision Id: 0x100004

For those who has VA model the patch may not work, as ZA has SPI connection

@plamen-kolev
Copy link

Belive that VA also has spi connection, can see it in journalctl
Serial bus multi instantiate pseudo device driver CSC3551:00: Instantiated 2 SPI devices., this is without the patch

@plamen-kolev
Copy link

plamen-kolev commented May 4, 2023

Got audio working by setting SND_PCI_QUIRK with the right subsystem id
So getting audio on UX3402VA is also possible

Hope for a real fix down the line

@fermino
Copy link

fermino commented May 4, 2023

Got audio working by setting SND_PCI_QUIRK with the right subsystem id So getting audio on UX3402VA is also possible

Hope for a real fix down the line

I would encourage you to try to send the patch upstream :)

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