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

    How To Apply Raphnet Kernel Patch To Fix "Northwest" Drift

    Scheduled Pinned Locked Moved Help and Support
    linuxraphnetkernelcontrollerhow-to
    25 Posts 10 Posters 10.4k 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.
    • obsidianspiderO
      obsidianspider
      last edited by obsidianspider

      When I installed my Raphnet USB adapter I saw the "northwest" drift that seems to be fairly well known. To address this Raphnet has a kernel patch that can be applied. They document the process on their website, but I've seen a few people not understand how to apply the patch, and the first time I did it, it took me a bit of figuring. The steps outlined on Raphnet's site rely on combining steps from the official Raspberry Pi site and their own lines inserted into the mix. To try to help out the next person attempting this, below is how I got it to work on my Pi 2 and Pi 3. If you're not comfortable fussing around in Linux and/or possibly breaking things, don't attempt the steps below. Just because it worked for me, doesn't mean it will work for you.

      • Update RetroPie by going into RetroPie Setup, option S Update RetroPie-Setup script then option U Update all installed packages; when prompted to update underlying components, say Yes
        Running option S first seems like it may be redundant, but it only takes a few seconds, and made me feel better.

      • Get to the command line on your Pi, either by hitting F4 in EmulationStation, or by SSHing into it. (I used SSH)

      • Run the commands from Raspberry Pi website and insert the Raphnet patches before building the kernel:
        First get the sources, which will take some time:
        git clone --depth=1 https://github.com/raspberrypi/linux
        Add missing dependencies:
        sudo apt-get install bc
        Downloading the patches
        wget www.raphnet-tech.com/support/retropie/usbhid_iostart.diff
        wget www.raphnet-tech.com/support/retropie/usbhid_start_before_connect.diff
        wget www.raphnet-tech.com/support/retropie/jsdev_initial_value.diff
        Applying the patches
        cd linux
        patch -p1 < ../usbhid_iostart.diff
        patch -p1 < ../usbhid_start_before_connect.diff
        patch -p1 < ../jsdev_initial_value.diff
        Raspberry Pi 2/3 default build configuration
        KERNEL=kernel7
        make bcm2709_defconfig
        Build and install the kernel, modules, and Device Tree blobs; this step takes a long time:
        make -j4 zImage modules dtbs
        sudo make modules_install
        sudo cp arch/arm/boot/dts/*.dtb /boot/
        sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
        sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
        sudo scripts/mkknlimg arch/arm/boot/zImage /boot/$KERNEL.img

      • Reboot and enjoy!
        sudo reboot

      Optional cleanup:

      • Delete /home/pi/linux directory
      • Delete usbhid_iostart.diff, usbhid_start_before_connect.diff, jsdev_initial_value.diff from /home/pi/ directory

      📷 @obsidianspider

      1 Reply Last reply Reply Quote 3
      • hansolo77H
        hansolo77
        last edited by

        I'm getting stuck at the MAKE stages....

        pi@retropie:~/linux $  make -j4 zImage modules dtbs
        scripts/kconfig/conf  --silentoldconfig Kconfig
        
        *** Error during update of the configuration.
        
        scripts/kconfig/Makefile:37: recipe for target 'silentoldconfig' failed
        make[2]: *** [silentoldconfig] Error 1
        Makefile:541: recipe for target 'silentoldconfig' failed
        make[1]: *** [silentoldconfig] Error 2
        make: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/kernel.release'.  Stop.
        

        Who's Scruffy Looking?

        1 Reply Last reply Reply Quote 0
        • obsidianspiderO
          obsidianspider
          last edited by

          What's scripts/kconfig/conf --silentoldconfig Kconfig coming from? Did you type that?

          📷 @obsidianspider

          1 Reply Last reply Reply Quote 0
          • hansolo77H
            hansolo77
            last edited by hansolo77

            No, I cut/pasted each line you posted. The first line after "pi@retropie:" is what I typed.. (~/linux $ make -j4 zImage modules dtbs). That scripts/kconfig stuff is what was returned after I hit the enter key on my keyboard.

            I made a backup of my SD card before I tried this, so I'm going to try it again now that I'm home from work. I skipped the first part, where you said to run the update of all installed packages including all components. I had recently done that when I was updating stuff a few days ago to fix the RetroArch stuff. Maybe something went wrong. So I'll rewrite my SD card from the backup and do that bit as well.


            It all works now. I wish I could go back and delete everything we talked about since your OP, as following your instructions EXACTLY does the trick. You have to do the update underlying systems as well, as it gets some missing files. Also.. don't double-click the things you have to type into your SSH. I discovered that by doing that, and blindly copy/paste actually puts in an extra space or 2 at the beginning. That might have also been the reason for my issues before. But if you do EXACTLY what you say, and either type out the commands manually, or copy to the letter rather than double-click, it works perfectly.

            Thanks for figuring this out!

            Who's Scruffy Looking?

            obsidianspiderO 1 Reply Last reply Reply Quote 1
            • obsidianspiderO
              obsidianspider @hansolo77
              last edited by

              @hansolo77 I'm glad you got it working! :)

              📷 @obsidianspider

              1 Reply Last reply Reply Quote 0
              • J
                j.e.f.f
                last edited by

                Is this patch specifically for the Raphnet controller, or is it supposed to solve the "northwest drift" for pretty much any controller that exhibits this behaviour? I have this problem with 8bitdo controllers and Playstation 3 controllers. I tried following the instructions above, but I still have the problem when I connect the second controller.

                edmaul69E 1 Reply Last reply Reply Quote 0
                • edmaul69E
                  edmaul69 @j.e.f.f
                  last edited by

                  @j.e.f.f it is a fix to a linux issue. I use it on my apple iie because the keyboard causes this issue as well. It will fix the issue no problem.

                  1 Reply Last reply Reply Quote 1
                  • J
                    j.e.f.f
                    last edited by

                    Will it work for Bluetooth devices too? This seems to have only fixed the issue for my playstation controllers which are wired , but my bluetooth controllers still have the problem.

                    edmaul69E 1 Reply Last reply Reply Quote 0
                    • E
                      enderandrew
                      last edited by

                      Has anyone suggested this upstream to the Raspbian distro maintainers to include the kernel patch?

                      edmaul69E 1 Reply Last reply Reply Quote 0
                      • edmaul69E
                        edmaul69 @enderandrew
                        last edited by

                        @enderandrew im not sure why raphael hasnt done it as he has done other patches. I was so grateful when he did this patch for me when i first found the issue with the 4nes4snes board i got from him. Hopefully it does get put into the distro to solve this issue for good.

                        1 Reply Last reply Reply Quote 0
                        • edmaul69E
                          edmaul69 @j.e.f.f
                          last edited by

                          @j.e.f.f the nes30 is the only bluetooth i have seen with this issue. The fc30 pro and nes30 pro do not have this issue. I am curious if other bluetooth controllers have this issue.

                          J 1 Reply Last reply Reply Quote 0
                          • J
                            j.e.f.f @edmaul69
                            last edited by

                            @edmaul69 I wonder if there is something wrong with my setup... I can't see the other models behaving all that different.

                            I was pretty sure I followed the setup properly. Other than the scrolling problem, the controllers work great after hitting the D-pad once to stop the scrolling. I'm even considering picking up two more to have all four controllers wireless.

                            edmaul69E 1 Reply Last reply Reply Quote 0
                            • edmaul69E
                              edmaul69 @j.e.f.f
                              last edited by edmaul69

                              @j.e.f.f oh i know what you are saying. I have one. I have two of the pros as well. An fc30 pro and an nes30 pro. I dont have the issue with them but i do with my nes30.

                              J 1 Reply Last reply Reply Quote 0
                              • hansolo77H
                                hansolo77
                                last edited by

                                Sorry to post in an old thread, but ti seemed redundant to create a new one... The latest "underlying kernel" update I did when I "updated all installed packages" broke the raphnet patch. So I need to reinstall it. Is it possible to patch without rebuilding the entire kernel again? If not, will going through this process still give me the latest updates to the kernel?

                                Suggestion - In future builds of the Setup Script, I think it should have this patch automatically applied when it does the kernel updates. Does this patch do anything to a system that doesn't have a raphnet adapter? If not, why not just include it?

                                Who's Scruffy Looking?

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

                                  @hansolo77 said in How To Apply Raphnet Kernel Patch To Fix "Northwest" Drift:

                                  Suggestion - In future builds of the Setup Script, I think it should have this patch automatically applied when it does the kernel updates. Does this patch do anything to a system that doesn't have a raphnet adapter? If not, why not just include it?

                                  We don't provide custom kernels - RetroPie sits on top of existing OS. If you want the patches included, they need to be fed to upstream kernel development. https://bugzilla.kernel.org/ - They will then filter down eventually to the Raspbian kernel, but they might be willing to backport it if it's accepted upstream.

                                  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
                                  • D
                                    Dhrystone
                                    last edited by

                                    Trying this and getting the following errors:

                                    pi@retropie:~ $ cd linux
                                    pi@retropie:~/linux $ patch -p1 < ../usbhid_iostart.diff
                                    patching file drivers/hid/hid-core.c
                                    Hunk #1 succeeded at 2508 (offset 335 lines).

                                    pi@retropie:~/linux $ patch -p1 < ../usbhid_start_before_connect.diff
                                    patching file include/linux/hid.h
                                    Hunk #1 FAILED at 936.
                                    1 out of 1 hunk FAILED -- saving rejects to file include/linux/hid.h.rej

                                    pi@retropie:~/linux $ patch -p1 < ../jsdev_initial_value.diff
                                    patching file drivers/input/joydev.c
                                    Hunk #1 succeeded at 155 (offset -1 lines).
                                    Hunk #2 FAILED at 234.
                                    Hunk #3 succeeded at 916 (offset 68 lines).
                                    Hunk #4 FAILED at 901.
                                    2 out of 4 hunks FAILED -- saving rejects to file drivers/input/joydev.c.rej

                                    1 Reply Last reply Reply Quote 2
                                    • J
                                      jthomas5150 @edmaul69
                                      last edited by jthomas5150

                                      @edmaul69 Hi, sorry to reply to an old post but I have found no progress on the northwest movement when the SN30 (firmware v4.10) is turned on and connects. (This 8bitdo controller seems to be popular so I am surprised this issue is not more documented.) This problem appears on fresh Retropie 4.3 and 4.4 installs. Once I tap the d-pad the scrolling stops. I tried the above kernel patch and same issue. My other bluetooth controller, the wiiupro, does not scroll northwest when turned on. Any ideas? Makes connecting my second player 2 SN30 kinda a pain...

                                      I would not mind buying two SN30 Pro controllers (as I hear this issue does not exist with this model), but I like the more simple SN30 controllers better for my NES/SNES games.

                                      I am willing to help to troubleshoot in any way I can!

                                      edmaul69E 1 Reply Last reply Reply Quote 0
                                      • edmaul69E
                                        edmaul69 @jthomas5150
                                        last edited by

                                        @jthomas5150 the problem is actually in linux and linux needs to be updated to stop it. Some controllers are affected and some arent. Most newer controllers have the problem fixed in them. But linux needs to actually fix the problem. If you use any usb controllers with the issue try putting them on a usb hub. Some people have luck that way.

                                        J 1 Reply Last reply Reply Quote 0
                                        • J
                                          jthomas5150 @edmaul69
                                          last edited by jthomas5150

                                          @edmaul69 Thanks for the reply. My USB controllers work just fine and so does my WiiUPro bluetooth controller. I wonder if anyone has any kind of bluetooth workaround like the Raphnet Kernel Patch but instead of fixing USB controller issues, addresses the bluetooth northwest issue for effected bluetooth controllers?

                                          Would an aftermarket bluetooth adapter solve the issue i wonder...? Or maybe that is a dumb idea since there is an issue with the kernel.

                                          edmaul69E 1 Reply Last reply Reply Quote 0
                                          • edmaul69E
                                            edmaul69 @jthomas5150
                                            last edited by

                                            @jthomas5150 if you have a northwest issue on bt, did you try the raphnet northwest fix?

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