smplayer-dev / smplayer

Free Media Player for Windows, Linux and Mac OS with YouTube support.
https://smplayer.info
GNU General Public License v2.0
656 stars 92 forks source link

Wayland support? #264

Open rubyFeedback opened 2 years ago

rubyFeedback commented 2 years ago

Hello there,

I remember many years ago I suggested to add support for mpv, due to mplayer lagging in behind with code changes. I do not know whether my issue request was what caused changes in smplayer, but I err on the side of my ego and assume "Yes!", so I will file this issue request here as well. ;) (Soon after smplayer also added mpv, but of course I don't know whether that had anything to do with my issue request. Obviously more and more people use mpv rather than mplayer these days; mpv just got a new release today as well. \o/)

The issue request here originated from this reddit thread:

https://old.reddit.com/r/kde/comments/qkmdjh/smplayer_does_not_seem_to_work_on_wayland_any/

Note: I am not one of the users there. I am actually banned on the linux reddit. People don't like hearing me complain about systemd ... :P

Would it be possible to consider adding wayland support for smplayer?

This is probably not super-urgent as-is and I am sure people get things ironed out eventually (if more and more people use wayland; note that I am using xorg and it works fine, including mpv + smplayer; admittedly I use mpv mostly from the commandline, but smplayer makes things more convenient. If I remember correctly I could even use it on windows, which is useful for elderly people in particular.)

I don't know what things have to be modified for smplayer to work on wayland, but perhaps this issue can serve as the first "meta-template", and people can comment what should happen to the smplayer code base in order to support wayland as a drop-in replacement. Thanks for reading; as always please feel free to close this issue at any moment in time.

smplayer-dev commented 2 years ago

Install the snap package. It should work with Wayland.

https://blog.smplayer.info/how-to-fix-the-video-problem-on-wayland/

medmedin2014 commented 1 year ago

Currently, on Plasma 5.27.5 with Wayland, SMPlayer is broken and can't play any video (mp4, webm...). Wayland is already programmed to be set the default with next Plasma 6 release. So this ticket is no longer an enhancement but a bug.

Screenshot_20230520_141017

smplayer-dev commented 1 year ago

What does the log say?

medmedin2014 commented 1 year ago

@smplayer-dev This mp4 video can be viewed by VLC, MPlayer and MPV, but SMPlayer shows the following error:

SMPlayer Version: 22.7.0 (revision 10091)
Operating System: Manjaro Linux 
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.106.0
Qt Version: 5.15.9
Kernel Version: 6.3.3-1-MANJARO (64-bit)
Graphics Platform: Wayland
/usr/bin/mplayer -noquiet -slave -identify -nofs -sub-fuzziness 1 -vo xv,x11, -nodr -double -nomouseinput -input nodefault-bindings:conf=/dev/null -nokeepaspect -wid 5 -monitorpixelaspect 1 -osdlevel 0 -subfont-osd-scale 3 -progbar-align 80 -ass -embeddedfonts -ass-line-spacing 0 -ass-font-scale 1 -noflip-hebrew -ass-styles /home/med/.config/smplayer/styles.ass -subcp ISO-8859-1 -subpos 100 -volume 50 -vf-add screenshot=/home/med/Pictures/smplayer_screenshots/shot -noslices -af-add scaletempo -softvol -softvol-max 110 /home/med/Videos/out.mp4

MPlayer SVN-r38412 (C) 2000-2023 MPlayer Team
226 audio & 469 video codecs
do_connect: could not connect to socket
connect: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
Terminal type `unknown' is not defined.

Playing /home/med/Videos/out.mp4.
libavformat version 60.3.100 (external)
libavformat file format detected.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f5b910aca80]Protocol name not provided, cannot determine if input is local or a network protocol, buffers and access patterns cannot be configured optimally without knowing the protocol
ID_VIDEO_ID=0
[lavf] stream 0: video (h264), -vid 0
VIDEO:  [H264]  1366x768  24bpp  59.000 fps  440.4 kbps (53.8 kbyte/s)
X11 error: BadMatch (invalid parameter attributes)
Opening video filter: [ass auto=1]
[ass] auto-open
Opening video filter: [screenshot=/home/med/Pictures/smplayer_screenshots/shot]
[ass] libass API version: 0x1701000
[ass] libass source: commit: 0.17.1-0-ge8ad72accd3a84268275a9385beb701c9284e5b3-dirty
[ass] Shaper: FriBidi 1.0.12 (SIMPLE) HarfBuzz-ng 7.3.0 (COMPLEX)
[ass] Using font provider fontconfig
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 60.3.100 (external)
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
ID_VIDEO_CODEC=ffh264
Clip info:
 major_brand: isom
ID_CLIP_INFO_NAME0=major_brand
ID_CLIP_INFO_VALUE0=isom
 minor_version: 512
ID_CLIP_INFO_NAME1=minor_version
ID_CLIP_INFO_VALUE1=512
 compatible_brands: isomiso2avc1mp41
ID_CLIP_INFO_NAME2=compatible_brands
ID_CLIP_INFO_VALUE2=isomiso2avc1mp41
 encoder: Lavf60.3.100
ID_CLIP_INFO_NAME3=encoder
ID_CLIP_INFO_VALUE3=Lavf60.3.100
ID_CLIP_INFO_N=4
Load subtitles in /home/med/Videos/
ID_FILENAME=/home/med/Videos/out.mp4
ID_DEMUXER=lavfpref
ID_VIDEO_FORMAT=H264
ID_VIDEO_BITRATE=440376
ID_VIDEO_WIDTH=1366
ID_VIDEO_HEIGHT=768
ID_VIDEO_FPS=59.000
ID_VIDEO_ASPECT=0.0000
ID_START_TIME=0.00
ID_LENGTH=22.85
ID_SEEKABLE=1
ID_CHAPTERS=0
Audio: no sound
Starting playback...
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
ID_VIDEO_ASPECT=1.7786
[swscaler @ 0x7f5b91194b00]using unscaled yuv420p -> rgb24 special converter
VO: [xv] 1366x768 => 1366x768 Planar YV12 
X11 error: BadWindow (invalid Window parameter)
X11 error: BadWindow (invalid Window parameter)
X11 error: BadDrawable (invalid Pixmap or Window parameter)
X11 error: BadWindow (invalid Window parameter)
X11 error: BadDrawable (invalid Pixmap or Window parameter)
X11 error: BadWindow (invalid Window parameter)
X11 error: BadDrawable (invalid Pixmap or Window parameter)
X11 error: BadWindow (invalid Window parameter)
X11 error: BadDrawable (invalid Pixmap or Window parameter)

MPlayer interrupted by signal 8 in module: filter video
ID_SIGNAL=8
- MPlayer crashed by bad usage of CPU/FPU/RAM.
  Recompile MPlayer with --enable-debug and make a 'gdb' backtrace and
  disassembly. Details in DOCS/HTML/en/bugreports_what.html#bugreports_crash.
- MPlayer crashed. This shouldn't happen.
  It can be a bug in the MPlayer code _or_ in your drivers _or_ in your
  gcc version. If you think it's MPlayer's fault, please read
  DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and
  won't help unless you provide this information when reporting a possible bug.
smplayer-dev commented 1 year ago

Does it work if you select mpv as multimedia engine instead of mplayer?

medmedin2014 commented 1 year ago

@smplayer-dev After switching to mpv then restarting the app, now it shows nothing just black screen Screenshot_20230521_150850

And after I click on close button it shows

Screenshot_20230521_151356

With the following error:

/usr/bin/mpv --no-quiet --terminal --no-msg-color --input-ipc-server=/tmp/smplayer-mpv-157f --msg-level=ffmpeg/demuxer=error --video-rotate=no --no-config --no-fs --hwdec=no --sub-auto=fuzzy --vo=xv,x11, --no-input-default-bindings --input-vo-keyboard=no --no-input-cursor --cursor-autohide=no --no-keepaspect --wid=5 --monitorpixelaspect=1 --osd-level=1 --osd-scale=1 --osd-bar-align-y=0.6 --sub-ass --embeddedfonts --sub-ass-line-spacing=0 --sub-scale=1 --sub-font=Arial --sub-color=#ffffffff --sub-shadow-color=#ff000000 --sub-border-color=#ff000000 --sub-border-size=0.75 --sub-shadow-offset=2.5 --sub-font-size=50 --sub-bold=no --sub-italic=no --sub-margin-y=8 --sub-margin-x=20 --sub-codepage=ISO-8859-1 --vid=1 --sub-pos=100 --volume=55 --cache=auto --screenshot-template=cap_%F_%p_%02n --screenshot-format=jpg --screenshot-directory=/home/med/Pictures/smplayer_screenshots --audio-pitch-correction=yes --volume-max=110 --term-playing-msg=MPV_VERSION=${=mpv-version:}
INFO_VIDEO_WIDTH=${=width}
INFO_VIDEO_HEIGHT=${=height}
INFO_VIDEO_ASPECT=${=video-params/aspect}
INFO_VIDEO_FPS=${=container-fps:${=fps}}
INFO_VIDEO_FORMAT=${=video-format}
INFO_VIDEO_CODEC=${=video-codec}
INFO_DEMUX_ROTATION=${=track-list/0/demux-rotation}
INFO_AUDIO_FORMAT=${=audio-codec-name}
INFO_AUDIO_CODEC=${=audio-codec}
INFO_AUDIO_RATE=${=audio-params/samplerate}
INFO_AUDIO_NCH=${=audio-params/channel-count}
INFO_LENGTH=${=duration:${=length}}
INFO_DEMUXER=${=current-demuxer:${=demuxer}}
INFO_SEEKABLE=${=seekable}
INFO_TITLES=${=disc-titles}
INFO_CHAPTERS=${=chapters}
INFO_TRACKS_COUNT=${=track-list/count}
METADATA_TITLE=${metadata/by-key/title:}
METADATA_ARTIST=${metadata/by-key/artist:}
METADATA_ALBUM=${metadata/by-key/album:}
METADATA_GENRE=${metadata/by-key/genre:}
METADATA_DATE=${metadata/by-key/date:}
METADATA_TRACK=${metadata/by-key/track:}
METADATA_COPYRIGHT=${metadata/by-key/copyright:}
INFO_MEDIA_TITLE=${=media-title:}
INFO_STREAM_PATH=${stream-path}
 --audio-client-name=SMPlayer --term-status-msg=STATUS: ${=time-pos} / ${=duration:${=length:0}} P: ${=pause} B: ${=paused-for-cache} I: ${=core-idle} VB: ${=video-bitrate:0} AB: ${=audio-bitrate:0} /home/med/Videos/out.mp4

 (+) Video --vid=1 (*) (h264 1366x768 59.000fps)
[vo/xv/x11] X11 error: BadDrawable (invalid Pixmap or Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 5, serial: 12
[vo/xv/x11] Error code: 9, request code: e, minor code: 0
[vo/xv/x11] X11 error: BadWindow (invalid Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 5, serial: 13
[vo/xv/x11] Error code: 3, request code: 28, minor code: 0
[vo/xv/x11] X11 error: BadWindow (invalid Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 5, serial: 14
[vo/xv/x11] Error code: 3, request code: 2, minor code: 0
[vo/xv/x11] X11 error: BadWindow (invalid Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 5, serial: 18
[vo/xv/x11] Error code: 3, request code: 1, minor code: 0
[vo/xv/x11] X11 error: BadWindow (invalid Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 1400002, serial: 1b
[vo/xv/x11] Error code: 3, request code: 12, minor code: 0
[vo/xv/x11] X11 error: BadWindow (invalid Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 1400002, serial: 1e
[vo/xv/x11] Error code: 3, request code: 92, minor code: 3
[vo/xv/x11] X11 error: BadWindow (invalid Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 1400002, serial: 20
[vo/xv/x11] Error code: 3, request code: 12, minor code: 0
[vo/xv/x11] X11 error: BadWindow (invalid Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 1400002, serial: 21
[vo/xv/x11] Error code: 3, request code: 12, minor code: 0
[vo/xv/x11] X11 error: BadWindow (invalid Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 1400002, serial: 23
[vo/xv/x11] Error code: 3, request code: 12, minor code: 0
[vo/xv/x11] X11 error: BadWindow (invalid Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 1400002, serial: 24
[vo/xv/x11] Error code: 3, request code: 12, minor code: 0
[vo/xv] Warning: this legacy VO has bad quality and performance, and will in particular result in blurry OSD and subtitles. You should fix your graphics drivers, or not force the xv VO.
VO: [xv] 1366x768 yuv420p
[vo/xv/x11] X11 error: BadDrawable (invalid Pixmap or Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 5, serial: 37
[vo/xv/x11] Error code: 9, request code: e, minor code: 0
[vo/xv/x11] X11 error: BadWindow (invalid Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 5, serial: 38
[vo/xv/x11] Error code: 3, request code: 28, minor code: 0
[vo/xv/x11] X11 error: BadWindow (invalid Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 1400002, serial: 39
[vo/xv/x11] Error code: 3, request code: c, minor code: 0
[vo/xv/x11] X11 error: BadWindow (invalid Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 1400002, serial: 3b
[vo/xv/x11] Error code: 3, request code: 12, minor code: 0
[vo/xv/x11] X11 error: BadWindow (invalid Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 1400002, serial: 3c
[vo/xv/x11] Error code: 3, request code: 2, minor code: 0
[vo/xv/x11] X11 error: BadWindow (invalid Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 1400002, serial: 3d
[vo/xv/x11] Error code: 3, request code: 2, minor code: 0
[vo/xv/x11] X11 error: BadWindow (invalid Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 1400002, serial: 3e
[vo/xv/x11] Error code: 3, request code: 3, minor code: 0
[vo/xv/x11] X11 error: BadWindow (invalid Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 1400002, serial: 40
[vo/xv/x11] Error code: 3, request code: 8, minor code: 0
[vo/xv/x11] X11 error: BadWindow (invalid Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 1400002, serial: 41
[vo/xv/x11] Error code: 3, request code: 12, minor code: 0
[vo/xv/x11] X11 error: BadWindow (invalid Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 1400002, serial: 44
[vo/xv/x11] Error code: 3, request code: 3, minor code: 0
[vo/xv/x11] X11 error: BadDrawable (invalid Pixmap or Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 5, serial: 46
[vo/xv/x11] Error code: 9, request code: e, minor code: 0
[vo/xv/x11] X11 error: BadWindow (invalid Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 5, serial: 47
[vo/xv/x11] Error code: 3, request code: 28, minor code: 0
[vo/xv/x11] X11 error: BadDrawable (invalid Pixmap or Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 1400002, serial: 48
[vo/xv/x11] Error code: 9, request code: 37, minor code: 0
[vo/xv/x11] X11 error: BadDrawable (invalid Pixmap or Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 1400002, serial: 49
[vo/xv/x11] Error code: 9, request code: 37, minor code: 0
MPV_VERSION=mpv 0.35.1-dirty
INFO_VIDEO_WIDTH=1366
INFO_VIDEO_HEIGHT=768
INFO_VIDEO_ASPECT=1.778646
INFO_VIDEO_FPS=59.000000
INFO_VIDEO_FORMAT=h264
INFO_VIDEO_CODEC=h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10)
INFO_DEMUX_ROTATION=
INFO_AUDIO_FORMAT=
INFO_AUDIO_CODEC=
INFO_AUDIO_RATE=
INFO_AUDIO_NCH=
INFO_LENGTH=22.847458
INFO_DEMUXER=lavf
INFO_SEEKABLE=yes
INFO_TITLES=
INFO_CHAPTERS=0
INFO_TRACKS_COUNT=1
METADATA_TITLE=
METADATA_ARTIST=
METADATA_ALBUM=
METADATA_GENRE=
METADATA_DATE=
METADATA_TRACK=
METADATA_COPYRIGHT=
INFO_MEDIA_TITLE=out.mp4
INFO_STREAM_PATH=/home/med/Videos/out.mp4
INFO_VIDEO_DSIZE=1366x768
INFO_TRACK_0: video 1 '' '' yes
[vo/xv/x11] X11 error: BadDrawable (invalid Pixmap or Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 1400002, serial: 57
[vo/xv/x11] Error code: 9, request code: 95, minor code: 13
[vo/xv/x11] X11 error: BadDrawable (invalid Pixmap or Window parameter)
[vo/xv/x11] Type: 0, display: 0x7f1c38044540, resourceid: 1400002, serial: 5b
[vo/xv/x11] Error code: 9, request code: 95, minor code: 13
[vo/xv] X11 can't keep up! Waiting for XShm completion events...
Exiting... (Quit)
smplayer-dev commented 1 year ago

Do the snap or flatpak packages work for you? https://www.smplayer.info/downloads

medmedin2014 commented 1 year ago

@smplayer-dev Appimage: After downloading the Appimage file then extracting it and removing squashfs-root/usr/lib/libgmodule-2.0.so.0 from it and repackaging with appimagetool, I succeeded to run it. With both mpv and mplayer the video file is played and the time counter starts counting but the screen is black and it doesn't give any error. Screenshot_20230521_174042

Flatpak This format also gives the same black screen with both mpv and mplayer. And it logs in terminal some kind of error/warning: Screenshot_20230521_184654

smplayer-dev commented 1 year ago

I'm afraid I can't reproduce this problem. Be sure the option "Wayland support" in preferences -> general -> video is enabled and the output driver set to "default" or "shared memory". Also the problem with the Appimage package should be fixed in this build: https://github.com/smplayer-dev/smplayer/actions/runs/5043856777

medmedin2014 commented 1 year ago

@smplayer-dev It seems latest 23.6.0 (revision 10157) works fine on Plasma Wayland and it can read mp4, avi, webm and mkv files without any crash.