Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tearing in fullscreen #232

Open
Sesshu opened this issue Oct 17, 2016 · 28 comments
Open

Tearing in fullscreen #232

Sesshu opened this issue Oct 17, 2016 · 28 comments

Comments

@Sesshu
Copy link

Sesshu commented Oct 17, 2016

Overview Description:
When running gnome-mpv in fullscreen I get tearing. This does not happen when I open up the same file in mpv, it only happens with gnome-mpv. I'm using the default configuration for both.

Version:
GNOME MPV 0.10 (and git master)
mpv 0.20.0
ffmpeg library versions:
libavutil 55.28.100
libavcodec 57.48.101
libavformat 57.41.100
libswscale 4.1.100
libavfilter 6.47.100
libswresample 2.1.100
ffmpeg version: 3.1.4

Additional Information:
The file I tested it was an mkv file using h264 video.
Graphics driver: nvidia
OS: ArchLinux

@gnome-mpv
Copy link
Collaborator

Run G_MESSAGES_DEBUG=all gnome-mpv <your-video-file>. Let the video play for a few seconds, then press Ctrl+C and post the output here.

After that, run mpv --length=3 -v <your-video-file> and post its output here as well.

@Sesshu
Copy link
Author

Sesshu commented Oct 17, 2016

gnome-mpv.txt
mpv.txt

@gnome-mpv
Copy link
Collaborator

Does setting --vo=vdpau solve the issue?

@Sesshu
Copy link
Author

Sesshu commented Oct 18, 2016

When I try to start gnome-mpv --vo=vdpau it says Unknown option --vo=vdpau.
Putting vo=vdpau into my mpv.conf doesn't fix it.

@gnome-mpv
Copy link
Collaborator

When I try to start gnome-mpv --vo=vdpau it says Unknown option --vo=vdpau.

You need to put the option in the textbox labeled Extra MPV options: in the preferences dialog (press Ctrl+p to open).

@Sesshu
Copy link
Author

Sesshu commented Oct 18, 2016

Still the same tearing as before.

@gnome-mpv
Copy link
Collaborator

Can you try playing a video fullscreen with this and see if you still get tearing? It's mpv's official client API example code I modified to support fullscreen mode. Compile by running qmake && make. You can toggle fullscreen mode by pressing F11. If you still get tearing with this, then the issue is probably related to mpv's client API support.

@Sesshu
Copy link
Author

Sesshu commented Oct 19, 2016

I tested it on the qtexample and couldn't find any tearing.

@Sesshu
Copy link
Author

Sesshu commented Oct 19, 2016

When I uncheck "Enable client-side decorations" and restart gnome-mpv I can't see any tearing. I guess I should have tried this sooner.
Also for this I found a relaiable way to reproduce the tearing. I noticed it doesn't always happen, sometimes I had to let it play a file for a while and seek before it started.
These are the steps that always produce tearing for me:

  1. Start gnome-mpv
  2. Press F11 to switch to full screen
  3. Press Ctrl+o to open up the file
  4. Press Ctrl+o again and open up the same file again
    After opening the file a second time, tearing will be visible. If the file is only opened once and played normally for a few seconds, I couldn't see any tearing.

Test file: (zipped so that I can upload it here)
test.zip

@gnome-mpv
Copy link
Collaborator

I can reproduce the tearing now.

@gnome-mpv
Copy link
Collaborator

I found that mpv does this when it's attached (using the --wid option) to any window that uses CSD, so the tearing is unlikely to be caused by a bug in gnome-mpv. I can reproduce the tearing with mpv using the steps below.

  1. Open any application that has fullscreen mode and uses CSD, eg. Evince. If you use Evince, you'll need to open a document with it before it'll let you switch to fullscreen mode.
  2. Run the following command and click the Evince window to attach mpv to it: mpv your-video-file.webm --wid=$(xwininfo | grep -oP '(?<=Window id: )[^ ]+')
  3. Switch to fullscreen mode and wait a bit. You should be able to see some tearing after a few seconds.

@ghost
Copy link

ghost commented Mar 2, 2017

That's not a mpv problem, rather an issue with either your compositor or the nvidia drivers. (With nvidia drivers, I can get good behavior only when setting it to maximum performance in general anyway - maybe that applies here too.)

Given how this won't work at all under Wayland, it might be a good idea to add support for opengl-cb embedding.

@TingPing
Copy link
Contributor

TingPing commented Mar 2, 2017

Given how this won't work at all under Wayland, it might be a good idea to add support for opengl-cb embedding.

opengl-cb is already used on Wayland.

@ghost
Copy link

ghost commented Mar 2, 2017

But not on X? Any reason for that?

@gnome-mpv
Copy link
Collaborator

But not on X? Any reason for that?

It will use opengl-cb on X if the user explicitly sets vo=opengl-cb. It's not the default because gnome-mpv uses GtkGLArea to display video frames, which doesn't work for some users since it requires at least OpenGL 3.2.

@ghost
Copy link

ghost commented Mar 2, 2017

since it requires at least OpenGL 3.2

That's really odd that it would require that...

@gnome-mpv
Copy link
Collaborator

Based on this, it requires core profiles from OpenGL 3.2+. Since gtk 3.20, it also supports legacy GL 3.0 profiles, but some users are still on older OpenGL versions.

@ghost
Copy link

ghost commented Mar 2, 2017

For what little GL usage they have, there really isn't an excuse not to support GL 2.1 + FBO extensions. But whatever.

@kaljandl
Copy link

kaljandl commented Jul 6, 2017

open gnome-mpv - press CTRL+P - Unmark "Enable client-side decoration"(its a first option.my english is not good^_^)its work on me

@harry-cpp
Copy link

Are there any other workarounds besides disabling CSD in gnome-mpv?

@gnome-mpv
Copy link
Collaborator

Are there any other workarounds besides disabling CSD in gnome-mpv?

You can also use Wayland.

@harry-cpp
Copy link

You can also use Wayland.

Oh god, that is even worse XD

@gnome-mpv gnome-mpv added the x11 label Sep 24, 2018
@Esokrates
Copy link

I don't know Gnome well enough, but what about forwarding this issue to the CSD/Gtk devs?

@TingPing
Copy link
Contributor

@Esokrates You need actionable information first. Something smaller to reproduce than "Use libmpv to render an entire video".

@sfaucheux
Copy link

I have found a workaround by installing this gnome-shell extension (works on 3.32):
https://github.com/kazysmaster/gnome-shell-extension-disable-unredirect
It seems to be a known problem since workarounds like this one apparently exist for a while.

@calico-cat968
Copy link

Unchecking "Enable client-side decorations" doesn't seem to fix the issue anymore. Here is how my tearing appears:

  1. Open a video with Celluloid
  2. Double-click the player to go full screen
  3. Move the mouse to show controls --> The tearing is visible. As the controls (and the csd) is hidden, the tearing disappears, but when I move the mouse again, the tearing appears.

To stop the tearing, I had to go to Preferences>Miscellaneous, and put --vo=opengl-cb in the Extra MPV options box, which is essentially the fix for #380 (Crash with "Use floating controls").

Test video

Additional Info:
Celluloid 0.18 (from universe)
OS: Ubuntu 20.04
Graphics: Mesa Intel (nouveau for nvidia)
Gnome 3.36.1

@ghost
Copy link

ghost commented Oct 10, 2020

Opposite Experience for me:

Enabling vo=opengl-cb just made my issue worse.

Reproduce:

  1. Open a video with Celluloid (only tested with 1080p .mkv so far.)
  2. Double-click the player to go full screen
  3. Tearing is constantly visible
    To stop the tearing, I simply had to disable CSD.

Additional Info:
Celluloid 0.20 (Flathub)
OS: Fedora 32 GNOME
Graphics: Mesa X.org AMD Radeon RX 5600 XT (NAVI10, DRM 3.38.0, 5.8.13-200.fc32.x86_64, LLVM 10.0.1) Mesa 20.1.9
Gnome: 3.36.6 on X11

Tomorrow I'm probably going to get a full bugzilla report to submit to GNOME and/or Mesa depending on what I can figure out.

@Igetin
Copy link

Igetin commented Sep 24, 2022

This is still reproducible on Celluloid 0.22.

  • OS: Fedora 35
  • Desktop environment: GNOME 41.6
  • Windowing system: X11
  • Graphics card: AMD Radeon RX 6800 XT
  • Graphics library: Mesa 21.3.9

Here's a relevant bug report on GNOME's bug tracker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants