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

    Retropie setup menu/Runcommand crashing in ES on Ubuntu

    Scheduled Pinned Locked Moved Help and Support
    help
    99 Posts 7 Posters 23.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.
    • mituM
      mitu Global Moderator @DjDiabolik
      last edited by mitu

      Can you post the RetroArch auto-configuration profile for the Dragonrise joystick ?

      yes it's not a problems... can you can you remind me the correct path where these files are located?

      They're in /opt/retropie/configs/all/retroarch-joypads, but I think the test below should be enough.

      sudo sysctl -w dev.tty.legacy_tiocsti=1

      I have to do this after getting the crash above indicated or also the obtain the input/output error ?

      Just run it anytime, but repeat the test and see if the crash occurs again, with the new configuration.

      After maded this... is this a permanent change or is it only applied temporarily? How do I get back to the default Ubuntu settings?

      No, it's temporary until the next restart.

      1 Reply Last reply Reply Quote 0
      • DjDiabolikD
        DjDiabolik
        last edited by

        @mitu ok... In the afternoon or evening I turn on my Intel NUC and do this test.

        About retroarch configs:
        If you thinks it's usefull, I can also try to recreate the configuration files of my various joypads or arcade kit sticks (I think I should do this directly from emulationstation by deleting or moving all current .cfg files including those for the keyboard) :)
        I brought these files with me with the system update.... I wouldn't want some system ID or interrupt to be changed and then the mess comes out :)

        1 Reply Last reply Reply Quote 0
        • DjDiabolikD
          DjDiabolik
          last edited by

          @mitu

          /opt/retropie/configs/all
          

          'retroarch-joypad' it's a simlink to

          /opt/retropie/configs/all/retroarch/autoconfig
          

          It actually contains only one file related to 'dragonrise'.... a file called

          DragonRise Inc. Generic USB Joystick.cfg
          

          It's contain this:

          input_device = "DragonRise Inc. Generic USB Joystick"
          input_driver = "udev"
          input_vendor_id = "121"
          input_product_id = "6"
          input_left_axis = "-0"
          input_state_slot_decrease_axis = "-0"
          input_right_axis = "+0"
          input_state_slot_increase_axis = "+0"
          input_r_btn = "6"
          input_save_state_btn = "6"
          input_down_axis = "+1"
          input_l_btn = "4"
          input_l_btn_label = "LB"
          input_load_state_btn = "4"
          input_y_btn = "0"
          input_y_btn_label = "Y"
          input_x_btn = "2"
          input_menu_toggle_btn = "2"
          input_b_btn = "1"
          input_b_btn_label = "B"
          input_reset_btn = "1"
          input_a_btn = "3"
          input_up_axis = "-1"
          input_select_btn = "8"
          input_select_btn_label = "Back"
          input_start_btn = "9"
          input_start_btn_label = "Start"
          input_exit_emulator_btn = "9"
          input_enable_hotkey_btn = "8"
          input_l2_btn = "5"
          input_r2_btn = "7"
          input_r2_btn_label = "RT"
          

          Now try to open terminal and see if joy2key_sdl.py goes in crash....

          1 Reply Last reply Reply Quote 0
          • DjDiabolikD
            DjDiabolik
            last edited by DjDiabolik

            diabolik@NUC-Ubuntu:~$ sudo sysctl -w dev.tty.legacy_tiocsti=1
            dev.tty.legacy_tiocsti = 1
            diabolik@NUC-Ubuntu:~$
            

            After on same terminal windows tryed this:

            diabolik@NUC-Ubuntu:~$ /opt/retropie/admin/joy2key/joy2key_sdl.py kcub1 kcuf1 kcuu1 kcud1 0x0a 0x20 0x1b 0x00 kpp knp -d
            diabolik@NUC-Ubuntu:~$ 2024-09-19 16:13:18,613 DEBUG  Using SDL Version 2.30.0, PySDL2 version 0.9.16
            2024-09-19 16:13:18,666 DEBUG  Joystick #0 DragonRise Inc. Generic USB Joystick added
            2024-09-19 16:13:18,666 DEBUG  Added configuration for known device DragonRise Inc. Generic USB Joystick, hats: {}, buttons: {6: 'pagedown', 4: 'pageup', 0: 'y', 2: 'x', 1: 'b', 3: 'a'}, axis: {0: [(-1, 'left'), (1, 'right')], 1: [(1, 'down'), (-1, 'up')]}
            2024-09-19 16:13:24,321 DEBUG  Events emitted: ['left']
            2024-09-19 16:13:26,439 DEBUG  Events emitted: ['right']
            2024-09-19 16:13:27,396 DEBUG  Events emitted: ['down']
            2024-09-19 16:13:27,800 DEBUG  Events emitted: ['up']
            /opt/retropie/admin/joy2key/joy2key_sdl.py kcub1 kcuf1 kcuu1 kcud1 0x0a 0x20 0x1b 0x00 kpp knp -d2024-09-19 16:13:28,356 DEBUG  Events emitted: ['left']
            2024-09-19 16:13:31,180 DEBUG  Events emitted: ['right']
             2024-09-19 16:13:31,936 DEBUG  Events emitted: ['down']
                                   2024-09-19 16:13:32,845 DEBUG  Events emitted: ['left']
            2024-09-19 16:13:33,853 DEBUG  Events emitted: ['right']
            2024-09-19 16:13:34,610 DEBUG  Events emitted: ['up']
            /opt/retropie/admin/joy2key/joy2key_sdl.py kcub1 kcuf1 kcuu1 kcud1 0x0a 0x20 0x1b 0x00 kpp knp -d2024-09-19 16:13:35,216 DEBUG  Events emitted: ['down']
                                   2024-09-19 16:13:35,771 DEBUG  Events emitted: ['left']
            2024-09-19 16:13:36,376 DEBUG  Events emitted: ['right']
            2024-09-19 16:13:36,982 DEBUG  Events emitted: ['up']
            /opt/retropie/admin/joy2key/joy2key_sdl.py kcub1 kcuf1 kcuu1 kcud1 0x0a 0x20 0x1b 0x00 kpp knp -d2024-09-19 16:13:37,537 DEBUG  Events emitted: ['down']
                                   2024-09-19 16:13:38,041 DEBUG  Events emitted: ['right']
            2024-09-19 16:13:38,546 DEBUG  Events emitted: ['left']
            2024-09-19 16:13:41,572 DEBUG  Events emitted: ['b']
             2024-09-19 16:13:42,178 DEBUG  Events emitted: ['a']
            
            diabolik@NUC-Ubuntu:~$ /opt/retropie/admin/joy2key/joy2key_sdl.py kcub1 kcuf1 kcuu1 kcud1 0x0a 0x20 0x1b 0x00 kpp knp -d
            diabolik@NUC-Ubuntu:~$ 2024-09-19 16:13:50,575 DEBUG  Using SDL Version 2.30.0, PySDL2 version 0.9.16
            2024-09-19 16:13:50,576 DEBUG  Joystick #0 DragonRise Inc. Generic USB Joystick added
            2024-09-19 16:13:50,576 DEBUG  Added configuration for known device DragonRise Inc. Generic USB Joystick, hats: {}, buttons: {6: 'pagedown', 4: 'pageup', 0: 'y', 2: 'x', 1: 'b', 3: 'a'}, axis: {0: [(-1, 'left'), (1, 'right')], 1: [(1, 'down'), (-1, 'up')]}
            2024-09-19 16:13:52,443 DEBUG  Events emitted: ['right']
            2024-09-19 16:13:52,468 DEBUG  Events emitted: ['right']
            2024-09-19 16:13:53,453 DEBUG  Events emitted: ['right']
            2024-09-19 16:13:53,478 DEBUG  Events emitted: ['right']
            2024-09-19 16:13:54,008 DEBUG  Events emitted: ['right']
            2024-09-19 16:13:54,032 DEBUG  Events emitted: ['right']
            2024-09-19 16:13:54,586 DEBUG  Events emitted: ['left']
            2024-09-19 16:13:54,613 DEBUG  Events emitted: ['left']
            2024-09-19 16:13:55,092 DEBUG  Events emitted: ['up']
            /opt/retropie/admin/joy2key/joy2key_sdl.py kcub1 kcuf1 kcuu1 kcud1 0x0a 0x20 0x1b 0x00 kpp knp -d2024-09-19 16:13:55,117 DEBUG  Events emitted: ['up']
                                   sudo sysctl -w dev.tty.legacy_tiocsti=12024-09-19 16:13:57,843 DEBUG  Events emitted: ['left']
            2024-09-19 16:13:57,867 DEBUG  Events emitted: ['left']
            ^C
            diabolik@NUC-Ubuntu:~$ 
            
            
            

            No more input/output error but i need to terminate the command whit CTRL + C.

            For a purpose test now i want to try to open emulationstation and launch retropie setup script and it's continue to crash immediatelly after press a keyboard button.
            All moviment on arcade stick it's simply ignored and do not cause any effect on the window of retropie setup script.
            I have also tryed to launch a games.... runcommand appears if i press a button on keyboard apparently runcommand option it's be open. Every button or moviment on joypad do nothings.

            Strange.

            EDIT
            OMG Wait a moment... now the RUNCOMMAND works!! Apparently right now i can access to runcommand option menĂ¹ and i can move on all option whit arcade stick.
            Anyway the retropie setup script instead continue to crash after first pression on a keyboard button.

            mituM 1 Reply Last reply Reply Quote 0
            • DjDiabolikD
              DjDiabolik
              last edited by

              @mitu
              just another purpose test... open new terminal and:

              diabolik@NUC-Ubuntu:~$ sudo sysctl -w dev.tty.legacy_tiocsti=0
              dev.tty.legacy_tiocsti = 0
              diabolik@NUC-Ubuntu:~$ /opt/retropie/admin/joy2key/joy2key_sdl.py kcub1 kcuf1 kcuu1 kcud1 0x0a 0x20 0x1b 0x00 kpp knp -d
              diabolik@NUC-Ubuntu:~$ 2024-09-19 18:25:40,148 DEBUG  Using SDL Version 2.30.0, PySDL2 version 0.9.16
              2024-09-19 18:25:40,201 DEBUG  Joystick #0 DragonRise Inc. Generic USB Joystick added
              2024-09-19 18:25:40,201 DEBUG  Added configuration for known device DragonRise Inc. Generic USB Joystick, hats: {}, buttons: {6: 'pagedown', 4: 'pageup', 0: 'y', 2: 'x', 1: 'b', 3: 'a'}, axis: {0: [(-1, 'left'), (1, 'right')], 1: [(1, 'down'), (-1, 'up')]}
              2024-09-19 18:25:42,926 DEBUG  Events emitted: ['left']
              Traceback (most recent call last):
                File "/opt/retropie/admin/joy2key/joy2key_sdl.py", line 557, in <module>
                  sys.exit(main())
                           ^^^^^^
                File "/opt/retropie/admin/joy2key/joy2key_sdl.py", line 549, in main
                  event_loop(configs, joy_map, tty_fd)
                File "/opt/retropie/admin/joy2key/joy2key_sdl.py", line 409, in event_loop
                  fcntl.ioctl(tty_fd, termios.TIOCSTI, c)
              OSError: [Errno 5] Input/output error
              
              

              just to understand... what sets that value that we set to 1?

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

                @DjDiabolik said in Retropie setup menu/Runcommand crashing in ES on Ubuntu:

                No more input/output error but i need to terminate the command whit CTRL + C.

                Yes, that's normal.
                I don't understand whether this works for you after the command I posted. I seems that the joystick works to command runcommand, but not the keyboard ? Confusing.

                1 Reply Last reply Reply Quote 0
                • LolonoisL
                  Lolonois @DjDiabolik
                  last edited by

                  @DjDiabolik said in Retropie setup menu/Runcommand crashing in ES on Ubuntu:

                  what sets that value that we set to 1?

                  It forces the Linux kernel to allow a potential unsafe system call which mimics tty inputs. It can be a security vulnerability when crafted input is processed as the input is not sanitized. This long standing security loophole was fixed with kernel 6.2 onwards, hence the IOError respective crash. With the setting dev.tty.legacy_tiocsti=1 the pre 6.2 kernel behaviour is restored.

                  About the system call and the TIOCSTI value see man 2 ioctl and man 2 ioctl_tty (FWIW section 2 of man is for system calls).

                  The security implications are explained here: https://ruderich.org/simon/notes/su-sudo-from-root-tty-hijacking

                  HTH

                  DjDiabolikD 1 Reply Last reply Reply Quote 0
                  • DjDiabolikD
                    DjDiabolik @Lolonois
                    last edited by

                    @Lolonois said in Retropie setup menu/Runcommand crashing in ES on Ubuntu:

                    It forces the Linux kernel to allow a potential unsafe system call which mimics tty inputs. It can be a security vulnerability when crafted input is processed as the input is not sanitized. This long standing security loophole was fixed with kernel 6.2 onwards, hence the IOError respective crash. With the setting dev.tty.legacy_tiocsti=1 the pre 6.2 kernel behaviour is restored.

                    About the system call and the TIOCSTI value see man 2 ioctl and man 2 ioctl_tty (FWIW section 2 of man is for system calls).

                    The security implications are explained here: https://ruderich.org/simon/notes/su-sudo-from-root-tty-hijacking

                    HTH

                    Very great explanation.... I'm not an expert, in fact it was just a trivial curiosity of the case :)

                    @mitu said in Retropie setup menu/Runcommand crashing in ES on Ubuntu:

                    I don't understand whether this works for you after the command I posted. I seems that the joystick works to command runcommand, but not the keyboard ? Confusing.

                    It seems that the "retropie setup script" terminal crash issue and the problem of the "runcommand" options being inaccessible (every button pressed on the arcade stick seemed to be ignored) they are two distinct and in any case unconnected problems.
                    Try to explain better:

                    With dev.tty.legacy_tiocsti=1 :

                    • Choose and open a game. The "runcommand" window appear. I can reach the "runcommand" option also if i press a button on my "arcade stick" and i can navigate all voices in the terminal windows.

                    With dev.tty.legacy_tiocsti=0 :

                    • Choose and open a game. "Runcommand" window appear. Every button i press on my "arcade stick" it's like they're being ignored. Sometime, after two or three buttons pressed, the system crash report windows appear and i can send system report (I still haven't figured out who, what and where he sends this information to).
                    • For open the "Runcommand" option i need to press any button on the keyboard. All "runcommand" voices can be navigate only by keyboard using the arrow keys. Apparently joy2key not work.

                    whatever the value of "dev.tty.legacy_tiocsti" is instead It has no effect on the "retropie setup script" issue crash. Every other terminal windows launched from ES continue to crash like "EsThemes" "Show Ip" "RunCommand Option" etc etc.

                    If I explain it and write it in my language in Italian then you can translate it into English do you think it's better? Maybe that way I can explain the situation better.

                    1 Reply Last reply Reply Quote 0
                    • DjDiabolikD
                      DjDiabolik
                      last edited by DjDiabolik

                      @mitu and all other user partecipated here :)

                      For made runcommand works look what did i do..It's a rude method but at the moment I don't see any alternatives:

                      • create an "alternative" retropie.desktop on .local/share/application . This alternative .desktop point a file .sh :
                      [Desktop Entry]
                      Type=Application
                      Exec=/usr/bin/retropie.sh
                      Hidden=false
                      NoDisplay=false
                      X-GNOME-Autostart-enabled=true
                      Name[de_DE]=RetroPie
                      Name=RetroPie
                      Comment[de_DE]=RetroPie
                      Comment=retropie
                      Icon=/usr/local/share/icons/retropie.svg
                      Categories=Game
                      

                      retropie.sh it's contain:

                      #!/bin/bash
                      
                      file=/tmp/file.$PPID
                       
                      if ! [ -f $file ]; 
                      then 
                          echo 1 >$file && sleep 1 && rm $file
                      else
                          sleep 10 && exit 0
                      fi
                      
                      _isRunning() {
                          ps -o comm= -C "$1" 2>/dev/null | grep -x "$1" >/dev/null 2>&1
                      }
                      
                      if ! _isRunning emulationstatio; then
                          sudo sysctl -w dev.tty.legacy_tiocsti=1
                          gnome-terminal --full-screen --hide-menubar -- emulationstation
                          sudo sysctl -w dev.tty.legacy_tiocsti=0
                      
                      fi
                      
                      exit 0
                      

                      In this mode i'm "vurnerable" only when emulationstation it's running... and during that i can obtain the runcommand option work.

                      1 Reply Last reply Reply Quote 0
                      • DjDiabolikD
                        DjDiabolik
                        last edited by

                        @mitu and @Lolonois

                        And have some news... from Today also whit dev.tty.tiocsti=1 joy2key start to crash anyway.

                        Look here:

                        diabolik@NUC-Ubuntu:~$ sudo sysctl -w dev.tty.legacy_tiocsti=1
                        dev.tty.legacy_tiocsti = 1
                        diabolik@NUC-Ubuntu:~$ /opt/retropie/admin/joy2key/joy2key_sdl.py kcub1 kcuf1 kcuu1 kcud1 0x0a 0x20 0x1b 0x00 kpp knp -d
                        diabolik@NUC-Ubuntu:~$ 2024-09-23 17:30:31,527 DEBUG  Using SDL Version 2.30.0, PySDL2 version 0.9.16
                        2024-09-23 17:30:31,580 DEBUG  Joystick #0 DragonRise Inc. Generic USB Joystick added
                        2024-09-23 17:30:31,580 DEBUG  Added configuration for known device DragonRise Inc. Generic USB Joystick, hats: {}, buttons: {6: 'pagedown', 4: 'pageup', 0: 'y', 2: 'x', 1: 'b', 3: 'a'}, axis: {0: [(-1, 'left'), (1, 'right')], 1: [(1, 'down'), (-1, 'up')]}
                        2024-09-23 17:30:35,213 DEBUG  Events emitted: ['left']
                        Traceback (most recent call last):
                          File "/opt/retropie/admin/joy2key/joy2key_sdl.py", line 557, in <module>
                            sys.exit(main())
                                     ^^^^^^
                          File "/opt/retropie/admin/joy2key/joy2key_sdl.py", line 549, in main
                            event_loop(configs, joy_map, tty_fd)
                          File "/opt/retropie/admin/joy2key/joy2key_sdl.py", line 409, in event_loop
                            fcntl.ioctl(tty_fd, termios.TIOCSTI, c)
                        OSError: [Errno 5] Input/output error
                        

                        From right now Ubuntu 24.04.1 LTS it's not more capable to use runcommand and retropie ecosystem.

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

                          @DjDiabolik said in Retropie setup menu/Runcommand crashing in ES on Ubuntu:

                          And have some news... from Today also whit dev.tty.tiocsti=1 joy2key start to crash anyway.

                          I don't see why the workaround wouldn't work anymore - I suggest you re-check that the sudo sysctl -w dev.tty.legacy_tiocsti=1 is run before your tests.
                          I'm working on a solution to eliminate the workaround and the cause of the crash, but it's not yet fully tested.

                          1 Reply Last reply Reply Quote 1
                          • DjDiabolikD
                            DjDiabolik
                            last edited by

                            @mitu
                            I can't even explain it to myself why it doesn't work anymore.. lol :)

                            For right now my retropie.sh it's that:

                            #!/bin/bash
                            
                            sudo sysctl -w dev.tty.legacy_tiocsti=1
                            
                            file=/tmp/file.$PPID
                             
                            if ! [ -f $file ]; 
                            then 
                                echo 1 >$file && sleep 1 && rm $file
                            else
                                sleep 10 && exit 0
                            fi
                            
                            _isRunning() {
                                ps -o comm= -C "$1" 2>/dev/null | grep -x "$1" >/dev/null 2>&1
                            }
                               
                            if ! _isRunning emulationstatio; then
                                #gnome-terminal --full-screen --hide-menubar -e emulationstation
                                #sudo sysctl -w dev.tty.legacy_tiocsti=1
                                gnome-terminal --full-screen --hide-menubar -- emulationstation
                                #sudo sysctl -w dev.tty.legacy_tiocsti=0
                                #sudo gedit
                            
                            fi
                            
                            sudo sysctl -w dev.tty.legacy_tiocsti=0
                            
                            exit 0
                            

                            Look right now.. i have tryed to put the tiocsti = 1 and 0 before and after emulationstation runned.
                            It seems like they are being ignored...
                            And i ask... why ?

                            The strange things ? If i open manually a terminal windows and i manually enable the tiocsti and only after that i execute emulationstation runcommand work.
                            If i try for .sh not work... strange.

                            1 Reply Last reply Reply Quote 0
                            • DjDiabolikD
                              DjDiabolik
                              last edited by

                              OMG... i have problably understand what's my issue... look that:

                              diabolik@NUC-Ubuntu:~$ /usr/bin/retropie.sh
                              dev.tty.legacy_tiocsti = 1
                              dev.tty.legacy_tiocsti = 0
                              

                              Here i have tryed to launch retropie.sh from a manual opened terminal.... the tiocsti it's correctly setted to 1...

                              But in my case i need to SET this value at 0 only when i exit from emulationstation.

                              On my retropie.sh instead emulationstation it's correctly launched but immediatelly after the tiocsti it's setted back to 0 and runcommand it's not accessible :)

                              I think I'll avoid resetting it to zero for now....We said that the setting resets when the system reboots. I just hope I don't expose my NUC Mini PC to any risks during daily use...

                              1 Reply Last reply Reply Quote 0
                              • DjDiabolikD
                                DjDiabolik
                                last edited by DjDiabolik

                                Lol... founded another workaround..... right now my .local/share/application/retropie.desktop :

                                [Desktop Entry]
                                Type=Application
                                Exec=gnome-terminal --full-screen --hide-menubar -- /usr/bin/retropie.sh
                                Hidden=false
                                NoDisplay=false
                                X-GNOME-Autostart-enabled=true
                                Name[de_DE]=RetroPie
                                Name=RetroPie
                                Comment[de_DE]=RetroPie
                                Comment=retropie
                                Icon=/usr/local/share/icons/retropie.svg
                                Categories=Game
                                

                                And this /usr/bin/retropie.sh :

                                #!/bin/bash
                                
                                sudo sysctl -w dev.tty.legacy_tiocsti=1
                                
                                file=/tmp/file.$PPID
                                 
                                if ! [ -f $file ]; 
                                then 
                                    echo 1 >$file && sleep 1 && rm $file
                                else
                                    sleep 10 && exit 0
                                fi
                                
                                _isRunning() {
                                    ps -o comm= -C "$1" 2>/dev/null | grep -x "$1" >/dev/null 2>&1
                                }
                                   
                                if ! _isRunning emulationstatio; then
                                    emulationstation
                                    #sudo sysctl -w dev.tty.legacy_tiocsti=1
                                    #gnome-terminal --full-screen --hide-menubar -- emulationstation
                                    #sudo sysctl -w dev.tty.legacy_tiocsti=0
                                    #sudo gedit
                                
                                fi
                                
                                sudo sysctl -w dev.tty.legacy_tiocsti=0
                                
                                exit 0
                                

                                This apparently it's a good workaround.
                                basically run the retropie.sh directly in a windows terminal, the tiocsti it's setted correctly to 1. And after that emulationstation it's launched.
                                Since it is launched in a terminal window runcommand is now properly accessible also from my arcade stick..
                                So when i choose to exit from emulationstation tiocsti it's setted again to 0 as default and terminal windows it's closed himself.

                                I thinks it's a good solution.

                                Thanks in advance for support and and for future fixes that will give back the possibility to use the retropie setup script directly from emulationstation.

                                -- EDIT --

                                Little TWEAK Operation on retropie.sh... now it's :

                                #!/bin/bash
                                
                                file=/tmp/file.$PPID
                                 
                                if ! [ -f $file ]; 
                                then 
                                    echo 1 >$file && sleep 1 && rm $file
                                else
                                    sleep 10 && exit 0
                                fi
                                
                                _isRunning() {
                                    ps -o comm= -C "$1" 2>/dev/null | grep -x "$1" >/dev/null 2>&1
                                }
                                   
                                if ! _isRunning emulationstatio; then
                                    sudo sysctl -w dev.tty.legacy_tiocsti=1
                                    emulationstation
                                    sudo sysctl -w dev.tty.legacy_tiocsti=0
                                    #gnome-terminal --full-screen --hide-menubar -- emulationstation
                                    #sudo gedit
                                else
                                    wmctrl -a emulationstation
                                fi
                                
                                exit 0
                                

                                I have to install wmctrl to set focus to emulationstation if it's already runned.

                                All this it's to prevent a double istance if you made a erroneous double on retropie icon on left dock :)

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

                                  The latest RetroPie-Setup version updares joy2key to a new version that's no longer dependant on dev.tty.legacy_tiocsti being modified from the default. You can give it a try by updating RetroPiet-Setup, joy2key will be automatically updated in the process.

                                  DjDiabolikD 1 Reply Last reply Reply Quote 0
                                  • DjDiabolikD
                                    DjDiabolik @mitu
                                    last edited by

                                    @mitu

                                    Yes I have seen the recent and latest commits.
                                    Now I do all the updates... I edit everything and remove the "sysctl" entries from my retropie.sh and update you.

                                    Should this also fix the 'retropie setup script' thing that crashes when launched from emulationstation?

                                    1 Reply Last reply Reply Quote 0
                                    • DjDiabolikD
                                      DjDiabolik
                                      last edited by

                                      @mitu no friends.... apparently the new joy2key it's not resolve the issue.

                                      I have try to run a games and press a button during runcommand windows and there's happen this:
                                      c214e1da-2b6b-4332-a8d1-66a4bd4069bd-immagine.png

                                      Open the detail it's appear this:
                                      1c36faef-0c7c-4a8f-a3d3-d2edc686dde2-immagine.png

                                      If you thinks it's usefull i can also try to run joy2key from terminal........ i try to edit this same post in a minute.

                                      1 Reply Last reply Reply Quote 0
                                      • DjDiabolikD
                                        DjDiabolik
                                        last edited by

                                        In a terminal it's happen this:
                                        54ba29b6-4fac-4e5c-88fe-be313eaea2da-immagine.png

                                        Try to lauch 'Retropie setup script' and other tools from emulationstation all goes in crash after you press a key or touch somethings on my arcade stick.

                                        Look at here... for works good from terminal apparently i need to launch joy2key on sudo right now:

                                        diabolik@NUC-Ubuntu:~$ sudo /opt/retropie/admin/joy2key/joy2key_sdl.py kcub1 kcuf1 kcuu1 kcud1 0x0a 0x20 0x1b 0x00 kpp knp -d
                                        2024-10-16 03:21:20,549 DEBUG  Debugging enabled, running in foreground
                                        2024-10-16 03:21:20,549 DEBUG  Cannot determine input code for "0x00", value ignored
                                        2024-10-16 03:21:20,549 DEBUG  Cannot determine input code for "0x00", value ignored
                                        2024-10-16 03:21:20,549 DEBUG  Joy map:
                                         {'left': 105, 'right': 106, 'up': 103, 'down': 108, 'a': 28, 'b': 57, 'x': 1, 'y': 0, 'pageup': 104, 'pagedown': 109}
                                        2024-10-16 03:21:23,482 DEBUG  Using SDL Version 2.30.0, PySDL2 version 0.9.16
                                        2024-10-16 03:21:23,483 DEBUG  Creating uinput keyboard devices with events: [(1, 105), (1, 106), (1, 103), (1, 108), (1, 28), (1, 57), (1, 1), (1, 0), (1, 104), (1, 109)]
                                        2024-10-16 03:21:23,536 DEBUG  Joystick #0 DragonRise Inc. Generic USB Joystick added
                                        2024-10-16 03:21:23,536 DEBUG  Added configuration for known device DragonRise Inc. Generic USB Joystick, hats: {}, buttons: {6: 'pagedown', 4: 'pageup', 0: 'y', 2: 'x', 1: 'b', 3: 'a'}, axis: {0: [(-1, 'left'), (1, 'right')], 1: [(1, 'down'), (-1, 'up')]}
                                        2024-10-16 03:21:32,167 DEBUG  Events to emit: ['down']
                                        2024-10-16 03:21:32,168 DEBUG  Emitting input code 108
                                        ^[[B2024-10-16 03:21:41,959 DEBUG  Events to emit: ['up']
                                        2024-10-16 03:21:41,959 DEBUG  Emitting input code 103
                                        ^[[A2024-10-16 03:21:43,827 DEBUG  Events to emit: ['left']
                                        2024-10-16 03:21:43,828 DEBUG  Emitting input code 105
                                        ^[[D2024-10-16 03:21:45,544 DEBUG  Events to emit: ['right']
                                        2024-10-16 03:21:45,544 DEBUG  Emitting input code 106
                                        ^[[C^C2024-10-16 03:21:47,829 DEBUG  /opt/retropie/admin/joy2key/joy2key_sdl.py exiting cleanly
                                        diabolik@NUC-Ubuntu:~$
                                        

                                        Emulationstation how use current joy2key ? By sudo or not ?

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

                                          @DjDiabolik said in Retropie setup menu/Runcommand crashing in ES on Ubuntu:

                                          Emulationstation how use current joy2key ? By sudo or not ?

                                          The RetroPie setup (or the other dialog based configuration tools) is using sudo to launch, but not runcommand. Your user needs to be part of the input group, which apparently is not done by default on Ubuntu ?

                                          I'll modify the installation routine to make sure the user is part of the input group, so the 1st error (for runcommand ) does not happen anymore.
                                          EDIT: ok, update RetroPie-Setup and then re-login/reboot, the next run of runcommand (starting a game) should not give you an error.

                                          1 Reply Last reply Reply Quote 0
                                          • DjDiabolikD
                                            DjDiabolik
                                            last edited by

                                            @mitu ok... i have unpdate 'retropie setup script' to last recent commit.... and reboot my ubuntu 24.04.1 LTS

                                            Apparently from terminal nothings it's changed :

                                            diabolik@NUC-Ubuntu:~$ /opt/retropie/admin/joy2key/joy2key_sdl.py kcub1 kcuf1 kcuu1 kcud1 0x0a 0x20 0x1b 0x00 kpp knp -d
                                            2024-10-16 12:07:25,089 DEBUG  Debugging enabled, running in foreground
                                            2024-10-16 12:07:25,089 DEBUG  Cannot determine input code for "0x00", value ignored
                                            2024-10-16 12:07:25,089 DEBUG  Cannot determine input code for "0x00", value ignored
                                            2024-10-16 12:07:25,090 DEBUG  Joy map:
                                             {'left': 105, 'right': 106, 'up': 103, 'down': 108, 'a': 28, 'b': 57, 'x': 1, 'y': 0, 'pageup': 104, 'pagedown': 109}
                                            2024-10-16 12:07:27,766 DEBUG  Using SDL Version 2.30.0, PySDL2 version 0.9.16
                                            2024-10-16 12:07:27,766 DEBUG  Creating uinput keyboard devices with events: [(1, 105), (1, 106), (1, 103), (1, 108), (1, 28), (1, 57), (1, 1), (1, 0), (1, 104), (1, 109)]
                                            Traceback (most recent call last):
                                              File "/opt/retropie/admin/joy2key/joy2key_sdl.py", line 608, in <module>
                                                sys.exit(main())
                                                         ^^^^^^
                                              File "/opt/retropie/admin/joy2key/joy2key_sdl.py", line 600, in main
                                                event_loop(configs, joy_map)
                                              File "/opt/retropie/admin/joy2key/joy2key_sdl.py", line 334, in event_loop
                                                kbd = uinput.Device(events=keyboard_events, name="Joy2Key Keyboard")
                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                              File "/usr/lib/python3/dist-packages/uinput/__init__.py", line 178, in __init__
                                                self.__uinput_fd = fd or fdopen()
                                                                         ^^^^^^^^
                                              File "/usr/lib/python3/dist-packages/uinput/__init__.py", line 84, in fdopen
                                                return _libsuinput.suinput_open()
                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
                                              File "/usr/lib/python3/dist-packages/uinput/__init__.py", line 70, in _open_error_handler
                                                raise OSError(code, msg)
                                            PermissionError: [Errno 13] Failed to open the uinput device: Permission denied
                                            diabolik@NUC-Ubuntu:~$
                                            

                                            From emulationstation i need to test to run one games..... edit in a moment.

                                            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.