mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
26.89k stars 2.84k forks source link

X11 error: BadDrawable (invalid Pixmap or Window parameter) #8051

Closed bbhtt closed 3 years ago

bbhtt commented 3 years ago

Important Information

# mpv --version

mpv 0.32.0 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
ffmpeg library versions:
   libavutil       56.31.100 (runtime 56.51.100)
   libavcodec      58.54.100 (runtime 58.91.100)
   libavformat     58.29.100 (runtime 58.45.100)
   libswscale      5.5.100 (runtime 5.7.100)
   libavfilter     7.57.100 (runtime 7.85.100)
   libswresample   3.5.100 (runtime 3.7.100)
ffmpeg version: n4.3.1

Arch Linux, kernel linux 5.8.5-arch1-1

Arch repository

XFCE 4.14

mesa 20.1.6-1
mesa-vdpau 20.1.6-1
xf86-video-amdgpu 19.1.0-2

Reproduction steps

Noted below (*)

Expected behavior

SMPlayer or MPV itself to play videos.

Actual behavior

MPV doesn't work with the arguments supplied.

Log file

https://gist.github.com/kortewegdevries/21fee8f5c81916c7eeca3436b992c548

(*) SMPlayer by default uses MPV as backend and passes this command to play videos, recently I noticed SMPlayer wasn't working with mpv but with mplayer as backend, so I copied the command that SMPlayer passes to mpv on a terminal to play my own video and seems that one of the argument of MPV is causing problem on my setup.

The argument SMPlayer passes (source: Ctrl+M on SMPlayer after playing a video with mpv as backend):

/usr/bin/mpv --no-config --no-quiet --terminal --no-msg-color --input-ipc-server=/tmp/smplayer-mpv-34 --msg-level=ffmpeg/demuxer=error --no-fs --hwdec=no --sub-auto=fuzzy --no-input-default-bindings --input-x11-keyboard=no --no-input-cursor --cursor-autohide=no --no-keepaspect --wid=75497517 --monitorpixelaspect=1 --osd-level=1 --osd-scale=1 --sub-ass --embeddedfonts --ass-line-spacing=0 --sub-scale=1 --sub-text-shadow-color=#ff000000 --sub-codepage=ISO-8859-1 --sub-pos=100 --volume=0 --cache=auto --screenshot-template=cap_%F_%p_%02n --screenshot-format=jpg --softvol=yes --softvol-max=110 --term-playing-msg=MPV_VERSION=${=mpv-version:}

The softvol and --term-playing-msg=MPV_VERSION=${=mpv-version:} doesn't work on a terminal with MPV, trimming those two, I pass this to MPV only:

(2)

/usr/bin/mpv --no-config --no-quiet --terminal --no-msg-color --input-ipc-server=/tmp/smplayer-mpv-34 --msg-level=ffmpeg/demuxer=error --no-fs --hwdec=no --sub-auto=fuzzy --no-input-default-bindings --input-x11-keyboard=no --no-input-cursor --cursor-autohide=no --no-keepaspect --wid=75497517 --monitorpixelaspect=1 --osd-level=1 --osd-scale=1 --sub-ass --embeddedfonts --ass-line-spacing=0 --sub-scale=1 --sub-text-shadow-color=#ff000000 --sub-codepage=ISO-8859-1 --sub-pos=100 --volume=0 --cache=auto --screenshot-template=cap_%F_%p_%02n --screenshot-format=jpg /home/korte/Downloads/sample-mp4-file.mp4

See error:

[vo/gpu/x11] X11 error: BadDrawable (invalid Pixmap or Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7fbb480042f0, resourceid: 480002d, serial: 13
[vo/gpu/x11] Error code: 9, request code: e, minor code: 0
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7fbb480042f0, resourceid: 480002d, serial: 14
[vo/gpu/x11] Error code: 3, request code: 28, minor code: 0
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7fbb480042f0, resourceid: 480002d, serial: 1a
[vo/gpu/x11] Error code: 3, request code: 2, minor code: 0
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7fbb480042f0, resourceid: 480002d, serial: 1c
[vo/gpu/x11] Error code: 3, request code: 1, minor code: 0
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7fbb480042f0, resourceid: 5200002, serial: 1f
[vo/gpu/x11] Error code: 3, request code: 12, minor code: 0
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7fbb480042f0, resourceid: 5200002, serial: 21
[vo/gpu/x11] Error code: 3, request code: 12, minor code: 0
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7fbb480042f0, resourceid: 5200002, serial: 22
[vo/gpu/x11] Error code: 3, request code: 12, minor code: 0
[vo/gpu/opengl] Could not create EGL surface!
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7fbb480042f0, resourceid: 5200002, serial: 24
[vo/gpu/x11] Error code: 3, request code: 12, minor code: 0
X Error of failed request:  BadWindow (invalid Window parameter)

The argument from (2) causing the problem: --wid=75497517, trimming it too, MPV runs fine with rest of the arguments.

bbhtt commented 3 years ago

This could be an issue with upstream drivers/my setup, I'm not sure, would appreciate some insight for the error.

ghost commented 3 years ago
[input] No key binding found for key '['.
[input] No key binding found for key 'c'.
[input] No key binding found for key 'p'.
[input] No key binding found for key 'l'.
[input] No key binding found for key 'a'.
[input] No key binding found for key 'y'.
[input] No key binding found for key 'e'.
[input] No key binding found for key 'r'.
[input] No key binding found for key ']'.
[input] No key binding found for key 'SPACE'.

Why is smplayer feeding mpv's log back to stdin? I can onyl imagine smplayer is doing something wrong here, and it's up to them to analyze this.

bbhtt commented 3 years ago

Do you think there is some inconsistencies between the arguments that are passed to mpv i.e. one shouldn't be used with the other or etc.?

rubyFeedback commented 3 years ago

I can not help with your issue, but I remember that in my custom ruby wrappers where I select whether to use mplayer or mpv (I usually prefer mpv these days, but I keep good old oldschool mplayer around, to test stuff too, and differences), I have to see which options are supported and which ones not. One simple that comes to mind was -msg_color versus -msgcolor or something like that. It may be that the smplayer author may not aware of differences, so the more information can be gathered, the better it may be for "upstream" smplayer to adjust. (I believe smplayer is still an active project. I use it when I need a fancier GUI, but admittedly these days I really just use ruby on the commandline, and call mpv for whatever audio or video I need to play; it's just so much faster and more convenient - sorry for the off-topic now.)

Traneptora commented 3 years ago

@kortewegdevries I have seen this occasionally after updating drivers, and restarting my system to refresh the drivers makes it go away - does this work for you?