[mythtv] OpenGL, Android and Fire Stick

Mark Spieth mark at digivation.com.au
Mon Oct 8 22:20:23 UTC 2018



On 09/10/18 02:07, Peter Bennett wrote:
> With the fire stick I find that video decoding is fast enough for 
> regular 1x playback of MPEG2, H264 and H265 up to 1080. However OpenGL 
> presents a variety of problems.
>
This is a S905 I seem to remember.
> There are three sets of shaders for video playback:
> yv12: On the fire stick playback is restricted to 15-20 fps, giving a 
> rather unpleasant viewing experience. Also there is a fat green line 
> along the bottom (as we observed also with shield) and a green line at 
> the right.
yv12 should be better because it has less data per frame! WTF
Fat green line could be 1088 lines or upscale for a lower res. Green is 
0 data and beyond the frame range.
> uyvu: On the fire stick playback speed is much better, but the right 
> hand side of the picture has low resolution. Starting from the center 
> of the picture, moving to the right the resolution gradually reduces, 
> resulting in jagged edges and loss of detail towards the right of the 
> picture.
> rgb:   On the fire stick playback speed is good, as it is for uyvu. 
> There is no picture resolution problem on the right or anywhere, there 
> is no green line at the bottom, but the colors are wrong. I thing the 
> red color is missing entirely.
This resolution issue is very wierd. Normally this is yuvu or yuv2. not 
sure it uyvu is a typo.
>
> The fire stick is capable of reasonable playback speed and of good 
> quality picture, but the OpenGL needs some changes. I think part of it 
> may be the differences between OpenGL and OpenGL ES.
I think the implementation of GL/accel HW is not to standard. Not a GLES 
issue per se.
>
> I have little understanding of OpenGL, so I am going through the 
> OpenGL ES book and examples, to try to get an understanding of what 
> goes on in those shaders, so that I can create shaders that works with 
> good performance and quality in this situation. At the same time I 
> hope to eliminate the green line problem so that yv12 can be used when 
> needed.
See my greenline patches from a while back. I still run with them and it 
fixes the green lines on my shield and h96 pro (S912). I can resend i 
that helps. May not fix the thick green line though.

There may also be a scaling issue with sone GL implementations in that 
the iterate over lines/pixels 0..N instead of 0..N-1 and this causes the 
green lines bottom and right.

The other critical patch may be the float resolution. I changed this 
from medium to high and that fixed quite a few issues too. Give that a 
try. From my reading, float res is not specified, some hardware/impl is 
better than others for mediump and lowp.

libmythui/mythrender_opengl2es.h
change "precision mediump float" to "precision highp float"

I also think the deinterlace gets the line ordering for fields wrong 
too. This may be an amlogic specific issue.

HTH
Mark


More information about the mythtv-dev mailing list