mcobit / retrosmc

An easier way to get retropie onto osmc
Other
212 stars 32 forks source link

Driver mkarcadejoystick doesnt install on OSMC #36

Open asfixia opened 7 years ago

asfixia commented 7 years ago

Trying to install the mkarcadejoystick on OSMC report the error missing raspberrypi-kernel-headers packages that make impossible to use gpio joystick.

mcobit commented 7 years ago

Please show the complete error message. If the kernel headers are missing, did you try to install them via apt?

asfixia commented 7 years ago

Yes i installed, my current kernel version is 4.4.27-9-osmc and i installed the 'rbp2-headers-4.4.27-9-osmc' package

When i use the install script menu:

Installing dependencies for mkarcadejoystick : Raspberry Pi GPIO Joystick Driver Did not find needed package(s): raspberrypi-kernel-headers. I am trying to install them now. Fetched 13.6 kB in 17s (787 B/s) Reading package lists... Reading package lists... Building dependency tree... Reading state information... E: Unable to locate package raspberrypi-kernel-headers Could not install package(s): raspberrypi-kernel-headers.

trying to make directly:

osmc@osmc:/usr/src/mk_arcade_joystick_rpi-0.1.4$ make make -C /lib/modules/uname -r/build M=/usr/src/mk_arcade_joystick_rpi-0.1.4 modules make[1]: /lib/modules/4.4.27-9-osmc/build: No such file or directory. Stop. Makefile:9: recipe for target 'all' failed make: [all] Error 2

Putting the osmc headers link in build folder: osmc@osmc:/usr/src$ sudo ln -s /usr/src/rbp2-headers-4.4.27-9-osmc /lib/modules/4.4.27-9-osmc/build

And doing the make again:

osmc@osmc:/usr/src/mk_arcade_joystick_rpi-0.1.4$ make ARCH=arm make -C /lib/modules/uname -r/build M=/usr/src/mk_arcade_joystick_rpi-0.1.4 modules make[1]: Entering directory '/usr/src/rbp2-headers-4.4.27-9-osmc' CC [M] /usr/src/mk_arcade_joystick_rpi-0.1.4/mk_arcade_joystick_rpi.o In file included from ./arch/arm/include/asm/delay.h:9:0, from include/linux/delay.h:14, from /usr/src/mk_arcade_joystick_rpi-0.1.4/mk_arcade_joystick_rpi.c:30: ./arch/arm/include/asm/memory.h:22:25: fatal error: mach/memory.h: No such file or directory

include <mach/memory.h>

                     ^

compilation terminated. scripts/Makefile.build:264: recipe for target '/usr/src/mk_arcade_joystick_rpi-0.1.4/mk_arcade_joystick_rpi.o' failed make[2]: [/usr/src/mk_arcade_joystick_rpi-0.1.4/mk_arcade_joystick_rpi.o] Error 1 Makefile:1400: recipe for target 'module/usr/src/mk_arcade_joystick_rpi-0.1.4' failed make[1]: [module/usr/src/mk_arcade_joystick_rpi-0.1.4] Error 2 make[1]: Leaving directory '/usr/src/rbp2-headers-4.4.27-9-osmc' Makefile:9: recipe for target 'all' failed make: *** [all] Error 2

asfixia commented 7 years ago

I finally could compile the module: (but now the issue is that it doenst load using modprob)

install the kernel source:

sudo apt-get install rbp2-source-4.4.27-9-osmc Link the src to the build folder

sudo ln -s /usr/src/rbp2-source-4.4.27-9-osmc /lib/modules/4.4.27-9-osmc/build Go to the source folder and prepare for module build:

cd /usr/src/rbp2-source-4.4.27-9-osmc
sudo make modules_prepare

Download the deb package:

wget https://github.com/recalbox/mk_arcade_joystick_rpi/releases/download/v0.1.4/mk-arcade-joystick-rpi-0.1.4.deb install package:

sudo dpkg -i mk-arcade-joystick-rpi-0.1.4.deb

but it doenst load:

sudo modprobe mk_arcade_joystick_rpi map=1,2 modprobe: ERROR: could not insert 'mk_arcade_joystick_rpi': Exec format error

asfixia commented 7 years ago

I Could compile the module but i've found another issue:

sudo modprobe mk_arcade_joystick_rpi map=1
modprobe: ERROR: could not insert 'mk_arcade_joystick_rpi': Device or resource busy

To make sure that the kernel version is right:

sudo apt-get instal rbp2-image-4.4.27-9-osmc

l the module compiled using:

> sudo make -C /usr/src/rbp2-source-4.4.27-9-osmc M=/lib/modules/mk_arcade_joystick_rpi/ modules
make: Entering directory '/usr/src/rbp2-source-4.4.27-9-osmc'
  CC [M]  /lib/modules/mk_arcade_joystick_rpi//mk_arcade_joystick_rpi.o
/lib/modules/mk_arcade_joystick_rpi//mk_arcade_joystick_rpi.c:152:1: warning: no semicolon at end of struct or union
 };
 ^
/lib/modules/mk_arcade_joystick_rpi//mk_arcade_joystick_rpi.c: In function 'i2c_read':
/lib/modules/mk_arcade_joystick_rpi//mk_arcade_joystick_rpi.c:269:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     unsigned short bufidx;
     ^
/lib/modules/mk_arcade_joystick_rpi//mk_arcade_joystick_rpi.c: In function 'mk_setup_pad':
/lib/modules/mk_arcade_joystick_rpi//mk_arcade_joystick_rpi.c:412:14: warning: too many arguments for format [-Wformat-extra-args]
              pr_err("Invalid gpio argument\n", pad_type);
              ^
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /lib/modules/mk_arcade_joystick_rpi//mk_arcade_joystick_rpi.mod.o
  LD [M]  /lib/modules/mk_arcade_joystick_rpi//mk_arcade_joystick_rpi.ko
make: Leaving directory '/usr/src/rbp2-source-4.4.27-9-osmc'

dmesg msg:

[25074.291901] ------------[ cut here ]------------
[25074.291945] WARNING: CPU: 1 PID: 21967 at arch/arm/mm/ioremap.c:301 __arm_ioremap_caller+0x180/0x1a4()
[25074.291957] Modules linked in: mk_arcade_joystick_rpi(O+) binfmt_misc 8021q garp stp llc r8188eu(C) sg cfg80211 evdev joydev rfkill uas xpad snd_bcm2835 snd_pcm snd_timer bcm2835_thermal snd bcm2835_gpiomem bcm2835_wdt uio_pdrv_genirq uio fuse ipv6
[25074.292064] CPU: 1 PID: 21967 Comm: modprobe Tainted: G        WC O    4.4.27-9-osmc #1
[25074.292073] Hardware name: BCM2709
[25074.292110] [<8001fa6c>] (unwind_backtrace) from [<8001b28c>] (show_stack+0x20/0x24)
[25074.292135] [<8001b28c>] (show_stack) from [<8041522c>] (dump_stack+0xd4/0x118)
[25074.292159] [<8041522c>] (dump_stack) from [<8003105c>] (warn_slowpath_null+0x88/0xdc)
[25074.292180] [<8003105c>] (warn_slowpath_null) from [<800277fc>] (__arm_ioremap_caller+0x180/0x1a4)
[25074.292194] [<800277fc>] (__arm_ioremap_caller) from [<800273dc>] (ioremap+0x2c/0x30)
[25074.292218] [<800273dc>] (ioremap) from [<7f339020>] (mk_init+0x20/0x5e0 [mk_arcade_joystick_rpi])
[25074.292261] [<7f339020>] (mk_init [mk_arcade_joystick_rpi]) from [<80009820>] (do_one_initcall+0xa0/0x1ec)
[25074.292281] [<80009820>] (do_one_initcall) from [<8015ed84>] (do_init_module+0x74/0x218)
[25074.292304] [<8015ed84>] (do_init_module) from [<800dc6a8>] (load_module+0x268c/0x2a4c)
[25074.292321] [<800dc6a8>] (load_module) from [<800dcc3c>] (SyS_finit_module+0x8c/0xa4)
[25074.292339] [<800dcc3c>] (SyS_finit_module) from [<80016f40>] (ret_fast_syscall+0x0/0x1c)
[25074.292350] ---[ end trace 12742ca205262812 ]---
[25074.292357] mk_arcade_joystick_rpi: io remap failed

what i am doing wrong?

A thread about this in osmc forum: https://discourse.osmc.tv/t/gpio-joystick-raspberrypi-kernel-headers/35592/12