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

Retroarch cores crash on trigger press (Mouse Click) with overlay active

Scheduled Pinned Locked Moved Help and Support
lr-fceummwiimotelightgunoverlay
50 Posts 13 Posters 10.3k 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.
  • H
    Headrush69 @roslof
    last edited by 13 Aug 2018, 03:18

    @roslof Can you also post the output of cat /proc/bus/input/devices

    Can you plug in your bluetooth dongle after starting the Pi and then checking lsusb

    Having 3 mouse devices connected at once is making diagnosing a little harder.
    It would be best to just use your mini_keyboard with touchpad as mouse and see if setting the mouse index in Retroarch with just one device attached still causes the same issue.

    1 Reply Last reply Reply Quote 0
    • G
      GoG
      last edited by 25 Jan 2019, 20:48

      I am wondering if anyone has figured out a resolution to this problem? My trackball and mouse work fine if I disable overlays on mouse index 0, but if overlays are enabled, it locks up on left mouse click. I really like the look of the overlays / bezels, so I would like to use them. I have tried a few different Retropie loads, even one that was made in 2019 with the latest bells and whistles, but it is still no go... really frustrating, but I realize I am in the minority with using a trackball with retropie.

      R 1 Reply Last reply 26 Jan 2019, 09:36 Reply Quote 0
      • R
        roslof @GoG
        last edited by 26 Jan 2019, 09:36

        @GoG I wish. I realized after a clean install and the problem still occurred that this is a retroarch issue that has not yet been solved. I tried all kinds of different combos of controllers and such to no success.

        Shame, because I devoted a ton of time to perfecting overlays, only to not have trackball button support.

        So I remove the overlays for the games that are designed for trackballs.

        Boo... But at least that's a type of work-around.

        1 Reply Last reply Reply Quote 0
        • S
          SuperJim
          last edited by 5 Feb 2019, 09:03

          I also have this issue, but in my case I am using a custom HID composite device that implements two joysticks, mouse and keyboard (media keys only).

          I have noticed that the mouse is detected twice in the runcommand.log,
          [INFO] [udev]: Mouse #0 (/dev/input/event2).
          [INFO] [udev]: Mouse #1 (/dev/input/mouse0).

          These two entries are the same device,

          pi@retropie:~ $ ls -lr /dev/input/*
          crw-rw---- 1 root input 13, 32 Feb 5 21:37 /dev/input/mouse0
          crw-rw---- 1 root input 13, 63 Feb 5 21:37 /dev/input/mice
          crw-rw----+ 1 root input 13, 1 Feb 5 21:37 /dev/input/js1
          crw-rw----+ 1 root input 13, 0 Feb 5 21:37 /dev/input/js0
          crw-rw---- 1 root input 13, 69 Feb 5 21:37 /dev/input/event5
          crw-rw---- 1 root input 13, 68 Feb 5 21:37 /dev/input/event4
          crw-rw---- 1 root input 13, 67 Feb 5 21:37 /dev/input/event3
          crw-rw---- 1 root input 13, 66 Feb 5 21:37 /dev/input/event2
          crw-rw----+ 1 root input 13, 65 Feb 5 21:37 /dev/input/event1
          crw-rw----+ 1 root input 13, 64 Feb 5 21:37 /dev/input/event0

          /dev/input/by-path:
          total 0
          lrwxrwxrwx 1 root root 9 Feb 5 21:37 platform-soc:shutdown_button-event -> ../event5
          lrwxrwxrwx 1 root root 9 Feb 5 21:37 platform-3f980000.usb-usb-0:1.1.2:1.0-mouse -> ../mouse0
          lrwxrwxrwx 1 root root 6 Feb 5 21:37 platform-3f980000.usb-usb-0:1.1.2:1.0-joystick -> ../js1
          lrwxrwxrwx 1 root root 9 Feb 5 21:37 platform-3f980000.usb-usb-0:1.1.2:1.0-event-mouse -> ../event2
          lrwxrwxrwx 1 root root 9 Feb 5 21:37 platform-3f980000.usb-usb-0:1.1.2:1.0-event-joystick -> ../event0
          lrwxrwxrwx 1 root root 9 Feb 5 21:37 platform-3f980000.usb-usb-0:1.1.2:1.0-event -> ../event4

          /dev/input/by-id:
          total 0
          lrwxrwxrwx 1 root root 9 Feb 5 21:37 usb-JEB_Arcade_Interface_00000000001A-mouse -> ../mouse0
          lrwxrwxrwx 1 root root 6 Feb 5 21:37 usb-JEB_Arcade_Interface_00000000001A-joystick -> ../js1
          lrwxrwxrwx 1 root root 9 Feb 5 21:37 usb-JEB_Arcade_Interface_00000000001A-event-mouse -> ../event2
          lrwxrwxrwx 1 root root 9 Feb 5 21:37 usb-JEB_Arcade_Interface_00000000001A-event-joystick -> ../event0
          lrwxrwxrwx 1 root root 9 Feb 5 21:37 usb-JEB_Arcade_Interface_00000000001A-event-if00 -> ../event4

          I experimented by deleting event2, and then the crash no longer happens on button press; the mouse is detected in the log file, but then doesn't appear to function properly (doesn't work in dosbox or scummvm, does work in amiberry).

          When the crash does happen, the retroarch process immediately goes to 100%, and can only be killed using -9... then you drop back to emulationstation as expected.

          1 Reply Last reply Reply Quote 0
          • S
            SuperJim
            last edited by 7 Feb 2019, 08:19

            I have made further progress in tracking down the problem, but I don't really understand how the input driver code works. I used gdb to determine retroarch was stuck in input_poll_overlay()

            What I can say for certain is that the following loop in function input_poll_overlay() from file input\input_overlay.c never exits,

            for (i = 0;
                  input_ptr->input_state(input_data, joypad_info, NULL, 0, device, i, RETRO_DEVICE_ID_POINTER_PRESSED);
                  i++)
            {
               input_overlay_state_t polled_data;
               int16_t x = input_ptr->input_state(input_data, joypad_info, NULL, 0, device, i, RETRO_DEVICE_ID_POINTER_X);
               int16_t y = input_ptr->input_state(input_data, joypad_info, NULL, 0, device, i, RETRO_DEVICE_ID_POINTER_Y);
            
               memset(&polled_data, 0, sizeof(struct input_overlay_state));
            
               if (ol->enable)
               {
                   input_overlay_poll(ol, &polled_data, x, y);
               }
               else
                  ol->blocked = false;
            
               bits_or_bits(ol_state->buttons.data, polled_data.buttons.data, ARRAY_SIZE(polled_data.buttons.data));
            
               for (j = 0; j < ARRAY_SIZE(ol_state->keys); j++)
                  ol_state->keys[j] |= polled_data.keys[j];
            
               // Fingers pressed later take priority and matched up with overlay poll priorities.
               for (j = 0; j < 4; j++)
                  if (polled_data.analog[j])
                     ol_state->analog[j] = polled_data.analog[j];
            
               polled = true;
            }
            

            I've had trouble following how exactly input_ptr->input_state works, however it evidently stays true in the loop statement forever, which is why it locks up.

            input_overlay_poll() is called every time, but as far as I can tell does nothing, because ol->active->size is always zero, so the loop is never executed.

            I can bypass input_poll_overlay() completely by just immediately returning, and stop the lockup, then the mouse pointer still works, but the buttons don't.

            R 1 Reply Last reply 8 Feb 2019, 23:07 Reply Quote 0
            • R
              roslof @SuperJim
              last edited by 8 Feb 2019, 23:07

              @SuperJim Great progress on the debugging here. Glad to see somebody with some engineering chops took the time to take a look. Clearly, there is something funky, but I don't know if anybody can help take this to the next level.

              Is there Retroarch documentation somewhere for how to submit bugs and such? With this information, maybe somebody more involved with Retroarch could devote time to investigate further.

              1 Reply Last reply Reply Quote 0
              • M
                MrLightgun
                last edited by 1 Mar 2019, 09:23

                Good news, I logged this as a Retroarch issue on github referencing this thread:

                https://github.com/libretro/RetroArch/issues/8326

                Orbea and Casdevel kindly assisted in resolving the issue and a fix has been commited to RetroArch.

                Big thanks to everyone in this thread that provided information.

                R C 2 Replies Last reply 2 Mar 2019, 03:31 Reply Quote 2
                • R
                  roslof @MrLightgun
                  last edited by 2 Mar 2019, 03:31

                  @MrLightgun YES! That is GREAT news! Thank you for helping to make this happen.

                  1 Reply Last reply Reply Quote 0
                  • R
                    roslof
                    last edited by roslof 3 Mar 2019, 04:07 2 Mar 2019, 17:04

                    I updated the Retropie script and attempted to update Retroarch by source, but I don't believe the fix/change made it down yet. I'm not clear on how to view when a fix moves into RetroArch master or otherwise how to build it without the RetroPie Script.

                    mituM 1 Reply Last reply 3 Mar 2019, 10:36 Reply Quote 0
                    • C
                      ChuckyP @MrLightgun
                      last edited by 3 Mar 2019, 05:27

                      @MrLightgun what a fitting name to be bringing this update. It has been a while since I had started looking for a solution to this problem... and for once it wasn’t something simple I had overlooked.

                      Thanks to everyone for jumping in and keeping this active. Can’t wait for the official release of this fix.

                      1 Reply Last reply Reply Quote 1
                      • mituM
                        mitu Global Moderator @roslof
                        last edited by 3 Mar 2019, 10:36

                        @roslof The RetroPie script is not using the RA's latest source, it's pinned to a release (right now it's at 17.6). If you wish to get the latest version, then you'll need to compile it separately and move the resulting binary in the installation folder (/opt/retropie/emulators/retroarch/bin).

                        1 Reply Last reply Reply Quote 1
                        • S
                          SuperJim
                          last edited by SuperJim 6 Mar 2019, 08:03

                          I've tried adding the change, and it was successful! I've listed the steps below if you want to compile it yourself. I believe the --enable-neon flag should be added to the configure command, but it won't work for me with that included. * note the configure command is one line, ending with --enable-dispmanx; it seems be wrapping below.

                          Update using the script to ensure you have 1.7.6 installed,
                          ~/RetroPie-Setup/retropie_setup.sh

                          cd
                          git clone https://github.com/libretro/RetroArch.git
                          cd RetroArch
                          git checkout tags/v1.7.6

                          <RPI2 only>
                          CFLAGS="-O2 -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -ftree-vectorize -funsafe-math-optimizations" ./configure --disable-sdl --enable-sdl2 --disable-oss --disable-al --disable-jack --disable-qt --disable-x11 --disable-pulse --enable-neon --enable-floathard --enable-dispmanx

                          <RPI3 only>
                          CFLAGS="-O2 -march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard -ftree-vectorize -funsafe-math-optimizations" ./configure --disable-sdl --enable-sdl2 --disable-oss --disable-al --disable-jack --disable-qt --disable-x11 --disable-pulse --enable-neon --enable-floathard --enable-dispmanx

                          git apply ~/RetroPie-Setup/scriptmodules/emulators/retroarch/01_hotkey_hack.diff
                          git apply ~/RetroPie-Setup/scriptmodules/emulators/retroarch/02_disable_search.diff
                          git apply ~/RetroPie-Setup/scriptmodules/emulators/retroarch/03_disable_udev_sort.diff

                          using whatever editor you prefer, edit input/drivers/udev_input.c, line 991 and replace,

                            case RETRO_DEVICE_POINTER:
                                 return udev_pointer_state(udev, port, id, false);
                            case RARCH_DEVICE_POINTER_SCREEN:
                                 return udev_pointer_state(udev, port, id, true);
                          

                          with the following,

                            case RETRO_DEVICE_POINTER:
                              if (idx == 0) /* multi-touch unsupported (for now) */
                                 return udev_pointer_state(udev, port, id, false);
                              break;
                            case RARCH_DEVICE_POINTER_SCREEN:
                              if (idx == 0) /* multi-touch unsupported (for now) */
                                 return udev_pointer_state(udev, port, id, true);
                              break;
                          

                          make
                          sudo cp retroarch /opt/retropie/emulators/retroarch/bin

                          R 1 Reply Last reply 8 Mar 2019, 07:23 Reply Quote 0
                          • WarC0zesW
                            WarC0zes
                            last edited by 6 Mar 2019, 08:50

                            @SuperJim I'm a beginner for compile. It's possible to share your compiled retroarch with the fix?

                            RetroPie v4.5.1 • RPi3 Model B • NorthPada 5V 3A • 128GB SanDisk Ultra Cat.10 microSDXC • 1 x Logitech Wireless Desktop MK250 • 1 x Qanba Q4RAF USB Arcade joysticks • 1 x PS4 Dualshock4 v2 controller • 1 x Mayflash Dolphinbar + Nintendo WiiMote.

                            1 Reply Last reply Reply Quote 0
                            • S
                              SuperJim
                              last edited by 7 Mar 2019, 22:04

                              I don't think I can upload files here.

                              1 Reply Last reply Reply Quote 0
                              • R
                                roslof @SuperJim
                                last edited by 8 Mar 2019, 07:23

                                @SuperJim your steps worked like a charm. Feels amazing to finally be able to play trackball games w/overlays. Thanks Jim & all for helping make this fix a reality after so long...

                                1 Reply Last reply Reply Quote 0
                                • maxbeanzM
                                  maxbeanz
                                  last edited by 21 Mar 2019, 22:27

                                  Does anyone know if this has been fixed yet or do we still have to manually do @SuperJim 's fix above ? I'm about to redo my Pi setup.

                                  mituM 1 Reply Last reply 22 Mar 2019, 04:37 Reply Quote 0
                                  • mituM
                                    mitu Global Moderator @maxbeanz
                                    last edited by 22 Mar 2019, 04:37

                                    @maxbeanz It has only been fixed upstream, but the fix is not yet part of the RetroArch package in RetroPie.

                                    1 Reply Last reply Reply Quote 0
                                    • maxbeanzM
                                      maxbeanz
                                      last edited by 22 Mar 2019, 10:24

                                      @mitu So it's safe to just update RetroArch from source ?

                                      mituM 1 Reply Last reply 22 Mar 2019, 10:29 Reply Quote 0
                                      • mituM
                                        mitu Global Moderator @maxbeanz
                                        last edited by 22 Mar 2019, 10:29

                                        @maxbeanz No and no. The source update would still get you the 1.7.6 version (before the fix was added) and removing the version tag from the source script would not be able compile the latest dev/master (due to https://github.com/libretro/RetroArch/issues/8448).
                                        I suggest to either apply the patch to the 1.7.6 build or wait for the next RetroArch package release.

                                        1 Reply Last reply Reply Quote 0
                                        • maxbeanzM
                                          maxbeanz
                                          last edited by maxbeanz 22 Mar 2019, 10:40

                                          OK thanks, i'll bookmark this page.

                                          One last thing, he says 'enable neon' should be added but it doesn't work for him. Is this going to make much difference for Raspberry Pi 3 ?

                                          mituM 1 Reply Last reply 22 Mar 2019, 11:44 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.

                                            This community forum collects and processes your personal information.
                                            consent.not_received