I have bisected the appearence of this bug down to
Author: Chris Wilson <email@example.com>
Date: Thu May 8 16:25:32 2014 +0100
sna: Add support for DRI3
Signed-off-by: Chris Wilson <firstname.lastname@example.org>
Hardware: Mesa DRI Intel(R) Ivybridge Mobile
After this commit, running mpv-player from git master (though all tested versions show the same symptom) with the following command
mpv/build/mpv --no-config --hwdec=vaapi --vo=opengl --msg-level=all=trace <h264file>
will result in the following output right before the player exits (either because of regular end of file or the user quitting the program with "q").
[ao/alsa] uninit: pcm closed
[input] release all
[vo/opengl/x11] Enabling screensaver.
[vo/opengl/x11] X11 error: BadDrawable (invalid Pixmap or Window parameter)
[vo/opengl/x11] Type: 0, display: 0x7f1a9825d0f0, resourceid: 4a0000d, serial: 141
[vo/opengl/x11] Error code: 9, request code: 9a, minor code: 4
[vo/opengl/x11] uninit ...
No other ill effects are observed by the user. I tried narrowing down the error within the mpv code, but it appears to be happening on essentially random/unrelated X calls (i.e., xss_suspend, or XDefineCursor depending on whehter the --no-stop-screensaver is added) likely because the x connection is asyncronous.
This behaviour is only observed with the above combination of vaapi hardware decoding with opengl interop output (i.e, none of "--hwdec=vaapi --vo=vaapi", "--hwdec=vaapi-copy --vo=opengl", or "--hwdec=no --vo=opengl" exhibit this problem).
I have linked the mpv bug report in the URL for this bug.
The trick would be to set XSynchronize() inside mpv to capture the error as it happens and use gdb to see the culprit.
Just tried XSychronizing the display. Of course, that makes the error go away :).
With the same xf86-video-intel and mpv commits, this no longer happens for me. Something has likely changed in the kernel or xserver itself.
as above, no longer happens