• 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

Emulationstation CPU usage

Scheduled Pinned Locked Moved Help and Support
cpuemulationstatio
24 Posts 7 Posters 6.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.
  • S
    Sano
    last edited by 24 Jun 2017, 07:44

    Since my last full update, ES is using nearly 30% of a CPU core when idle, on my RPi 3 according to top.
    It was around 6% before the update. No video, no screensaver, no game added (<150), rebooted, waited, ... No change.
    Does anyone can relate ?

    F 1 Reply Last reply 7 Apr 2018, 16:09 Reply Quote 0
    • C
      cyperghost
      last edited by 25 Jun 2017, 16:02

      Can't confirm CPU load is still 6% for ES only
      I updated from 4.1 to 4.2....

      1 Reply Last reply Reply Quote 0
      • P
        pjft
        last edited by 25 Jun 2017, 21:34

        I can't, but would be interested in at least understanding if there's a problem.

        Do you remember what your previous EmulationStation version was?

        I'll have to check on my end what CPU usage it has while idle. I don't recall it being that high, though I also don't recall it being as low as 6% unfortunately :)

        1 Reply Last reply Reply Quote 0
        • S
          Sano
          last edited by Sano 26 Jun 2017, 06:10

          Nevermind, it seems I just didn't wait long enough :)
          When launching ES (boot or after quitting a game), the CPU usage ranges from 30 to 40 percent during maybe 15-20 min. Then it falls back to the usual ~6%.
          I don't remember this behaviour with previous versions, but since it's limited in time, this surely can be disregarded.
          Sorry for the useless post...

          1 Reply Last reply Reply Quote 0
          • P
            pjft
            last edited by pjft 26 Jun 2017, 06:35

            Well, I wouldn't call it a useless post per se - 15-20 mins seems like an awfully long - and random - period to stay at such high utilization.

            Would love to see if others experience it as well, and/or whether you consistently replicate it on your end as well. I'll see what happens on my end as well, but I struggle to imagine what may be happening on ES that would make that happen - or at least, what would have changed.

            The only thing that comes to mind is the Pi after a while deciding to throttle down the CPU usage to 600Mhz given low utilization, but... shouldn't we expect to observe the opposite, then?

            I'm not sure. I'll see if on my end I experience that.

            One thing you may try to observe is, when the CPU is being highly utilized, what's the CPU speed, and when it goes to 6%, what's the CPU speed as well.

            You can get it in Mhz by dividing this by 1000:

             cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
            

            If you see there's a specific core that's taking the load (maybe htop can be your friend here, but you need to install it), you can change cpu0by 1, 2 or 3.

            Let me know.

            S 1 Reply Last reply 26 Jun 2017, 07:07 Reply Quote 0
            • S
              Sano @pjft
              last edited by 26 Jun 2017, 07:07

              @pjft
              No need for htop, top can display CPU usage per core by pressing 1 ;)
              And as far as I remember a single core is more used, yes.

              I'm at work now, but installing sar (sysstat package) may also help to diagnose...

              1 Reply Last reply Reply Quote 1
              • S
                Sano
                last edited by Sano 26 Jun 2017, 18:28

                Ok I just did some testing using pidstat.

                First, I was wrong, the CPU at 30-40% only last 5 minutes, but is triggered everytime I press a button (scroll carousel, selact a system, ...).
                So with idle system, ES is around 6% CPU.
                Do anything, it rise to 30-40 percent, and after 5 minutes go in screensaver mode and CPU usage fall to ~6% again.
                If I continue doing "things" (browsing games/systems) the CPU stay at 30-40% and only goes down after 5 minutes not touching anything.

                Note than manually launching screensaver with select does not work, CPU usage stay high again for 5 minutes.

                P 1 Reply Last reply 26 Jun 2017, 21:24 Reply Quote 1
                • P
                  pjft @Sano
                  last edited by 26 Jun 2017, 21:24

                  @Sano Hm. I see.

                  And are you confident that this was not the case in the previous ES versions? Would you feel comfortable installing an older version to test it out?

                  It seems it only drops when it goes to screensaver mode, is that correct?

                  Also, what do you mean by launching screensaver with select not working - do you mean it doesn't go to the screensaver, or does it go into screensaver mode but it doesn't lower the CPU? I assume it's the latter, which makes some sense knowing the code, but I'm worried about the suggestion that this may be a new thing, because that would warrant some further investigation. :/

                  1 Reply Last reply Reply Quote 1
                  • S
                    Sano
                    last edited by 26 Jun 2017, 21:34

                    I'm not 100% confident it wasn't the case with previous versions, but I can't remember seeing this behaviour.
                    My memories only contain an average of around 6% CPU used, as seen in some forums : see here https://www.reddit.com/r/RetroPie/comments/4fz878/what_is_emulationstation_doing_when_its_doing/

                    Yes, the CPU drops when going in screensaver mode, but (yes again) only after the timeout. Forcing screensaver with select key on the carousel doesn't lower the CPU consumption.

                    Is there an ES package archive repository for me to try an old version ?

                    P 1 Reply Last reply 26 Jun 2017, 21:38 Reply Quote 1
                    • P
                      pjft @Sano
                      last edited by 26 Jun 2017, 21:38

                      @Sano Are you comfortable compiling things on your Pi?

                      There seems to be an old 2.1.4 version here:

                      https://github.com/RetroPie/EmulationStation/releases

                      But it's the source code, not a binary.

                      If you're comfortable compiling things, though, we could even go for a git bisect, to track the change down, but first I'd try this version from February - which is sufficiently (I'd even say "scarily") old enough to test if it's a new thing or not.

                      We can then try to narrow things down further if needed.

                      Let me know, and thanks for helping with this!

                      1 Reply Last reply Reply Quote 0
                      • S
                        Sano
                        last edited by 26 Jun 2017, 21:46

                        Don't you want to have some confirmation of other users before enabling panic mode ? :)

                        I used to compile my linux kernel/drivers by myself, but it was nearly 20 years ago. apt killed my compilation skills... That said, I could give a try if needed, but on my "production" unit (don't have another Pi/SD to test).

                        Moreover, I try to make a full update at least once a month, so IMHO, and if the problem is not only in my head (or on my setup), the origin won't be more than a few weeks old.

                        P 1 Reply Last reply 26 Jun 2017, 22:17 Reply Quote 1
                        • C
                          cyperghost
                          last edited by 26 Jun 2017, 21:55

                          There might be an issue.

                          I use top for monitoring cpu usage
                          I use IO theme

                          You start ES 99% CPU usage - that's okay
                          ES is started and connected with BT controller - CPU usage is 6-8%
                          You scroll around the carousel: 9-10% usage and it does not drop down
                          You open Emulation System (Amiga for ex) it stays to 14-15%
                          The Screensaver is activated by timer CPU usage drops down to 3% (does not work if you activate screen saver via select)

                          I restart ES:
                          CPU usage is 6-8%
                          I scroll around... it raises 10% drops to 12%
                          I open Emulation System ... CPU usage 15%
                          It depends heavily on roms in folder 4000 roms CPU usage 20%, 10 roms in folder 10%

                          Do you use interrupts for button managment or trigger timer?

                          1 Reply Last reply Reply Quote 1
                          • P
                            pjft @Sano
                            last edited by 26 Jun 2017, 22:17

                            @Sano Yeah, you're right :)

                            Let's leave it at that for now, but I'll keep it on the backburner.

                            I know @Hex has forked ES to build a less-CPU-consuming version of it, so maybe this has been going on for a while.

                            1 Reply Last reply Reply Quote 0
                            • H
                              Hex
                              last edited by Hex 26 Jun 2017, 23:12

                              Thanks @pjft for bringing me into the loop. My build was mostly for Pi zero /1 which would suffer heavily due to constant rendering of the screen. This doesn't mean there are any disadvantages on using it on Pi2/3. I would be glad to create a production ready branch that can then be installed by users using meleu's script.

                              @Sano , @cyperghost would you guys be interested in testing this feature for me? I am interested in submitting this as a feature. It is quite stable for now but not ready for merge. As such testers would be most welcome.

                              @meleu Based on this and many other experiences would you think it would be better if there are some repositories already included in the script. This will create awareness and testers can test branches out without having to hunt for which branches need testing.

                              Sent from 20,000 leagues under the sea.

                              Powersaver Emulation station : https://github.com/hex007/EmulationStation
                              ES dev script : https://github.com/hex007/es-dev/blob/master/es-tests.sh

                              M C 3 Replies Last reply 27 Jun 2017, 00:07 Reply Quote 1
                              • M
                                meleu @Hex
                                last edited by 27 Jun 2017, 00:07

                                @Hex I'm not sure... Once the branch is merged there's no need to keep it in the list IMHO.

                                I'm planning to work out my git-fu and try to find a way to get the branches from the open Pull Requests list in the EmulationStation repo and build a list based on that info. It would pretty cool, huh? :-)

                                It seems that you're more experienced with git, do you know how to do that (get a list of open PRs and their respective repo/branch)?

                                I've found some documentation here but didn't find enough free time to dive into it. I am planning to use curl to get the needed info...

                                • Useful topics
                                • joystick-selection tool
                                • rpie-art tool
                                • achievements I made
                                M 1 Reply Last reply 27 Jun 2017, 00:21 Reply Quote 0
                                • M
                                  meleu @meleu
                                  last edited by 27 Jun 2017, 00:21

                                  do you know how to do that (get a list of open PRs and their respective repo/branch)?

                                  Getting the info in a JSON format:
                                  https://api.github.com/repos/RetroPie/EmulationStation/pulls?status=open

                                  Now I need some time to learn how to use jq:
                                  https://stedolan.github.io/jq/

                                  Looks promising! I'll try to release something next weekend! ;-)

                                  • Useful topics
                                  • joystick-selection tool
                                  • rpie-art tool
                                  • achievements I made
                                  1 Reply Last reply Reply Quote 0
                                  • H
                                    Hex
                                    last edited by 27 Jun 2017, 00:26

                                    Json makes it very easy. I was already starting with curl (mobile page)+regex. I will let you know if i finish .

                                    Sent from 20,000 leagues under the sea.

                                    Powersaver Emulation station : https://github.com/hex007/EmulationStation
                                    ES dev script : https://github.com/hex007/es-dev/blob/master/es-tests.sh

                                    1 Reply Last reply Reply Quote 1
                                    • H
                                      Hex
                                      last edited by Hex 27 Jun 2017, 01:09

                                      @meleu How about this

                                      Get page from github

                                      curl https://api.github.com/repos/RetroPie/EmulationStation/pulls?status=open > page
                                      

                                      Loop over all PRs

                                      n_pr=$(($(cat page | ./jq-linux64 'keys | length')-1))
                                      for i in `seq 0 "$n_pr"`; do
                                      cat page | ./jq-linux64 ".[$i] | {name: .user.login, title: .title, branch: .head.ref}"
                                      # Do individual processing here eg. add each item to list
                                      echo "Yolo \m/"
                                      done
                                      # Or get all PRs in single operation
                                      cat page | ./jq-linux64 ".[] | {name: .user.login, title: .title, branch: .head.ref}"

                                      Output

                                      {
                                        "name": "pjft",
                                        "title": "Adding support for \"All\", \"Favorites\" and \"Last Played\" systems",
                                        "branch": "RetroPie-Virtual-Systems-PR"
                                      }
                                      {
                                        "name": "nschloe",
                                        "title": "various code fixes",
                                        "branch": "coverity-retropie"
                                      }
                                      {
                                        "name": "PronkMedia",
                                        "title": "Added a new (missing) transition style, 'carousel slide'.",
                                        "branch": "master"
                                      }
                                      {
                                        "name": "sokie",
                                        "title": "Implemented favourites system",
                                        "branch": "favourites"
                                      }
                                      {
                                        "name": "seriema",
                                        "title": "OSX compilation fixes",
                                        "branch": "osx-compilation-fixes"
                                      }
                                      
                                      

                                      Sent from 20,000 leagues under the sea.

                                      Powersaver Emulation station : https://github.com/hex007/EmulationStation
                                      ES dev script : https://github.com/hex007/es-dev/blob/master/es-tests.sh

                                      M 1 Reply Last reply 28 Jun 2017, 16:01 Reply Quote 1
                                      • M
                                        meleu @Hex
                                        last edited by 28 Jun 2017, 03:48

                                        @Hex by the way, I have a raspi1 and I'm interested in test your branch. What's its name?

                                        • Useful topics
                                        • joystick-selection tool
                                        • rpie-art tool
                                        • achievements I made
                                        1 Reply Last reply Reply Quote 0
                                        • H
                                          Hex
                                          last edited by Hex 28 Jun 2017, 04:44

                                          @meleu Its my master branch. It has all tweaks and works. I was thinking of separating the feature so that a pull request can be optionally submitted. The only downside is Screensaver is not triggered as the Pi waits for user input and stops rendering new frames as there is literally nothing to do. Although it can be manually triggered by pressing "select" in systems menu

                                          Sent from 20,000 leagues under the sea.

                                          Powersaver Emulation station : https://github.com/hex007/EmulationStation
                                          ES dev script : https://github.com/hex007/es-dev/blob/master/es-tests.sh

                                          1 Reply Last reply Reply Quote 1
                                          20 out of 24
                                          • First post
                                            20/24
                                            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