PCSX2 / pcsx2

PCSX2 - The Playstation 2 Emulator
https://pcsx2.net
GNU General Public License v3.0
11.85k stars 1.63k forks source link

Tales of Legendia - Graphical Tearing #1578

Closed orbea closed 4 years ago

orbea commented 8 years ago

OS: Slackware64-current pcsx2-2016.09.20_b00ae97_master-x86_64-1_git

When moving back and forth left to right in town, especially visible in buildings the game will produce horizontal tearing. This will occur with both HW and SW renderers and despite any hacks, CRC level or Blending Unit accuracy.

I could not reproduce this when replaying an apitrace and this does not show up in screenshots.

GSDX Dump - http://ks392457.kimsufi.com/orbea/stuff/games/pcsx2/snaps/gsdx_TOL_20160920093251.gs.xz

I have not observed it with other games and this appears to have been present for a while, but I can no longer compile 1.4.0 on my system to check.

gregory38 commented 8 years ago

Did you try to enable vsync? It used to be on by default on Mesa, now you can configure it in PCSX2

orbea commented 8 years ago

I presume you mean Wait for Vsync on refresh? Enabling it eliminates most of the tearing, but there is still a single line of tearing towards the top of the screen.

gregory38 commented 8 years ago

Did you try to play with interlacing option in GSdx ?

orbea commented 8 years ago

I had it set to auto, I tried all the options now and it does not make a difference.

gregory38 commented 8 years ago

Honestly if it really a tearing. It would be hard to reproduce and to fix it. I guess the game is 50 fps and GSdx will suffer to produce only 50 vsync in a 60 fps display.

orbea commented 8 years ago

That is understandable, thanks for your help.

orbea commented 8 years ago

I've found out that it will only occur when full screen.

Edit: Additionally if I make the window floating / full screen and then resize it so that the top of the window is not full screen it will go away. Could it be related to how my monitor's resolution is 1680x1050?

FlatOutPS2 commented 8 years ago

You must have an AMD GPU. :p

The issue should also disappear when using 4:3 aspect ratio.

orbea commented 8 years ago

I have a nvidia card, GTX 780 Ti (GK110B) using nouveau drivers.The issue unfortunately persists if using 4:3 aspect ratio.

jcdenton2k commented 8 years ago

I don't know if this is related but on Win7 when I disabled Desktop Window Composition and Aero/Themes completely then I had massive screen-tearing issues in PCSX2 with nearly every game. Re-enabling them is what solved the issue for me.

So my thought is that as far as your *nix OS is concerned there may be some similar kind of 'desktop composition' thing that isn't working properly.

Just a thought. Also the nouveau drivers have known issues/incompatabilities and for gaming purposes most distros recommend the proprietary drivers. Right now you're using a reverse-engineered alpha-quality GPU driver on top of reverse-engineered Playstation 2 emulator. No wonder you have tearing issues O_O.

I have the same monitor resolution so it isn't your monitor causing the tearing. It is likely that nouveau driver doing it. It is great but not perfect.

See if you still have the issues with Linux-native games in windowed or full-screen modes using the Nvidia proprietary Linux-based drivers.

orbea commented 8 years ago
  1. I have no desktop composition and the issue persists if I start pcsx2 in its own xorg session with xinit /usr/bin/PCSX2 -- :1 although that is not very usable with full screen.
  2. I do not consider nvidia drivers very trustworthy, they have a lot of unrelated issues, the nouveau devs provide a lot more support and I can play most games I want to at full speed with them. Installing proprietary drivers will never be a good or desirable solution.

If this issue is related to nouveau then asking the nouveau devs will be a good idea. However that is difficult when screenshots and apitrace do not show the problem.

orbea commented 8 years ago

Actually apitrace now does capture it a little bit, however its reduced.

http://ks392457.kimsufi.com/orbea/stuff/trace/PCSX2_TOL_tearing.trace.xz

orbea commented 8 years ago

A nouveau dev was able to reproduce the issue in the backtrace, but was not sure what could be causing it or whether it was a pcsx2, nouveau, mesa or xorg issue.

jcdenton2k commented 8 years ago

Thanks for the update. Hopefully they can fix this upstream on the Linux side of things.

There are many things that only the proprietary drivers can accomplish at this time. It is your choice on whether or not to have it installed/enabled but outright refusing to EVER use those drivers (even for testing) is going to limit the software you can use and the capability of your testing environment.

Can someone please tag this issue as upstream? Thanks.

orbea commented 8 years ago

The issue should be diagnosed better before it is tagged as upstream or not, the potential for it being fixed all in pcsx2 still exists.

Nvidia causes more harm to my system during the install process by overwriting standard system libraries than the benefit from testing their drivers for this minor issue would bring. Additionally this discussion is not at all relevant to solving this, I would very much appreciate if you where more understanding of nouveau users as has been demonstrated in previous pcsx2 issue reports, thanks.

gregory38 commented 8 years ago

I need help to know where to look. Do you have the issue if you disable accurate blending?

jcdenton2k commented 8 years ago

@orbea As someone that tests out and reports Linux-based issues and contributes to a few Linux-based projects here and there, I'm well aware of the 'nouveau users'. I'm also aware of the realities and problems of the situation.

On the Windows side we have had to do PCSX2-specific hacks to fix driver errors from idiots at Nvidia (and it is always Nvidia doing that crap) for that weird glitch with the emulation glitching out with zoom in/out repeatedly. There was an Nvidia-specific hack put in just to fix that and that took too much time & effort from the PCSX2 devs because Nvidia was shit about it.

That said, on the Linux side we have a great deal more freedom in determining what is wrong and how to fix it since we have source-code access. If you want this issue fixed then you'll need to be quite detailed in your future bug reports and provide detailed explicit information requested by the PCSX2 team and possibly the nouveau and upstream teams if applicable.

I'd recommend doing further testing like @gregory38 has stated with regards to enabling/disabling certain options and seeing what happens and providing test dumps where appropriate. They need to narrow down the issue in order to diagnose it and possibly either fix it in PCSX2 specifically or fix it upstream if needed.

Your issue is graphical tearing and typically that's a vsync/composition-specific issue rather than a PCSX2-specific issue. But it varies. So good luck with testing that out. I'd test it out myself but even with the default open-source non-proprietary drivers I'm using on my own Linux Mint OS laptop, I haven't encountered any screen-tearing issues in any programs or PCSX2. It may be another Nvidia-specific hardware driver issue again.

orbea commented 7 years ago

@gregory38 I found that I can avoid the problem by setting the aspect ratio to Fit to Window/Screen instead of 4:9 or 16:9. My monitor is 16:10. It will also occur with Ar Tonelico.

gamax92 commented 7 years ago

As @jcdenton2k pointed out a compositing window manager or a separate composition manager would probably help to eliminate tearing, and many DE's will ship with one.

GNOME's Mutter, xfce's xfwm, KDE's KWin, Cinnamon's Muffin, MATE's marco are all either compositing window managers or have compositing options. Compiz also has compositing features. Marco is also only a software compositor though and on it's own did not help to resolve tearing.

There's also standalone compositors, though I've only ever gotten compton to work, and compton would cause lag in window moving and editors. Proprietary NVIDIA driver users also have the "ForceCompositionPipeline" option that may also eliminate tearing.

I'm currently working with ForceCompositionPipeline + marco (as MATE is my DE) and I've eliminated tearing with scrolling, window moving, video playback, and gaming. Performance is just as good as without.

MrCK1 commented 7 years ago

@orbea Might be good to compile a new build and see if you still get tearing with the new VSync code.

orbea commented 7 years ago

@MrCK1 I already have and I still do. To work around the tearing I currently need to set the aspect ratio to Fit to Window/Screen and set the Wait for Vsync on refresh to Standard.

MrCK1 commented 7 years ago

Got it, thanks for the quick reply.

orbea commented 6 years ago

Recently the wm I use, spectrwm, gained a WIP branch with support for compositors such as compton. Using the following command from the arch wiki also resolves screen tearing in PCSX2 and other graphical programs like mplayer.

compton -b --paint-on-overlay --unredir-if-possible --backend xr_glx_hybrid --vsync drm --glx-swap-method -1 --glx-no-stencil

https://wiki.archlinux.org/index.php/Nouveau#Vertical_Sync

This did however require a recent git revision of compton to work correctly.

I think this further suggests that there is some underlying nouveau bug here.

orbea commented 4 years ago

Closing this because in hindsight it seems to be much more general than pcsx2.