OpenGL not available (ubuntu 20.04 / mythtv 31)

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
dannyclark
Newcomer
Posts: 9
Joined: Sat Jun 27, 2020 5:07 pm
Great Britain

OpenGL not available (ubuntu 20.04 / mythtv 31)

Post by dannyclark » Sat Jun 27, 2020 5:38 pm

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!

User avatar
mark_k
Developer
Posts: 54
Joined: Tue Jan 28, 2020 3:14 pm
Great Britain

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

Post by mark_k » Sat Jun 27, 2020 6:18 pm

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

dannyclark
Newcomer
Posts: 9
Joined: Sat Jun 27, 2020 5:07 pm
Great Britain

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

Post by dannyclark » Sat Jun 27, 2020 9:09 pm

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.
Attachments
mythfrontend.log
(70.67 KiB) Downloaded 9 times

User avatar
mark_k
Developer
Posts: 54
Joined: Tue Jan 28, 2020 3:14 pm
Great Britain

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

Post by mark_k » Sat Jun 27, 2020 10:30 pm

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

dannyclark
Newcomer
Posts: 9
Joined: Sat Jun 27, 2020 5:07 pm
Great Britain

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

Post by dannyclark » Sun Jun 28, 2020 12:49 am

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.

User avatar
mark_k
Developer
Posts: 54
Joined: Tue Jan 28, 2020 3:14 pm
Great Britain

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

Post by mark_k » Mon Jun 29, 2020 4:07 pm

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

dannyclark
Newcomer
Posts: 9
Joined: Sat Jun 27, 2020 5:07 pm
Great Britain

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

Post by dannyclark » Mon Jun 29, 2020 10:16 pm

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.
Attachments
mythfrontend.log.gz
(23.27 KiB) Downloaded 2 times

User avatar
mark_k
Developer
Posts: 54
Joined: Tue Jan 28, 2020 3:14 pm
Great Britain

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

Post by mark_k » Tue Jun 30, 2020 10:46 am

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

dannyclark
Newcomer
Posts: 9
Joined: Sat Jun 27, 2020 5:07 pm
Great Britain

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

Post by dannyclark » Tue Jun 30, 2020 1:26 pm

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.
Attachments
mythfrontend.log
(183.68 KiB) Downloaded 1 time

dannyclark
Newcomer
Posts: 9
Joined: Sat Jun 27, 2020 5:07 pm
Great Britain

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

Post by dannyclark » Tue Jun 30, 2020 9:51 pm

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?
Attachments
mythfrontend.log
(156.25 KiB) Downloaded 1 time

User avatar
stuarta
Developer
Posts: 210
Joined: Wed Feb 05, 2014 5:13 pm
Great Britain

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

Post by stuarta » Thu Jul 02, 2020 1:14 pm

Could you supply the output from `glxinfo -B` please?

dannyclark
Newcomer
Posts: 9
Joined: Sat Jun 27, 2020 5:07 pm
Great Britain

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

Post by dannyclark » Thu Jul 02, 2020 9:13 pm

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

dannyclark
Newcomer
Posts: 9
Joined: Sat Jun 27, 2020 5:07 pm
Great Britain

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

Post by dannyclark » Fri Jul 03, 2020 7:50 am

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.
Attachments
mythfrontend.log
(99.88 KiB) Downloaded 1 time

dannyclark
Newcomer
Posts: 9
Joined: Sat Jun 27, 2020 5:07 pm
Great Britain

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

Post by dannyclark » Fri Jul 03, 2020 9:58 am

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.

Post Reply