Re: horizontal screen tearing with mpv, modesetting(4), and compositor

2022-04-08 Thread Ashlen
On 22/04/06 15:39, Ashlen wrote:
> There are open issues about things that appear to be similar, and in
> those others corroborate that it seems to be something with the
> modesetting driver:
>
> https://github.com/mpv-player/mpv/issues/7106
> https://gitlab.freedesktop.org/xorg/xserver/-/issues/928

On a second review of these issues, these are not dealing with the same
problem. Somehow I overlooked this, sorry about that.

Considering my email again, it may be more appropriate to try bringing
it up in the relevant issue tracker, rather than an email to misc@. But
hopefully the workaround helps for anyone that encounters the same
issue.

--
https://amissing.link/



horizontal screen tearing with mpv, modesetting(4), and compositor

2022-04-06 Thread Ashlen
Hey all, I'm encountering an issue where when I play videos with mpv
while a compositor is running under modesetting(4), horizontal screen
tearing will occur during playback. I've tested this on xmonad, cwm,
and fvwm.

As for why I'm using a compositor, it's for semi-transparency in the
terminal emulator I'm using (urxvt). I like being able to see the
wallpaper in the background while writing programs or using the shell.

I played with some of the flags mentioned in xcompmgr(1) including `-a`,
`-c`, `-s`, and `-S`, but none make a difference. I should note that
picom with default settings has the same problem, as well as with the
different backends such as `--backend=glx`.

Using `mpv --no-config` doesn't help, and messing around with
`--x11-bypass-compositor` as mentioned in mpv(1) doesn't seem to affect
the issue.

Using an override in `/etc/X11/xorg.conf.d/intel.conf` to force intel(4)
instead of the default modesetting(4) with TearFree enabled and
`machdep.allowaperture=1` *does* help and gets rid of the tearing. I
would really prefer to use modesetting(4) if at all possible however.

Interestingly, killing xcompmgr before playback removes the screen
tearing entirely. So currently the only real workaround I know of that
doesn't involve using intel(4) is a wrapper script I run to turn off
xcompmgr before playback, and enable it after playback is finished. I'll
include it below along with some other relevant information.

The FAQ mentions some stuff about tearing but none of it worked for me.

https://github.com/mpv-player/mpv/wiki/FAQ

There are open issues about things that appear to be similar, and in
those others corroborate that it seems to be something with the
modesetting driver:

https://github.com/mpv-player/mpv/issues/7106
https://gitlab.freedesktop.org/xorg/xserver/-/issues/928

If there's any more info I can provide on my end for debugging purposes,
let me know. Otherwise, here's what I have.


$ cat /var/log/Xorg.0.log # modesetting(4)
[ 11307.284] (WW) checkDevMem: failed to open /dev/xf86 and /dev/mem
(Operation not permitted)
Check that you have set 'machdep.allowaperture=1'
in /etc/sysctl.conf and reboot your machine
refer to xf86(4) for details
[ 11307.285]linear framebuffer access unavailable
[ 11307.290] (--) Using wscons driver on /dev/ttyC4
[ 11307.293]
X.Org X Server 1.21.1.3
X Protocol Version 11, Revision 0
[ 11307.293] Current Operating System: OpenBSD lain.home.arpa 7.1 
GENERIC.MP#458 amd64
[ 11307.293]
[ 11307.293] Current version of pixman: 0.40.0
[ 11307.293]Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
[ 11307.293] Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 11307.293] (==) Log file: "/var/log/Xorg.0.log", Time: Wed Apr  6 13:36:31 
2022
[ 11307.293] (==) Using system config directory 
"/usr/X11R6/share/X11/xorg.conf.d"
[ 11307.293] (==) No Layout section.  Using the first Screen section.
[ 11307.293] (==) No screen section available. Using defaults.
[ 11307.293] (**) |-->Screen "Default Screen Section" (0)
[ 11307.293] (**) |   |-->Monitor ""
[ 11307.293] (==) No monitor specified for screen "Default Screen Section".
Using a default monitor configuration.
[ 11307.293] (==) Automatically adding devices
[ 11307.293] (==) Automatically enabling devices
[ 11307.293] (==) Not automatically adding GPU devices
[ 11307.293] (==) Automatically binding GPU devices
[ 11307.294] (==) Max clients allowed: 256, resource mask: 0x1f
[ 11307.294] (==) FontPath set to:
/usr/X11R6/lib/X11/fonts/misc/,
/usr/X11R6/lib/X11/fonts/TTF/,
/usr/X11R6/lib/X11/fonts/OTF/,
/usr/X11R6/lib/X11/fonts/Type1/,
/usr/X11R6/lib/X11/fonts/100dpi/,
/usr/X11R6/lib/X11/fonts/75dpi/
[ 11307.294] (==) ModulePath set to "/usr/X11R6/lib/modules"
[ 11307.294] (II) The server relies on wscons to provide the list of input 
devices.
If no devices become available, reconfigure wscons or disable 
AutoAddDevices.
[ 11307.294] (II) Loader magic: 0x724f63b87c0
[ 11307.294] (II) Module ABI versions:
[ 11307.294]X.Org ANSI C Emulation: 0.4
[ 11307.294]X.Org Video Driver: 25.2
[ 11307.294]X.Org XInput driver : 24.4
[ 11307.294]X.Org Server Extension : 10.0
[ 11307.294] (--) PCI:*(0@0:2:0) 8086:3ea0:17aa:2292 rev 2, Mem @ 
0xe000/16777216, 0xd000/268435456, I/O @ 0x2000/64
[ 11307.294] (II) LoadModule: "glx"
[ 11307.294] (II) Loading /usr/X11R6/lib/modules/extensions/libglx.so
[ 11307.296] (II) Module glx: vendor="X.Org Foundation"
[ 11307.296]compiled for 1.21.1.3, module version = 1.0.0
[ 11307.296]ABI class: X.Org Server Extension, version 10.0
[ 11307.296] (==) Matched modesetting as autoconfigured driver 0
[ 11307.296] (==) Assigned the driver to the xf86ConfigLayout