berarma / new-lg4ff

Experimental Logitech force feedback module for Linux
GNU General Public License v2.0
298 stars 18 forks source link

Fix types for 32bits systems #48

Closed berarma closed 3 years ago

berarma commented 3 years ago

Ensure that 64bits variables are used where is needed even on 32bits systems. This should fix #47.

Fredobedo commented 3 years ago

Dear Berarma, I tested it and it's working perfectly now, left and right are working! Yes, you did it !

Many thanks. Fred

berarma commented 3 years ago

I'll keep this PR open a few more days to keep testing the changes. I want to make sure it works correctly.

Fredobedo commented 3 years ago

Dear, I had a bit of time today and verified again but I was too enthusiast; I did a test again and here is my first problem, it doesn't compile: << root@Netbooter:/usr/src# sudo dkms install /usr/src/new-lg4ff

Creating symlink /var/lib/dkms/new-lg4ff/0.3.1/source -> /usr/src/new-lg4ff-0.3.1

DKMS: add completed.

Kernel preparation unnecessary for this kernel. Skipping...

Building module: cleaning build area... make -j4 KERNELRELEASE=5.10.17-v7l+ KVERSION=5.10.17-v7l+....(bad exit status: 2) Error! Bad return status for module build on kernel: 5.10.17-v7l+ (armv7l) Consult /var/lib/dkms/new-lg4ff/0.3.1/build/make.log for more information. root@Netbooter:/usr/src#

root@Netbooter:/usr/src# more /var/lib/dkms/new-lg4ff/0.3.1/build/make.log DKMS make.log for new-lg4ff-0.3.1 for kernel 5.10.17-v7l+ (armv7l) Fri May 21 16:31:49 BST 2021 make -C /lib/modules/5.10.17-v7l+/build M=$PWD make[1]: Entering directory '/usr/src/linux-headers-5.10.17-v7l+' CC [M] /var/lib/dkms/new-lg4ff/0.3.1/build/hid-lg.o CC [M] /var/lib/dkms/new-lg4ff/0.3.1/build/hid-lg4ff.o CC [M] /var/lib/dkms/new-lg4ff/0.3.1/build/hid-lgff.o CC [M] /var/lib/dkms/new-lg4ff/0.3.1/build/hid-lg2ff.o CC [M] /var/lib/dkms/new-lg4ff/0.3.1/build/hid-lg3ff.o LD [M] /var/lib/dkms/new-lg4ff/0.3.1/build/hid-logitech-new.o MODPOST /var/lib/dkms/new-lg4ff/0.3.1/build/Module.symvers ERROR: modpost: "__aeabi_ldivmod" [/var/lib/dkms/new-lg4ff/0.3.1/build/hid-logitech-new.ko] undefined! ERROR: modpost: "__aeabi_uldivmod" [/var/lib/dkms/new-lg4ff/0.3.1/build/hid-logitech-new.ko] undefined! make[2]: [scripts/Makefile.modpost:111: /var/lib/dkms/new-lg4ff/0.3.1/build/Module.symvers] Error 1 make[2]: Deleting file '/var/lib/dkms/new-lg4ff/0.3.1/build/Module.symvers' make[1]: [Makefile:1708: modules] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-5.10.17-v7l+' make: [Makefile:5: default] Error 2 root@Netbooter:/usr/src#

Best regards

berarma commented 3 years ago

Please, update and give it another try. I can't try it but I hope it's fixed now.

Fredobedo commented 3 years ago

Thank you, It is compiling now and I can use the effects on my PI 4 32bits: << root@Netbooter:/usr/src# sudo dkms install /usr/src/new-lg4ff

Creating symlink /var/lib/dkms/new-lg4ff/0.3.1/source -> /usr/src/new-lg4ff-0.3.1

DKMS: add completed.

Kernel preparation unnecessary for this kernel. Skipping...

Building module: cleaning build area... make -j4 KERNELRELEASE=5.10.17-v7l+ KVERSION=5.10.17-v7l+.... cleaning build area...

DKMS: build completed.

hid-logitech.ko: Running module version sanity check.

depmod.... Job for systemd-modules-load.service failed because the control process exited with error code. See "systemctl status systemd-modules-load.service" and "journalctl -xe" for details.

DKMS: install completed. root@Netbooter:/usr/src# reboot

I can now activate some effects like SINE, SPRING, CONSTANT (left and right) but still have troubles with FF_FRICTION effect. Whatever I do, the wheel goes left, even when I test on my Ubuntu 64 bits.

Did you already test a friction effect on your side, please?

Fred

berarma commented 3 years ago

I can now activate some effects like SINE, SPRING, CONSTANT (left and right) but still have troubles with FF_FRICTION effect. Whatever I do, the wheel goes left, even when I test on my Ubuntu 64 bits.

Do you mean that it goes left for all effects or just the friction effect type?

Fredobedo commented 3 years ago

Only for the friction effect. It could come from my code but have tried to change parameters with no luck.

Not being an expert with all these FFB effecs, but I could use Damper effect instead, functionally I should get something equal.

berarma commented 3 years ago

Only for the friction effect. It could come from my code but have tried to change parameters with no luck.

Not being an expert with all these FFB effecs, but I could use Damper effect instead, functionally I should get something equal.

The friction effect played almost the same if not the same than the damper effect, at least on my G29.

I'll test it again. I didn't thought it could have changed due to these commits.

Fredobedo commented 3 years ago

Oh sorry for the misunderstanding; I didn't test FF_FRICTION before (thus with previous new-lg4ff), I just implemented it based on fftest.c I found here https://github.com/flosse/linuxconsole/blob/master/utils/fftest.c .

I can imagine it's a problem with my code too but it's very strange

Fredobedo commented 3 years ago

Dear, I checked again my code and found a bug, after correcting it, friction effect functions perfectly.

Sorry for this

Best regards

Fredobedo commented 3 years ago

Hi Dear, this fix for new-lg4ff is really working great! For your information, I use your Logitech drivers for transforming Arcade games FFB orders to Logitech FFB: https://youtu.be/_WRH8y1oFbs

I still do have a concern which is the Wheel range; it's at 900 degree, is it possible to change its range programmatically, please?

Best regards Fred

berarma commented 3 years ago

Stunning! Thanks for sharing! This kind of uses are very interesting.

The wheel range can be changed by sysfs. You have to locate the Logitech driver dir inside /sys and write to a file named range.

Alternatively, you can use Oversteer if you have a python environment. It'll make things easier.

I'll merge this PR shortly since it doesn't seem to break anything.

Fredobedo commented 3 years ago

many thanks for the information, I'll try the hard way :)

Thanks