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

    Issues re-focusing EmulationStation (RaspberryCast)

    Scheduled Pinned Locked Moved Help and Support
    raspberrycastemulationstatiofocusscript
    8 Posts 3 Posters 1.5k 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.
    • madmodder123M
      madmodder123
      last edited by madmodder123

      So I have recently been using RaspberryCast as a replacement for a Chromecast.
      I used "new_log": false in the raspberrycast.conf file to disable the waiting to cast splash screen.

      It works fine except for one thing... when you are done casting a video or end the casting session, it fails to switch the focus back to EmulationStation. ES is still being run and you can blindly navigate it and launch games, but all you can see is a black screen.

      Does anyone have any ideas on how one would set the focus back to ES?

      I also tried to work around this issue by editing the background music script to detect when something is being cast, and then exit and re-launch ES. But apparently you cannot do this from a python script!

      This issue is already detailed on the RaspberryCast GitHub here, but I was wondering if anyone here could help as i'm sure not many people check that GitHub.

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

        @madmodder123 said in RaspberryCast issues with EmulationStation:

        I also tried to work around this issue by editing the background music script to detect when something is being cast, and then exit and re-launch ES. But apparently you cannot do this from a python script!

        Yes, you can, as the topic explains. I wouldn't recommend it though, since forcibly restarting ES might lead to other issues.
        How are you launching RaspberryCast ? It looks like RasbperryCast does some changes to/takes over the display output when running, but doesn't properly restore the display settings when exiting.

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

          OK, since obviously I have too much free time, I looked over the RaspberryCast and found a workaround. The RPCast server starts omxplayer fullscreen and changes the video mode, inserting a black bg while doing that. The solution is to tell omxplayer to start playing in a window above ES and to not change the video mode.
          So, in the process.py file from the RaspberryCast folder, around line 166, replace

                  os.system(
                      "omxplayer -b -r -o both '" + url + "' " + resolution + " --vol " +
                      str(volume) + " < /tmp/cmd"
                  )
          

          with

                  os.system(
                      "omxplayer -b --layer 10010  -o both '" + url + "' " + resolution + " --vol " +
                      str(volume) + " < /tmp/cmd"
                  )
          

          basically removing the -r option and disabling the video refresh. There is a similar command line for omxplayer above, for videos with subtitles, should be treated similarly.

          madmodder123M 1 Reply Last reply Reply Quote 0
          • M
            MrSco
            last edited by

            @mitu Thanks so much for spending time on this and figuring this out!

            It works great except for when pausing it causes video to black out and it doesn't come back. have to Stop and re-cast which starts video off at beginning again...any ideas?

            M 1 Reply Last reply Reply Quote 0
            • madmodder123M
              madmodder123 @mitu
              last edited by

              @mitu Thanks a lot! I posted about this fix on the github page :)

              1 Reply Last reply Reply Quote 0
              • M
                MrSco @MrSco
                last edited by

                @madmodder123

                It works great except for when pausing it causes video to black out and it doesn't come back. have to Stop and re-cast which starts video off at beginning again...any ideas?

                you have this issue too?

                madmodder123M 2 Replies Last reply Reply Quote 0
                • madmodder123M
                  madmodder123 @MrSco
                  last edited by madmodder123

                  @mrsco Hmmmm so I did some testing and it seems to work 100% fine when I have my Pi set to 720p, but when I switch it to 1080p I get the following distorted video/black screen: https://www.dropbox.com/s/vvxu0gz03wcqfye/20180226_214546.mp4?dl=1
                  When tested on another monitor I get the same results except that when the black screen/loss of signal happens on that monitor, the monitor enters sleep mode/powers off.
                  I tried enabling/disabling overscan and it didn't make a difference.
                  The video distortion is seen while the video is playing/initially paused.

                  Test videos:

                  0:42 360p clip
                  2:53 720p clip

                  So on the short clip it plays fine until it is paused, and then it distorts and goes to the black screen.
                  On the longer clip is remains distorted and goes in and out of the black screen for the duration of the video.

                  1 Reply Last reply Reply Quote 0
                  • madmodder123M
                    madmodder123 @MrSco
                    last edited by

                    @mrsco I fixed it :)

                    I added "--aspect-mode fill" to the omxplayer lines and that seems to fix it.

                    What it looks like now:

                    if sub:
                        os.system(
                            "omxplayer --aspect-mode fill -b --layer 10010 -o both '" + url + "' " + resolution + " --vol " +
                            str(volume) +
                            " --subtitles subtitle.srt < /tmp/cmd"
                        )
                    elif url is None:
                        pass
                    else:
                        os.system(
                            "omxplayer --aspect-mode fill -b --layer 10010 -o both '" + url + "' " + resolution + " --vol " +
                            str(volume) + " < /tmp/cmd"
                        )
                    

                    Thanks for the help

                    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.