Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

Gamecon driver fails to build on Kernel 4.19.x



  • Pi3B+, using retropie-4.4.8-rpi2_rpi3.img.gz weekly from May 26 updated to 4.4.12

    System: Linux retropie 4.19.42-v7+ #1219 SMP Tue May 14 21:20:58 BST 2019 armv7l GNU/Linux
    Loading new gamecon_gpio_rpi-1.3 DKMS files...
    It is likely that 4.19.42-v7+ belongs to a chroot's host
    Building for 4.19.42+ and 4.19.42-v7+
    Building for architecture armv7l
    Building initial module for 4.19.42+
    Error! Bad return status for module build on kernel: 4.19.42+ (armv7l)
    Consult /var/lib/dkms/gamecon_gpio_rpi/1.3/build/make.log for more information.
    

    Make.log

    DKMS make.log for gamecon_gpio_rpi-1.3 for kernel 4.19.42+ (armv7l)
    Mon 27 May 12:18:38 BST 2019
    make -C /lib/modules/4.19.42+/build M=/var/lib/dkms/gamecon_gpio_rpi/1.3/build modules
    make[1]: Entering directory '/usr/src/linux-headers-4.19.42+'
      CC [M]  /var/lib/dkms/gamecon_gpio_rpi/1.3/build/gamecon_gpio_rpi.o
    /var/lib/dkms/gamecon_gpio_rpi/1.3/build/gamecon_gpio_rpi.c: In function ‘gc_probe’:
    /var/lib/dkms/gamecon_gpio_rpi/1.3/build/gamecon_gpio_rpi.c:1138:2: error: implicit declaration of function ‘setup_timer’ [-Werror=implicit-function-declaration]
      setup_timer(&gc->timer, gc_timer, (long) gc);
      ^~~~~~~~~~~
    cc1: some warnings being treated as errors
    scripts/Makefile.build:309: recipe for target '/var/lib/dkms/gamecon_gpio_rpi/1.3/build/gamecon_gpio_rpi.o' failed
    make[2]: *** [/var/lib/dkms/gamecon_gpio_rpi/1.3/build/gamecon_gpio_rpi.o] Error 1
    Makefile:1524: recipe for target '_module_/var/lib/dkms/gamecon_gpio_rpi/1.3/build' failed
    make[1]: *** [_module_/var/lib/dkms/gamecon_gpio_rpi/1.3/build] Error 2
    make[1]: Leaving directory '/usr/src/linux-headers-4.19.42+'
    Makefile:5: recipe for target 'all' failed
    make: *** [all] Error 2
    

  • Global Moderator

    The error is quite obvious:

    Module build for kernel 4.14.98-v7+ was skipped since the
    kernel headers for this kernel does not seem to be installed.

    Also, I see at least 3 versions of 4.19.x, while Raspbian only released 1 update - did you use rpi-update to upgrade/downgrade your kernel ?



  • @mitu I did not. As I said, I only use retropie-setup to update and choose "yes" to update underlying os a few minutes ago from an update from ~6hrs ago. I learned my lesson long ago to not update by other means if I want my pad driver to work. I reverted from my mistake and retro-pie update has worked for months until now. I guess those are the remnants? . I guess I can go back to a weekly and not update retropie at all.

    I'll try and reproduce the problem on a clean weekly and update that.


  • Global Moderator

    @Darksavior It's not a RetroPie error - it's a Raspbian package that's missing.
    What version of kernel are you running ? You can install the corresponding package that has the kernel headers so the compilation would work.



  • @mitu I decided to use the latest weekly retropie-4.4.8-rpi2_rpi3.img.gz from May 26 and I can't reproduce the problem. No idea why the kernel was updated on my main build. The driver still doesn't build on the weekly, though.

    System: Linux retropie 4.19.42-v7+ #1219 SMP Tue May 14 21:20:58 BST 2019 armv7l GNU/Linux
    Loading new gamecon_gpio_rpi-1.3 DKMS files...
    It is likely that 4.19.42-v7+ belongs to a chroot's host
    Building for 4.19.42+ and 4.19.42-v7+
    Building for architecture armv7l
    Building initial module for 4.19.42+
    Error! Bad return status for module build on kernel: 4.19.42+ (armv7l)
    Consult /var/lib/dkms/gamecon_gpio_rpi/1.3/build/make.log for more information.
    

    make.log

    DKMS make.log for gamecon_gpio_rpi-1.3 for kernel 4.19.42+ (armv7l)
    Mon 27 May 12:18:38 BST 2019
    make -C /lib/modules/4.19.42+/build M=/var/lib/dkms/gamecon_gpio_rpi/1.3/build modules
    make[1]: Entering directory '/usr/src/linux-headers-4.19.42+'
      CC [M]  /var/lib/dkms/gamecon_gpio_rpi/1.3/build/gamecon_gpio_rpi.o
    /var/lib/dkms/gamecon_gpio_rpi/1.3/build/gamecon_gpio_rpi.c: In function ‘gc_probe’:
    /var/lib/dkms/gamecon_gpio_rpi/1.3/build/gamecon_gpio_rpi.c:1138:2: error: implicit declaration of function ‘setup_timer’ [-Werror=implicit-function-declaration]
      setup_timer(&gc->timer, gc_timer, (long) gc);
      ^~~~~~~~~~~
    cc1: some warnings being treated as errors
    scripts/Makefile.build:309: recipe for target '/var/lib/dkms/gamecon_gpio_rpi/1.3/build/gamecon_gpio_rpi.o' failed
    make[2]: *** [/var/lib/dkms/gamecon_gpio_rpi/1.3/build/gamecon_gpio_rpi.o] Error 1
    Makefile:1524: recipe for target '_module_/var/lib/dkms/gamecon_gpio_rpi/1.3/build' failed
    make[1]: *** [_module_/var/lib/dkms/gamecon_gpio_rpi/1.3/build] Error 2
    make[1]: Leaving directory '/usr/src/linux-headers-4.19.42+'
    Makefile:5: recipe for target 'all' failed
    make: *** [all] Error 2
    

  • Global Moderator

    @Darksavior So it seems it's not building with 4.19.x, that's a real issue.



  • @mitu I updated the topic to the real problem.


  • administrators

    You will have to downgrade your kernel for now - https://retropie.org.uk/forum/post/190436


  • administrators

    @Darksavior Topic isn't correct (says 4.4) - it fails to build on 4.19.x - I'll sort it.


  • Global Moderator

    Looks like the change that breaks the driver is in 4.15, when setup_timer was replaced by timer_setup in the Linux kernel internal API (https://kernel.googlesource.com/pub/scm/linux/kernel/git/kees/linux/+/for-linus-timers-conversion-final-v4.15-rc1, https://lwn.net/Articles/735887/).


  • administrators

    @mitu Ah. Nice work. Should be an easy IFDEF fix then. No way I know of though of contacting author (maybe email in package info?), but worst case we could fix this ourselves.

    This would be better on a GitHub repo also imho. Maybe they would upload their unpackaged files if they don't already have a repository somewhere (if we can contact them).



  • @BuZz The developer "marqs" sometimes posts on the raspberry pi forums. https://www.raspberrypi.org/forums/viewtopic.php?t=15787

    This is his github repo: https://github.com/marqs85/


  • administrators

    @Darksavior thanks! :-)


  • Global Moderator

    @Darksavior If you're willing to try a patched version (since I have don't have the hardware setup), you can clone from my fork and give it try with the new 4.19.x kernel.

    # clone & setup
    git clone https://github.com/cmitu/gamecon_gpio_rpi
    cd gamecon_gpio_rpi
    sudo cp -r gamecon_gpio_rpi-1.3/ /usr/src/
    
    # build the kernel
    sudo dkms add gamecon_gpio_rpi/1.3
    sudo dkms build gamecon_gpio_rpi/1.3
    sudo dkms install gamecon_gpio_rpi/1.3
    


  • @mitu This works. Thanks! Thought I had to wait a few months like the last time the driver broke.


  • Global Moderator

    @Darksavior Alright, thanks for testing and reporting.
    I'll submit the patches upstream - the repo(s) you indicated, maybe we should change also the scriptmodule to pull the sources from there.


  • Global Moderator

    @Darksavior The changes have been pushed upstream and also added to the RetroPie's package. If you want, you can update your RetroPie-setup script and then re-install the gamecon driver package to see if it works.



  • @mitu Gamecon driver no longer working when using the retropie fkms_rpi4 branch on a pi4. Might be too early for support. I'm asking before I go making a new topic or if it's ok in here.


  • Global Moderator

    @Darksavior Is the compilation not working or the module loads but the controller doesn't work ?



  • @mitu This time it's different. It seems to compile fine? ES sees both pads and gives me the option to configure them but they won't work. Jstest also sees both pads but no response. Not sure how to check if the module is loaded properly.
    https://pastebin.com/fZXz6E7F



Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.