fix: build on kernel v6.12
Fixes the build issues related to:
snd_pcm_lib_alloc_vmalloc_buffer()
snd_pcm_lib_free_vmalloc_buffer()
snd_pcm_lib_get_vmalloc_page()
On kernel v6.12-rc1
The change for the helper can be found at "Drop of obsoloted vmalloc PCM buffer helper API" and the code that I implemented here was taken from the driver here
This also depends on the PR https://github.com/medusalix/xone/pull/48 for the v6.11 build fix.
Note: I don't have a headset to verify that the driver is working as expected, I only made the necessary changes to get it to build!
I'll verify this once 6.12 lands in Debian experimental.
Working here on linux-tkg 6.12-rc1
Just adding another data point: I can confirm that the 6.11 fix worked for me (linux kernel 6.11.1-zen1-1-zen)
This worked for me as well, on kernel 6.11.1-arch1-1.
Works on Suse Tumbleweed
Works in NixOS with 6.11 and 6.12-rc kernels
How is it with the maintenance on this project? @medusalix is there a way to help?
Files replaced in the original xone's folder and working properly on ArchLinux with 6.11.3-arch1-1.
Confirmed working on Fedora 41 beta (kernel 6.11.3). Thank you for opening this PR 👏!
Confirmed working on Fedora 40, as well (we just got 6.11.3 a day or so ago).
Confirmed working on Debian Testing 6.11.2 (just got it today). Thank you for the PR :)
Files replaced in the original xone's folder and working properly on ArchLinux with 6.11.3-arch1-1.
Confirming this as well
Working on Fedora 41 KDE
Confirmed working on 6.12
OS: CachyOS Linux x86_64 Host: X870E Taichi Lite Kernel: Linux 6.12.0-rc7-1-cachyos-autofdo
Confirmed working on 6.11
OS: Fedora 41 Gnome Kernel: 6.11.7-300.fc41.x86_64
Confirmed working on 6.12.0-2-cachyos
OS: CachyOS Kernel: 6.12.0-2-cachyos (64-bit)
Confirmed working on Arch, 6.12.1-zen.
confirmed working on ubuntu, 6.11.0-1009-oem
I want to install this but i'm getting an error:
Building module(s).....(bad exit status: 2)
Failed command:
make -j6 KERNELRELEASE=6.12.4-1-MANJARO -C /usr/lib/modules/6.12.4-1-MANJARO/build M=/var/lib/dkms/xone/unknown/build
Error! Bad return status for module build on kernel: 6.12.4-1-MANJARO (x86_64)
Consult /var/lib/dkms/xone/unknown/build/make.log for more information.
DKMS make.log for xone/unknown for kernel 6.12.4-1-MANJARO (x86_64)
mar. 17 déc. 2024 11:50:59 CET
make : on entre dans le répertoire « /usr/lib/modules/6.12.4-1-MANJARO/build »
CC [M] /var/lib/dkms/xone/unknown/build/transport/wired.o
CC [M] /var/lib/dkms/xone/unknown/build/transport/dongle.o
CC [M] /var/lib/dkms/xone/unknown/build/transport/mt76.o
CC [M] /var/lib/dkms/xone/unknown/build/bus/bus.o
CC [M] /var/lib/dkms/xone/unknown/build/bus/protocol.o
CC [M] /var/lib/dkms/xone/unknown/build/auth/auth.o
/var/lib/dkms/xone/unknown/build/bus/bus.c:126:18: erreur: initialisation de « int (*)(struct device *, const struct device_driver *) » depuis le type pointeur « int (*)(struct device *, struct device_driver *) » qui est incompatible [-Wincompatible-pointer-types]
126 | .match = gip_bus_match,
| ^~~~~~~~~~~~~
/var/lib/dkms/xone/unknown/build/bus/bus.c:126:18: note: (près de l'initialisation de « gip_bus_type.match »)
make[2]: *** [scripts/Makefile.build:229: /var/lib/dkms/xone/unknown/build/bus/bus.o] Error 1
make[2]: *** Attente des tâches non terminées....
make[1]: *** [/usr/lib/modules/6.12.4-1-MANJARO/build/Makefile:1936: /var/lib/dkms/xone/unknown/build] Error 2
make: *** [Makefile:224: __sub-make] Error 2
make : on quitte le répertoire « /usr/lib/modules/6.12.4-1-MANJARO/build »
@jmfergeau
I suspect that you haven't merged the patch(es) before building? You can either check out my branch directly and build from there, or merge my branch on top of main here
I cloned your repository with git clone https://github.com/tskaar/xone but when I tried to install it, got this error message
`Building module(s)....(bad exit status: 2) Failed command: make -j16 KERNELRELEASE=6.12.4-200.fc41.x86_64 -C /lib/modules/6.12.4-200.fc41.x86_64/build M=/var/lib/dkms/xone/unknown/build
Error! Bad return status for module build on kernel: 6.12.4-200.fc41.x86_64 (x86_64) Consult /var/lib/dkms/xone/unknown/build/make.log for more information. DKMS make.log for xone/unknown for kernel 6.12.4-200.fc41.x86_64 (x86_64) Tue Dec 17 06:23:36 PM CET 2024 make: Entering directory '/usr/src/kernels/6.12.4-200.fc41.x86_64' CC [M] /var/lib/dkms/xone/unknown/build/transport/wired.o CC [M] /var/lib/dkms/xone/unknown/build/transport/dongle.o CC [M] /var/lib/dkms/xone/unknown/build/transport/mt76.o CC [M] /var/lib/dkms/xone/unknown/build/bus/bus.o CC [M] /var/lib/dkms/xone/unknown/build/bus/protocol.o CC [M] /var/lib/dkms/xone/unknown/build/auth/auth.o CC [M] /var/lib/dkms/xone/unknown/build/auth/crypto.o CC [M] /var/lib/dkms/xone/unknown/build/driver/common.o CC [M] /var/lib/dkms/xone/unknown/build/driver/gamepad.o CC [M] /var/lib/dkms/xone/unknown/build/driver/headset.o CC [M] /var/lib/dkms/xone/unknown/build/driver/chatpad.o CC [M] /var/lib/dkms/xone/unknown/build/driver/madcatz_strat.o CC [M] /var/lib/dkms/xone/unknown/build/driver/madcatz_glam.o CC [M] /var/lib/dkms/xone/unknown/build/driver/pdp_jaguar.o LD [M] /var/lib/dkms/xone/unknown/build/xone-gip-gamepad.o /var/lib/dkms/xone/unknown/build/bus/bus.c:126:18: error: initialization of ‘int (*)(struct device *, const struct device_driver )’ from incompatible pointer type ‘int ()(struct device *, struct device_driver *)’ [-Wincompatible-pointer-types] 126 | .match = gip_bus_match, | ^~~~~~~~~~~~~ /var/lib/dkms/xone/unknown/build/bus/bus.c:126:18: note: (near initialization for ‘gip_bus_type.match’) make[2]: *** [scripts/Makefile.build:229: /var/lib/dkms/xone/unknown/build/bus/bus.o] Error 1 make[2]: *** Waiting for unfinished jobs.... /var/lib/dkms/xone/unknown/build/driver/headset.c: In function ‘gip_headset_pcm_hw_params’: /var/lib/dkms/xone/unknown/build/driver/headset.c:93:16: error: implicit declaration of function ‘snd_pcm_lib_alloc_vmalloc_buffer’ [-Wimplicit-function-declaration] 93 | return snd_pcm_lib_alloc_vmalloc_buffer(sub, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /var/lib/dkms/xone/unknown/build/driver/headset.c: In function ‘gip_headset_pcm_hw_free’: /var/lib/dkms/xone/unknown/build/driver/headset.c:99:16: error: implicit declaration of function ‘snd_pcm_lib_free_vmalloc_buffer’; did you mean ‘snd_pcm_lib_malloc_pages’? [-Wimplicit-function-declaration] 99 | return snd_pcm_lib_free_vmalloc_buffer(sub); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | snd_pcm_lib_malloc_pages /var/lib/dkms/xone/unknown/build/driver/headset.c: At top level: /var/lib/dkms/xone/unknown/build/driver/headset.c:160:17: error: ‘snd_pcm_lib_get_vmalloc_page’ undeclared here (not in a function); did you mean ‘snd_pcm_lib_malloc_pages’? 160 | .page = snd_pcm_lib_get_vmalloc_page, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ | snd_pcm_lib_malloc_pages make[2]: *** [scripts/Makefile.build:229: /var/lib/dkms/xone/unknown/build/driver/headset.o] Error 1 make[1]: *** [/usr/src/kernels/6.12.4-200.fc41.x86_64/Makefile:1976: /var/lib/dkms/xone/unknown/build] Error 2 make: *** [Makefile:236: __sub-make] Error 2 make: Leaving directory '/usr/src/kernels/6.12.4-200.fc41.x86_64' `
@zolotvok;
You need to clone the specific branch, and not main: Main is currently tracking the xone repo 1:1, hence it has the same issue, retry with either:
git clone https://github.com/tskaar/xone -b fix-6.12,
Or go into your pulled git repo and run:
git switch fix-6.12
Confirming that this fixes the core functionality on Fedora 41 and kernel 6.12.
BUT, there used to be some features on kernel 6.9 that don't work anymore:
- on system shutdown, xone was sending a poweroff signal to all connected controllers, so they also shutdown
- controller input used to be recognized as system activity. Now, if the only active input is the controller, the system goes to sleep or screen-off, according on power management settings.
- controller input used to be recognized as system activity. Now, if the only active input is the controller, the system goes to sleep or screen-off, according on power management settings.
This is a kde bug they have finally announced they are working on. Been that way for a decade. https://bugs.kde.org/show_bug.cgi?id=328987
Any workarounds were likely using utilities like joystickwake
- controller input used to be recognized as system activity. Now, if the only active input is the controller, the system goes to sleep or screen-off, according on power management settings.
This is a kde bug they have finally announced they are working on. Been that way for a decade. https://bugs.kde.org/show_bug.cgi?id=328987
Any workarounds were likely using utilities like joystickwake
I probably had a workaround that I don't remember then 😅
@zolotvok;
You need to clone the specific branch, and not main: Main is currently tracking the xone repo 1:1, hence it has the same issue, retry with either:
git clone https://github.com/tskaar/xone -b fix-6.12, Or go into your pulled git repo and run:
git switch fix-6.12
Thanks. Silly of me, i didn't noticed there was a branch for it ^^'
It worked like a charm. Thanks. I don't get why this fix isn't pushed yet...
Thank you this worked for me also 6.11.11-1-MANJARO
Any chance that this could be merged?
Seems to work fine on:
Fedora Linux 41 (Workstation Edition) Linux 6.12.7-200.fc41.x86_64
Also, it seems to fulfill the following pull-requests:
- https://github.com/medusalix/xone/pull/56
- https://github.com/medusalix/xone/pull/57
working on 6.12.8-arch1-1
Works like a charm on the 6.12.8-arch1-1, thank you so much mate!