Bug 22969 - flickering when playing video under invertion
Summary: flickering when playing video under invertion
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: 7.4 (2008.09)
Hardware: x86 (IA32) Linux (All)
: medium major
Assignee: Chris Wilson
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
: 22937 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-07-27 12:15 UTC by Bryce Harrington
Modified: 2013-10-21 22:49 UTC (History)
7 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Xorg.0.log (21.63 KB, text/plain)
2009-07-27 12:15 UTC, Bryce Harrington
no flags Details
dmesg.txt (37.60 KB, text/plain)
2009-07-27 12:17 UTC, Bryce Harrington
no flags Details
Conf file for my display - resolution 1024x600 (5.06 KB, text/plain)
2009-07-28 01:27 UTC, asergiu
no flags Details
Adrian -Xorg.0.log for starting X + AdobeAir + rotating screen 180 degrees (no debug) (22.97 KB, application/octet-stream)
2009-07-28 01:30 UTC, asergiu
no flags Details
Adrian - lspci -vv for my config (19.01 KB, text/plain)
2009-07-28 01:35 UTC, asergiu
no flags Details
Adrian - dmesg for my config (29.86 KB, text/plain)
2009-07-28 01:53 UTC, asergiu
no flags Details
video with the bug (727.62 KB, application/octet-stream)
2009-07-28 02:18 UTC, asergiu
no flags Details

Description Bryce Harrington 2009-07-27 12:15:24 UTC
Created attachment 28042 [details]
Xorg.0.log

Forwarding this Canonical customer-critical issue from launchpad:
https://bugs.edge.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/405425

[Problem]
When executing adobe air application that includes a "invert screen" effect heavy flickering can be noticed on the display.

This issue is seen on Jaunty but with the Karmic X stack and kernel.

[Original Report]
Hardware Platfform :Dell Optiplex 760 with Intel Corporation 4 Series Chipset Integrated Graphics Controller.
Ubuntu Version: 9.04
Intel Driver version: 2:2.8.0+git20090724.9a45ace2-0ubuntu0sarvatt~jaunty
X version: 2:1.6.2+git20090724+server-1.6-branch.606f6dba-0ubuntu0sarvatt2~jaunty
Kernel version: linux-image-2.6.31-020631rc4-generic

Description of the issue: When executing adobe air application that includes a "invert screen" effect heavy flickering can be noticed on the display. A video of the issue can be accessed at :
http://people.canonical.com/~luislopez/Dell_Optiplex_760_Display_Flickering_on_Adobe_Air_Application.avi

[lpci]
00:00.0 Host bridge [0600]: Intel Corporation 4 Series Chipset DRAM Controller [8086:2e10] (rev 03)
	Subsystem: Dell Device [1028:027f]
00:02.0 VGA compatible controller [0300]: Intel Corporation 4 Series Chipset Integrated Graphics Controller [8086:2e12] (rev 03)
	Subsystem: Dell Device [1028:027f]
Comment 1 Bryce Harrington 2009-07-27 12:17:11 UTC
Created attachment 28043 [details]
dmesg.txt
Comment 2 Gordon Jin 2009-07-27 20:02:15 UTC
*** Bug 22937 has been marked as a duplicate of this bug. ***
Comment 3 Gordon Jin 2009-07-27 20:05:21 UTC
I'm suspecting this is related to bug#16612.
Comment 4 asergiu 2009-07-28 01:27:11 UTC
Created attachment 28115 [details]
Conf file for my display - resolution 1024x600

Adrian - my xorg.conf - I tried removing most of the things from the conf -it still exposes the same behaviour.
Comment 5 asergiu 2009-07-28 01:30:43 UTC
Created attachment 28116 [details]
Adrian -Xorg.0.log for starting X + AdobeAir + rotating screen 180 degrees (no debug)

Adrian - Here is an Xorg.0.log for starting X + appl + rotating the screen after application start. (xrandr -o inverted) - there is no debug option in xorg.conf
Comment 6 asergiu 2009-07-28 01:35:26 UTC
Created attachment 28117 [details]
Adrian - lspci -vv for my config
Comment 7 asergiu 2009-07-28 01:43:48 UTC
IMPORTANT:
Now regarding the Air Application displaying video or video effects when screen rotated if I keep the finger pressed (it has a touchscreen or the mouse pressed) somewhere on the corner of the screen the flckering dissapears. So maybe is has something to do with a bad choice for the moment of blitting the rotated buffer which interacts with mouse display ???!?!? - so maybe doing that during vblank would be a better option ?

Adrian

P.S. 
Additional REMARK
On my platform as well when I turn off X (init 3 or killall X) the machine freezez about 3-5 seconds and the display is garbled for that period of time- but I think this is another issue not linked with the current bug. This is systematic.
Comment 8 asergiu 2009-07-28 01:53:25 UTC
Created attachment 28118 [details]
Adrian - dmesg for my config 

Dmesg file for my config
Comment 9 asergiu 2009-07-28 02:18:04 UTC
Created attachment 28119 [details]
video with the bug

See here how when turning the screen the app flashes. When pressing the screen (touchscreen) the flickering dissapears. 

I only had a phone to take the video (quite bad quality bu t the result can be seen) so the format is 3gp. It can be played by VLC even if it complains it doesn't know how to play this format.

Adrian
Comment 10 Keith Packard 2009-07-28 09:02:01 UTC
under RandR transforms, there is no synchronization of the screen updates with vblank.
Comment 11 Luis F. Lopez 2009-07-28 10:42:19 UTC
It's important to mention that on the original bug report the screen rotation is not performed using xrandr, it's done via internal application mechanism (probably by  Adobe Air API)
Comment 12 Keith Packard 2009-07-28 11:01:05 UTC
thanks, it wasn't entirely clear (and some of the replies included xrandr rotation).

The only way to get synchronization today is to use Xv or GL; all other 2D rendering is not synchronized with vertical blank.
Comment 13 Keith Packard 2009-07-28 18:15:58 UTC
I'm not sure what else we can do here; if adobe air works fine in some orientation and fails in others, it doesn't seem like something we can fix in the driver.
Comment 14 asergiu 2009-07-29 02:06:40 UTC
In my case screen rotation is done via xrandr and not by Adobe. What is strange is that if the mouse is pressed somewhere on the screen outside the video area the flicker dissapears and if it's on the video it still does some strange things on all lines  of the screen corresponding to the mouse shape. So it has to do with some sync.

Adrian 
Comment 15 Luis F. Lopez 2009-07-29 08:00:09 UTC
An additional remark that needs to be mentioned is that when the screen resolution is reduced to 1024x768 (normally it's 1366x768) then the flickering disappears.
 
Also when executing the application on a hardware platform that requires a proprietary driver (ATI), this issue is not present. 

Could these two facts be considered as an indication that this is a driver issue? 
Comment 16 asergiu 2009-07-29 08:27:50 UTC
To resume the problems marked by Bryce and me(Adrian):

1) Screen flickering aith Air applications when screen is turned in Adobe AND xrandr (maybe internally Adobe does the same thing xrandr)

2) Screen flickering does NOT occur on other proprietary video drivers (screen turned with xrandr or native in Adobe) with other cards: NVIDIA Geforce(Adrian) and  ATI (Bryce) - so this kind of excludes Adobe Air issues !

3) Adrian : when pressing and holding the mouse cursor pressed in some corner of te screen flickering dissapears

4) Bryce: when resolution is not at it's maximum flickering dissapears.
   Adrian: tested on myconfig - flickering is still there in 800x600 on my 1024x600 capable screen !

CONCLUSION:
  According to point 2) Adobe Air should almost be excluded as source of the problem hence we do have a problem that should be fixed here.

Adrian
Comment 17 Keith Packard 2009-07-29 10:15:35 UTC
Please don't conflate the RandR configuration with a separate application; these are two separate issues. RandR has known performance and flickering issues which do not have any bearing on environments not using it.

Given that there is no way to avoid tearing using core X interfaces, the fact that other drivers don't exhibit the same level of tearing is entirely accidental. To fix this in general, the Adobe Air application will need to use some API which avoids tearing. The only candidates today are either Xv or OpenGL; we simply don't have a core X API that solves this problem available to us.
Comment 18 asergiu 2009-07-29 10:58:52 UTC
I don't want to be rude - I just want things to be solved and even help if I can.

So  on a very similar machine - the CPU is still Atom 1.6 Ghz but on the video part the chipset is a bit different it is working with xrandr turned. The driver and OS and software is exactly the same. 

NOT WORKING MACHINE
-------------------
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)


WORKING MACHINE:
---------------
00:02.0 VGA compatible controller: Intel Corporation 82945G/GZ Integrated Graphics Controller (rev 02)

A) So the one not working is the MObile version of the approximatelly same chipset. 
If it flickers sometimes is now and in 3 minutes - I can live with that -it is usable.


B) Somebody explain me way on the machine that flickers with screen turned - if I press the mouse and keep it pressed during interaction with the application the flicker goes away ?!?!? 

If Adobe is not using Xv or Gl it should flicker all the time.

On the two machines I run exactly the same application - the same binaries !

I have no answer to this ....


Adrian
Comment 19 Luis F. Lopez 2009-08-05 08:41:36 UTC
Adding URL for video showing that no flickering is noticeable when resolution is reduced to 1024x768:

http://people.canonical.com/~luislopez/Dell_Optiplex_760_Adobe_Air_Application_No_Flickering_at_1024x768.avi

Comment 20 Gordon Jin 2009-09-14 18:10:21 UTC
It's said Ubuntu has found a workaround and this bug's priority can be decreased.
Comment 21 asergiu 2009-09-15 01:01:05 UTC
(In reply to comment #20)
> It's said Ubuntu has found a workaround and this bug's priority can be
> decreased.

Could you give a link or something to the workaround ?
Adrian
Comment 22 Gordon Jin 2009-09-16 02:22:29 UTC
(In reply to comment #21)
> (In reply to comment #20)
> > It's said Ubuntu has found a workaround and this bug's priority can be
> > decreased.
> 
> Could you give a link or something to the workaround ?
> Adrian

I heard that from Quanxian, but I don't know more detail. I guess Ubuntu know.
Comment 23 Yingying 2009-09-16 03:38:57 UTC
Copy from Alberto's email:
"he only workaround that the user who reported the bug found is to set the resolution to 1024x768."

I added Alberto to the copy list.
Comment 24 asergiu 2009-09-16 05:09:28 UTC
I did that and it doesn't solve the problem in our case.
In any resolution I have the same problem. 

Adrian
Comment 25 asergiu 2009-09-16 05:15:35 UTC
I repeat what I previously said before:

Setup: I have two machines with different motherboards but same CPU (atom 1.6).
1) Shuttle
2) Tablet 

Shutlle - everything works with screen turned with xrandr .

Tablet - I have the flickering problem when turning the screen. 
However if I keep the mouse button pressed (or the touchscreen) the flickering stops - I have a normal display.

Adrian
Comment 26 Keith Packard 2009-10-26 11:15:53 UTC
X server version 1.6.4 improves scheduling of rotation redisplay; have you tried that to see if this reduces flickering?
Comment 27 asergiu 2009-10-26 16:55:02 UTC
(In reply to comment #26)
> X server version 1.6.4 improves scheduling of rotation redisplay; have you
> tried that to see if this reduces flickering?

Yes ! I am using the opensuse 11.1 Factory X11 repository so I download right away all things. There are some changes - I don't know if I can call them improvements in my case. For I managed to have something working by passing in 64k color instead of true color. 

With the old Xorg when screen was turned I had flickering but strange enough ony when not pressing the mouse somewhere on the screen. When the mouse button was pressed the flickering had gone away.

Now - whenever there should be flickering the video/or display starts to move alot slower and pressing the mouse button somewhere does not help anymore. Anyway is a bit more fluid as interface but I am trying to play a 800x600 video on an Atom 1.6Ghz machine. I insist however for the case with the old Xorg when pressing the mouse button over at any position on the screen will completely remove flickering - very strange. 

Adrian
Comment 28 agajan 2012-10-15 03:31:19 UTC
I have a Dell Optiplex 960 which has a Q45 Express chipset.

I am seeing similar flickering when I view a video at the following URL:

http://www.wpix.com/sports/college-sports/

On the right side, there is a Flash video.  If I make that video fullscreen and play it, I get the flickering.

The same computer can play other Flash videos in fullscreen mode and not have flickering issue.

xorg-x11-server-Xorg-1.12.3-2.fc17.x86_64
xorg-x11-drv-intel-2.20.8-1.fc17.x86_64
Comment 29 Chris Wilson 2012-10-15 08:41:12 UTC
(In reply to comment #28)
> I have a Dell Optiplex 960 which has a Q45 Express chipset.
> 
> I am seeing similar flickering when I view a video at the following URL:
> 
> http://www.wpix.com/sports/college-sports/
> 
> On the right side, there is a Flash video.  If I make that video fullscreen
> and play it, I get the flickering.
> 
> The same computer can play other Flash videos in fullscreen mode and not
> have flickering issue.

Fortuitous. Flash does not employ synchronized updates to the scanout. This bug is purely about that the update of the rotated scanout is not synchronous even if the applications are requesting synchronous updates.
Comment 30 Chris Wilson 2013-10-21 22:49:13 UTC
Requires the explicit Option "TearFree", but is now possible as of

commit d788b69fdb5ea73b1d283a89e53b2b19eaa90e6e
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Oct 21 23:44:29 2013 +0100

    sna: Enable TearFree rendering for transformed scanouts
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=22969
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Ideally this task will be performed by the compositor instead.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.