xone icon indicating copy to clipboard operation
xone copied to clipboard

fix: build on kernel v6.12

Open tskaar opened this issue 1 year ago • 53 comments

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!

tskaar avatar Sep 30 '24 19:09 tskaar

I'll verify this once 6.12 lands in Debian experimental.

dlundqvist avatar Oct 01 '24 06:10 dlundqvist

Working here on linux-tkg 6.12-rc1

claybie avatar Oct 01 '24 16:10 claybie

Just adding another data point: I can confirm that the 6.11 fix worked for me (linux kernel 6.11.1-zen1-1-zen)

gbluma avatar Oct 03 '24 00:10 gbluma

This worked for me as well, on kernel 6.11.1-arch1-1.

nul9o9 avatar Oct 04 '24 03:10 nul9o9

Works on Suse Tumbleweed

lostiniceland avatar Oct 09 '24 07:10 lostiniceland

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?

BeiNacht avatar Oct 09 '24 12:10 BeiNacht

Files replaced in the original xone's folder and working properly on ArchLinux with 6.11.3-arch1-1.

sh0ra1t avatar Oct 12 '24 10:10 sh0ra1t

Confirmed working on Fedora 41 beta (kernel 6.11.3). Thank you for opening this PR 👏!

TarsiSurdi avatar Oct 15 '24 00:10 TarsiSurdi

Confirmed working on Fedora 40, as well (we just got 6.11.3 a day or so ago).

hajnal-endot avatar Oct 16 '24 09:10 hajnal-endot

Confirmed working on Debian Testing 6.11.2 (just got it today). Thank you for the PR :)

wayneyaoo avatar Oct 16 '24 11:10 wayneyaoo

Files replaced in the original xone's folder and working properly on ArchLinux with 6.11.3-arch1-1.

Confirming this as well

tyumici avatar Oct 16 '24 12:10 tyumici

Working on Fedora 41 KDE

GarethTheNerd avatar Nov 13 '24 22:11 GarethTheNerd

Confirmed working on 6.12

OS: CachyOS Linux x86_64 Host: X870E Taichi Lite Kernel: Linux 6.12.0-rc7-1-cachyos-autofdo

Juts2 avatar Nov 16 '24 10:11 Juts2

Confirmed working on 6.11

OS: Fedora 41 Gnome Kernel: 6.11.7-300.fc41.x86_64

prystoynyy avatar Nov 16 '24 16:11 prystoynyy

Confirmed working on 6.12.0-2-cachyos

OS: CachyOS Kernel: 6.12.0-2-cachyos (64-bit)

Mike710Shine avatar Nov 18 '24 19:11 Mike710Shine

Confirmed working on Arch, 6.12.1-zen.

bursterburster avatar Nov 24 '24 17:11 bursterburster

confirmed working on ubuntu, 6.11.0-1009-oem

adamdmoss avatar Dec 09 '24 20:12 adamdmoss

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 avatar Dec 17 '24 10:12 jmfergeau

@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

tskaar avatar Dec 17 '24 13:12 tskaar

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 avatar Dec 17 '24 17:12 zolotvok

@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

tskaar avatar Dec 17 '24 23:12 tskaar

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.

Kidlike avatar Dec 20 '24 13:12 Kidlike

  • 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

Juts2 avatar Dec 21 '24 04:12 Juts2

  • 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 😅

Kidlike avatar Dec 21 '24 07:12 Kidlike

@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...

jmfergeau avatar Dec 21 '24 11:12 jmfergeau

Thank you this worked for me also 6.11.11-1-MANJARO

PrimerFender avatar Dec 31 '24 19:12 PrimerFender

Any chance that this could be merged?

purkhusid avatar Jan 06 '25 20:01 purkhusid

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

drick0230 avatar Jan 07 '25 04:01 drick0230

working on 6.12.8-arch1-1

lmReef avatar Jan 07 '25 05:01 lmReef

Works like a charm on the 6.12.8-arch1-1, thank you so much mate!

k0nm4 avatar Jan 08 '25 19:01 k0nm4