bondagit / ravenna-alsa-lkm

RAVENNA ALSA LKM
20 stars 9 forks source link

Kernel 5.10.16 issues #1

Closed GrauBlitz closed 3 years ago

GrauBlitz commented 3 years ago

I have seen the hint with Kernel >5.2 compilation failure but what should i do if i use this kernel? Cant the __put_user_x calls just be replaced with __put_user / put_user or something like that? Is there a workaround? Even the original repository wont compile and gives me a implicit declaration of function ‘__put_user_x’; did you mean ‘put_user’? compiler error but its nothing stated that it wont work with newer Kernel versions.

GrauBlitz commented 3 years ago

I think i solved the problem for the system Orange Pi PC 2 with Armbian Ubuntu by installing the legacy kernel parts: apt install linux-headers-legacy-sunxi64

GrauBlitz commented 3 years ago

Nevermind now i cant activate the driver:

# insmod MergingRavennaALSA.ko
insmod: ERROR: could not insert module MergingRavennaALSA.ko: Invalid module format
bondagit commented 3 years ago

Please use the aes67-daemon branch of this repo to include all the patches required to compile with kernel 5.x. User space transfers are no longer needed by the driver.

GrauBlitz commented 3 years ago

Strange, i used this branch, more specifically your build.sh script of the upper project. I will try it again on another device, thank you!

bondagit commented 3 years ago

I have pushed a new commit 8e63d25 a few minutes ago on that branch that removes all put_user() calls.Thesr are no longer needed. Can you please retry?

bondagit commented 3 years ago

any update on this issue?

GrauBlitz commented 3 years ago

No, sorry, i currently have no time to test this, but i will return to it in a week.

What about this error i mentioned? Is this occuring because i compiled with the wrong kernel dev headers?

# insmod MergingRavennaALSA.ko
insmod: ERROR: could not insert module MergingRavennaALSA.ko: Invalid module format
bondagit commented 3 years ago

Yes, I think so. Most probably there is mismatch between kernel in use and kernel headers. Check in the kernel ring buffer with dmesg you should see the reason.

GrauBlitz commented 3 years ago

Thank you, i will try this and get back to you on new results.

GrauBlitz commented 3 years ago

The driver compiles now after armbian-config -> software -> install headers.

But now i get this error, has it to do with the driver or is this a mistake on my side?

make -C /lib/modules/5.10.4-sunxi64/build/ M=/root/aes67-linux-daemon/3rdparty/ravenna-alsa-lkm/driver modules
make[1]: Entering directory '/usr/src/linux-headers-5.10.4-sunxi64'
make[3]: *** No rule to make target 'scripts/module.lds', needed by '/root/aes67-linux-daemon/3rdparty/ravenna-alsa-lkm/driver/MergingRavennaALSA.ko'.  Stop.
make[2]: *** [scripts/Makefile.modpost:117: __modpost] Error 2
make[1]: *** [Makefile:1711: modules] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.10.4-sunxi64'
make: *** [Makefile:14: modules] Error 2
bondagit commented 3 years ago

it looks like these is a bug in the kernel, see: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1906131 The suggested work around to compile external kernel modules is the following:

wget https://raw.githubusercontent.com/torvalds/linux/master/scripts/module.lds.S -O /usr/src/your_kernel_src_folder/scripts/module.lds
sudo sed -i '$ d' /usr/src/your_kernel_src_folder/scripts/module.lds

If you already have scripts/module.lds.S you can just copy it to scripts/module.lds and run sed:

cp /usr/src/your_kernel_src_folder/scripts/module.lds.S -O /usr/src/your_kernel_src_folder/scripts/module.lds
sudo sed -i '$ d' /usr/src/your_kernel_src_folder/scripts/module.lds
GrauBlitz commented 3 years ago

After this instructions the compilation worked, but it still showed "invalid module format". I will now try a older kernel like 5.4.X to get it work. Thank you very much for your help.

GrauBlitz commented 3 years ago

As this is working on another system with this kernel version, i think the problem lies elsewhere. I will close this issue.