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

    Python Code Stopping During Emulation

    Scheduled Pinned Locked Moved Help and Support
    3 Posts 3 Posters 1.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Z
      Zetser
      last edited by

      I'm trying to make a portable RPI game system, somewhat similar to the PiGRRL that adafruit has kits for. I'm making my own code for my custom controls, and everything seems to be functioning correctly until I start a game emulator.

      I'm using Python with the uinput module to emulate keyboard strokes with inputs to the GPIO pins. Inside emulationstation, and inside of the standard terminal my code functions correctly and outputs the keystrokes I tell it to. However, when I start a game through emulationstation the Python code just seems to stop working. The keyboard works for controlling the games, but even though my controls are setup to use the same buttons the keyboard is using, nothing happens. After I exit the game the buttons function correctly again.

      I'm guessing that possibly when a game is being run some processes are being paused, or something along those lines.

      Currently I'm using Raspbian. I'm running both my Python code and emulation station through the terminal, so I'm not running the Python code on startup or anything yet (although after I figure this out that is my next step). I'm running them as follows:

      emulationstation & sudo python controls.py

      where controls.py is my controller code.

      Does anyone have any ideas? Any help is much appreciated!

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

        Or it could be related to how retroarch polls for input being incompatible or something. You could start the script from /etc/rc.local to test running it in the background before ES starts etc.

        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
        • meleuM
          meleu
          last edited by meleu

          maybe this thread has some info for you:
          https://retropie.org.uk/forum/topic/2298/raspberry-pi-zero-built-into-a-nes-controller-buttons-won-t-work-in-retroarch-but-do-work-in-emulationstation

          • Useful topics
          • joystick-selection tool
          • rpie-art tool
          • achievements I made
          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.