Mailing List Archive

#13351: Add OpenGL ES configurability/autodetection
Hi,

Working on ARM HW (AmLogic s905, RPI) I need OpenGL ES support in myth.

I added OpenGL ES configurability and it works in following way: there is new configure switch: —enable-opengles

Overall logic: OpenGL ES is disabled by default (if no switch passed to configure or —disable-opengles passed to configure)
If —enable-opengles is passed to configure, configure will detect all required and set conditional USING_OPENGLES if all is OK.
If anything is missing - configure will exit with error.

So summarising:

A) ./configure WITHOUT —enable-opengles

Result:
OpenGL ES disabled; what OS provides doesn’t matter
USING_OPENGLES is not set

B) ./configure WITH —enable-opengles

B.1) System has proper support for OpenGL ES. This means:
a) pkg-config present to EGL and GLESv2
b) *.h, GLESv2 libs are present
c) Qt provides Open GL ES

Result:
configure sets USING_OPENGLES

B.2) System has broken support for OpenGL ES
(any of a) or b) or c) from B.1 are not valid)

Result:
configure exits with error

Why exit with error?
If user asks for OpenGL ES but system is not properly prepared to build, user should be explicitly notified by this issue.


This way current build bots should still work ok.
Only change is required for android building: now it requires adding —enable-opengles to configure params

I tested it on x86 and RPI3 with fully working OpenGL ES.

Let me know what You think




_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: #13351: Add OpenGL ES configurability/autodetection [ In reply to ]
On 11/25/18 2:37 PM, Piotr Oniszczuk wrote:
> Hi,
>
> Working on ARM HW (AmLogic s905, RPI) I need OpenGL ES support in myth.
>
> I added OpenGL ES configurability and it works in following way: there is new configure switch: —enable-opengles
>
> Overall logic: OpenGL ES is disabled by default (if no switch passed to configure or —disable-opengles passed to configure)
> If —enable-opengles is passed to configure, configure will detect all required and set conditional USING_OPENGLES if all is OK.
> If anything is missing - configure will exit with error.
>
> So summarising:
>
> A) ./configure WITHOUT —enable-opengles
>
> Result:
> OpenGL ES disabled; what OS provides doesn’t matter
> USING_OPENGLES is not set
>
> B) ./configure WITH —enable-opengles
>
> B.1) System has proper support for OpenGL ES. This means:
> a) pkg-config present to EGL and GLESv2
> b) *.h, GLESv2 libs are present
> c) Qt provides Open GL ES
>
> Result:
> configure sets USING_OPENGLES
>
> B.2) System has broken support for OpenGL ES
> (any of a) or b) or c) from B.1 are not valid)
>
> Result:
> configure exits with error
>
> Why exit with error?
> If user asks for OpenGL ES but system is not properly prepared to build, user should be explicitly notified by this issue.
>
>
> This way current build bots should still work ok.
> Only change is required for android building: now it requires adding —enable-opengles to configure params
>
> I tested it on x86 and RPI3 with fully working OpenGL ES.
>
> Let me know what You think
>
>
>
>
What is the problem with the current setup? OpenGL ES is already used in
android and raspberry pi, and as far as I know it is already enabled if
the correct libraries are present.

Peter
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: #13351: Add OpenGL ES configurability/autodetection [ In reply to ]
Peter,

As far as I reading code - usage gles is possible only on Android and currently is used only for android:
https://github.com/MythTV/mythtv/blob/9c940817da8aa001219bbded26b26f12a7b364b7/mythtv/configure#L6566
There is no way in myth to use gles on other platforms.

I think we should address 2 things:

1.Selection in configure to use gles when OS proves OpenGL Desktop _and_ OpenGL ES

2.Working myth when OS provides _only_ OpenGL ES

Patches in #13351 already are working OK for case 1)

For case 2) situation is a bit more complicated as first I need to prepare OS providing GL and Qt only at OpenGL ES level (which is not trivial).
I already have working configure+building for case 2) - but resulting code not working with GL painter.
I don’t yet know why.
To sort this first I must investigate:
a) is this issue of underlying OS (most probably Qt5)
b) or this is issue of myth (effectively current master can’t work with GL painter without OpenGL Desktop API available - even if conditional USING_OPENGLES is set at building)
I suspect my issue is a)

To investigate further: can anybody from android world confirm me that:
- android provides _ONLY_ OpenGL ES?
- do android has libGL.so and include/GL/*.h files?
- how config.summary from Qt5 configure looks like in android build?

Why all this?
Because almost standard in embedded systems is no OpenGL Desktop and only GLES.
Without this I can’t move forward with myth on ARM platforms with linux (not android) on platforms where there is no working Mesa yet.

thx in advance!



> Wiadomo?? napisana przez Peter Bennett <pb.mythtv@gmail.com> w dniu 26.11.2018, o godz. 19:39:
>
>
>
> On 11/25/18 2:37 PM, Piotr Oniszczuk wrote:
>> Hi,
>>
>> Working on ARM HW (AmLogic s905, RPI) I need OpenGL ES support in myth.
>>
>> I added OpenGL ES configurability and it works in following way: there is new configure switch: —enable-opengles
>>
>> Overall logic: OpenGL ES is disabled by default (if no switch passed to configure or —disable-opengles passed to configure)
>> If —enable-opengles is passed to configure, configure will detect all required and set conditional USING_OPENGLES if all is OK.
>> If anything is missing - configure will exit with error.
>>
>> So summarising:
>>
>> A) ./configure WITHOUT —enable-opengles
>>
>> Result:
>> OpenGL ES disabled; what OS provides doesn’t matter
>> USING_OPENGLES is not set
>>
>> B) ./configure WITH —enable-opengles
>>
>> B.1) System has proper support for OpenGL ES. This means:
>> a) pkg-config present to EGL and GLESv2
>> b) *.h, GLESv2 libs are present
>> c) Qt provides Open GL ES
>>
>> Result:
>> configure sets USING_OPENGLES
>>
>> B.2) System has broken support for OpenGL ES
>> (any of a) or b) or c) from B.1 are not valid)
>>
>> Result:
>> configure exits with error
>>
>> Why exit with error?
>> If user asks for OpenGL ES but system is not properly prepared to build, user should be explicitly notified by this issue.
>>
>>
>> This way current build bots should still work ok.
>> Only change is required for android building: now it requires adding —enable-opengles to configure params
>>
>> I tested it on x86 and RPI3 with fully working OpenGL ES.
>>
>> Let me know what You think
>>
>>
> What is the problem with the current setup? OpenGL ES is already used in android and raspberry pi, and as far as I know it is already enabled if the correct libraries are present.
>
> Peter
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-dev
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: #13351: Add OpenGL ES configurability/autodetection [ In reply to ]
On 27/11/2018 11:21, Piotr Oniszczuk wrote:
> Peter,
>
> As far as I reading code - usage gles is possible only on Android and currently is used only for android:
> https://github.com/MythTV/mythtv/blob/9c940817da8aa001219bbded26b26f12a7b364b7/mythtv/configure#L6566
> There is no way in myth to use gles on other platforms.
>
> I think we should address 2 things:
>
> 1.Selection in configure to use gles when OS proves OpenGL Desktop _and_ OpenGL ES

I'd like to be able to switch between the 2 at runtime in this
case. I don't believe there is a technical reason why this
isn't possible

>
> 2.Working myth when OS provides _only_ OpenGL ES
>

I thought we already had this on embedded platforms
such as the rpi?


Regards
Stuart


> Patches in #13351 already are working OK for case 1)
>
> For case 2) situation is a bit more complicated as first I need to prepare OS providing GL and Qt only at OpenGL ES level (which is not trivial).
> I already have working configure+building for case 2) - but resulting code not working with GL painter.
> I don’t yet know why.
> To sort this first I must investigate:
> a) is this issue of underlying OS (most probably Qt5)
> b) or this is issue of myth (effectively current master can’t work with GL painter without OpenGL Desktop API available - even if conditional USING_OPENGLES is set at building)
> I suspect my issue is a)
>
> To investigate further: can anybody from android world confirm me that:
> - android provides _ONLY_ OpenGL ES?
> - do android has libGL.so and include/GL/*.h files?
> - how config.summary from Qt5 configure looks like in android build?
>
> Why all this?
> Because almost standard in embedded systems is no OpenGL Desktop and only GLES.
> Without this I can’t move forward with myth on ARM platforms with linux (not android) on platforms where there is no working Mesa yet.
>
> thx in advance!
>
>
>
>> Wiadomo?? napisana przez Peter Bennett <pb.mythtv@gmail.com> w dniu 26.11.2018, o godz. 19:39:
>>
>>
>>
>> On 11/25/18 2:37 PM, Piotr Oniszczuk wrote:
>>> Hi,
>>>
>>> Working on ARM HW (AmLogic s905, RPI) I need OpenGL ES support in myth.
>>>
>>> I added OpenGL ES configurability and it works in following way: there is new configure switch: —enable-opengles
>>>
>>> Overall logic: OpenGL ES is disabled by default (if no switch passed to configure or —disable-opengles passed to configure)
>>> If —enable-opengles is passed to configure, configure will detect all required and set conditional USING_OPENGLES if all is OK.
>>> If anything is missing - configure will exit with error.
>>>
>>> So summarising:
>>>
>>> A) ./configure WITHOUT —enable-opengles
>>>
>>> Result:
>>> OpenGL ES disabled; what OS provides doesn’t matter
>>> USING_OPENGLES is not set
>>>
>>> B) ./configure WITH —enable-opengles
>>>
>>> B.1) System has proper support for OpenGL ES. This means:
>>> a) pkg-config present to EGL and GLESv2
>>> b) *.h, GLESv2 libs are present
>>> c) Qt provides Open GL ES
>>>
>>> Result:
>>> configure sets USING_OPENGLES
>>>
>>> B.2) System has broken support for OpenGL ES
>>> (any of a) or b) or c) from B.1 are not valid)
>>>
>>> Result:
>>> configure exits with error
>>>
>>> Why exit with error?
>>> If user asks for OpenGL ES but system is not properly prepared to build, user should be explicitly notified by this issue.
>>>
>>>
>>> This way current build bots should still work ok.
>>> Only change is required for android building: now it requires adding —enable-opengles to configure params
>>>
>>> I tested it on x86 and RPI3 with fully working OpenGL ES.
>>>
>>> Let me know what You think
>>>
>>>
>> What is the problem with the current setup? OpenGL ES is already used in android and raspberry pi, and as far as I know it is already enabled if the correct libraries are present.
>>
>> Peter
>> _______________________________________________
>> mythtv-dev mailing list
>> mythtv-dev@mythtv.org
>> http://lists.mythtv.org/mailman/listinfo/mythtv-dev
>> http://wiki.mythtv.org/Mailing_List_etiquette
>> MythTV Forums: https://forum.mythtv.org
>
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-dev
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org
>

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: #13351: Add OpenGL ES configurability/autodetection [ In reply to ]
> Wiadomo?? napisana przez Stuart Auchterlonie <stuarta@squashedfrog.net> w dniu 27.11.2018, o godz. 13:01:
>
>>
>> 2.Working myth when OS provides _only_ OpenGL ES
>>
>
> I thought we already had this on embedded platforms
> such as the rpi?

Well - correct me if I’m wrong:

For rpi we need to distinguish 2 cases:
1) GL provider is by brcm BLOBS
2) GL provides is by FOSS software (mesa 18+)

Ad1)
In this case afaik there is no GL Desktop at all, as there is no possibility to build Qt with OpenGL Desktop.
IIRC this is because low-level api provided by brcm blobs are not compatible with Qt GL integration sub-layer.
By this on brcm blobs we have only 2 options for painting in myth:
-EGLFS (if Qt build correctly for this)
-Qt

Ad2)
Mesa 18+ is able to provide GL (via v3d vc4) at Desktop GL and GLES levels.
This works perfectly and I have rpi fully working with OpenGL Desktop.
GLES however is not possible due: https://github.com/MythTV/mythtv/blob/9c940817da8aa001219bbded26b26f12a7b364b7/mythtv/configure#L6566
With #13351 have fully working GLES on rpi (including 2G accell via glamour and GL playback).
SD plays nicely - but for HD rpi’s cpu is too weak...
To get HD playback we need video decode hw accell - and afaik only solution is v4l2 m2m.
(OpenMAX IL is not option due low-level api provided by brcm blobs incompatibility).

br




>
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-dev
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: #13351: Add OpenGL ES configurability/autodetection [ In reply to ]
On 11/27/18 7:31 AM, Piotr Oniszczuk wrote:
>
>> Wiadomo?? napisana przez Stuart Auchterlonie <stuarta@squashedfrog.net> w dniu 27.11.2018, o godz. 13:01:
>>
>>> 2.Working myth when OS provides _only_ OpenGL ES
>>>
>> I thought we already had this on embedded platforms
>> such as the rpi?
> Well - correct me if I’m wrong:
>
> For rpi we need to distinguish 2 cases:
> 1) GL provider is by brcm BLOBS
> 2) GL provides is by FOSS software (mesa 18+)
>
> Ad1)
> In this case afaik there is no GL Desktop at all, as there is no possibility to build Qt with OpenGL Desktop.
> IIRC this is because low-level api provided by brcm blobs are not compatible with Qt GL integration sub-layer.
> By this on brcm blobs we have only 2 options for painting in myth:
> -EGLFS (if Qt build correctly for this)
> -Qt
>
> Ad2)
> Mesa 18+ is able to provide GL (via v3d vc4) at Desktop GL and GLES levels.
> This works perfectly and I have rpi fully working with OpenGL Desktop.
> GLES however is not possible due: https://github.com/MythTV/mythtv/blob/9c940817da8aa001219bbded26b26f12a7b364b7/mythtv/configure#L6566
> With #13351 have fully working GLES on rpi (including 2G accell via glamour and GL playback).
> SD plays nicely - but for HD rpi’s cpu is too weak...
> To get HD playback we need video decode hw accell - and afaik only solution is v4l2 m2m.
> (OpenMAX IL is not option due low-level api provided by brcm blobs incompatibility).
>
On the raspberry pi builds that I do with mythtv-light, opengl is
disabled except for one small place. It uses opengl es for the OSD. This
is a hybrid setup. The main GUI uses qt under x11, but the playback uses
openmax full screen api and the playback OSD uses the full-screen opengl es.

I will test your patches with all of the builds and see if everything works.

Peter
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: #13351: Add OpenGL ES configurability/autodetection [ In reply to ]
On 11/27/18 6:21 AM, Piotr Oniszczuk wrote:
> To investigate further: can anybody from android world confirm me that:
> - android provides_ONLY_ OpenGL ES?
> - do android has libGL.so and include/GL/*.h files?
no GL/*.h
There is /sysroot/usr/include/GLES/gl.h and others
> - how config.summary from Qt5 configure looks like in android build?

I pasted the config.summary here

https://pastebin.com/47Ssw6hm

Peter
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: #13351: Add OpenGL ES configurability/autodetection [ In reply to ]
> Wiadomo?? napisana przez Peter Bennett <pb.mythtv@gmail.com> w dniu 27.11.2018, o godz. 18:00:
>
>
>
> On 11/27/18 6:21 AM, Piotr Oniszczuk wrote:
>> To investigate further: can anybody from android world confirm me that:
>> - android provides_ONLY_ OpenGL ES?
>> - do android has libGL.so and include/GL/*.h files?
> no GL/*.h
> There is /sysroot/usr/include/GLES/gl.h and others

Peter,
thx!

What about libs?
(maybe 'ls -R' for ./lib and ./include dirs in Android)?

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org