Page 1 of 2

OpenGL not available (ubuntu 20.04 / mythtv 31)

Posted: Sat Jun 27, 2020 5:38 pm
by dannyclark
Hi,

I've been running mythtv 0.2x for years on an old machine (Intel D510MO with onboard graphics) and just upgraded to ubuntu 20.04 and mythtv 31 (from the ppa).

When I start the mythfrontend, I get "OpenGL not available", so can't play any video, yet the board supports OpenGL 1.4 and glxinfo appears to confirm it's available. I tried upgrading to mythtv 32 and then I upgraded graphics drivers (using the oibaf PPA), but neither of those things improved the situation.

Any other suggestions appreciated. Should I try downgrading to an earlier version of mythtv? I'll include some output from "mythfrontend -v playback" as that was mentioned in other threads. (I tried to include the whole thing but the forum software kept thinking it included URLs)

Code: Select all

2020-06-27 18:03:34.215254 I  Display: Found screen number 0 (VGA1)
2020-06-27 18:03:34.219992 I  UI Screen Resolution: 1920 x 1080
2020-06-27 18:03:34.259783 I  Qt: QEGLPlatformContext: Failed to create context: 3009
2020-06-27 18:03:34.260036 C  OpenGL: Failed to create OpenGLContext!
2020-06-27 18:03:34.260073 E  OpenGL: MythRenderOpenGL is not a valid OpenGL rendering context
2020-06-27 18:03:34.260100 I  OpenGL: MythRenderOpenGL closing
2020-06-27 18:03:34.260142 W  OpenGL: Context about to be destroyed
2020-06-27 18:03:34.261101 I  Using the Qt painter. Video playback will not work!

Re: OpenGL not available (ubuntu 20.04 / mythtv 31)

Posted: Sat Jun 27, 2020 6:18 pm
by mark_k
To get a little more detail on what is happening in Qt, run mythfrontend like this:-

QT_LOGGING_RULES=qt.qpa.gl=true mythfrontend

You may want to try disabling EGL (which is used to get better VAAPI performance but will probably not help in your case):-

MYTHTV_NO_EGL=1 mythfrontend

Either way - post the logs as they may help.

Regards
Mark

Re: OpenGL not available (ubuntu 20.04 / mythtv 31)

Posted: Sat Jun 27, 2020 9:09 pm
by dannyclark
Thanks for the reply. I've attached mythfrontend.log with:
  • 21:49:02 - running with QT_LOGGING_RULES
    21:56:25 - running with MYTHTV_NO_EGL=1 - in this case the UI does not come up and I killed it at 21:57:33
Please let me know if there are other logs that would be useful.

Appreciate the help,
Dan.

Re: OpenGL not available (ubuntu 20.04 / mythtv 31)

Posted: Sat Jun 27, 2020 10:30 pm
by mark_k
Does the first run (starting at 21.49.02) from that log work? It looks 'normal'.

Likewise - with the run starting as 21.56, apart from the missing Qt logging that is in the first - this looks ok.

Neither seem to have the opengl problem from your first post?

Thanks,
Mark

Re: OpenGL not available (ubuntu 20.04 / mythtv 31)

Posted: Sun Jun 28, 2020 12:49 am
by dannyclark
Sorry I think I picked up the log slightly too early and I've given you the wrong timestamp. I should have said:
  • 21:49:59 - running with QT_LOGGING_RULES
So there are in fact 3 runs, but I can't be 100% sure what happened at 21:49:02 so please disregard that (I think it's similar to the 21:56:25 run with the MYTHTV_NO_EGL flag).

So just to be clear.
  • The run at 21:49:59 gives "OpenGL not available" (at 21:50:06 it says "Using the Qt painter. Video playback will not work!").
    The run at 21:56:25 does not initiate a UI at all. It just freezes and I have to kill it.
Apologies for the earlier misinformation,
Dan.

Re: OpenGL not available (ubuntu 20.04 / mythtv 31)

Posted: Mon Jun 29, 2020 4:07 pm
by mark_k
OK - this could be tricky:)

Trying to debug a blank screen on older OpenGL versions can be problematic as, assuming an error is actually generated by the driver, we need to catch it just after it is generated (newer versions have debugging extensions that we can use).

First up - and this is a long shot - can you try starting mythfrontend with these settings, see if there is any change in behaviour and post some logs :-

QT_LOGGING_RULES=qt.qpa.gl=true MYTHTV_NO_EGL=1 MYTHTV_OPENGL_ES=1 mythfrontend -v gpu --loglevel=debug
QT_LOGGING_RULES=qt.qpa.gl=true MYTHTV_NO_EGL=1 MYTHTV_OPENGL_CORE=1 mythfrontend -v gpu --loglevel=debug
QT_LOGGING_RULES=qt.qpa.gl=true MYTHTV_NO_EGL=1 MYTHTV_OPENGL_CORE=1 MYTHTV_OPENGL_ES=1 mythfrontend -v gpu --loglevel=debug

If that doesn't help, I'll have to commit some debugging code to try and narrow it down.

Regards
Mark

Re: OpenGL not available (ubuntu 20.04 / mythtv 31)

Posted: Mon Jun 29, 2020 10:16 pm
by dannyclark
Thanks Mark. I tried all 3 in that sequence and it was the same result each time. No UI and I killed it after waiting a few minutes. I've attached the log with all of these events.

Must admit I hadn't quite realised how old OpenGL 1.4 was.

Regards,
Dan.

Re: OpenGL not available (ubuntu 20.04 / mythtv 31)

Posted: Tue Jun 30, 2020 10:46 am
by mark_k
Good news and bad:)

Good news is that the driver does actually support OpenGL debug contexts - so the logs show the errors.

Unfortunately it looks like the problem is somewhere in the Qt code - though possibly triggered by our use of Qt.

I did a little googling on the chipset - which suggested it supports OpenGL 2 on linux. Further digging suggests that this was a bit of a 'hack' in the driver to force OpenGL 2 support - which was then removed at a later date:-

https://www.phoronix.com/scan.php?page= ... nGL-2-Drop

There is a suggestion that you can still force the OpenGL version to 2.1 using an environment variable - tested here on forcing 1.4 and it seems to work (and indeed egl doesn't work here either with opengl 1.4).

So see if this helps:-

MESA_DEBUG=1 LIBGL_DEBUG=verbose MESA_GL_VERSION_OVERRIDE=2.1 QT_LOGGING_RULES=qt.qpa.gl=true MYTHTV_NO_EGL=1 mythfrontend -v gpu --loglevel=debug

(and maybe try MESA_GL_VERSION_OVERRIDE=2.0 as well)

Regards
Mark

Re: OpenGL not available (ubuntu 20.04 / mythtv 31)

Posted: Tue Jun 30, 2020 1:26 pm
by dannyclark
Wow. So that does actually come up without giving the OpenGL error.

In the case of 2.1, the UI was then completely unresponsive, so I wasn't able to attempt to play any video.
In the case of 2.0, it was able to play some video and I'll give it a proper test when I have a bit more time this evening.

I've attached the log just in case it sheds more light or is of interest.

Thanks for the help - I will report back further once I've done a bit more testing,
Dan.

Re: OpenGL not available (ubuntu 20.04 / mythtv 31)

Posted: Tue Jun 30, 2020 9:51 pm
by dannyclark
Hmmm... spoke too soon, I think.

Every time I run this tonight the UI won't come up. I don't if there's any more useful debug in the logs now?

Re: OpenGL not available (ubuntu 20.04 / mythtv 31)

Posted: Thu Jul 02, 2020 1:14 pm
by stuarta
Could you supply the output from `glxinfo -B` please?

Re: OpenGL not available (ubuntu 20.04 / mythtv 31)

Posted: Thu Jul 02, 2020 9:13 pm
by dannyclark
Sure. Here it is:
$ glxinfo -B
name of display: :0
display: :0 screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
Vendor: Intel Open Source Technology Center (0x8086)
Device: Mesa DRI Intel(R) Pineview (0xa001)
Version: 20.2.0
Accelerated: yes
Video memory: 384MB
Unified memory: yes
Preferred profile: compat (0x2)
Max core profile version: 0.0
Max compat profile version: 1.4
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 2.0
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Pineview
OpenGL version string: 1.4 Mesa 20.2.0-devel (git-54d7907 2020-06-30 focal-oibaf-ppa)

OpenGL ES profile version string: OpenGL ES 2.0 Mesa 20.2.0-devel (git-54d7907 2020-06-30 focal-oibaf-ppa)
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16

Re: OpenGL not available (ubuntu 20.04 / mythtv 31)

Posted: Fri Jul 03, 2020 7:50 am
by dannyclark
Hi,

I'm not sure what's different but here is a log from where it did start up correctly yesterday and I was able to play some video (with the "OpenGL Slim" profile, which worked really well). So it gives me confidence there is some life left in the old hardware.

This is using the command line from mark_k above:

MESA_DEBUG=1 LIBGL_DEBUG=verbose MESA_GL_VERSION_OVERRIDE=2.1 QT_LOGGING_RULES=qt.qpa.gl=true MYTHTV_NO_EGL=1 mythfrontend -v gpu --loglevel=debug

This isn't reliable though. After trying it occasionally over a few days (updating patches etc.), it worked after about the 10th try and I've tried it another 5 times today and can't get it to work again.

Regards,
Dan.

Re: OpenGL not available (ubuntu 20.04 / mythtv 31)

Posted: Fri Jul 03, 2020 9:58 am
by dannyclark
Problem solved. I think I've figured out what was going on.

When it froze and did not initiate a UI, this was because the mythfrontend process was consuming all keystrokes and mouse clicks (i.e. I could move the mouse across the desktop but nothing else; I had to ssh in from another box to kill the process). It looks like mythfrontend was running but wasn't managing to display the UI on the screen. If I hit enter 4 times, I can effectively select to play the first media recording available and then the screen comes up after a second or so delay. Then I can hit escape to return to the mythtv menu and the UI works fine from that point on.

So this appears to work even with just MYTHTV_NO_EGL=1. (With no env vars set, the UI comes straight up with "OpenGL not available"). I've created an entry in "startup applications" in Gnome which runs "env MYTHTV_NO_EGL=1 mythfrontend --service" and that seems to do the trick (I can connect via mythmote on android and just hit the main button 4 times after a reboot).

If anyone has better suggestions how to work around this, that'd be great, but this is workable for me. Many thanks to mark_k and stuarta for the help.

Cheers,
Dan.

Re: OpenGL not available (ubuntu 20.04 / mythtv 31)

Posted: Sat Jul 11, 2020 11:47 am
by mark_k
From the symptoms, there are 2 possible sources of the problem.

- there is a subtle timing issue that means the rendering window is not always receiving the initial 'show' event.
- the opengl code path when starting video playback is slightly different somewhere and clears whatever issue is causing the problem.

I suspect the former - which is then cleared with some windowing calls when video playback starts.

Can you try either 'alt tabbing' away from mythfronted and back again when the the UI is not shown. Alternatively maybe try starting mythfrontend in a smaller window (mythfronted -w --geometry=400x300) and try alt-tabbing again.

Regards
Mark