Hi! i'm using a kernel patch that i found on internet to fix an issue with my headset, the problem is whenever i update my kernel i have to do everything again. is there a way i can keep this even when the kernel update? this is my first time patching the linux kernel, sorry for being very bad. I heard about DKMS but i don't really know how it works. Here are the instructions i got to patch the kernel:
It's not so difficult. Install the kernel-devel package, get the linux sources (minor version should match to your installed kernel e.g. 6.0) - https://www.kernel.org/ - unpack sources, go to the directory, do suggested changes in sound/usb/endpoint.c (text editor) and:
make -C /lib/modules/$(uname -r)/build M=$(pwd)/sound/usb modules
Find snd-usb-audio.ko (sound/usb/snd-usb-audio.ko) and replace /lib/modules/$(uname -r)/kernel/sound/usb/snd-usb-audio.ko (maybe with .xz suffix). Reboot. I suggest to move the original kernel module to a different place (outside /lib/modules tree) so you can restore it after tests.
and here is the change:
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index 4aaf0784940b..e10b92755a3b 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -1412,6 +1412,8 @@ static int init_sample_rate(struct snd_usb_audio *chip,
return rate;
if (clock && !clock->need_setup)
return 0;
+ if ((ep->ep_num & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT)
+ goto __end;
err = snd_usb_init_sample_rate(chip, ep->cur_audiofmt, rate);
if (err < 0) {
@@ -1420,6 +1422,7 @@ static int init_sample_rate(struct snd_usb_audio *chip,
return err;
}
+__end:
if (clock)
clock->need_setup = false;
return 0;