Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#12150 closed Patch - Bug Fix (fixed)

Force refresh of xf86VidMode current modeline

Reported by: Cédric Schieli <cschieli@…> Owned by: Cédric Schieli <cschieli@…>
Priority: minor Milestone: 0.27.1
Component: MythTV - Video Playback Version: 0.27-fixes
Severity: medium Keywords:
Cc: Ticket locked: no

Description

After changing the mode with XRRSetScreenConfigAndRate, the modeline returned by XF86VidModeGetModeLine is wrong until XRRGetScreenInfo is called (at least for X.Org 1.14.5 and 1.15.0 with Intel video driver).

DisplayResX::SwitchToVideo? first calls XRRGetScreenInfo, then calls XRRSetScreenConfigAndRate. This leads to XF86VidModeGetModeLine always returning the previous modeline instead of the current one.

This was causing juddering in some cases, because the refreshrate used in MythPlayer? for initializing avsync_predictor is obtained from XF86VidModeGetModeLine.

For example the following scenario was causing me consistent juddering every second:

The display has modelines for 24 Hz, 50 Hz and 60 Hz modes, and the desktop mode is 60 Hz. I first play a 23.976 fps video. The display switches to 24 Hz mode, but the refreshrate used by avsync_predictor is set to 60. This does not cause noticeable judderng. Then, I play a 25 fps video. The display switches to 50 Hz mode, and the refreshrate is set to 24 (the previous one). Every second the avsync_predictor kicks in and drops some frames.

This patch fixes this issue by calling XRRGetScreenInfo after the mode is changed by XRRSetScreenConfigAndRate.

Attachments (1)

Force-refresh-of-xf86VidMode-current-modeline.patch (2.1 KB) - added by Cédric Schieli <cschieli@…> 6 years ago.

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by Cédric Schieli <cschieli@…>

comment:1 Changed 6 years ago by JYA

Thank you for this.

Sounds just like a work around a X bug really.

Anyhow, please read http://www.mythtv.org/wiki/Coding_Standards Do not use tabs, use spaces (4 spaces indentation)

comment:2 Changed 6 years ago by Cédric Schieli <cschieli@…>

Owner: set to Cédric Schieli <cschieli@…>
Resolution: fixed
Status: newclosed

In b8d5f110581bee170807e32e4c919f6f17e6a9e1/mythtv:

Force refresh of xf86VidMode current modeline

After changing the mode with XRRSetScreenConfigAndRate, the modeline returned
by XF86VidModeGetModeLine is wrong until XRRGetScreenInfo is called (at
least for X.Org 1.14.5 and 1.15.0 with Intel video driver).

DisplayResX::SwitchToVideo? first calls XRRGetScreenInfo, then calls
XRRSetScreenConfigAndRate. This leads to XF86VidModeGetModeLine always
returning the previous modeline instead of the current one.

This was causing juddering in some cases, because the refreshrate used
in MythPlayer? for initializing avsync_predictor is obtained from
XF86VidModeGetModeLine.

For example the following scenario was causing me consistent juddering
every second:

The display has modelines for 24 Hz, 50 Hz and 60 Hz modes, and the desktop
mode is 60 Hz.
I first play a 23.976 fps video. The display switches to 24 Hz mode, but the
refreshrate used by avsync_predictor is set to 60. This does not cause
noticeable judderng. Then, I play a 25 fps video. The display switches to
50 Hz mode, and the refreshrate is set to 24 (the previous one). Every second
the avsync_predictor kicks in and drops some frames.

This patch fixes this issue by calling XRRGetScreenInfo after the mode is
changed by XRRSetScreenConfigAndRate.

Fixes #12150
Signed-off-by: Jean-Yves Avenard <jyavenard@…>

comment:3 Changed 6 years ago by JYA

Milestone: unknown0.27.1

comment:4 Changed 6 years ago by Cédric Schieli <cschieli@…>

In d1aa80d3f96a5215090efa94bed2d3dabee5381b/mythtv:

Force refresh of xf86VidMode current modeline

After changing the mode with XRRSetScreenConfigAndRate, the modeline returned
by XF86VidModeGetModeLine is wrong until XRRGetScreenInfo is called (at
least for X.Org 1.14.5 and 1.15.0 with Intel video driver).

DisplayResX::SwitchToVideo? first calls XRRGetScreenInfo, then calls
XRRSetScreenConfigAndRate. This leads to XF86VidModeGetModeLine always
returning the previous modeline instead of the current one.

This was causing juddering in some cases, because the refreshrate used
in MythPlayer? for initializing avsync_predictor is obtained from
XF86VidModeGetModeLine.

For example the following scenario was causing me consistent juddering
every second:

The display has modelines for 24 Hz, 50 Hz and 60 Hz modes, and the desktop
mode is 60 Hz.
I first play a 23.976 fps video. The display switches to 24 Hz mode, but the
refreshrate used by avsync_predictor is set to 60. This does not cause
noticeable judderng. Then, I play a 25 fps video. The display switches to
50 Hz mode, and the refreshrate is set to 24 (the previous one). Every second
the avsync_predictor kicks in and drops some frames.

This patch fixes this issue by calling XRRGetScreenInfo after the mode is
changed by XRRSetScreenConfigAndRate.

Fixes #12150
Signed-off-by: Jean-Yves Avenard <jyavenard@…>

(cherry picked from commit b8d5f110581bee170807e32e4c919f6f17e6a9e1)

Note: See TracTickets for help on using tickets.