RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Powerblock proper ES shutdown

    Scheduled Pinned Locked Moved ControlBlock, PowerBlock & Co.
    powerblockmausberrshutdownswitch
    24 Posts 6 Posters 14.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.
    • lostlessL
      lostless @Capeman
      last edited by

      @capeman find a game that makes it obvious. Like one of the gba castlevania games. Save, kill one enemy. Check the xp before and after. Save and see what the xp is after the shutdown.

      CapemanC 1 Reply Last reply Reply Quote 0
      • CapemanC
        Capeman @lostless
        last edited by

        @lostless Right, that was my plan. I'll test it after my wife watches her netflix, and report back.

        Vector Artist, Designer and Maker of Stuff: Laser Cut Atari / Pixel Theme Bartop

        lostlessL 1 Reply Last reply Reply Quote 0
        • lostlessL
          lostless @Capeman
          last edited by

          @capeman i beat you to it. It does save! I will still keep auto on just in case of power outage. But it does solve then default delema of losing my save using a switch because I didn't to exit out of the emulator.

          1 Reply Last reply Reply Quote 2
          • CapemanC
            Capeman
            last edited by Capeman

            You indeed beat me to it, but i just got done finishing testing. Appears to be working for me too. I read a bit more into it, apparently KILL when used with a properly running non-frozen application can be ignored by the application and treated as a termination call. Most applications will clean exit on a KILL command and not hard exit when not frozen. So yeah, this seem to work just fine.

            Vector Artist, Designer and Maker of Stuff: Laser Cut Atari / Pixel Theme Bartop

            cyperghostC 1 Reply Last reply Reply Quote 1
            • cyperghostC
              cyperghost @Capeman
              last edited by cyperghost

              @capeman It wasn't possible withouth the great work @meleu and his RegEx hacks.

              1 Reply Last reply Reply Quote 1
              • P
                petrockblog Global Moderator
                last edited by

                You are doing awesome work here!
                Do you think that the PowerBlock driver in the repository should be modified or extended in any way?

                CapemanC cyperghostC 2 Replies Last reply Reply Quote 1
                • CapemanC
                  Capeman @petrockblog
                  last edited by Capeman

                  @petrockblog I would vote yes on this! It works flawlessly with ES and retroarch. It is such a simple update to the .sh file and even if doesn't clean exit a non retroarch emulator, it will still exit the old fashioned way and clean exit ES for meta save. So either way it seems pretty harmless.

                  Vector Artist, Designer and Maker of Stuff: Laser Cut Atari / Pixel Theme Bartop

                  1 Reply Last reply Reply Quote 0
                  • cyperghostC
                    cyperghost @petrockblog
                    last edited by

                    @petrockblog said in Powerblock proper ES shutdown:

                    You are doing awesome work here!

                    This one has several fathers.

                    Do you think that the PowerBlock driver in the repository should be modified or extended in any way?

                    Well ... I think the usecase must be cleared. I'm not sure if everybody will take case in the use of emulators. So I would rather prefer you take this sniplet and push it to your github and let the user get the choice to download/use it during driver installation.

                    @meleu What is your opinion?

                    meleuM 1 Reply Last reply Reply Quote 0
                    • meleuM
                      meleu @cyperghost
                      last edited by

                      @cyperghost

                      @meleu What is your opinion?

                      Well. I got my ego massage receiving a compliment from the RetroPie's creator. :-)

                      Oh... You're talking about modifying/extending the PowerBlock's driver in the repo... Well, what we made here is very specific for a RetroPie-EmulationStation setup. Some people use Attract Mode and at some point others will use Pegasus, and maybe there are PowerBlock owners that don't even run RetroPie.

                      Maybe you can put this code in the repo as an option, not as default.

                      That is my opinion.

                      • Useful topics
                      • joystick-selection tool
                      • rpie-art tool
                      • achievements I made
                      P 1 Reply Last reply Reply Quote 0
                      • P
                        petrockblog Global Moderator @meleu
                        last edited by

                        @meleu I agree. I will put that script into the repository as alternative shutdown script. Thanks!

                        cyperghostC 1 Reply Last reply Reply Quote 2
                        • cyperghostC
                          cyperghost @petrockblog
                          last edited by cyperghost

                          @petrockblog
                          There's a update to the code!

                          Version 1.59 --- I update forst posting!

                          Version 1.58 Introduced a method to kill child processes via PPID @cyperghost
                          Version 1.59 is a code polishing done by @meleu

                          SaturnXS 1 Reply Last reply Reply Quote 0
                          • SaturnXS
                            SaturnX @cyperghost
                            last edited by

                            @cyperghost @petrockblog

                            I know this topic a bit old - but I wanted to ask if this is still the best approach for a proper shutdown of a RetroPie/EmulationStation/PowerBlock combo?

                            @petrockblog you mentioned above that you were going to add this into your repo, but it looks like it's not there?

                            I just installed the PowerBlock on my Pi4 last night and it's working well, but I just wanted to add the proper shutdown of ES.

                            Thanks! Apologies for reviving an old thread.

                            lostlessL 1 Reply Last reply Reply Quote 0
                            • lostlessL
                              lostless @SaturnX
                              last edited by

                              @saturnx
                              @cyperghost has released a full power, exit script that works for many power options a while ago. It’s generic and just have to run certain tags from it to get the result you want.
                              https://github.com/crcerror/ES-generic-shutdown

                              SaturnXS 1 Reply Last reply Reply Quote 0
                              • SaturnXS
                                SaturnX @lostless
                                last edited by

                                @lostless Thanks!

                                I've seen that, but when using the PowerBlock, that script would be overkill since the PowerBlock driver already handles monitoring of the status of the switch and simply calls etc/powerblockswitchoff.sh

                                So really all that's necessary is ensuring the proper shutdown calls are made within that script to ensure the safe shutdown of ES, etc..

                                I'll dig through the generic script and compare - just wanted to check in to see there had been any updates/improvements or other best practices for shutting down ES gracefully.

                                lostlessL 1 Reply Last reply Reply Quote 0
                                • lostlessL
                                  lostless @SaturnX
                                  last edited by lostless

                                  @saturnx all you really have to do is, I think, is point to a Different file in that call. No need to edit the powerblockswitchoff.sh file.
                                  Change the main script to be the SHUTDOWNSCRIPT= to
                                  /home/pi/RetroPie/scripts/multi_switch.sh --es-poweroff
                                  After you install the generic multi switch script. You don’t have to start it as boot up. Just install it where it says to install according to the get hub page and you can use it. No need to use the the scripts ability to sense a switch
                                  Test it out and see if it works.

                                  SaturnXS 1 Reply Last reply Reply Quote 1
                                  • SaturnXS
                                    SaturnX @lostless
                                    last edited by

                                    @lostless thanks!

                                    Took a slightly different approach and called the multi-switch shutdown script from etc/powerblockswitchoff.sh So that I’d keep the main driver intact.

                                    Thanks again! This was something so simple that I overlooked. Totally missed that the script could issue the necessary ES shutdown without tying it to a physical switch.

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