RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    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

    Scheduled Pinned Locked Moved Help and Support
    retropie-setupgamecongamecon driver
    38 Posts 4 Posters 6.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mituM
      mitu Global Moderator @Darksavior
      last edited by

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

      DarksaviorD 1 Reply Last reply Reply Quote 0
      • DarksaviorD
        Darksavior @mitu
        last edited by

        @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
        
        mituM 1 Reply Last reply Reply Quote 0
        • mituM
          mitu Global Moderator @Darksavior
          last edited by mitu

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

          DarksaviorD 1 Reply Last reply Reply Quote 0
          • DarksaviorD
            Darksavior @mitu
            last edited by

            @mitu I updated the topic to the real problem.

            BuZzB 1 Reply Last reply Reply Quote 0
            • BuZzB
              BuZz administrators
              last edited by

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

              To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

              1 Reply Last reply Reply Quote 1
              • BuZzB
                BuZz administrators @Darksavior
                last edited by BuZz

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

                To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                1 Reply Last reply Reply Quote 0
                • mituM
                  mitu Global Moderator
                  last edited by

                  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/).

                  BuZzB 1 Reply Last reply Reply Quote 1
                  • BuZzB
                    BuZz administrators @mitu
                    last edited by

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

                    To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                    DarksaviorD 1 Reply Last reply Reply Quote 0
                    • DarksaviorD
                      Darksavior @BuZz
                      last edited by Darksavior

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

                      BuZzB mituM 2 Replies Last reply Reply Quote 1
                      • BuZzB
                        BuZz administrators @Darksavior
                        last edited by BuZz

                        @Darksavior thanks! :-)

                        To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                        1 Reply Last reply Reply Quote 0
                        • mituM
                          mitu Global Moderator @Darksavior
                          last edited by mitu

                          @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
                          
                          DarksaviorD 1 Reply Last reply Reply Quote 1
                          • DarksaviorD
                            Darksavior @mitu
                            last edited by

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

                            mituM 2 Replies Last reply Reply Quote 0
                            • mituM
                              mitu Global Moderator @Darksavior
                              last edited by mitu

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

                              1 Reply Last reply Reply Quote 1
                              • mituM
                                mitu Global Moderator @Darksavior
                                last edited by

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

                                DarksaviorD 1 Reply Last reply Reply Quote 1
                                • DarksaviorD
                                  Darksavior @mitu
                                  last edited by Darksavior

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

                                  mituM 1 Reply Last reply Reply Quote 0
                                  • mituM
                                    mitu Global Moderator @Darksavior
                                    last edited by

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

                                    DarksaviorD 1 Reply Last reply Reply Quote 0
                                    • DarksaviorD
                                      Darksavior @mitu
                                      last edited by Darksavior

                                      @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

                                      mituM 1 Reply Last reply Reply Quote 0
                                      • mituM
                                        mitu Global Moderator @Darksavior
                                        last edited by

                                        @Darksavior Yes, looks different than on a Pi3. The fact that pads are seen by ES and jstest seems to indicate that the driver is loaded, but you can also check with

                                        lsmod | grep gamecon_gpio_rpi
                                        

                                        Since this is the same Linux kernel version as on Stretch - 4.19, when you reported the issue - I think the problem is with either the GPIO configuration or the module compatibility with to the new PI model.

                                        DarksaviorD 1 Reply Last reply Reply Quote 0
                                        • DarksaviorD
                                          Darksavior @mitu
                                          last edited by

                                          @mitu I ran that command and got 45056 0
                                          At first I thought the controller ports weren't properly connected or maybe something desoldered, but it works fine on a pi3.

                                          1 Reply Last reply Reply Quote 0
                                          • mituM
                                            mitu Global Moderator
                                            last edited by

                                            The module is loaded alright, I think is just not compatible with the RPI4 model.
                                            I've looked at the bcm2835 GPIO library and - at the very least - the BCM2708_PERI_BASE is different on the PI4.
                                            I can add a patch if you'd like to test - do you have the possibility to test on both RPI3/RPI4 models ?

                                            DarksaviorD 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            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.