Asus Zenbook Duo (2024 / UX8406MA) & NixOS

Hey Tomass, could you share how you compiled the kernel for fedora with these patches? Just the code snippets would be enough :slight_smile:

I am using bluebuild (fedora), we can leverage their experimental Stages feature to have an rpm-ostree image with the compiled kernel directly (no need to do things locally)

Thanks!

Hello, I am not a developer and I have quite basic knowledge of Linux. Also I don’t use bluebuild. I followed this tutorial:

I saved the revert patch as linux-kernel-test.patch in the “kernel” directory and it compiled and installed. B

1 Like

Thanks for the help, I am trying to do it on rpm-ostree using bluebuild. Feel free to follow my progress here if interested: GitHub - mecattaf/zen: Fedora Atomic spin for Asus Zenbook Duo

1 Like

Since people are sharing the relevant Fedora kernel, and I’m trying to follow developments, thought I would share my OpenSUSE build with patches too: Show home:ponyisi:branches:openSUSE:Factory - openSUSE Build Service
Patches in https://build.opensuse.org/source/home:ponyisi:branches:openSUSE:Factory/kernel-source/patches.addon.tar.bz2

Thanks for sharing. I gave up on the Stages approach, instead opting to build the custom kernel locally and pushing it to fedora COPR. It is my first time attempting kernel-level changes, so not really sure where to start.

Also on a sidenote, do we know if this will be fixed in the upcoming kernel 6.10? Since it is almost at stable release I could wait a few more days hoping it would get fixed magically…

Also on a sidenote, do we know if this will be fixed in the upcoming kernel 6.10?

I’m not terribly familiar with the DRM merge process, but I doubt it. It hasn’t yet been fixed by Intel, let alone submitted upstream.

So our best bet is to wait for this issue to be resolved and use the asus kernel?

Thanks for noticing this! I thought I was going crazy with the flickering… For what it’s worth this also solved it on sway wm (using kanshi):

profile Duo {
    output eDP-1 scale 2 position 0,0   adaptive_sync on
    output eDP-2 scale 2 position 0,900 adaptive_sync on
    exec swaymsg gaps outer 0
    exec busctl --user set-property rs.wl-gammarelay /outputs/eDP_1 rs.wl.gammarelay Temperature q 3850
    exec busctl --user set-property rs.wl-gammarelay /outputs/eDP_2 rs.wl.gammarelay Temperature q 3350
}

By the way, the wl-gammarelay commands are this way because my two screens were not properly color-calibrated out of the box. The wl-gammarelay-rs package is the only project I found that allows per-display gamma adjustments. Hopefully this helps somebody out.

Lastly, for brightness control, here is a script I use to control both screens at the same time with light

2 Likes

The secondary display issue is this issue, filed with the Intel display team: Asus Zenbook Duo UX8406MA Regression - Display Blank (#11488) · Issues · drm / i915 / kernel · GitLab. This is the issue that would need to be resolved, and then upstreamed, and then released. At this point there is no resolution to it. As a workaround, the patch that introduced the problem can be reverted.

1 Like

The patch file can be downloaded here (zenbook-i915-revert-93cbc1accbcec2740231755774420934658e2b18.patch · GitHub ) or generated from the linux source tree

You can also pull it directly from GitLab:

boot.kernelPatches = [
  {
    name = "drm-dual-display-fix";
    patch = pkgs.fetchpatch {
      url = "https://gitlab.freedesktop.org/drm/i915/kernel/-/commit/93cbc1accbcec2740231755774420934658e2b18.patch";
      revert = true;
      hash = "sha256-MuI8aNX7651ODXsRO/1AEQHenzY6Q201l3n+U6kZD6Y=";
    };
  }
];

I was really not comfortable building/compiling my own kernel.
Fortunately sentry the legend (maintainer of fsync kernel) has just incorporated the patch I requested
and it’s already available.
For even more added convenience the ublue team has just prepared a new kernel cache repo. Will report back here once I test it out and confirm that it works on my device. You can also just leverage the Fsync kernel copr directly.

1 Like

Update on how to solve broken bottom screen due to kernel 6.9.x and beyond thanks to fsync kernel:

  1. If on regular fedora, follow instructions from fsync copr repo
  2. If using Fedora Atomic (specifically project bluebuild), make sure to add the fsync copr repo in the rpm-ostree module and add the following script in the scripts module

Hope this helps, apologies for spamming your nixOS thread, and thanks again to @mfenniak and @hacker1024 for identifying the patch!

1 Like

Do you know by chance how to use this patch/mod on arch?

It looks like this package does it: AUR (en) - linux-fsync-nobara-bin (just had to google “fsync kernel arch linux”)
I cannot guarantee it will work as I do not use arch so use at your own risk. Also make sure to go through the comments section in the above link so you know what potential issues to expect.

Hi Tom,

I use fedora as well with ux8406 and I’m having frequent sound issues (no sound sometimes, though it detects the board). I’ve also noticed in unity engine that uses fmod that it automatically gets redirected to HDMI instead of speaker.

I can’t manage with alesya scripts to get the touch panel working, by default everything gets redirected to top screen, but when I run duo set-tablet-mapping I get weird offset, like the resolution or physical size of the touch area is half the display, really hard for me to explain.

Do you have sound issues as well? I’m using fedora 40

Regards

1 Like

Hello yes, I confirm regular sound issues (no sound or sound garbled), also the bottom touch panel redirection as you mention.

Hey @xevicb:

  • I very rarely have sound issues (garbling only, but sound always available). I think they only occurs when I plug my laptop into or out of the charger.
  • Don’t use unity engine, and don’t use hdmi on my device. However you might want to make sure to install the following:
      - wireplumber
      - pipewire-alsa
      - pipewire-jack-audio-connection-kit
      - pipewire-pulseaudio
  • I hate having smudges on my laptop so don’t ever use the touchscreen, however from what you are saying about the offset you may be setting the wrong resolution in alesya’s script. In the first lines of the script I find:
#!/usr/bin/env bash

# 3k model
prefered_resolution="2880x1800@120.000"
ui_scale=1.7475727796554565 # 1.75
# y offset = height of resolution / ui_scale (1800/1.7475... = 1030), but better to check via bustle (recording session bus, you are interested in org.gnome.Mutter.DisplayConfig.ApplyMonitorsConfig call. start recording and configure display in gnome display settings)
y_offset=1030
backlight=card1-eDP-2-backlight

# 1080p model
#prefered_resolution="1920x1200@60.003"
#backlight=card1-eDP-2-backlight
#ui_scale=1
#y_offset=1200

so try commenting out the lines related to the 3k model and instead commenting in the lines related to the 1080p model? Or try-and-error with y-offset until you get it to what you want.

Just some thoughts, not sure any of it will work for you. And for fwiw I use fedora atomic, not regular, because it gives me a lot more control. If you want to go down the bluebuild rabbit hole find my recipe here and dotfiles here.

I think you are dual-booting with windows, but I completely uninstalled it from my device. I there a way to upgrade UEFI firmware from linux?

You can get the latest linux source files from arch repo here

In the PKGBUILD file update the source array adding link to the patch file
https://gist.githubusercontent.com/mfenniak/53a8cae856c66ec1f0a100703aab3690/raw/a078b2ac3223a441fa29bf0ebb184ededf3bed15/zenbook-i915-revert-93cbc1accbcec2740231755774420934658e2b18.patch

Also to the sha256sums and b2sums arrays add another ‘SKIP’ element.
Then from the directory containing PKGBUILD run makebuild -sirc to compile and install kernel with the included patch.

If you get lost, here’s arch wiki page on applying patches to packages
https://wiki.archlinux.org/title/Patching_packages

Reporting here in case anybody else has this question. Asus provides an EZ Flash Utility which lets us upgrade firmware independently from windows.

  1. Download BIOS for Asus EZ Flash Utility version 306 and unzip the file on your computer
  2. Insert a USB drive into your laptop, open a terminal and list your drives with lsblk. My drive was identified as sda
  3. Unmount all partitions on the drive: sudo umount /dev/sda*
  4. Format the new partition: sudo mkfs.vfat -F 32 -I /dev/sda - note that I used the -I option because I wanted to wipe the whole drive clean but if you don’t want to do that you can try creating a new partition table with sudo fdisk /dev/sda beforehand
  5. Mount the USB drive: sudo mount /dev/sda /mnt
  6. Copy the new UEFI firmware file to USB drive: sudo cp /path/downloaded/UEFI_file /mnt - in my case sudo cp Downloads/UX8406MAAS306/UX8406MAAS.306 /mnt
  7. Unmount the USB drive: sudo umount /mnt
  8. Reboot into BIOS: sudo systemctl reboot --firmware-setup
  9. Make sure your laptop is plugged into power. Inside the BIOS menu, top-left menu select the “Firmware” menu, it should it should automatically detect the new 306 firmware file. Start the update process. Do not unplug your laptop or remove the USB during the update. Should take 6-7 minutes. Reboots automatically when finished. Unplug your USB drive at that point.
  10. Make sure it worked by opening a new terminal and typing sudo dmidecode -t bios - check “Version” and “Release Date” field
  11. Profit

I highly recommend everybody with a Zenbook Duo to upgrade their firmware! No problems detected on my end after the update :slight_smile: