Ubuntu on 2022 Razer Blade 14'' with 3070 Ti | Razer Insider

Ubuntu on 2022 Razer Blade 14'' with 3070 Ti



Show first post

35 Replies

dmic working! whoop whoop
https://bugzilla.kernel.org/show_bug.cgi?id=216801

for now needs you to patch your kernel though.
Userlevel 1
Any chance of you letting me know how to apply this?
surveily
Any chance of you letting me know how to apply this?

i'll see if i can provide a dkms script and instructions this week. depending on your distro, manual patching of modules and swapping them in can be a burden.
Userlevel 1
I just need a general idea of what needs to be done. The exact steps I can probably Google. Unless you want to make me a gift for Christmas 😉
surveily
I just need a general idea of what needs to be done. The exact steps I can probably Google. Unless you want to make me a gift for Christmas ;)

in general you want to download your kernel sources, and rebuild module snd_soc_acp6x_mach with the above patch. i assume you do not compile your own kernel, but use the one shipped with your distro. you should be on a fairly recent kernel, and the above module should already be loaded (verify by running command 'lsmod | grep acp6x'), so the only thing we need to do is replace it :)

depending on your distribution this might be tricky. if you build a module from vanilla source code, even if the version matches your kernel, it will fail loading as the signing will be slightly different from the kernel shipped with your OS.

on fedora, the easiest way to build out of tree modules, or patch and replace in tree ones, i find is using dkms.
code:
sudo dnf install dkms

you also need your kernel-devel or whatever equivalent development package your distro provides as prereqs.

i put the above patch in a source folder, create some dkms scrips to pull the kernel sources from vanilla, patch the sources, but build against the OS installed kernel headers. below scripts might need to be adjusted for your kernel version. (make sure to make patch.sh executable)

code:
[wim@fedora snd_soc_acp6x_mach-0.1]$ pwd
/usr/src/snd_soc_acp6x_mach-0.1
[wim@fedora snd_soc_acp6x_mach-0.1]$ ls
acp6x-mach.patch dkms.conf patch.sh
[wim@fedora snd_soc_acp6x_mach-0.1]$ cat acp6x-mach.patch
--- acp6x-mach.c.ori 2022-12-12 09:45:40.076477587 +0100
+++ acp6x-mach.c 2022-12-12 09:47:30.727483991 +0100
@@ -213,6 +213,13 @@
DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m17 R5 AMD"),
}
},
+ {
+ .driver_data = &acp6x_card,
+ .matches = {
+ DMI_MATCH(DMI_BOARD_VENDOR, "Razer"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Blade 14 (2022) - RZ09-0427"),
+ }
+ },
{}
};
[wim@fedora snd_soc_acp6x_mach-0.1]$ cat patch.sh
#!/bin/bash
vers=(${kernelver//./ }) # split kernel version into individual elements
major="${vers[0]}"
minor="${vers[1]}"
version="$major.$minor" # recombine as needed
subver=$(grep "SUBLEVEL =" /usr/src/kernels/${kernelver}/Makefile | tr -d " " | cut -d "=" -f 2)

echo "Downloading kernel source $version.$subver for $kernelver"
wget https://mirrors.edge.kernel.org/pub/linux/kernel/v6.x/linux-6.1.tar.xz


echo "Extracting original source"
tar -xf linux-6.1.tar.* linux-6.1/$1 --xform=s,linux-6.1/$1,.,

for i in `ls *.patch`
do
echo "Applying $i"
patch < $i
done
[wim@fedora snd_soc_acp6x_mach-0.1]$ cat
acp6x-mach.patch dkms.conf patch.sh
[wim@fedora snd_soc_acp6x_mach-0.1]$ cat dkms.conf
PACKAGE_NAME="snd_soc_acp6x_mach"
PACKAGE_VERSION="0.1"
BUILT_MODULE_NAME[0]="snd_soc_acp6x_mach"
DEST_MODULE_LOCATION[0]="/updates/dkms/"
AUTOINSTALL="no"
REMAKE_INITRD="no"
PRE_BUILD="patch.sh sound/soc/amd/yc"
[wim@fedora snd_soc_acp6x_mach-0.1]$


when set up, build the module using
code:
sudo dkms build snd_soc_acp6x_mach/0.1

it should create the built module in /var/lib/dkms/snd_soc_acp6x_mach/0.1/build

find the .ko file, locate the original one in /lib/modules/<kernelver> and replace it, update initramfs (on fedora run 'dracut -f') reboot and you should be good to go. keep in mind that as soon as you update your kernel, you need to redo all of this (dkms offers a way to automate that, but this is the part that still requires time on my end to set it up this way).
if you are on gentoo, or you compile your own kernel, the above process is just insane 🙂 but i assume you are on something more mainstream that does not easily allow messing about with the kernel.
Userlevel 1
Right, so I will now figure it out how to do the same on Ubuntu/Debian. Thanks!
surveily
Right, so I will now figure it out how to do the same on Ubuntu/Debian. Thanks!

i mostly based the fedora stuff on this article https://www.collabora.com/news-and-blog/blog/2021/05/05/quick-hack-patching-kernel-module-using-dkms/ which was written for ubuntu 🙂
Userlevel 1
Awesome thanks!
fyi, the patch for the digital mic was upstreamed and at least on Fedora 38 (prerelease) with kernel 6.2.0-0.rc4 it works out of the box.
i assume this will be the same for any system running a 6.2 kernel.
enjoy
Userlevel 1
Will check it out as soon as possible on Ubuntu 22.10

Reply