mpv-player / mpv

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

No video output with more than 1 monitor attached on swaywm/wayland #6949

Closed chron-isch closed 5 years ago

chron-isch commented 5 years ago

mpv version and platform

Archlinux with mpv 1:0.29.1-8 from the community repository running on a Thinkpad x240 but I also tried mpv-git.

Reproduction steps

With only 1 monitor connected everything works as expected, but as soon as you connect a second monitor videos won't open anymore

# smsg -t get_outputs                                                                               [15:45:32]
Output eDP-1 'Unknown 0x04E3 0x00000000' (focused)
  Current mode: 1366x768 @ 59.993000 Hz
  Position: 0,0
  Scale factor: 1.000000
  Subpixel hinting: unknown
  Transform: normal
  Workspace: 2:www
  Available modes:
    1366x768 @ 59.993000 Hz

Output HDMI-A-1 'Unknown HP E243 CNK9030QM3'
  Current mode: 1920x1080 @ 60.000000 Hz
  Position: 1366,0
  Scale factor: 1.000000
  Subpixel hinting: unknown
  Transform: normal
  Workspace: 4
  Available modes:
    1920x1080 @ 60.000000 Hz
mpv --vo=gpu --gpu-context=wayland --hwdec=vaapi testvideo.mkv
Playing: testvideo.mkv
 (+) Video --vid=1 (*) (hevc 1280x720 23.976fps)
 (+) Audio --aid=1 (*) (aac 2ch 48000Hz)
[vo/gpu/vaapi-egl] vaAcquireSurfaceHandle() failed (invalid VASurfaceID)
Cannot load libcuda.so.1
[ffmpeg/video] hevc: No support for codec hevc profile 1.
VO: [gpu] 1280x720 yuv420p
[vo/gpu/opengl] after rendering: OpenGL error INVALID_OPERATION.
[vo/gpu/opengl] after rendering: OpenGL error INVALID_FRAMEBUFFER_OPERATION.
AO: [pulse] 48000Hz stereo 2ch float
AV: 00:00:12 / 00:42:27 (0%) A-V:  0.000

Audio plays, but video output never opens. As a workaround one can use --gpu-context=x11 but I really want mpv as a native wayland client.

Expected behavior

mpv window opens and video starts playing.

Actual behavior

audio starts playing but the video window never opens.

Log file

# mpv -v --vo=gpu --gpu-context=wayland --hwdec=vaapi Videos/testvideo.mkv                                                               [cplayer] Command line options: '-v' '--vo=gpu' '--gpu-context=wayland' '--hwdec=vaapi' 'Videos/testvideo.mkv'
[cplayer] mpv 0.29.1 Copyright © 2000-2018 mpv/MPlayer/mplayer2 projects
[cplayer]  built on Tue Aug  6 14:50:47 CEST 2019
[cplayer] ffmpeg library versions:
[cplayer]    libavutil       56.31.100
[cplayer]    libavcodec      58.54.100
[cplayer]    libavformat     58.29.100
[cplayer]    libswscale      5.5.100
[cplayer]    libavfilter     7.57.100
[cplayer]    libswresample   3.5.100
[cplayer] ffmpeg version: n4.2.1
[cplayer] 
[cplayer] Configuration: ./waf configure --prefix=/usr --confdir=/etc/mpv --enable-cdda --enable-dvb --enable-dvdnav --enable-libarchive --enable-libmpv-shared --enable-libsmbclient --enable-tv --enable-zsh-comp
[cplayer] List of enabled features: 52arch alsa asm atomics audio-input build-date caca cdda cplayer cplugins cuda-hwaccel debug-build drm drmprime dvbin dvdnav dvdread-common egl-drm egl-helpers egl-x11 fchmod ffmpeg ffnvcodec gbm gbm.h gl gl-wayland gl-x11 glibc-thread-name glob glob-posix gnuc gpl iconv jack jpeg lcms2 libaf libarchive libass libass-osd libav-any libavcodec libavdevice libbluray libdl libm libmpv-shared librt libsmbclient libv4l2 linux-fstatfs lua optimize oss-audio plain-gl posix posix-or-mingw posix-spawn posix-spawn-native pthreads pulse rubberband shaderc shaderc-shared stdatomic tv tv-v4l2 uchardet vaapi vaapi-drm vaapi-egl vaapi-glx vaapi-wayland vaapi-x-egl vaapi-x11 vdpau vdpau-gl-x11 videodev vt.h vulkan wayland wayland-protocols x11 xv zlib zsh-comp
[cplayer] Reading config file /etc/mpv/encoding-profiles.conf
[cplayer] Reading config file /home/chron/.config/mpv/mpv.conf
[ifo] Opening /home/chron/.config/mpv/input.conf
[ifo_dvdnav] Opening /home/chron/.config/mpv/input.conf
[bdmv/bluray] Opening /home/chron/.config/mpv/input.conf
[file] Opening /home/chron/.config/mpv/input.conf
[input] Parsing input config file /home/chron/.config/mpv/input.conf
[input] Input config file /home/chron/.config/mpv/input.conf parsed: 3 binds
[cplayer] Waiting for scripts...
[ytdl_hook] script-opts/ytdl_hook.conf not found. 
[ytdl_hook] lua-settings/ytdl_hook.conf not found. 
[stats] script-opts/stats.conf not found. 
[stats] lua-settings/stats.conf not found. 
[cplayer] Done loading scripts.
[cplayer] Playing: Videos/testvideo.mkv
[cplayer] Running hook: ytdl_hook/on_load
[ytdl_hook] ytdl:// hook 
[ytdl_hook] not a ytdl:// url 
[ifo] Opening Videos/testvideo.mkv
[ifo_dvdnav] Opening Videos/testvideo.mkv
[bdmv/bluray] Opening Videos/testvideo.mkv
[file] Opening Videos/testvideo.mkv
[demux] Trying demuxers for level=normal.
[mkv] Found the head...
[mkv] + a segment...
[mkv] Parsing seek head...
[mkv] |+ segment information...
[mkv] | + muxing app: libebml v1.3.1 + libmatroska v1.4.2
[mkv] | + writing app: mkvmerge v7.8.0 ('River Man') 32bit built on Mar 27 2015 16:18:02
[mkv] | + timecode scale: 1000000
[mkv] | + duration: 2547.914s
[mkv] | + segment uid bc c9 68 7f a2 11 10 1f bb c0 f1 cd 11 b5 81 91
[mkv] |+ segment tracks...
[mkv] | + a track...
[mkv] |  + Track number: 1
[mkv] |  + Track type: Video
[mkv] |  + Video track
[mkv] |   + Display width: 1280
[mkv] |   + Display height: 720
[mkv] |   + Pixel width: 1280
[mkv] |   + Pixel height: 720
[mkv] |  + Codec ID: V_MPEGH/ISO/HEVC
[mkv] |  + CodecPrivate, length 1072
[mkv] |  + Language: und
[mkv] |  + Default duration: 41.708ms ( = 23.976 fps)
[mkv] | + a track...
[mkv] |  + Track number: 2
[mkv] |  + Track type: Audio
[mkv] |  + Audio track
[mkv] |   + Sampling frequency: 24000.000000
[mkv] |   + Output sampling frequency: 48000.000000
[mkv] |   + Channels: 2
[mkv] |  + Codec ID: A_AAC
[mkv] |  + CodecPrivate, length 7
[mkv] |  + Language: und
[mkv] |  + Default duration: 42.667ms ( = 23.438 fps)
[mkv] |+ found cluster
[mkv] Seeking to 236102107 to read header element 0x1c53bb6b.
[mkv] Parsing cues...
[mkv] Seeking to 236114668 to read header element 0x1254c367.
[mkv] All headers are parsed!
[demux] Detected file format: Matroska
[cplayer] Opening done: Videos/testvideo.mkv
[find_files] Loading external files in Videos/
[cplayer] Running hook: ytdl_hook/on_preloaded
[mkv] select track 0
[mkv] select track 1
[cplayer]  (+) Video --vid=1 (*) (hevc 1280x720 23.976fps)
[cplayer]  (+) Audio --aid=1 (*) (aac 2ch 48000Hz)
[vo/gpu/opengl] Initializing GPU context 'wayland'
[vo/gpu/wayland] Registered for protocol wl_shm
[vo/gpu] Enabling event driven renderloop!
[vo/gpu/wayland] Registered for protocol wl_compositor
[vo/gpu/wayland] Registered for protocol wl_data_device_manager
[vo/gpu/wayland] Registered for protocol zwp_idle_inhibit_manager_v1
[vo/gpu/wayland] Registered for protocol xdg_wm_base
[vo/gpu/wayland] Registered for protocol org_kde_kwin_server_decoration_manager
[vo/gpu/wayland] Registered for protocol wl_seat
[vo/gpu/wayland] Registered for protocol wl_output
[vo/gpu/wayland] Registered for protocol wl_output
[vo/gpu/wayland] Enabling server decorations
[vo/gpu/opengl] EGL_VERSION=1.4
[vo/gpu/opengl] EGL_VENDOR=Mesa Project
[vo/gpu/opengl] EGL_CLIENT_APIS=OpenGL OpenGL_ES 
[vo/gpu/opengl] Trying to create Desktop OpenGL context.
[vo/gpu/wayland] GL_VERSION='4.5 (Core Profile) Mesa 19.1.6'
[vo/gpu/wayland] Detected desktop OpenGL 4.5.
[vo/gpu/wayland] GL_VENDOR='Intel Open Source Technology Center'
[vo/gpu/wayland] GL_RENDERER='Mesa DRI Intel(R) Haswell Mobile '
[vo/gpu/wayland] GL_SHADING_LANGUAGE_VERSION='4.50'
[vo/gpu] Testing FBO format rgba16f
[vo/gpu] Using FBO format rgba16f.
[vo/gpu] No advanced processing required. Enabling dumb mode.
[vo/gpu/wayland] Registered output Unknown 0x04E3 (0x1c):
[vo/gpu/wayland]        x: 0px, y: 0px
[vo/gpu/wayland]        w: 1366px (280mm), h: 768px (160mm)
[vo/gpu/wayland]        scale: 1
[vo/gpu/wayland]        Hz: 59.993000
[vo/gpu/wayland] Registered output Unknown HP E243 (0x21):
[vo/gpu/wayland]        x: 0px, y: 0px
[vo/gpu/wayland]        w: 1920px (530mm), h: 1080px (300mm)
[vo/gpu/wayland]        scale: 1
[vo/gpu/wayland]        Hz: 60.000000
[vd] Container reported FPS: 23.976025
[vd] Codec list:
[vd]     hevc - HEVC (High Efficiency Video Coding)
[vd]     hevc_v4l2m2m (hevc) - V4L2 mem2mem HEVC decoder wrapper
[vd]     hevc_cuvid (hevc) - Nvidia CUVID HEVC decoder
[vd] Opening decoder hevc
[vd] Looking at hwdec hevc-vaapi...
[vo/gpu] Loading hwdec driver 'vaapi-egl'
[vo/gpu/vaapi-egl] Trying to open a x11 VA display...
[vo/gpu/vaapi-egl] Trying to open a wayland VA display...
[vo/gpu/vaapi-egl/vaapi] libva: VA-API version 1.5.0
[vo/gpu/vaapi-egl/vaapi] libva: va_getDriverName() returns 0
[vo/gpu/vaapi-egl/vaapi] libva: Trying to open /usr/lib/dri/i965_drv_video.so
[vo/gpu/vaapi-egl/vaapi] libva: Found init function __vaDriverInit_1_3
[vo/gpu/vaapi-egl/vaapi] libva: va_openDriver() returns 0
[vo/gpu/vaapi-egl/vaapi] Initialized VAAPI: version 1.5
[vo/gpu/vaapi-egl] using VAAPI EGL interop
[vo/gpu/vaapi-egl/vaapi] libva: vaExportSurfaceHandle: fourcc 48323234 is not supported for export as separate planes.
[vo/gpu/vaapi-egl] vaAcquireSurfaceHandle() failed (invalid VASurfaceID)
[vo/gpu/vaapi-egl] Supported formats:
[vo/gpu/vaapi-egl]  yuv420p
[vo/gpu/vaapi-egl]  yuv420p
[vo/gpu/vaapi-egl]  nv12
[vo/gpu/vaapi-egl]  rgb0
[vo/gpu/vaapi-egl]  bgr0
[vo/gpu/vaapi-egl]  p010
[vo/gpu] Loading hwdec driver 'cuda-nvdec'
Cannot load libcuda.so.1
[vo/gpu/cuda-nvdec] Failed to load CUDA symbols
[vo/gpu] Loading failed.
[vo/gpu] Loading hwdec driver 'vdpau-glx'
[vo/gpu] Loading failed.
[vo/gpu] Loading hwdec driver 'drmprime-drm'
[vo/gpu/drmprime-drm] Failed to retrieve DRM fd from native display.
[vo/gpu] Loading failed.
[vd] Trying hardware decoding via hevc-vaapi.
[vd] Selected codec: hevc (HEVC (High Efficiency Video Coding))
[vf] User filter list:
[vf]   (empty)
[ad] Codec list:
[ad]     aac - AAC (Advanced Audio Coding)
[ad]     aac_fixed (aac) - AAC (Advanced Audio Coding)
[ad] Opening decoder aac
[ad] Requesting 1 threads for decoding.
[ad] Selected codec: aac (AAC (Advanced Audio Coding))
[af] User filter list:
[af]   (empty)
[cplayer] Starting playback...
[vd] Pixel formats supported by decoder: vaapi_vld vdpau cuda yuv420p
[vd] Codec profile: Main (0x1)
[ffmpeg/video] hevc: No support for codec hevc profile 1.
[vd] Hardware decoding of this stream is unsupported?
[vd] Requesting pixfmt 'yuv420p' from decoder.
[vd] Falling back to software decoding.
[vd] Detected 4 logical cores.
[vd] Requesting 5 threads for decoding.
[vd] Using software decoding.
[vd] Decoder format: 1280x720 [0:1] yuv420p auto/auto/auto/limited/auto CL=unknown (auto 0.000000/0.000000/0.000000)
[vd] Using container aspect ratio.
[vf] [in] 1280x720 yuv420p bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [userdeint] 1280x720 yuv420p bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [userdeint] (disabled)
[vf] [autorotate] 1280x720 yuv420p bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [autorotate] (disabled)
[vf] [convert] 1280x720 yuv420p bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [convert] (disabled)
[vf] [out] 1280x720 yuv420p bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[cplayer] VO: [gpu] 1280x720 yuv420p
[cplayer] VO: Description: Shader-based GPU Renderer
[vo/gpu] reconfig to 1280x720 yuv420p bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vo/gpu/wayland] Reconfiguring!
[vo/gpu] Resize: 0x0
[vo/gpu] Window size: 1x1
[vo/gpu] Video source: 1280x720 (1:1)
[vo/gpu] Video display: (0, 0) 1280x720 -> (0, 0) 1x1
[vo/gpu] Video scale: 0.000781/0.001389
[vo/gpu] OSD borders: l=0 t=0 r=0 b=0
[vo/gpu] Video borders: l=0 t=0 r=0 b=0
[vo/gpu] Texture for plane 0: 1280x720
[vo/gpu] Texture for plane 1: 640x360
[vo/gpu] Texture for plane 2: 640x360
[vo/gpu] Testing FBO format rgba16f
[vo/gpu] Using FBO format rgba16f.
[vo/gpu] No advanced processing required. Enabling dumb mode.
[vo/gpu/wayland] Handling resize on the egl side
[vo/gpu] Resize: 0x0
[vo/gpu] Window size: 1x1
[vo/gpu] Video source: 1280x720 (1:1)
[vo/gpu] Video display: (0, 0) 1280x720 -> (0, 0) 1x1
[vo/gpu] Video scale: 0.000781/0.001389
[vo/gpu] OSD borders: l=0 t=0 r=0 b=0
[vo/gpu] Video borders: l=0 t=0 r=0 b=0
[vo/gpu] DR enabled: yes
[vo/gpu/opengl] after rendering: OpenGL error INVALID_OPERATION.
[cplayer] first video frame after restart shown
[vo/gpu/opengl] after rendering: OpenGL error INVALID_FRAMEBUFFER_OPERATION.
[af] [in] 48000Hz stereo 2ch floatp
[af] [userspeed] 48000Hz stereo 2ch floatp
[af] [userspeed] (disabled)
[af] [convert] 48000Hz stereo 2ch floatp
[ao] Trying audio driver 'pulse'
[ao/pulse] requested format: 48000 Hz, stereo channels, floatp
[ao/pulse] Library version: 13.0.0
[ao/pulse] Proto: 33
[ao/pulse] Server proto: 4294967295
[ao/pulse] Channel layouts:
[ao/pulse]  - #fl
[ao/pulse]  - #fr
[ao/pulse]  - #fc
[ao/pulse]  - #lfe
[ao/pulse]  - #bl
[ao/pulse]  - #br
[ao/pulse]  - #flc
[ao/pulse]  - #frc
[ao/pulse]  - #bc
[ao/pulse]  - #sl
[ao/pulse]  - #sr
[ao/pulse]  - #tc
[ao/pulse]  - #tfl
[ao/pulse]  - #tfc
[ao/pulse]  - #tfr
[ao/pulse]  - #tbl
[ao/pulse]  - #tbc
[ao/pulse]  - #tbr
[ao/pulse] result: stereo
[ao/pulse] device buffer: 4800 samples.
[ao/pulse] using soft-buffer of 9600 samples.
[cplayer] AO: [pulse] 48000Hz stereo 2ch float
[cplayer] AO: Description: PulseAudio audio output
[autoconvert] inserting resampler
[swresample] format change, reinitializing resampler
[swresample] 48000Hz stereo floatp -> 48000Hz stereo float
[af] [out] 48000Hz stereo 2ch float
[cplayer] starting audio playback
[vo/gpu/wayland] Enabling idle inhibitor
[cplayer] playback restart complete
[statusline] AV: 00:00:00 / 00:42:27 (0%) A-V:  0.000
[vo/gpu] Dropping unrendered frame (pts 10168962)
[statusline] AV: 00:00:00 / 00:42:27 (0%) A-V:  0.001
[vo/gpu] Dropping unrendered frame (pts 10210248)
[statusline] AV: 00:00:00 / 00:42:27 (0%) A-V:  0.000
[vo/gpu] Dropping unrendered frame (pts 10252624)
[statusline] AV: 00:00:00 / 00:42:27 (0%) A-V:  0.000
[vo/gpu] Dropping unrendered frame (pts 10295092)
[statusline] AV: 00:00:00 / 00:42:27 (0%) A-V:  0.000
[vo/gpu] Dropping unrendered frame (pts 10337547)
[statusline] AV: 00:00:00 / 00:42:27 (0%) A-V:  0.001
[vo/gpu] Dropping unrendered frame (pts 10378973)
[statusline] AV: 00:00:00 / 00:42:27 (0%) A-V:  0.000
[vo/gpu] Dropping unrendered frame (pts 10421354)
[statusline] AV: 00:00:00 / 00:42:27 (0%) A-V:  0.000
[vo/gpu] Dropping unrendered frame (pts 10463738)
[statusline] AV: 00:00:00 / 00:42:27 (0%) A-V:  0.000
[vo/gpu] Dropping unrendered frame (pts 10505042)
[statusline] AV: 00:00:00 / 00:42:27 (0%) A-V:  0.000
[vo/gpu] Dropping unrendered frame (pts 10547293)
[statusline] AV: 00:00:00 / 00:42:27 (0%) A-V:  0.000
[vo/gpu] Dropping unrendered frame (pts 10589498)
[statusline] AV: 00:00:00 / 00:42:27 (0%) A-V:  0.001
[vo/gpu] Dropping unrendered frame (pts 10630645)
[statusline] AV: 00:00:00 / 00:42:27 (0%) A-V:  0.000
[vo/gpu] Dropping unrendered frame (pts 10672747)
[statusline] AV: 00:00:00 / 00:42:27 (0%) A-V:  0.001
[cplayer] EOF code: 5  
[vo/gpu/wayland] Disabling the idle inhibitor
[ad] Uninit decoder.
[vd] Uninit decoder.
[cplayer] finished playback, success (reason 3)
[cplayer] 
[cplayer] 
[cplayer] Exiting... (Quit)
[stats] Exiting...
[ytdl_hook] Exiting...
[ao/pulse] draining...
[vo/gpu/wayland] Deregistering output Unknown HP E243 (0x21)
[vo/gpu/wayland] Deregistering output Unknown 0x04E3 (0x1c)
Dudemanguy commented 5 years ago

I can't reproduce this with current git master (in Sway or Weston). I'm not sure why this would have happened or when it would have been fixed, but could you try it again since there's been a lot of commits in these past few days? Possibly related to #6653.

Dudemanguy commented 5 years ago

Does the issue persist after #6978?

chron-isch commented 5 years ago

Just tested the latest git version, it's working, thank you.