Opened 2 years ago

Closed 2 years ago

Last modified 17 months ago

#13054 closed Bug Report - General (Fixed)

Video Playback vertical offset when using UseVideoModes=1 for JudderFree support

Reported by: support@… Owned by: Peter Bennett
Priority: minor Milestone: unknown
Component: MythTV - Video Playback Version: 0.28.1
Severity: medium Keywords:
Cc: Ticket locked: no

Description

When using any video playback mode other than VDPAU the playback window is shifted between 50 and 150 pixels down if we turn on UseVideoModes=1

I've confirmed this with

  • Normal
  • Slim
  • OpenGL
  • VDPAU - multiple modes

To reproduce enable JudderFree? as per

Then playback a video that would normally fill the screen and it will be offset by 50-150 pixels depending on the output mode you select.

Attachments (2)

20170906_test_displayres.patch (745 bytes) - added by Peter Bennett 2 years ago.
Patch to test a possible solution by forcing fullscreen
mythfrontend.log (12.3 KB) - added by chrisw@… 2 years ago.
Part of log: just after file open to playback start

Download all attachments as: .zip

Change History (48)

comment:1 Changed 2 years ago by Steven Ellis <support@…>

I've run some tests to isolate the potential issue via

  • mythfrontend -v playback

The debug output appears to indicate that in file tv_play.cpp there is a critical section of code that is causing the change, but it doesn't occur when using VDPAU, or perhaps the NVidia card compensates.

  • Changing from None to WatchingVideo? - Line 2532
    • Somewhere between these we've called VideoOutWindow::MoveResize?
  • Main UI disabled - Line 2634

comment:2 Changed 2 years ago by Steven Ellis <support@…>

Comparing Normal playback with and without frame rate switching

Initial difference

# Normal with no offset
 I  VideoOutWindow::SetPIPState. pip_state: 0]
 I  VDP: LoadBestPreferences(2048x2048, 23.9394)
 I  Display Rect  left: 0, top: 132, width: 1920, height: 815, aspect: 1.33333
 I  Video Rect    left: 0, top: 0, width: 848, height: 480, aspect: 1.76667
 I  VDP: LoadBestPreferences(848x480, 23.9394)
 I  Display Rect  left: 0, top: 132, width: 1920, height: 815, aspect: 1.33333
 I  Video Rect    left: 0, top: 0, width: 848, height: 480, aspect: 1.76667
 I  VideoOutput: Pixel dimensions: Screen 1920x1080, window 1920x1080
 I  VideoOutput: Actual display dimensions: 487x274 mm  Aspect: 1.77737
 I  VideoOutput: Estimated window dimensions: 487x274 mm  Aspect: 1.77737
 I  VideoOutputXv: InitSetupBuffers() render: xv-blit, allowed: xv-blit,xshm,xlib

# vs Normal with video offset


 I  VideoOutputXv: ctor
 I  VideoOutWindow::SetPIPState. pip_state: 0]
 I  VDP: LoadBestPreferences(2048x2048, 23.9394)
 I  Display Rect  left: 0, top: 132, width: 1920, height: 815, aspect: 1.33333
 I  Video Rect    left: 0, top: 0, width: 848, height: 480, aspect: 1.76667
 I  VDP: LoadBestPreferences(848x480, 23.9394)
 I  Display Rect  left: 0, top: 132, width: 1920, height: 815, aspect: 1.33333
 I  Video Rect    left: 0, top: 0, width: 848, height: 480, aspect: 1.76667
 I  Trying to match best refresh rate 23.939Hz
 I  Using 1920x1080 23.971 Hz
 I  SwitchToVideo: Video size 848 x 480: 
    Already displaying resolution 1920 x 1080, 508mm x 286mm
 I  VideoOutput: Pixel dimensions: Screen 1920x1080, window 1920x1080
 I  VideoOutput: Actual display dimensions: 487x274 mm  Aspect: 1.77737
 I  VideoOutput: Estimated window dimensions: 487x274 mm  Aspect: 1.77778
 I  VideoOutputXv: InitSetupBuffers() render: xv-blit, allowed: xv-blit,xshm,xlib

Additional lines are

 I  Trying to match best refresh rate 23.939Hz
 I  Using 1920x1080 23.971 Hz
 I  SwitchToVideo: Video size 848 x 480: 
    Already displaying resolution 1920 x 1080, 508mm x 286mm

Later on the key differences are

 I  playCtx: StartPlaying(): took 0 ms to start player.
 I  TV::StartPlayer(): Created player.
 I  TV::HandleStateChange(): Changing from None to WatchingVideo
 I  TV::HandleStateChange(): Main UI disabled.
 I  TV::StartTV(): Entering main playback loop.
 I  Player(3): Video Aspect ratio changed from 1.76667 to 1.77778
 I  Display Rect  left: 0, top: 0, width: 1920, height: 1080, aspect: 1.77778
 I  Video Rect    left: 0, top: 0, width: 848, height: 480, aspect: 1.77778
 I  OSD: Base theme size: 1920x1080


# vs Normal with video offset

 I  playCtx: StartPlaying(): took 0 ms to start player.
 I  TV::StartPlayer(): Created player.
 I  TV::HandleStateChange(): Changing from None to WatchingVideo
 I  Display Rect  left: 0, top: 56, width: 1920, height: 1088, aspect: 1.60197
 I  Video Rect    left: 0, top: 0, width: 848, height: 480, aspect: 1.76667
 I  TV::HandleStateChange(): Main UI disabled.
 I  TV::StartTV(): Entering main playback loop.
 I  Player(3): Waiting for video buffers...
 I  Player(3): Video Aspect ratio changed from 1.76667 to 1.77778
 I  Display Rect  left: 0, top: 59, width: 1920, height: 1081, aspect: 1.60197
 I  Video Rect    left: 0, top: 0, width: 848, height: 480, aspect: 1.77778
 I  OSD: Base theme size: 1920x1080

Key change is an additional call to VideoOutWindow::MoveResize

 I  Display Rect  left: 0, top: 56, width: 1920, height: 1088, aspect: 1.60197
 I  Video Rect    left: 0, top: 0, width: 848, height: 480, aspect: 1.76667

# Plus broken values on the other call 
 I  Display Rect  left: 0, top: 59, width: 1920, height: 1081, aspect: 1.60197

For some reason we're ending up with a top offset of 56 or 59 pixes.

comment:3 Changed 2 years ago by Steven Ellis <support@…>

Ditto comparing working VDPAU output with Broken output using Normal playback

#VDPAU 
 I  Player(3): Video timing method: USleep with busy wait
 I  Player(3): Display Refresh Rate: 23.971 Video Frame Rate: 23.939
 I  Player(3): SetFrameInterval ps:1 scan:1
 I  VidOutVDPAU: Added 2 new buffers. New buffer size 16 (4 decode and 12 process)
 I  playCtx: StartPlaying(): took 0 ms to start player.
 I  TV::StartPlayer(): Created player.
 I  TV::HandleStateChange(): Changing from None to WatchingVideo
 I  TV::HandleStateChange(): Main UI disabled.
 I  TV::StartTV(): Entering main playback loop.
 I  Player(3): Waiting for video buffers...
 I  VidOutVDPAU: Created VDPAU decoder (4 ref frames)
 I  Player(3): Video Aspect ratio changed from 1.76667 to 1.77778
 I  Display Rect  left: 0, top: 0, width: 1920, height: 1080, aspect: 1.77778
 I  Video Rect    left: 0, top: 0, width: 848, height: 480, aspect: 1.

# Normal Playback (offset)
 I  Player(3): Video timing method: USleep with busy wait
 I  Player(3): Display Refresh Rate: 23.971 Video Frame Rate: 23.939
 I  Player(3): SetFrameInterval ps:1 scan:1
 I  playCtx: StartPlaying(): took 0 ms to start player.
 I  TV::StartPlayer(): Created player.
 I  TV::HandleStateChange(): Changing from None to WatchingVideo
 I  Display Rect  left: 0, top: 56, width: 1920, height: 1088, aspect: 1.60197
 I  Video Rect    left: 0, top: 0, width: 848, height: 480, aspect: 1.76667
 I  TV::HandleStateChange(): Main UI disabled.
 I  TV::StartTV(): Entering main playback loop.
 I  Player(3): Waiting for video buffers...
 I  Player(3): Video Aspect ratio changed from 1.76667 to 1.77778
 I  Display Rect  left: 0, top: 59, width: 1920, height: 1081, aspect: 1.60197
 I  Video Rect    left: 0, top: 0, width: 848, height: 480, aspect: 1.77778

Broken playback as an additional call to VideoOutWindow::MoveResize

 I  Display Rect  left: 0, top: 56, width: 1920, height: 1088, aspect: 1.60197
 I  Video Rect    left: 0, top: 0, width: 848, height: 480, aspect: 1.76667

# Plus broken values on the other call
 I  Display Rect  left: 0, top: 59, width: 1920, height: 1081, aspect: 1.60197

comment:4 Changed 2 years ago by Steven Ellis <support@…>

I can now reproduce this on two different frontends

  • One with NVidia Graphics
  • One with onboard Intel Graphics

On both machines

  • No playback alignment issues with UseVideoModes=0
  • Vertical offset of around 50 pixels with UseVideoModes=1 and Normal
  • Vertical offset of around 130 pixels with UseVideoModes=1 and OpenGL
  • No playback alignment issues with UseVideoModes=1 and VPDAU with NVidia Graphics

It is clear from the logs that the calls to !VideoOutWindow::MoveResize have odd Display Rect sizes when we enable UseVideoModes but I can't isolate where the change is being made.

The other key difference is we're seeing an additional call to !VideoOutWindow::MoveResize when running with OpenGL or Normal video output compared to the VDPAU drive.

comment:5 Changed 2 years ago by Jonatan Lindblad

#7408 and #9233 might be relevant.

comment:6 Changed 2 years ago by Peter Bennett

I can reproduce this but only when I set the GUI video mode as smaller than the native screen resolution. I have a monitor that is capable of 1280*1024.

If I select GUI as 1152*864 and Video also as 1152*864, the video is shifted down by a couple of hundred pixels. If I select GUI as 1152*864 and Video as 640*480 the video is additionally huge with only a small part of it visible.

On the other hand, if I select GUI as 1280*1024, everything works fine for all sizes of video I select.

If I select Video as a different shape than the monitor, the video is squished unless I override the aspect ratio (I think this is a separate problem).

It seems like some wrong calculations are being done.

comment:7 Changed 2 years ago by Peter Bennett

Owner: changed from JYA to Peter Bennett
Status: newassigned

comment:8 Changed 2 years ago by Steven Ellis <support@…>

Interesting as I've got the GUI set to 1920x1080 which is the same as the native screen resolution, and yet I'm seeing the video offset problem.

comment:9 Changed 2 years ago by Peter Bennett

Status: assignedaccepted

comment:10 Changed 2 years ago by Peter Bennett <pbennett@…>

Resolution: fixed
Status: acceptedclosed

In 7388b5a60c54d5e812a535bf5212295e512c5c3f/mythtv:

Fix bugs that occur when using a different video mode for playback.

Fixes these cases where the code does not cater for the video mode
changing between GUI and playback.

  • Playback using xv-blit and maybe others is shown in the wrong size and position.
  • Playback using OpenGL is displaced downward.
  • LiveTV using OpenGL is the wrong size.
  • Program Guide and other screens selected from within LiveTV when using OpenGL

are cut off on the right.

Fixes #7408
Fixes #11363
Fixes #13054

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

In eef6a480b0eca5201eec785b0ce57f9a6f4b7fdd/mythtv:

Fix bugs that occur when using a different video mode for playback.

Fixes these cases where the code does not cater for the video mode
changing between GUI and playback.

  • Playback using xv-blit and maybe others is shown in the wrong size and position.
  • Playback using OpenGL is displaced downward.
  • LiveTV using OpenGL is the wrong size.
  • Program Guide and other screens selected from within LiveTV when using OpenGL

are cut off on the right.

Fixes #7408
Fixes #11363
Fixes #13054

(cherry picked from commit 7388b5a60c54d5e812a535bf5212295e512c5c3f)

comment:12 Changed 2 years ago by Steven Ellis <support@…>

Resolution: fixed
Status: closednew

Afraid the issue hasn't been resolved for

  • OpenGL
  • VAAPI

It does appear to be fixed with xv-blit

Tried testing with the following Video Playback Modes

  • High Quality - works no offset
  • Open GL (all variants) - still have an offset
  • VAAPI - Still has an offset

Tried on two types of hardware under Ubuntu 16.04.2 with a build from source of 0.28 fixes branch.

comment:13 Changed 2 years ago by Steven Ellis <support@…>

To assist with debugging I inserted some additional debug LOGs into the source

diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp
index 12fa839..22de436 100644
--- a/mythtv/libs/libmythtv/tv_play.cpp
+++ b/mythtv/libs/libmythtv/tv_play.cpp
@@ -2606,6 +2606,7 @@ void TV::HandleStateChange(PlayerContext *mctx, PlayerContext *ctx)
         // skip this logic in that case.
         if (!switchMode)
         {
+            LOG(VB_PLAYBACK, LOG_INFO, LOC + "UseVideoModes is 0");
             MythMainWindow *mainWindow = GetMythMainWindow();
             mainWindow->setBaseSize(player_bounds.size());
             mainWindow->setMinimumSize(
@@ -9880,6 +9881,7 @@ void TV::customEvent(QEvent *e)
         if (!switchMode
             && (!db_use_gui_size_for_tv || !db_use_fixed_size))
         {
+            LOG(VB_PLAYBACK, LOG_INFO, LOC + "UseVideoModes is 0");
             mwnd->setMinimumSize(QSize(16, 16));
             mwnd->setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
             mwnd->setGeometry(player_bounds.left(), player_bounds.top(),

diff --git a/mythtv/libs/libmythtv/videoout_opengl.cpp b/mythtv/libs/libmythtv/videoout_opengl.cpp
index a743e92..2bbb2f0 100644
--- a/mythtv/libs/libmythtv/videoout_opengl.cpp
+++ b/mythtv/libs/libmythtv/videoout_opengl.cpp
@@ -363,6 +363,8 @@ bool VideoOutputOpenGL::SetupOpenGL(void)
     if (!gl_context)
         return false;
 
+
+    LOG(VB_PLAYBACK, LOG_INFO, LOC + "SetupOpenGL");
     QRect dvr = window.GetDisplayVisibleRect();
 
     MythMainWindow *mainWin = GetMythMainWindow();


diff --git a/mythtv/libs/libmythtv/videooutwindow.cpp b/mythtv/libs/libmythtv/videooutwindow.cpp
index 0ea9a17..ac56d04 100644
--- a/mythtv/libs/libmythtv/videooutwindow.cpp
+++ b/mythtv/libs/libmythtv/videooutwindow.cpp
@@ -100,6 +100,7 @@ void VideoOutWindow::populateGeometry(void)
 {
     qApp->processEvents();
     QDesktopWidget *desktop = NULL;
+    LOG(VB_PLAYBACK, LOG_INFO, "populateGeometry");
     if (qobject_cast<QApplication*>(qApp))
         desktop = QApplication::desktop();

Output confirmed that the correct paths were being taken for all playback modes when UseVideoModes=1

comment:14 Changed 2 years ago by Steven Ellis <support@…>

Output with --verbose playback when displaying a MPEG-2 576i SD video stream

2017-08-05 19:45:31.972431 I  AFD: Successfully opened decoder for file: "/myth2/tv/5906_20170805031700.ts". novideo(0)
2017-08-05 19:45:31.979570 I  VideoOutput: Allowed renderers: xv-blit,xshm,xlib,opengl,opengl-lite,vdpau,openglvaapi
2017-08-05 19:45:31.979619 I  VideoOutput: Allowed renderers (filt: ffmpeg): xlib,xshm,xv-blit,opengl,opengl-lite,vdpau,openglvaapi
2017-08-05 19:45:31.981986 I  VDP: Accepting: cmp(> 0 0) dec(ffmpeg) cpus(2) skiploop(enabled) rend(opengl) osd(opengl2) osdfade(enabled) deint(opengldoubleratekerneldeint,ope
nglkerneldeint) filt()
2017-08-05 19:45:31.982009 I  VDP: LoadBestPreferences(2048x2048, 0)
2017-08-05 19:45:31.982040 I  VDP: LoadBestPreferences(2048x2048, 60)
2017-08-05 19:45:31.982064 I  VDP: LoadBestPreferences(720x576, 60)
2017-08-05 19:45:31.982091 I  VideoOutput: Preferred renderer: opengl
2017-08-05 19:45:31.982106 I  VideoOutput: Trying video renderer: 'opengl'
2017-08-05 19:45:31.998963 I  populateGeometry
2017-08-05 19:45:32.013792 I  VDP: Accepting: cmp(> 0 0) dec(ffmpeg) cpus(2) skiploop(enabled) rend(opengl) osd(opengl2) osdfade(enabled) deint(opengldoubleratekerneldeint,ope
nglkerneldeint) filt()
2017-08-05 19:45:32.013819 I  VDP: LoadBestPreferences(2048x2048, 0)
2017-08-05 19:45:32.013850 I  VDP: LoadBestPreferences(2048x2048, 60)
2017-08-05 19:45:32.013891 I  VideoOutWindow::SetPIPState. pip_state: 0]
2017-08-05 19:45:32.013902 I  VDP: LoadBestPreferences(2048x2048, 25)
2017-08-05 19:45:32.033491 I  populateGeometry
2017-08-05 19:45:32.034530 I  Display Rect  left: 60, top: 0, width: 1800, height: 1080, aspect: 1.33333
2017-08-05 19:45:32.034551 I  Video Rect    left: 0, top: 0, width: 720, height: 576, aspect: 1.25
2017-08-05 19:45:32.034571 I  VDP: LoadBestPreferences(720x576, 25)
2017-08-05 19:45:32.034625 I  Display Rect  left: 60, top: 0, width: 1800, height: 1080, aspect: 1.33333
2017-08-05 19:45:32.034640 I  Video Rect    left: 0, top: 0, width: 720, height: 576, aspect: 1.25
2017-08-05 19:45:32.034661 I  VDP: SetVideoRenderer(opengl)
2017-08-05 19:45:32.034674 I  VDP: SetVideoRender(opengl) == GetVideoRenderer()
2017-08-05 19:45:32.034687 I  ColourSpace: PictureAttributes: Brightness, Contrast, Colour, Hue, Studio Levels, 
2017-08-05 19:45:32.063827 I  VidOutGL: Using main UI render context
2017-08-05 19:45:32.064983 I  Trying to match best refresh rate 25.000Hz
2017-08-05 19:45:32.065022 I  Using 1920x1080 50.000 Hz
2017-08-05 19:45:32.065050 I  SwitchToVideo: Video size 720 x 576: 
    Already displaying resolution 1920 x 1080, 508mm x 286mm
2017-08-05 19:45:32.065067 I  VideoOutput: Pixel dimensions: Screen 1920x1080, window 1920x1080
2017-08-05 19:45:32.069443 I  VideoOutput: Actual display dimensions: 508x286 mm  Aspect: 1.77622
2017-08-05 19:45:32.069467 I  VideoOutput: Estimated window dimensions: 508x286 mm  Aspect: 1.77778
2017-08-05 19:45:32.069486 I  VidOutGL: Using main UI painter
2017-08-05 19:45:32.069493 I  VidOutGL: SetupOpenGL
2017-08-05 19:45:32.069543 I  OpenGL: Using GL_NV_fence
2017-08-05 19:45:32.069554 I  GLVid: Viewport: 1920x1080
2017-08-05 19:45:32.073729 I  GLVid: Creating master filter.
2017-08-05 19:45:32.074316 I  GLVid: Using custom UYVY input textures.
2017-08-05 19:45:32.074332 I  GLVid: Creating resize filter.
2017-08-05 19:45:32.085200 I  OpenGL: Created frame buffer object (720x576).
2017-08-05 19:45:32.085333 I  GLVid: MMX: 1 PBO: 1
2017-08-05 19:45:32.085380 I  VDP: GetFilteredDeint() : opengl -> 'opengldoubleratekerneldeint'
2017-08-05 19:45:32.086398 I  FilterManager: GetFilterInfo(convert) returning: 0x0
2017-08-05 19:45:32.086425 E  VideoOutput: Couldn't load deinterlace filter opengldoubleratekerneldeint
2017-08-05 19:45:32.086432 I  VideoOutput: Using deinterlace method 
2017-08-05 19:45:32.086462 I  Display Rect  left: 285, top: 0, width: 1350, height: 1080, aspect: 1.77778
2017-08-05 19:45:32.086475 I  Video Rect    left: 0, top: 0, width: 720, height: 576, aspect: 1.25
2017-08-05 19:45:32.086508 I  Display Rect  left: 285, top: 0, width: 1350, height: 1080, aspect: 1.77778
2017-08-05 19:45:32.086520 I  Video Rect    left: 0, top: 0, width: 720, height: 576, aspect: 1.25
2017-08-05 19:45:32.088315 I  Over/underscan. V: 0, H: 0
2017-08-05 19:45:32.088338 I  Display Rect  left: 285, top: 0, width: 1350, height: 1080, aspect: 1.77778
2017-08-05 19:45:32.088350 I  Video Rect    left: 0, top: 0, width: 720, height: 576, aspect: 1.25
2017-08-05 19:45:32.088388 I  Player(0): LoadFilters(''..) -> 0x0
2017-08-05 19:45:32.089987 I  Player(0): Decoder thread starting.

comment:15 Changed 2 years ago by Peter Bennett

Status: newinfoneeded_new

Please make sure that you have the following settings:

GUI width 0 Gui height 0 Gui X offset 0 Gui Y offset 0 Use window border unchecked.

It is only fixed for the full screen case. Using nonzero offsets and window sizes do not work in a reasonable fashion when the resolution gets changed.

If you have confirmed these settings and it is still happening, please tell me what you have for everything on theme/screen settings and video mode settings, also which playback profile you are using.

For me, I only see the problem when setting GUI height, width etc. or setting window border.

If there is some real reason for needing those setting in conjunction with separate video modes, please explain the problem you are trying to solve.

comment:16 Changed 2 years ago by Steven Ellis <support@…>

Pulling the values out of the DB for this frontend.

GUI Settings

mythfe@mythtv:~$ mysqldump --skip-opt -u $DBUserName -p$DBPassword -h $DBHostName $DBName -t --compact   settings -w "hostname='mythbuntu_brix'" | egrep -i "gui|border"
INSERT INTO `settings` VALUES ('GuiWidth','0','mythbuntu_brix');
INSERT INTO `settings` VALUES ('GuiHeight','0','mythbuntu_brix');
INSERT INTO `settings` VALUES ('GuiOffsetX','0','mythbuntu_brix');
INSERT INTO `settings` VALUES ('GuiOffsetY','0','mythbuntu_brix');
INSERT INTO `settings` VALUES ('GuiSizeForTV','0','mythbuntu_brix');
INSERT INTO `settings` VALUES ('GuiVidModeResolution','1920x1080','mythbuntu_brix');

Video Mode

INSERT INTO `settings` VALUES ('UseVideoModes','1','mythbuntu_brix');
INSERT INTO `settings` VALUES ('DefaultVideoPlaybackProfile','OpenGL Slim','mythbuntu_brix');

OpenGL Settings

mythfe@mythtv:~$ mysqldump --skip-opt -u $DBUserName -p$DBPassword -h $DBHostName $DBName -t --compact | egrep -i "OpenGL Slim"

INSERT INTO `displayprofilegroups` VALUES ('OpenGL Slim','mythbuntu_brix',74);

mythfe@mythtv:~$ mysqldump --skip-opt -u $DBUserName -p$DBPassword -h $DBHostName $DBName -t --compact   displayprofiles -w "profilegroupid=74"

INSERT INTO `displayprofiles` VALUES (74,148,'pref_priority','1');
INSERT INTO `displayprofiles` VALUES (74,148,'pref_cmp0','> 0 0');
INSERT INTO `displayprofiles` VALUES (74,148,'pref_decoder','ffmpeg');
INSERT INTO `displayprofiles` VALUES (74,148,'pref_max_cpus','1');
INSERT INTO `displayprofiles` VALUES (74,148,'pref_skiploop','1');
INSERT INTO `displayprofiles` VALUES (74,148,'pref_videorenderer','opengl-lite');
INSERT INTO `displayprofiles` VALUES (74,148,'pref_osdrenderer','opengl2');
INSERT INTO `displayprofiles` VALUES (74,148,'pref_osdfade','1');
INSERT INTO `displayprofiles` VALUES (74,148,'pref_deint0','onefield');
INSERT INTO `displayprofiles` VALUES (74,148,'pref_deint1','onefield');
INSERT INTO `displayprofiles` VALUES (74,148,'pref_filters','');
INSERT INTO `displayprofiles` VALUES (74,148,'pref_cmp1','');

Themes

INSERT INTO `settings` VALUES ('ThemePainter','auto','mythbuntu_brix');
INSERT INTO `settings` VALUES ('MenuTheme','defaultmenu','mythbuntu_brix');
INSERT INTO `settings` VALUES ('Theme','Monochrome','mythbuntu_brix');

comment:17 Changed 2 years ago by Steven Ellis <support@…>

Note that this is reproducible on two very different HW platforms

  • Athlon X2 with NVidia GT710 graphics
  • Gigabyte Brix N3150 with onboard Intel graphics

UseVideoModes=1 works with VDPAU fine on the NVidia card.

OpenGL fails on both sets of HW and VAAPI failes on the Intel HW.

comment:18 Changed 2 years ago by Peter Bennett

Can you tell me the size you set for Video Output resolution.

Are you using any settings in the section "overrides for specific video sizes" and if so what settings do you have there?

comment:19 Changed 2 years ago by Peter Bennett

I have retested on two machines with different hardware, including setting overrides for specific video sizes. On both OpenGL and VAAPI, there is no offset as long as I have the full screen settings mentioned in https://code.mythtv.org/trac/ticket/13054#comment:15 . Please can you paste the full version number from mythutil --version.

comment:20 Changed 2 years ago by Steven Ellis <support@…>

Details from mythutil

mythfe1@mythtv:~$ LD_LIBRARY_PATH=~/mythbuild/lib/ ~/mythbuild/bin/mythutil --version
Please attach all output as a file in bug reports.
MythTV Version : v0.28.1-38-geef6a48-dirty
MythTV Branch : fixes/0.28
Network Protocol : 88
Library API : 0.28.20161120-1
QT Version : 5.5.1
Options compiled in:
 linux debug use_hidesyms using_alsa using_oss using_pulse using_pulseoutput using_backend using_bindings_perl using_bindings_python using_bindings_php using_dvb using_frontend using_hdhomerun using_vbox using_ceton using_hdpvr using_ivtv using_joystick_menu using_lirc using_mheg using_opengl using_opengl_video using_opengl_themepainter using_qtwebkit using_qtscript using_qtdbus using_taglib using_v4l2 using_x11 using_xrandr using_xv using_debugtype using_bindings_perl using_bindings_python using_bindings_php using_freetype2 using_mythtranscode using_opengl using_vaapi using_vdpau using_ffmpeg_threads using_mheg

comment:21 Changed 2 years ago by Steven Ellis <support@…>

I'm running with a fairly standard MythBuntu 16.04

  • Display 1920x1080
  • xfce desktop

Some additional settings for this frontend mode - I appear to meet all the settings you specified under comment:15

INSERT INTO `settings` VALUES ('GuiVidModeResolution','1920x1080','mythbuntu_brix');
INSERT INTO `settings` VALUES ('RunFrontendInWindow','0','mythbuntu_brix');
INSERT INTO `settings` VALUES ('TVVidModeForceAspect0','0.0','mythbuntu_brix');
INSERT INTO `settings` VALUES ('TVVidModeForceAspect1','0.0','mythbuntu_brix');
INSERT INTO `settings` VALUES ('TVVidModeForceAspect','1.77777777777','mythbuntu_brix');
INSERT INTO `settings` VALUES ('TVVidModeForceAspect2','0.0','mythbuntu_brix');
INSERT INTO `settings` VALUES ('TVVidModeRefreshRate0','60.000','mythbuntu_brix');
INSERT INTO `settings` VALUES ('TVVidModeRefreshRate','0','mythbuntu_brix');
INSERT INTO `settings` VALUES ('TVVidModeRefreshRate1','60.000','mythbuntu_brix');
INSERT INTO `settings` VALUES ('TVVidModeRefreshRate2','60.000','mythbuntu_brix');
INSERT INTO `settings` VALUES ('TVVidModeResolution0','640x480','mythbuntu_brix');
INSERT INTO `settings` VALUES ('TVVidModeResolution1','640x480','mythbuntu_brix');
INSERT INTO `settings` VALUES ('TVVidModeResolution','1920x1080','mythbuntu_brix');
INSERT INTO `settings` VALUES ('TVVidModeResolution2','640x480','mythbuntu_brix');
INSERT INTO `settings` VALUES ('UseFixedWindowSize','1','mythbuntu_brix');

Is there anything else I can insert into my build to help with debugging?

comment:22 Changed 2 years ago by Peter Bennett

Before my fixes I could see this clearly in many places as you described. The fixes involved resetting in coordinate systems to correct values after the resolution change. Now it works perfectly for me in every case. I don't really have any chance of fixing it if I cannot reproduce it.

Perhaps the problem depends on the window manager. What window manager are you using?

echo "$XDG_CURRENT_DESKTOP"

I am using XCFE, and all is fine.

Maybe you could try without a window manager, see this link https://code.mythtv.org/trac/ticket/12311#comment:14 , as an experiment to see if that changes anything.

comment:23 Changed 2 years ago by Steven Ellis <support@…>

Thanks for the tips. Interesting behaviour

Without a window managed both xvblit and opengl have issues with my debug build with your changes. I tried the modes

  • Normal
  • OpenGL Normal

I then switched back to the default Mythbuntu window managed XFCE and found that

  • Normal - correctly fills screen
  • OpenGL Normal - Same video offset issue

Is there any other debug data I can grab to help resolve this, or perhaps add some additional debug output to my local build?

comment:24 in reply to:  23 Changed 2 years ago by Peter Bennett

Replying to Steven Ellis <support@…>:

Is there any other debug data I can grab to help resolve this, or perhaps add some additional debug output to my local build?

If you look at 7388b5a60c54d5e812a535bf5212295e512c5c3f/mythtv:

See the changes to mythtv/libs/libmythtv/videoout_opengl.cpp at the lines of code shown below. This is where I adjust for the resolution change.

If you print out all the values in this calculation, maybe we can see what is going on

if (dvr.height() < mainSize.height())
    dvr.setTop(dvr.top()-mainSize.height()+dvr.height());

i.e. print dvr.height(), mainSize.height(), dvr.top() before the if test. Then after the calculation print dvr.top() again to see how it was changed. If you give me the results also tell me the screen resolutions you are using at the time.

comment:25 Changed 2 years ago by chrisw@…

I see the same issues. Mythtv version

/usr/local/bin/mythutil --version
Please attach all output as a file in bug reports.
MythTV Version : v29.0-25-g7a40b2fcac-dirty
MythTV Branch : fixes/29
Network Protocol : 91
Library API : 29.20170212-1
QT Version : 5.7.1
Options compiled in:
 linux profile use_hidesyms using_alsa using_oss using_backend using_bindings_perl using_bindings_python using_bindings_php using_dvb using_frontend using_hdhomerun using_vbox using_ceton using_hdpvr using_ivtv using_joystick_menu using_libcrypto using_libxml2 using_lirc using_mheg using_opengl using_opengl_video using_opengl_themepainter using_qtwebkit using_qtscript using_taglib using_v4l2 using_x11 using_xrandr using_xv using_profiletype using_bindings_perl using_bindings_python using_bindings_php using_freetype2 using_mythtranscode using_opengl using_vaapi using_ffmpeg_threads using_mheg using_libxml2

Core i5 Intel Skylake NUC. Software components

Linux mythtv 4.12.5-gentoo #16 SMP PREEMPT Tue Aug 22 18:35:49 AEST 2017 x86_64 Intel(R) Core(TM) i5-6260U CPU @ 1.80GHz GenuineIntel GNU/Linux

00:02.0 VGA compatible controller: Intel Corporation Iris Graphics 540 (rev 0a)

[IP-] [  ] x11-drivers/xf86-video-intel-2.99.917_p20170313:0
[IP-] [  ] x11-libs/libva-1.7.3:0
[IP-] [  ] x11-libs/libva-intel-driver-1.7.3:0
[IP-] [  ] x11-base/xorg-server-1.19.3:0/1.19.3
[IP-] [  ] x11-wm/evilwm-1.0.1:0

Mythtv straight from git with this patch as suggested above:

diff --git a/mythtv/libs/libmythtv/videoout_opengl.cpp b/mythtv/libs/libmythtv/videoout_opengl.cpp
index 6bdd0c0a59..98490304f6 100644
--- a/mythtv/libs/libmythtv/videoout_opengl.cpp
+++ b/mythtv/libs/libmythtv/videoout_opengl.cpp
@@ -381,6 +381,17 @@ bool VideoOutputOpenGL::SetupOpenGL(void)
     MythMainWindow *mainWin = GetMythMainWindow();
     QSize mainSize = mainWin->size();

+LOG(VB_PLAYBACK, LOG_INFO, LOC + "Before adjustment");
+LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("mainSize[w=%1 h=%2]")
+       .arg(mainSize.width())
+       .arg(mainSize.height()) );
+LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("dvr[l=%1 t=%2 w=%3 h=%4]")
+       .arg(dvr.left())
+       .arg(dvr.top())
+       .arg(dvr.width())
+       .arg(dvr.height()) );
+
+
     // If the Video screen mode has vertically less pixels
     // than the GUI screen mode - OpenGL coordinate adjustments
     // must be made to put the video at the top of the display
@@ -395,6 +406,16 @@ bool VideoOutputOpenGL::SetupOpenGL(void)
     if (dvr.width() < mainSize.width())
         dvr.setWidth(mainSize.width());

+LOG(VB_PLAYBACK, LOG_INFO, LOC + "After adjustment");
+LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("mainSize[w=%1 h=%2]")
+       .arg(mainSize.width())
+       .arg(mainSize.height()) );
+LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("dvr[l=%1 t=%2 w=%3 h=%4]")
+       .arg(dvr.left())
+       .arg(dvr.top())
+       .arg(dvr.width())
+       .arg(dvr.height()) );
+
     if (video_codec_id == kCodec_NONE)
     {

This output in the frontend log when playing a 1280x720p 23.98Hz source.

Sep  1 18:29:54 mythtv mythfrontend[10065]: mythfrontend[10065]: I CoreContext DisplayRes.cpp:148 (SwitchToVideo) Trying to match best refresh rate 23.976Hz
Sep  1 18:29:54 mythtv mythfrontend[10065]: mythfrontend[10065]: I CoreContext DisplayRes.cpp:162 (SwitchToVideo) Changing to 1920x1080 24.000 Hz
Sep  1 18:29:54 mythtv mythfrontend[10065]: mythfrontend[10065]: I CoreContext DisplayRes.cpp:183 (SwitchToVideo) SwitchToVideo: Video size 1280 x 720:
    Switched to displaying resolution 1920 x 1080, 508mm x 285mm
Sep  1 18:29:54 mythtv mythfrontend[10065]: mythfrontend[10065]: I CoreContext videooutwindow.cpp:568 (PrintMoveResizeDebug) Display Rect  left: 0, top: 0, width: 1920, height: 1080, aspect: 1.77778
Sep  1 18:29:54 mythtv mythfrontend[10065]: mythfrontend[10065]: I CoreContext videooutwindow.cpp:577 (PrintMoveResizeDebug) Video Rect    left: 0, top: 0, width: 1280, height: 720, aspect: 1.77778
Sep  1 18:29:54 mythtv mythfrontend[10065]: mythfrontend[10065]: I CoreContext videooutbase.cpp:1880 (InitDisplayMeasurements) VideoOutput: Pixel dimensions: Screen 1920x1080, window 1920x1080
Sep  1 18:29:54 mythtv mythfrontend[10065]: mythfrontend[10065]: I CoreContext videooutbase.cpp:1913 (InitDisplayMeasurements) VideoOutput: Database display dimensions: 508x285 mm  Aspect: 1.78246
Sep  1 18:29:54 mythtv mythfrontend[10065]: mythfrontend[10065]: I CoreContext videooutbase.cpp:1937 (InitDisplayMeasurements) VideoOutput: Estimated window dimensions: 508x285 mm  Aspect: 1.78246
Sep  1 18:29:54 mythtv mythfrontend[10065]: mythfrontend[10065]: I CoreContext videoout_opengl.cpp:489 (CreatePainter) VidOutGL: Using main UI painter
Sep  1 18:29:54 mythtv mythfrontend[10065]: mythfrontend[10065]: I CoreContext videoout_opengl.cpp:384 (SetupOpenGL) VidOutGL: Before adjustment
Sep  1 18:29:54 mythtv mythfrontend[10065]: mythfrontend[10065]: I CoreContext videoout_opengl.cpp:387 (SetupOpenGL) VidOutGL: mainSize[w=1920 h=1080]
Sep  1 18:29:54 mythtv mythfrontend[10065]: mythfrontend[10065]: I CoreContext videoout_opengl.cpp:392 (SetupOpenGL) VidOutGL: dvr[l=0 t=0 w=1920 h=1080]
Sep  1 18:29:54 mythtv mythfrontend[10065]: mythfrontend[10065]: I CoreContext videoout_opengl.cpp:409 (SetupOpenGL) VidOutGL: After adjustment
Sep  1 18:29:54 mythtv mythfrontend[10065]: mythfrontend[10065]: I CoreContext videoout_opengl.cpp:412 (SetupOpenGL) VidOutGL: mainSize[w=1920 h=1080]
Sep  1 18:29:54 mythtv mythfrontend[10065]: mythfrontend[10065]: I CoreContext videoout_opengl.cpp:417 (SetupOpenGL) VidOutGL: dvr[l=0 t=0 w=1920 h=1080]
Sep  1 18:29:54 mythtv mythfrontend[10065]: mythfrontend[10065]: I CoreContext openglvideo.cpp:736 (SetViewPort) GLVid: Viewport: 1920x1080
Sep  1 18:29:54 mythtv mythfrontend[10065]: mythfrontend[10065]: I CoreContext videocolourspace.cpp:115 (SetSupportedAttributes) ColourSpace: PictureAttributes:

The DVR is not adjusted. The GUI and video playback size are the same, only frame rate changed.

Settings pretty much out-of-the-box

INSERT INTO `settings` VALUES ('DefaultVideoPlaybackProfile','VAAPI Normal','mythtv');
INSERT INTO `settings` VALUES ('ThemePainter','auto','mythtv');
INSERT INTO `settings` VALUES ('MenuTheme','defaultmenu','mythtv');
INSERT INTO `settings` VALUES ('GuiWidth','0','mythtv');
INSERT INTO `settings` VALUES ('GuiHeight','0','mythtv');
INSERT INTO `settings` VALUES ('GuiOffsetX','0','mythtv');
INSERT INTO `settings` VALUES ('GuiOffsetY','0','mythtv');
INSERT INTO `settings` VALUES ('GuiSizeForTV','1','mythtv');
INSERT INTO `settings` VALUES ('UseVideoModes','1','mythtv');
INSERT INTO `settings` VALUES ('GuiVidModeResolution','1920x1080','mythtv');
INSERT INTO `settings` VALUES ('Theme','MythCenter-wide','mythtv');
INSERT INTO `settings` VALUES ('ThemeUpdateStatus','','mythtv');
INSERT INTO `displayprofilegroups` VALUES ('VAAPI Normal','mythtv',73);
INSERT INTO `displayprofiles` VALUES (73,199,'pref_priority','1');
INSERT INTO `displayprofiles` VALUES (73,199,'pref_cmp0','> 0 0');
INSERT INTO `displayprofiles` VALUES (73,199,'pref_decoder','vaapi');
INSERT INTO `displayprofiles` VALUES (73,199,'pref_max_cpus','2');
INSERT INTO `displayprofiles` VALUES (73,199,'pref_skiploop','1');
INSERT INTO `displayprofiles` VALUES (73,199,'pref_videorenderer','openglvaapi');
INSERT INTO `displayprofiles` VALUES (73,199,'pref_osdrenderer','opengl2');
INSERT INTO `displayprofiles` VALUES (73,199,'pref_osdfade','1');
INSERT INTO `displayprofiles` VALUES (73,199,'pref_deint0','vaapibobdeint');
INSERT INTO `displayprofiles` VALUES (73,199,'pref_deint1','vaapionefield');
INSERT INTO `displayprofiles` VALUES (73,199,'pref_filters','');
INSERT INTO `displayprofiles` VALUES (73,200,'pref_priority','2');
INSERT INTO `displayprofiles` VALUES (73,200,'pref_cmp0','> 0 0');
INSERT INTO `displayprofiles` VALUES (73,200,'pref_decoder','ffmpeg');
INSERT INTO `displayprofiles` VALUES (73,200,'pref_max_cpus','2');
INSERT INTO `displayprofiles` VALUES (73,200,'pref_skiploop','1');
INSERT INTO `displayprofiles` VALUES (73,200,'pref_videorenderer','opengl');
INSERT INTO `displayprofiles` VALUES (73,200,'pref_osdrenderer','opengl2');
INSERT INTO `displayprofiles` VALUES (73,200,'pref_osdfade','1');
INSERT INTO `displayprofiles` VALUES (73,200,'pref_deint0','opengldoubleratekerneldeint');
INSERT INTO `displayprofiles` VALUES (73,200,'pref_deint1','openglkerneldeint');
INSERT INTO `displayprofiles` VALUES (73,200,'pref_filters','');
INSERT INTO `displayprofiles` VALUES (73,199,'pref_cmp1','');
INSERT INTO `displayprofiles` VALUES (73,199,'cond_codecs','');
INSERT INTO `displayprofiles` VALUES (73,199,'cond_framerate','');
INSERT INTO `displayprofiles` VALUES (73,200,'cond_codecs','');
INSERT INTO `displayprofiles` VALUES (73,200,'cond_framerate','');
INSERT INTO `displayprofiles` VALUES (73,200,'pref_cmp1','');

Myth successfully changes the refresh rate to match the video but the image is shifted downward. It is as if the image is sitting on the bottom edge of the screen with the black space that should be two letterbox bars at the top. Perhaps a divide-by-two missing somwehere in the positioning (haven't found it myself).

comment:26 Changed 2 years ago by Peter Bennett

You have a screen size of 1920x1080 and a video of 1280x720. You set the video mode to 1920x1080 which is the same size as the GUI mode.

I just now tried exactly the same thing with MythTV master version and I see no black bar. The video is full screen.

The changes I had originally made were to address the case where the resolution was changed. However in your case the resolution did not change.

The image cannot be sitting on the bottom edge of the screen, some of it must be cut off, because at 1280x720 it is the same shape and size as the screen, or am I missing something here?

If I can recreate the problem I expect I could fix it, but nothing I do creates this effect.

If you change to use OpenGL playback profile, with standard decoding instead of VAAPI, does anything change?

I assume if you disable the separate modes for video and GUI that the problem goes away?

Could there be a broken OpenGL implementation? Perhaps some versions of OpenGL handle resolution changes differently?

comment:27 in reply to:  26 Changed 2 years ago by chrisw@…

Replying to pbennett:

You have a screen size of 1920x1080 and a video of 1280x720. You set the video mode to 1920x1080 which is the same size as the GUI mode.

Correct. I really only want the mode change to match screen rate to video rate with the GPU hardware scaling

I just now tried exactly the same thing with MythTV master version and I see no black bar. The video is full screen.

The changes I had originally made were to address the case where the resolution was changed. However in your case the resolution did not change.

Correct. Here is a version with a resolution change (same input video)

  • VAAPI Normal
  • Settings > Appearance > Separate video modes for GUI and TV playback checked
  • Video output set to 1280x720 (i.e. matching the test video size and different to the GUI size)
  • Video playback is offset

The debug output in SetupOpenGL() shows an adjustment.

Sep  2 12:21:57 mythtv mythfrontend[4341]: I CoreContext videoout_opengl.cpp:489 (CreatePainter) VidOutGL: Using main UI painter
Sep  2 12:21:57 mythtv mythfrontend[4341]: I CoreContext videoout_opengl.cpp:384 (SetupOpenGL) VidOutGL: Before adjustment
Sep  2 12:21:57 mythtv mythfrontend[4341]: I CoreContext videoout_opengl.cpp:387 (SetupOpenGL) VidOutGL: mainSize[w=1920 h=1080]
Sep  2 12:21:57 mythtv mythfrontend[4341]: I CoreContext videoout_opengl.cpp:392 (SetupOpenGL) VidOutGL: dvr[l=0 t=0 w=1280 h=720]
Sep  2 12:21:57 mythtv mythfrontend[4341]: I CoreContext videoout_opengl.cpp:409 (SetupOpenGL) VidOutGL: After adjustment
Sep  2 12:21:57 mythtv mythfrontend[4341]: I CoreContext videoout_opengl.cpp:412 (SetupOpenGL) VidOutGL: mainSize[w=1920 h=1080]
Sep  2 12:21:57 mythtv mythfrontend[4341]: I CoreContext videoout_opengl.cpp:417 (SetupOpenGL) VidOutGL: dvr[l=0 t=-360 w=1920 h=1080]

The image cannot be sitting on the bottom edge of the screen, some of it must be cut off, because at 1280x720 it is the same shape and size as the screen, or am I missing something here?

Agreed. The 1280x720 should scale by 1.5 to exactly 1920x1080. The video, while offset, is not distorted. You're not missing something, I was.

If I can recreate the problem I expect I could fix it, but nothing I do creates this effect.

If you change to use OpenGL playback profile, with standard decoding instead of VAAPI, does anything change?

Changing only 'VAAPI Normal' to 'OpenGL Normal' gives me the same result. This removes the hardware decoding but not OpenGL from play I guess.

I assume if you disable the separate modes for video and GUI that the problem goes away?

Correct.

  • VAAPI Normal
  • Settings > Appearance > Separate video modes for GUI and TV playback UNCHECKED
  • Video playback is correctly positioned (full screen in this case).

I also tried this in case we have two similar options being used in different places:

  • 'VAAPI Normal'
  • Settings > Appearance > Theme/Screen Settings > Use GUI size for TV playback UNCHECKED
  • Settings > Appearance > Separate video modes for GUI and TV playback CHECKED
  • Video playback is offset

Could there be a broken OpenGL implementation? Perhaps some versions of OpenGL handle resolution changes differently?

I guess it is possible but I see this on Intel and earlier reports have seen it on NVidia. It could be a breakage in Qt5 OpenGL but you might expect that to be universally broken. Several different Qt versions have been reported in this thread.

I will try:

comment:28 Changed 2 years ago by chrisw@…

No difference with these updated to align with Intel's recipe:

  • media-libs/mesa-17.1.3 (was 17.0.6)
  • x11-libs/libdrm-2.4.81 (was 2.4.80)
  • x11-libs/libva-1.8.3 (was 1.7.3)
  • x11-libs/libva-intel-driver-1.8.3 (was 1.7.3)

The current git master gives the same (broken) result.

mythutil --version
Please attach all output as a file in bug reports.
MythTV Version : v30-Pre-36-g7c4a57a42f-dirty
MythTV Branch : master
Network Protocol : 91
Library API : 30.20170212-1
QT Version : 5.7.1
Options compiled in:
 linux profile use_hidesyms using_alsa using_oss using_backend using_bindings_perl using_bindings_python using_bindings_php using_dvb using_frontend using_hdhomerun using_vbox using_ceton using_hdpvr using_ivtv using_joystick_menu using_libcrypto using_libxml2 using_lirc using_mheg using_opengl using_opengl_video using_opengl_themepainter using_qtwebkit using_qtscript using_taglib using_v4l2 using_x11 using_xrandr using_xv using_profiletype using_bindings_perl using_bindings_python using_bindings_php using_freetype2 using_mythtranscode using_opengl using_vaapi using_ffmpeg_threads using_mheg using_libxml2

I will dive into the code over the coming days

comment:29 Changed 2 years ago by Peter Bennett

Have you tried this?

While playing a video or recording that is offset:

  • Press M (menu)
  • select Video
  • select Manual Zoom Mode
  • down arrow a few times
  • press enter when picture is OK

Does this work? At least it could be workaround until we figure out what causes this. Unfortunately you would have to do this for each playback.

comment:30 Changed 2 years ago by chrisw@…

No, it does not work.

The top bar remains unchanged as the image slides up 'underneath' it. More of the lower part of the image is displayed but the top is truncated. With the same input video (1280x720) the amount of offset needed to put the bottom of the image at the bottom of the screen varies with the playback video size.

comment:31 Changed 2 years ago by Peter Bennett

I wonder if the window is getting wrongly positioned. Can you try something else.

While a video is playing and is offset -

  • Press alt-spacebar. Do you see the system menu at the top LHS of the window?
  • Do you see "Leave Fullscreen" or "Fullscreen" on the menu? Does selecting that change anything?
  • Do you see "Move" on the menu? Can you select that and then use up/down arrow to get the video correct?

comment:32 Changed 2 years ago by chrisw@…

I am using evilwm which has no notion of a system menu attached to the (notional) window border. The equivalent of the maximize/minimize toggle (ctl-alt-X) seemingly had no effect.

Using the Move-window-up command (ctl-alt-H) did the image move up and shrink the top bar. However, the 16 pixels exposed at the bottom were not redrawn and stayed with whatever was drawn before the move up. Moving down, left, or right had similar effects at the trailing edge.

After moving the image, using the maximize toggle would restore the image to its original position on the screen.

This is not a workable workaround, but it may provide a clue. It seems that there is a video window positioned too far down the display, with a height limited to the height available on the screen. The image is position at the top left of that space.

comment:33 Changed 2 years ago by Peter Bennett

There is a difference between maximized and fullscreen. When I select maximized on my xfce desktop there is indeed a gap at the top of the screen (where the status bar resides). Selecting fullscreen fixes it.

Based on the theory that the window is being incorrectly positioned for whatever reason, please can you try the attached patch. This is a temporary patch to see if it fixes the problem. It sets the window to fullscreen after changing video mode for playback.

If this fixes the problem, the patch will need a bit more work to be complete, as it will not be correctly resetting the GUI after playback in all cases, although it should be OK with the default settings you are using. It is not correctly dealing with the "use GUI size for TV playback" setting.

Changed 2 years ago by Peter Bennett

Patch to test a possible solution by forcing fullscreen

comment:34 Changed 2 years ago by chrisw@…

No change with the patch. I will attach the relevant part of the frontend log

Tried ratpoison in case this was an odd interaction with evilwm Tried running mythfrontend directly rather than through mythwelcome

Changed 2 years ago by chrisw@…

Attachment: mythfrontend.log added

Part of log: just after file open to playback start

comment:35 Changed 2 years ago by Peter Bennett

I don't know what else to do. I can keep throwing suggestions out but that does not seem to be productive. My latest thought is that maybe it is selecting a video mode that the hardware does not correctly support. In years past I have experienced many strange effects from setting refresh rates and resolutions that the hardware did not support, but that was with old crt-type screens, and I don't know whether that would happen these days. I suggest play around with different settings, different applications, different window managers and try to find any more information that may point to the cause.

There is a related patch in #13100 that I will be looking at. Maybe that will fix the problem. I have not tried that yet, you may want to look at it and if it applies in your situation try it out.

comment:36 Changed 2 years ago by Steven Ellis <support@…>

I'm currently running an older NVidia driver due to the issue from #13100.

Using

  • nvidia-340

comment:37 Changed 2 years ago by Steven Ellis <support@…>

Ok just tried some tests and if I try the 0002-Handle-non-integer-refresh-rates-in-XRandr.patch from #13100 it breaks OpenGL playback and I get no video out when using a 0.28 branch.

comment:38 Changed 2 years ago by Steven Ellis <support@…>

Second test - Change GUI Size under Appearance to 1920 x 1080 rather 0 x 0.

  • MythTV UI is now offset so that the menu bar from XFCE is present.
  • Playback under OpenGL appears to frame the video (almost) correctly, except for the menu bar offset meaning the bottom of the video is off the bottom of the screen by approx 20 pixels.

I'll try to grab some debug log output.

comment:39 Changed 2 years ago by Steven Ellis <support@…>

Some more testing.

With GUI Size fixed to 1920x1080 I can use ALT+Space to select full screen.

Any restart of the MythUI results in the Menu-bar re-appearing and I have to re-select full-screen.

If I set

  • Settings > Appearance > Theme/Screen Settings > GUI 1920 x 1080
  • Settings > Appearance > Theme/Screen Settings > Use GUI size for TV playback UNCHECKED
  • Settings > Appearance > Separate video modes for GUI and TV playback CHECKED

then playback hides the menu bar and I'm offset by about 200 pixels from the top of the screen again


If I set

  • Settings > Appearance > Theme/Screen Settings > GUI 1920 x 1080
  • Settings > Appearance > Theme/Screen Settings > Use GUI size for TV playback UNCHECKED
  • Settings > Appearance > Separate video modes for GUI and TV playback CHECKED

then playback is full screen as long as I manually hide the menu bar via ALT+SPACE and select full screen

comment:40 Changed 2 years ago by Peter Bennett

The two groups of settings in your last post look identical to me. I think you may have a typo. Maybe you meant screen settings 0x0 in the first set?

You say you are using NVidia. In that case why not use VDPAU? Are you using VAAPI, because on my NVidia systems VAAPI gives a distorted and cropped picture. On my Intel graphics system, VAAPI works perfectly.

If you now have it working with just the xfce menu bar visible, you can set the menu bar to auto-hide and then the video should go completely full screen.

The other thing is, if you have it working except for the xfce menu bar, you should be able to apply the patch after comment 33 (20170906_test_displayres.patch​) to force full screen.

I think I should anyway make a change to force full screen every time resolution is changed for video mode.

comment:41 Changed 2 years ago by Steven Ellis <support@…>

My main rig has a GT710 card and I usually use VDPAU which has no issues.

My test rig has intel graphics where I use VAAPI.

Testing of OpenGL playback shows the same issues on both sets of hardware and the compile time is faster on my main rig so I'm usually compiling new builds there.

Once I've resolved the OpenGL and VAAPI issues my plan is to use a lightweight NUC style device as a front end so I don't need a discrete NVidia card.

Yes you're right there was a typo above and the first set of options should have

  • Settings > Appearance > Theme/Screen Settings > GUI 0 x 0
  • Settings > Appearance > Theme/Screen Settings > Use GUI size for TV playback UNCHECKED
  • Settings > Appearance > Separate video modes for GUI and TV playback CHECKED

I'll take a look at your other patch over the weekend, but it would be useful to know why the issue only occurs when GUI should match the current screen resolution with 0x0

comment:42 Changed 2 years ago by Peter Bennett

I have done a number of tests and tried a few things.

My patch above to force fullscreen does not work.

If I leave GUI as 0x0 separate video modes work for me on both Intel and NVidia. In this case the GUI sets the window as fullscreen, with no menu bar visible.

If I set a different size for the GUI, the code uses a normal window, which means the menu bar is visible. In this case if you set your window as 1920x1080 part of it will be off screen since the menu bar takes up some of the screen. You may be able to solve this by setting the panel as auto-hide. If using a normal window this way, both the GUI and video playback are in windowed mode even if you set it to not use GUI size for playback.

If you set a GUI size, the code is using a normal window, the code starts getting into calculating window sizes and positions. When you combine this with mode switching, the results are not good. I tried tweaking the values and could not find the correct solution. I think a rewrite of some of the window handling is needed.

This is what I observed:

  • Gui Dimension , use GUI size, sep modes with same size - OK
  • Gui Dimension , use GUI size, sep modes with diff size - OK but this makes no sense because the position and size in pixels no longer fit the screen size
  • Gui Dimension , NOT use GUI size, sep modes with same size - picture cropped
  • Gui Dimension , NOT use GUI size, sep modes with diff size - picture offset and cropped
  • NO Gui Dimension , NOT use GUI size, sep modes with same size - OK
  • NO Gui Dimension , NOT use GUI size, sep modes with diff size - OK
  • Gui Dimension , NOT use GUI size, NO sep modes - OK but xfce status bar shows

I think we need to change so that when switching modes, using GUI size for video should be disabled, because the resulting picture may not fit on the screen. Also we should change it so that if using GUI size for video is disabled, it should go full screen for the video.

I think all that is beyond the scope of this ticket.

comment:43 Changed 2 years ago by Stuart Auchterlonie

I agree, redesigning that is beyond the scope of this ticket and is a pretty major piece of work.

Regards Stuart

comment:44 Changed 2 years ago by Peter Bennett

Resolution: Fixed
Status: infoneeded_newclosed

comment:45 Changed 22 months ago by Steven Ellis <support@…>

I'm still getting the same issues under MythTV 29 on MythBuntu? 16.04 running with an XFCE desktop.

Confirmed on two different devices with clean mythfrontend configurations

comment:46 Changed 17 months ago by Peter Bennett

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