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 16.0k 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 @V0rt3x667
      last edited by

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

      I think it is an issue with pysdl2.

      Sure, it migh be, but that doesn't explain why the setup script works fine outside of EmulationStation - pysdl2 is used in that case also for joy2key.

      V 1 Reply Last reply Reply Quote 0
      • V
        V0rt3x667 @mitu
        last edited by V0rt3x667

        @mitu @rom11617 Sorry one thing I forgot to mention is to try using a different terminal emulator like alacritty, kitty and I think the Gnome project has a newer terminal out it is called gnome-console.

        R 1 Reply Last reply Reply Quote 0
        • R
          rom11617 @V0rt3x667
          last edited by

          @V0rt3x667 I installed kitty and set as the default terminal emulator. However when Emulationstation loads, I still get the purple colored terminal screen, it doesn't look like kitty. No change to being able to launch runcommand and change the emulators...

          V 1 Reply Last reply Reply Quote 0
          • V
            V0rt3x667 @rom11617
            last edited by V0rt3x667

            @rom11617 Just to clarify did you launch EmulationStation directly from kitty? If you use the RetroPie shortcut it will still launch via gnome-terminal. Thanks.

            R 1 Reply Last reply Reply Quote 0
            • R
              rom11617 @V0rt3x667
              last edited by

              @V0rt3x667 I did launch through retropie shortcut. Duh...I'll try and report back.

              V 1 Reply Last reply Reply Quote 0
              • V
                V0rt3x667 @rom11617
                last edited by

                @rom11617 Hi did you have any luck getting the launch menu working with a controller? Thanks

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

                  And i have just now found i have problably the same issue......... problably also a very similar issue explained here:
                  https://retropie.org.uk/forum/topic/35461/controller-not-working-in-retropie-setup-runcommand-etc/12
                  And here on this thread.

                  I have updated my Mini PC Intel to UBUNTU 24.04.1 LTS..... Emulationstation working.... but if i try to open Retropie Setup or for example the Runcommands setup it's not accept anythigs command!
                  No moviment at all if i use my Controller....... and if i press one button on KEYBOARD all it's crash and it's bring back emulationstation.

                  For example if i open Retropie_setup it's be launch.. but when i touch a button on keyboard all crash and emulationstation bring back on the screen.

                  Apparently if i open retropie_setup script from terminal joy2key works and i can move inside all menù.... retropie_setup for example crash only if i launch it from emulationstation.

                  EDIT
                  @mitu the strange things it's every it's be need to run on terminal by Emulationstation goes in crash after a lot seconds.
                  I have also tryed to open ESThemes.... RunCommand option... Show IP... Config Editor..

                  Every Terminal operation it's opened apparently it's not accept any pressed button from keyboard and from Joystick (so it's joy2key not work??) and the terminal windows crash whitout any apparently error.

                  When you launch a game if you use a keyboard you can change options from runcommand but runcommand not show if i press one button on joystick....

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

                    hi @mitu about 1 minutes ago i have obtain this errors on my PC... look:
                    93e70ac2-ccb3-4412-96d3-152cface163f-immagine.png

                    When i try to open a games i have tryed to open the runcommand menù.... and this errors it's appears.

                    Open the details apparently i can't use copy/paste... need other screenshot:
                    e806d8a5-7dfc-4ad3-942a-af4fe191d2cb-immagine.png

                    Or full image:
                    dd6bf883-6f4b-4d4a-b992-04b77b2d0dd0-immagine.png

                    Scroll down:
                    79ddd5ec-1f1a-499b-878e-9c0cd42cdb8c-immagine.png

                    Also here can provide full screen image:
                    3703d7f5-a683-4d4f-94c7-6354e219184b-immagine.png

                    among the many lines one says:
                    This package does not appear to be installed correctly

                    But it's related to phyton... joy2key himself or again the current kernel ?
                    Onestly i don't have the necessary knowledge to understand that.

                    The strange issue you can't reproduce the issue.. really ?

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

                      it's some news as been explored about this issue ?

                      1 Reply Last reply Reply Quote 0
                      • mituM mitu referenced this topic on
                      • DjDiabolikD
                        DjDiabolik
                        last edited by

                        @mitu
                        For a purpose test i have tryed this from a terminal:

                        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-18 17:36:04,786 DEBUG  Using SDL Version 2.30.0, PySDL2 version 0.9.16
                        2024-09-18 17:36:04,838 DEBUG  Joystick #0 DragonRise Inc. Generic USB Joystick added
                        2024-09-18 17:36:04,838 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-18 17:36:12,101 DEBUG  Events emitted: ['right']
                        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
                        

                        or also in this mode:
                        b46e153c-ebf5-4d17-b630-f9681ae7575c-immagine.png

                        It's the crash appears on runcommand windows....

                        We can confirm it's joy2key create all issue here ?

                        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:

                          We can confirm it's joy2key create all issue here ?

                          Could be that, or the SDL2 library present on Ubuntu. Can you post the RetroArch auto-configuration profile for the Dragonrise joystick ?

                          EDIT: actually, this may not be related to the configuration of the joystick. Can you run, from a terminal:

                          sudo sysctl -w dev.tty.legacy_tiocsti=1
                          

                          and - if you don't get an error - repeat the test ?

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

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

                            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?
                            In theory I should have 2 profiles with a similar name because sometime i use two similar arcade kit on this retropie setup to play with friends on retrogaming evenings :)

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

                            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 ?
                            After maded this... is this a permanent change or is it only applied temporarily? How do I get back to the default Ubuntu settings?

                            mituM 1 Reply Last reply Reply Quote 0
                            • 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
                                            • 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.