Android build on Fire TV - opengl produces white screen

Post Reply
clubsoda
Newcomer
Posts: 6
Joined: Thu Feb 01, 2018 7:29 pm
Canada

Android build on Fire TV - opengl produces white screen

Post by clubsoda » Thu Feb 01, 2018 7:37 pm

Hello,

First, I hope this is the right forum - apologies if it's not!

I've been using myth for a few years and would like to replace my aging ion-based frontend. I was pleasantly surprised to find that an android port of mythfrontend is available. I've been able to successfully build an apk from git master and install it on a couple of devices (a nexus 7 2013, marshmallow and a moto g4 play, nougat). Video playback using opengl works great.

I have tried loading it to my fire tv stick (basic edition) running Fire OS 5.2, which I believe is derived from lollipop. Navigating menus with the qt painter works pretty well with a few minor glitches where menu elements flash white momentarily.

Unlike my other two devices, opengl does not work with the fire stick. Once I enable opengl, the theme background is made fullscreen and I cannot see anything "underneath" it. If I force close mythfrontend and open it back up the following happens:

1) myth displays a white screen for a couple seconds
2) a black screen displays for another second or two
3) the regular main menu flashes quickly
4) a white image overlays the screen

I know myth has not crashed because I can enter live tv if I press OK a few times. I can then hear live tv and can switch channels all while having a completely white image. The nexus and moto g4 also display a white screen at startup when opengl is enabled but it is quickly replaced by the main menu as expected. I have been testing with mythcenter-wide for the most part. Changing themes does not have an impact.

I have been able to get gdb connected to the fire stick but I wasn't sure how to get useful output for this issue.

Thanks in advance for your help and ideas.

User avatar
gigem
Developer
Posts: 1
Joined: Fri Feb 07, 2014 8:19 pm
United States of America

Re: Android build on Fire TV - opengl produces white screen

Post by gigem » Thu Feb 01, 2018 9:56 pm

What version of MythTV and Android tools are you using? I ask because a few of us developers are in the process of updating the Android support to more recent versions and very little except the menus is know to work right now.

clubsoda
Newcomer
Posts: 6
Joined: Thu Feb 01, 2018 7:29 pm
Canada

Re: Android build on Fire TV - opengl produces white screen

Post by clubsoda » Fri Feb 02, 2018 1:19 am

Thanks for the quick reply. I used the following to build:

* v30-pre (master) - I built this against master a couple of times, once on Jan 25 and again on Jan 30
* ndk r15
* android sdk 21 (also installed 19 so that makelibs could copy over missing headers)
* oracle jdk 8 version 8u161

I think that's the major stuff. Everything else was downloaded and built as per the latest makelibs script, so Qt 5.9.1. Let me know if I can provide any more information. Great to hear that android support is being worked on!

EDIT: Forgot to mention build-tools 27.0.3.

User avatar
markspieth
Developer
Posts: 3
Joined: Sun Mar 22, 2015 2:50 am
Australia

Re: Android build on Fire TV - opengl produces white screen

Post by markspieth » Fri Feb 02, 2018 1:48 pm

Hi
The android build is undergoing a rework ATM but it does not display video.

Questions:
1. What version android is it running?
2. What baseline of the android packaging repo are you using?

A white screen is normal while it loads resources. This will be investigated when video works as it bugs me.
After that it shows the theme background for a bit and then the menu. When using qt theme painter everything UI seems to work ok. opengl themepainter does not work so well (yet). This can be changed directly using phpmyadmin or something similar.

A couple of years ago it worked ok with QT5.4 (I think) but still had problems. Bringing it to the present has proven to be a bit more challenging.

Stay tuned. There is a group of us working on it.

Mark

clubsoda
Newcomer
Posts: 6
Joined: Thu Feb 01, 2018 7:29 pm
Canada

Re: Android build on Fire TV - opengl produces white screen

Post by clubsoda » Fri Feb 02, 2018 4:37 pm

Hi Mark

1. It runs a derivative of lollipop. It's the fire tv basic edition which was just recently released internationally.
2. I built against git master to have the latest code. The apk produced is named "mythfrontend-20180130-arm-v30-Pre-436-gc3d0aeb.apk"

Running the opengl2 painter works great on my nexus 7 (2013, running android 6.0.1). The theme is drawn nicely with very few glitches and even the fading effect works. Video works really well too. I get smooth playback of 1080i channels using yadif and disabling the deblock filter. CPU usage across all 4 cores is ~70%. I'm not a developer so I won't even speculate as to why it works so well on the nexus and not at all the fire tv! I can setup a clean build environment and rebuild from scratch is that's helpful at all.

User avatar
markspieth
Developer
Posts: 3
Joined: Sun Mar 22, 2015 2:50 am
Australia

Re: Android build on Fire TV - opengl produces white screen

Post by markspieth » Fri Feb 02, 2018 9:29 pm

I am amazed you have had this much success.
I assume you built against current master using makelibs and mythbuild scripts.
I will try it on my 2012 nexus 7 just to see.
Which NDK are you using? 13b is the recommended on as 15 doesnt have enough of the right headers.

Also if you can do an "adb logcat | tee nexus7.log" and one against your fire tv and then compare the differences. see lines marked with mfe as the interesting ones. Interesting info will be the opengl info printed near the start.

Mark

clubsoda
Newcomer
Posts: 6
Joined: Thu Feb 01, 2018 7:29 pm
Canada

Re: Android build on Fire TV - opengl produces white screen

Post by clubsoda » Sat Feb 03, 2018 3:08 am

Yep, I built against master with makelibs and mythbuild. Both scripts work great. I used ndk r15c without any modifications. I tried r16 at one point but came up with errors and abandoned it pretty quickly. I think it was missing headers?

I've attached a couple sets of logs. The -mfe.log files are extracts of the mfe lines, and the -opengl.log files are lines anytime "opengl" came up. The only thing that immediately popped out was that "Use EGL_SWAP_BEHAVIOR_PRESERVED" is false with the firetv but true on the nexus (see opengl lines). Not sure what impact this would have. I also see that that nexus supports opengl es3.0 and the firetv only 2.0.

I'll try to have a closer look later tonight and post anything else I find. Any luck with your nexus 7?
Attachments
firetv-mfe.log
(110.88 KiB) Downloaded 14 times
nexus7-mfe.log
(140.54 KiB) Downloaded 16 times

clubsoda
Newcomer
Posts: 6
Joined: Thu Feb 01, 2018 7:29 pm
Canada

Re: Android build on Fire TV - opengl produces white screen

Post by clubsoda » Sat Feb 03, 2018 3:09 am

And the opengl logs. There are a couple of "libQt5OpenGL.so: unused DT entry" lines here.
Attachments
nexus7-opengl.log
(16.07 KiB) Downloaded 17 times
firetv-opengl.log
(15.01 KiB) Downloaded 14 times

User avatar
markspieth
Developer
Posts: 3
Joined: Sun Mar 22, 2015 2:50 am
Australia

Re: Android build on Fire TV - opengl produces white screen

Post by markspieth » Sun Feb 18, 2018 3:35 am

Try with the latest. opengl is largely fixed.
Still some minor issues like green lines and x2 deinterlacers doing funny things.
Will probably work with android 5.0+.
Im using ndk r13b.
Tablets should work ok too.

clubsoda
Newcomer
Posts: 6
Joined: Thu Feb 01, 2018 7:29 pm
Canada

Re: Android build on Fire TV - opengl produces white screen

Post by clubsoda » Sun Feb 18, 2018 9:53 pm

Okay, I built git master of mythtv and packaging last night. Thanks for the reminder about ndk r13b. I couldn't get myth to build with r15.

My firetv stick is now launching myth with opengl2 enabled without the white screen covering the gui! This is great. The stick is a bit underpowered and has trouble doing mpeg2 @ 720p or 1080i but is perfect with SD content. Deinterlacing with yadif works but really slows things down. Playing 480p h264 files work well and cpu usage bounces between 30-50%. 1080p h264 stops an stutters and the cpu maxes out. My nexus 7 2013 fares better as before but deinterlacing shows a noticeable framerate drop.

Let me know if you need any more logs or testing done. I think the resynced version of ffmpeg that was just recently committed supports hardware acceleration via mediacodec for mpeg2 and mpeg4, is there some way to enable this? I'm guessing right now everything is being software decoded via ffmpeg?

Thanks again, this is awesome! I will do some more testing and see how different video settings affect playback with these changes.

Post Reply