Issues re-focusing EmulationStation (RaspberryCast)
-
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.
-
@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. -
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 tellomxplayer
to start playing in a window above ES and to not change the video mode.
So, in theprocess.py
file from the RaspberryCast folder, around line 166, replaceos.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. -
@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?
-
@mitu Thanks a lot! I posted about this fix on the github page :)
-
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?
-
@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:
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. -
@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
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.