smplayer-dev / smplayer

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

smplayer native wayland usage #6

Open miku84 opened 3 years ago

miku84 commented 3 years ago

Hello,

When smplayer is started native wayland from command line (QT_QPA_PLATFORM=wayland-egl smplayer), then video play does not work. Video is not loaded (settings are default). I tried all of the video output, but they give errors.

If QT_QPA_PLATFORM=xcb smplayer is used, then it is working.

errors vaapi for example: [vo/vaapi/x11] Error code: 3, request code: 12, minor code: 0 [vaapi] libva: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null) [vaapi] Failed to initialize VAAPI: unknown libva error X Error of failed request: BadWindow (invalid Window parameter) Major opcode of failed request: 10 (X_UnmapWindow) Resource id in failed request: 0x1e00002 Serial number of failed request: 35 Current serial number in output stream: 39

vaapi works fine with other players.

x11: [ffmpeg] sws: initFilter failed Could not initialize video chain. X Error of failed request: BadGC (invalid GC parameter) Major opcode of failed request: 60 (X_FreeGC)

I hope this can be fixed somehow.

Thanks in advance!

miku84 commented 3 years ago

Additional info: With further testing I noticed that with disabling the new wayland support checkbox, for example with VAAPI opens the file, but it has the old outside smplayer window issue. So when wayland is enabled it gives above issues, but if disabled then the video is outside and not full screen.

altosch commented 3 years ago

Hi, I really like SMPlayer and it's problems in Wayland is one of the last things preventing me switching for good. I have SMPlayer 21.1.0 on KDE NEON 5.21 installed from ppa:rvm/smplayer. I read about initial Wayland session support so I'm here to report that it doesn't work for me. When the "Wayland support" is checked in Preferences there's no video just audio. When trying to seek Smplayer freezes. With "Wayland support" leaving unchecked video is in the separate window labelled mpv.

SMPlayer Version: 21.1.0 (revision 9475) Using Qt 5.15.2 (compiled with Qt 5.12.8) Using MPV 0.32.0

Operating System: KDE neon 5.21 KDE Plasma Version: 5.21.3 KDE Frameworks Version: 5.80.0 Qt Version: 5.15.2 Kernel Version: 5.4.0-70-generic OS Type: 64-bit Graphics Platform: Wayland Processors: 4 × Intel® Core™ i5-4210U CPU @ 1.70GHz Memory: 7,2 GiB of RAM Graphics Processor: Mesa DRI Intel® HD Graphics 4400

kleshas commented 3 years ago

When the "Wayland support" is checked in Preferences there's no video just audio. When trying to seek Smplayer freezes. With "Wayland support" leaving unchecked video is in the separate window labelled mpv.

Same here mpv alone works fine, vlc works fine, smplayer does not work under any combination of settings I've tried. Crashes every time I try and change anything in preferences too. smplayer works fine under x11 (i3gaps)

Version: 21.1.0 (revision 9475) Using Qt 5.15.2 (compiled with Qt 5.15.2) Using MPV 0.33.1-dirty

Arch Linux always up-to-date sway 5.12.12-arch1-1 wayland i7 2600k, 24GB RAM, RX570 4GB

fabianski7 commented 3 years ago

running under xwayland can work as a workaround for now

and the wayland compatibility option in the settings is also breaking smplayer. when it's on, nothing works (although another window opens for the video).

smplayer-dev commented 3 years ago

Those having problems on wayland, could you test this flatpak package? (Select "shared memory" as video output)

fabianski7 commented 3 years ago

well, i don't have flatpak installed on my system, so i tested it in a virtual machine. The smplayer doesn't close as before, and you can even see the progress bar playing the video, but the image is broken https://i.imgur.com/aANkMZq.png

ahmad-wahyudin commented 3 years ago

Those having problems on wayland, could you test this flatpak package? (Select "shared memory" as video output)

yeah it's worked in Fedora 34 Wayland Version 21.1.0.9769

But after 1~2 minutes playing video, smplayer force close itself

smplayer-dev commented 3 years ago

There was a problem in mpv in that version. Try version 9771 which you can find here: https://github.com/smplayer-dev/smplayer/releases/tag/v21.1.0.9771

desmond27 commented 3 years ago

I am not sure if this is related, but when running under wayland (Manjaro up-to-date) and when attempting to play any video I get some logs related to smplayer attempting to run x11 related functionality and failing.

Here's some logs when using vdpau as an output:

[vo/vdpau/x11] X11 error: BadDrawable (invalid Pixmap or Window parameter)
[vo/vdpau/x11] Type: 0, display: 0x7fc89c0027e0, resourceid: 4, serial: 11
[vo/vdpau/x11] Error code: 9, request code: e, minor code: 0
[vo/vdpau/x11] X11 error: BadWindow (invalid Window parameter)
[vo/vdpau/x11] Type: 0, display: 0x7fc89c0027e0, resourceid: 4, serial: 12
[vo/vdpau/x11] Error code: 3, request code: 28, minor code: 0
[vo/vdpau/x11] X11 error: BadWindow (invalid Window parameter)
[vo/vdpau/x11] Type: 0, display: 0x7fc89c0027e0, resourceid: 4, serial: 13
[vo/vdpau/x11] Error code: 3, request code: 2, minor code: 0
[vo/vdpau/x11] X11 error: BadWindow (invalid Window parameter)
[vo/vdpau/x11] Type: 0, display: 0x7fc89c0027e0, resourceid: 4, serial: 17
[vo/vdpau/x11] Error code: 3, request code: 1, minor code: 0
[vo/vdpau/x11] X11 error: BadWindow (invalid Window parameter)
[vo/vdpau/x11] Type: 0, display: 0x7fc89c0027e0, resourceid: 2400002, serial: 1a
[vo/vdpau/x11] Error code: 3, request code: 12, minor code: 0
[vo/vdpau/x11] X11 error: BadWindow (invalid Window parameter)
[vo/vdpau/x11] Type: 0, display: 0x7fc89c0027e0, resourceid: 2400002, serial: 1c
[vo/vdpau/x11] Error code: 3, request code: 12, minor code: 0
[vo/vdpau/x11] X11 error: BadWindow (invalid Window parameter)
[vo/vdpau/x11] Type: 0, display: 0x7fc89c0027e0, resourceid: 2400002, serial: 1d
[vo/vdpau/x11] Error code: 3, request code: 12, minor code: 0
[vo/vdpau/x11] X11 error: BadWindow (invalid Window parameter)
[vo/vdpau/x11] Type: 0, display: 0x7fc89c0027e0, resourceid: 2400002, serial: 1f
[vo/vdpau/x11] Error code: 3, request code: 12, minor code: 0
[vo/vdpau/x11] X11 error: BadWindow (invalid Window parameter)
[vo/vdpau/x11] Type: 0, display: 0x7fc89c0027e0, resourceid: 2400002, serial: 20
[vo/vdpau/x11] Error code: 3, request code: 12, minor code: 0
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
[vo/vdpau] Error when calling vdp_device_create_x11: 1
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  10 (X_UnmapWindow)
  Resource id in failed request:  0x2400002
  Serial number of failed request:  34
  Current serial number in output stream:  38

I get this error despite Wayland support being selected under the video tab in preferences. Selecting any other output has similar results though will somewhat different log messages.

ahmad-wahyudin commented 3 years ago

There was a problem in mpv in that version. Try version 9771 which you can find here: https://github.com/smplayer-dev/smplayer/releases/tag/v21.1.0.9771

it's not force close anymore, but when i move mouse in fullscreen, floating controll not showing. I try checked option; show only when mouse in bottom, the floating controll still not showing, same as latest version. I don't know it because of flapak or wayland or bugs in software

miku84 commented 3 years ago

Here's some logs when using vdpau as an output:

Hi desmond27, I am not sure whether vdpau is working on wayland, but it would explain x11 code. Could you try vaapi as well?

desmond27 commented 3 years ago

Here's some logs when using vdpau as an output:

Hi desmond27, I am not sure whether vdpau is working on wayland, but it would explain x11 code. Could you try vaapi as well?

Yes, I tried that, the result is the same. Apparently smplayer still thinks it's running in X11, no matter what option I choose.

If I select default it just freezes. Any other option gives an error related to X11.

smplayer-dev commented 3 years ago

There was a problem in mpv in that version. Try version 9771 which you can find here: https://github.com/smplayer-dev/smplayer/releases/tag/v21.1.0.9771

it's not force close anymore, but when i move mouse in fullscreen, floating controll not showing. I try checked option; show only when mouse in bottom, the floating controll still not showing, same as latest version. I don't know it because of flapak or wayland or bugs in software

I don't know why this happens but a workaround seems to be clicking with the mouse left button while moving it.

xavier83 commented 3 years ago

It works perfectly when I set the output driver to Shared Memory( attached screenshot). video opens in new window if output is set to wlshm, libmpv and blank screen when I set it to default, xv, x11, crashes in other models. Thanks @smplayer-dev , now I hope to move to wayland-kde full-time if there aren't any surprises. Screenshot_20210707_193614

rechapit commented 3 years ago

Almost there for me. Everything seems perfect in windowed mode but in fullscreen mode playback controls do not show up when hovering the mouse on the bottom of the of the screen. Forcing me to exit fullscreen if I want to use the slider to seek to specific point. Still a lot more usable.

smplayer-dev commented 3 years ago

Try clicking with the left button while moving the mouse. That works for me.

rechapit commented 3 years ago

It works but its inconsistent. Mostly works on the second or third try. A lot of times I end up double clicking by accident and exiting full screen as result

smplayer-dev commented 3 years ago

It seems this problem only happens when using wayland and the flatpack package. I've just created an appimage package, could you test it?

Download the artifact from this page: https://github.com/smplayer-dev/smplayer-build/actions/runs/1017955002

Unzip it, give it execute permission (chmod a+x SMPlayer-21.1.0.9800-x86_64.AppImage) and run it. Be sure the mpv path in preferences is set to "mpv" and not "/usr/bin/mpv" and the video output to "Shared memory".

rechapit commented 3 years ago

Trying the appimage wouldn't give me the option for "Shared memory". However, setting the video output to "Default" works just fine. The playback controls show on mouseover. Thanks!

EDIT: On closer inspection I realized it was working because smplayer was working via xwayland. appimage forces X11 maybe?

rechapit commented 3 years ago
QT_QPA_PLATFORM=wayland ./SMPlayer-21.1.0.9800-x86_64.AppImage
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb.

[1]    39206 abort (core dumped)  QT_QPA_PLATFORM=wayland ./SMPlayer-21.1.0.9800-x86_64.AppImage

Seem the appimage is not compiled with wayland support

ahmadraniri1994 commented 3 years ago

smplayer open 2 windows (instead 1 fixed window, 1 for smplayer and the other for mpv) is still exist, Smplayer v.20.6.0 / mpv 0.32.0.

smplayer-dev commented 3 years ago

The Appimage package should really fix the video window problem on Wayland:

ahmadraniri1994 commented 3 years ago

smplayer open 2 windows (instead 1 fixed window, 1 for smplayer and the other for mpv) is still exist, Smplayer v.20.6.0 / mpv 0.32.0.

Fixed on gnome wayland Arch linux, can't replicate on devuan. Thanks

ahmadraniri1994 commented 3 years ago

smplayer open 2 windows (instead 1 fixed window, 1 for smplayer and the other for mpv) is still exist, Smplayer v.20.6.0 / mpv 0.32.0.

Fixed on gnome wayland Arch linux, can't replicate on devuan. Thanks

Fixed using appimage and compile the latest version (on devuan with gnome 3.38), just make sure not to use "XDG_SESSION_TYPE=wayland" when starting gnome from tty. Thanks.

smplayer-dev commented 3 years ago

I think smplayer-21.1.0.9864.flatpak doesn't have the floating control problem when using wayland.

ahmad-wahyudin commented 3 years ago

There is still a bugs when Using Wayland. When I change Contrast, Gamma, and Saturation it has no Effect

Version 21.8.0

smplayer-dev commented 3 years ago

You need to enable the software video equalizer (preferences -> general -> video).

ahmad-wahyudin commented 3 years ago

You need to enable the software video equalizer (preferences -> general -> video).

Thanks it's work

francoism90 commented 2 years ago

I'm having the same issue on KDE Plasma 5.23.1 Wayland - should one force Wayland or x11?

miku84 commented 2 years ago

Hi, We are talking about native usage (smpayer) and not x11 (QT_QPA_PLATFORM=xcb smplayer), which is working fine.

I am manjaro with smplayer 21.10.0-1 and seems I do not have the option "shared memory". Is it a must when using wayland?

smplayer-dev commented 2 years ago

You only need "shared memory" if none of the others video outputs work for you. But the "shared memory" output is only available in the snap, flatpak and appimage packages.

je-vv commented 1 year ago

I don't know if fixes associated to this issue were merged and also released into any version.

I'm using 22.7.0 from Arch and with mpv (1:0.35.1-3) + vaapi, and when loading a video (mp4 or mkv) on wayland, without "QT_QPA_PLATFORM=xcb", meaning natively, I get a bunch of X11 errors:

[vo/gpu/x11] X11 error: BadDrawable (invalid Pixmap or Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7f8538045730, resourceid: 5, serial: 12
[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: 0x7f8538045730, resourceid: 5, serial: 13
[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: 0x7f8538045730, resourceid: 5, serial: 1c
[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: 0x7f8538045730, resourceid: 5, serial: 1e
[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: 0x7f8538045730, resourceid: 1c00002, 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: 0x7f8538045730, resourceid: 1c00002, serial: 24
[vo/gpu/x11] Error code: 3, request code: 92, minor code: 3
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7f8538045730, resourceid: 1c00002, serial: 26
[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: 0x7f8538045730, resourceid: 1c00002, serial: 27
[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: 0x7f8538045730, resourceid: 1c00002, serial: 29
[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: 0x7f8538045730, resourceid: 1c00002, serial: 2a
[vo/gpu/x11] Error code: 3, request code: 12, minor code: 0
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  10 (X_UnmapWindow)
  Resource id in failed request:  0x1c00002
  Serial number of failed request:  49
  Current serial number in output stream:  53

But I'm confused, since it seems the issues were solved, at least on some side flatpak versions. I see the issues still open, but I'm not sure if because the fixes hadn't reached a release yet, or because there are some other nuances still not fixed. In my case, it's plain not working natively on wayland.

If I use QT_QPA_PLATFORM=xcb, then I can load videos, no issues, though there are some nuances when moving to full screen, it's like the bottom play bar gets broken for some seconds and then goes to normal, but it works in genera.

Just asking because I got confused with the tests some users did on the flatpak versions on 2021, and the latest release still not able to load videos natively on wayland....

BTW, I don't use flatpak, snap, or any of those binary package managers...

smplayer-dev commented 1 year ago

The flatpak and snap packages provide patched versions of mpv and mplayer which should fix the problem on Wayland.

ttys3 commented 1 year ago

patched versions of mpv? can this be contribued to the upstream ?

smplayer-dev commented 1 year ago

It's a patch that adds another video output (shm), which doesn't output anything but sends the video data to a shared buffer. It's based in a mplayer video output for macos.

It's unlikely that mpv accepted this patch since they already provide another method using their lib. I think it would be too complicated to implement support for the mpv lib and at the same time the mplayer slave commands. I would probably have to drop support for mplayer. For me it was just easier to add that small video output to both mplayer and mpv, for the snap and flatpak packages.

ttys3 commented 1 year ago

Can you open source the patched version of mpv? Because not everyone likes to use flatpak or snap

Sent from Outlook for iOShttps://aka.ms/o0ukef


From: Ricardo @.> Sent: Saturday, March 18, 2023 5:46:54 PM To: smplayer-dev/smplayer @.> Cc: ttys3 @.>; Manual @.> Subject: Re: [smplayer-dev/smplayer] smplayer native wayland usage (#6)

It's a patch that adds another video output (shm), which doesn't output anything but sends the video data to a shared buffer. It's based in a mplayer video output for macos.

It's unlikely that mpv accepted this patch since they already provide another method using their lib. I think it would be too complicated to implement support for the mpv lib and at the same time the mplayer slave commands. I would probably have to drop support for mplayer. For me it was just easier to add that small video output to both mplayer and mpv, for the snap and flatpak packages.

— Reply to this email directly, view it on GitHubhttps://github.com/smplayer-dev/smplayer/issues/6#issuecomment-1474790666, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJ7RGV3MKHXO76LQQDV3MRLW4WAA5ANCNFSM4ZJHIIEQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>

smplayer-dev commented 1 year ago

https://github.com/smplayer-dev/mplayer-mod https://github.com/smplayer-dev/mpv-mod

je-vv commented 1 year ago

I think it would be too complicated to implement support for the mpv lib and at the same time the mplayer slave commands. I would probably have to drop support for mplayer.

I'm sure I have no influence on your decision, but just so you know, I originally was a mplayer user, but it's lack of vaapi support, and mpv showing up with it, made me ditch mplayer, and it's gui wrapper I was using t that time, and moved to mpv + smplayer, which at the point of my move, already supported mpv, which already supported vaapi.

There's a mplayer fork now a days, which adds vaapi support now, but it's not upstreaming such support to mplayer AFAIK, ang it got sort of stale/unmaintained, and mpv is way more supported on most distros. So, having migrated to mpv, I never looked back to mplayer.

Perhaps that's the same for others besides me. So having to remove mplayer's support might not be that harmful after all, but I understand it might be a hard decision to make.

ttys3 commented 1 year ago

I think it would be too complicated to implement support for the mpv lib and at the same time the mplayer slave commands. I would probably have to drop support for mplayer.

I'm sure I have no influence on your decision, but just so you know, I originally was a mplayer user, but it's lack of vaapi support, and mpv showing up with it, made me ditch mplayer, and it's gui wrapper I was using t that time, and moved to mpv + smplayer, which at the point of my move, already supported mpv, which already supported vaapi.

There's a mplayer fork now a days, which adds vaapi support now, but it's not upstreaming such support to mplayer AFAIK, ang it got sort of stale/unmaintained, and mpv is way more supported on most distros. So, having migrated to mpv, I never looked back to mplayer.

Perhaps that's the same for others besides me. So having to remove mplayer's support might not be that harmful after all, but I understand it might be a hard decision to make.

Yes. I also switched from mplayer to mpv, and I was also an mplayer user many years ago. But I have been switching to mpv for many years, it was also a difficult decision (to remove mplayer support)

ttys3 commented 1 year ago

@smplayer-dev I compiled mpv with the vo shm patch (under Linux), and also recompiled smplayer with

DEFINES += USE_SHM
DEFINES+=USE_GL_WINDOW

not working.

image

smplayer-dev commented 1 year ago

Please send log.

barsnick commented 1 year ago

Related to https://github.com/smplayer-dev/smplayer/commit/a4dd1953c0f2ad9bdcb455279d3409d3ce68873b (and vice versa).

brainrom commented 3 months ago

I examined the SMPlayer's source code and concluded, that it's really hard to fix. So I reimplemented from scratch most of SMPlayer functionality on top of libmpv (OpenGL Render API) and Qt6 in a different project.

fabianski7 commented 3 months ago

I examined the SMPlayer's source code and concluded, that it's really hard to fix. So I reimplemented from scratch most of SMPlayer functionality on top of libmpv (OpenGL Render API) and Qt6 in a different project.

hey @brainrom, great job! I can confirm that it works very well. I've left some suggestions for functions that I used a lot in smplayer. Thank you!

smplayer-dev commented 3 months ago

It would be possible to run smplayer as a native wayland application, but right now there are some problems: