Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#12984 closed Bug Report - General (fixed)

OpenGL or VAAPI playback fails when using QT Themepainter

Reported by: J.Pilk@… Owned by: Peter Bennett
Priority: minor Milestone: unknown
Component: MythTV - Video Playback Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

My main box (SL7.3, Qt 5.6.1 0.28-pre-189-g98b5662) has a longstanding QL driver bug that puts occasional reports starting like this into dmesg. The reports seem more frequent after the recent SL7.3 upgrade.

 WARNING: CPU: 0 PID: 1897 at drivers/gpu/drm/i915/i915_gem.c:4508 i915_gem_free_object+0x2e0/0x340 [i915]()
[332608.612640] WARN_ON(obj->frontbuffer_bits)

I think it also eats memory, so I stop and restart the frontend from time to time.

The Qt painter is suggested for use in a case like this, but if I start playback of a DVB-T radio recording the frontend screen vanishes and I get continuous reports of

QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined

This makes it impossible to use the on-screen editor. It also happens with Qt selected on an nVidia-equipped fc24 Qt 5.6.2 0.29-pre-278-gd1f336c box.

Change History (12)

comment:1 Changed 8 years ago by Peter Bennett

This is normally caused by using an OPENGL playback profile with a QT theme painter. As a workaround, check if your playback profile is set to one of the OPENGL profiles and if so change it to something else (e.g. Normal)

comment:2 Changed 8 years ago by J.Pilk@…

Thanks. Both boxes have it as Normal :-(

comment:3 Changed 8 years ago by J.Pilk@…

Same behaviour on my buntu laptop with 0.28-114-g9802102 (fixes) which doesn't have any of my attempts to improve the audiograph display and also uses the Normal profile. On passing <ctrl>C to the frontend after this has happened they all say something like this:

2017-01-30 16:43:56.101380 C  Received Interrupt: Code 128, PID 0, UID 0, Value 0x00000000
2017-01-30 16:43:56.101413 I  TV::StartTV(): Exiting main playback loop.
2017-01-30 16:43:56.126802 W  MythPainter: 16 images not yet de-allocated.
2017-01-30 16:43:56.126817 I  Clearing OpenGL painter cache.
2017-01-30 16:43:56.126827 I  OpenGL2: Deleting OpenGL Resources
2017-01-30 16:43:56.127414 I  OpenGL: Deleting OpenGL Resources

comment:4 Changed 8 years ago by Peter Bennett

If you have Changed theme painter to QT and selected a playback profile that does not use OpenGL, you should not be seeing that OpenGL stuff in the log. Maybe there is a plugin that uses it?

comment:5 Changed 8 years ago by J.Pilk@…

Good thought. I had a look at the menu during radio playback and there's visualisation there, so I tried 'dnf erase mythmusic' on the test box. Should have been 'dnf remove mythmusic' but it seemed to work. I don't know if it's taken the 'music' with it, but it hasn't affected what happens. The screen collapses and the swap-buffers complaint rolls on. Here's the frontend log after selecting playback:

2017-01-30 20:37:48.555790 I  TV::TV(): Creating TV object
2017-01-30 20:37:48.575648 N  Suspending idle timer
2017-01-30 20:37:48.577732 I  TV::Init(): Created TvPlayWindow.
2017-01-30 20:37:48.594695 I  TV::HandleStateChange(): Attempting to change from None to WatchingPreRecorded
2017-01-30 20:37:48.626427 E  ALSA: snd_pcm_info_get_card: Operation not permitted
2017-01-30 20:37:48.647758 N  AudioPlayer: Enabling Audio
2017-01-30 20:37:48.684077 I  AFD: codec MP2 has 2 channels
2017-01-30 20:37:48.684138 I  AFD: Opened codec 0x3019d20, id(MP2) type(Audio)
2017-01-30 20:37:48.684766 I  AOBase: Opening audio device 'default' ch 6(2) sr 48000 sf 32 bit floating point reenc 0
2017-01-30 20:37:48.710928 E  ALSA: no playback control PCM found on mixer device default
2017-01-30 20:37:48.710936 E  ALSA: Unable to open audio mixer. Volume control disabled
2017-01-30 20:37:49.871964 E  VDPAU: Error at mythrender_vdpau.cpp:1615 (#1, Unknown)
2017-01-30 20:37:49.871971 E  VDPAU: Failed to create VDPAU device.
2017-01-30 20:37:49.871975 E  VDPAU: No VDPAU device
2017-01-30 20:37:49.871979 E  VDPAU: Failed to create VDPAU render device.
2017-01-30 20:37:49.871984 E  VidOutVDPAU: Failed to initialise VDPAU
2017-01-30 20:37:49.890107 I  OpenGL: Sync to VBlank is enabled (good!)
2017-01-30 20:37:49.951988 I  Trying the OpenGL 2.0 render
2017-01-30 20:37:50.053565 I  OpenGL2: GLSL supported
2017-01-30 20:37:50.053619 I  OpenGL: OpenGL vendor  : NVIDIA Corporation
2017-01-30 20:37:50.053624 I  OpenGL: OpenGL renderer: GeForce 7500 LE/PCIe/SSE2
2017-01-30 20:37:50.053629 I  OpenGL: OpenGL version : 2.1.2 NVIDIA 304.134
2017-01-30 20:37:50.053636 I  OpenGL: Max texture size: 4096 x 4096
2017-01-30 20:37:50.053641 I  OpenGL: Max texture units: 4
2017-01-30 20:37:50.053661 I  OpenGL: Direct rendering: Yes
2017-01-30 20:37:50.053678 I  OpenGL: Extensions Supported: 1e3b
2017-01-30 20:37:50.053683 I  OpenGL: PixelBufferObject support available
2017-01-30 20:37:50.098848 I  OpenGL: Initialised MythRenderOpenGL
2017-01-30 20:37:50.098859 I  VidOutGL: Created MythRenderOpenGL device.
2017-01-30 20:37:50.103256 I  OpenGL painter using existing OpenGL context.
2017-01-30 20:37:50.103262 I  OpenGL painter using existing QWidget.
2017-01-30 20:37:50.104408 I  OSD: Base theme size: 1280x720
2017-01-30 20:37:50.104419 I  OSD: Scaling factors: 0.8x0.8
2017-01-30 20:37:50.154098 I  OSD: Base theme size: 1280x720
2017-01-30 20:37:50.154109 I  OSD: Scaling factors: 0.8x0.8
2017-01-30 20:37:50.156445 I  Player(0): Video timing method: USleep with busy wait
2017-01-30 20:37:50.159796 I  TV::StartPlayer(): Created player.
QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined
QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined
2017-01-30 20:37:50.162551 I  TV::HandleStateChange(): Changing from None to WatchingPreRecorded
2017-01-30 20:37:50.164842 I  TV::HandleStateChange(): Main UI disabled.
2017-01-30 20:37:50.165613 I  TV::StartTV(): Entering main playback loop.
2017-01-30 20:37:50.178673 I  ScreenSaverDBus: Successfully inhibited screensaver via org.freedesktop.ScreenSaver. cookie 8378. nom nom
2017-01-30 20:37:50.178977 I  ScreenSaverDBus: Successfully inhibited screensaver via org.freedesktop.PowerManagement.Inhibit. cookie 36. nom nom
2017-01-30 20:37:50.179242 I  ScreenSaverX11Private: DPMS Deactivated 1
QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined
QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined
QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined
QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined
QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined


I'll look to see what GL controls the nVidia system offers, but the initial motivation was to bypass the i915 GL brokenness. The visualisation still works with 'Auto' painter, so it oughtn't to be part of mythmusic anyway...

comment:6 Changed 8 years ago by Peter Bennett

From the log it looks like VDPAU is selected, and that fails so it selects OpenGL instead. If you have QT as the theme painter and OpenGL is used as the video renderer you get the error.

That is something the developers need to address, but in the meantime you can try to find some video renderer that does not end up selecting OpenGL.

comment:7 Changed 8 years ago by J.Pilk@…

Thank you. I had never tried the Edit buttons on the Playback Profiles page. xv-blit stops this problem on my test box with QT Painter, Normal profile and a non-vdpau nvidia card using 304.134. I haven't yet tried it with the i915 driver, or with more sophisticated switching on resolution. Perhaps I can bypass its kernel oopses.

https://www.mythtv.org/wiki/Configuring_Frontend#Playback_Profiles

comment:8 Changed 8 years ago by J.Pilk@…

An additional minor feature that it seems appropriate to report here: now that I'm using xv-blit and not seeing GL-related stuff in the logs the width of the OSD has shrunk for radio recordings. On my monitor it falls from 266mm to 244mm in a 290mm 1024 pixel window and looks uncomfortable. The log shows OSD width scaling factors of 0.5625, 0.55 and 0.425 for picture widths of 720, 704 and 544 pixels. No factor is shown for radio. Playback data shows 0x0@25.00fps. MythCenter?-wide with minor tweaks.

comment:9 Changed 8 years ago by Peter Bennett

Component: MythTV - GeneralMythTV - Video Playback
Owner: set to Peter Bennett
Status: newassigned
Summary: Qt painter crashes frontend in playback of DVB-T radio recordingsOpenGL or VAAPI playback fails when using QT Themepainter

There have been many reports complaining of this and three tickets, but nobody ever made the connection that is was the combination of QT Themepainter and OPENGL or VAAPI playback profile that causes this. It is not related to DVB Radio, it happens on all playback with these settings.

See tickets #12421, #12440

The OSD issue may be a duplicate of #12840

Last edited 8 years ago by Peter Bennett (previous) (diff)

comment:10 Changed 8 years ago by J.Pilk@…

A long time ago I quit using the Qt painter with the intel i915 driver under SL7 because the screen collapsed when I played radio recordings.' But TV played fine.' When I came back to that box it appeared that the xv-blit renderer was selected, although I had no memory of choosing it. Maybe the Auto-chosen GL Normal profile takes precedence.

It's now working fine with Qt, although there are very brief video glitches perhaps caused by buffer swaps at playback start or when a new preview is put up. I'm still getting the i915 warning messages, often after closing the frontend.

I'll add that I'm using a windowed display on a monitor. Not clear to me how much of the screen is affected by these choices.

Thanks anyway.

comment:11 Changed 8 years ago by Peter Bennett <pbennett@…>

Resolution: fixed
Status: assignedclosed

In e9daa4ef21577f2638f6f77413cd73a1e624f86e/mythtv:

Fix frontend failure when using QT painter with OpenGL video

Video output will select another method if the frontend theme painter
is not set up for OpenGL.

Fixes #12984

comment:12 Changed 7 years ago by Peter Bennett

Owner: changed from Peter Bennett to Peter Bennett
Note: See TracTickets for help on using tickets.