Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What about wayland support? #188

Open
pshirshov opened this issue Jan 13, 2016 · 14 comments · May be fixed by #331
Open

What about wayland support? #188

pshirshov opened this issue Jan 13, 2016 · 14 comments · May be fixed by #331

Comments

@pshirshov
Copy link

baka-mplayer crashes under wayland for now while mpv itself works successfully.

@u8sand u8sand added the bug label Jan 13, 2016
@u8sand
Copy link
Owner

u8sand commented Feb 13, 2016

I'm assuming you've added the relevant Qt compilation flag; the other thing that would cause it to crash is the X11 specific code in src/platform/linux.cpp

Can you confirm that it works when you apply this patch?

diff --git a/src/platform/linux.cpp b/src/platform/linux.cpp
index 0321f9d..6f370a1 100644
--- a/src/platform/linux.cpp
+++ b/src/platform/linux.cpp
@@ -7,9 +7,6 @@
 #include <QDir>
 #include <QUrl>

-#include <QX11Info>
-#include <X11/Xlib.h>
-
 namespace Util {

 QString VersionFileUrl()
@@ -24,33 +21,11 @@ QString DownloadFileUrl()

 bool DimLightsSupported()
 {
-    QString tmp = "_NET_WM_CM_S"+QString::number(QX11Info::appScreen());
-    Atom a = XInternAtom(QX11Info::display(), tmp.toUtf8().constData(), false);
-    if(a && XGetSelectionOwner(QX11Info::display(), a)) // hack for QX11Info::isCompositingManagerRunning()
-        return true;
     return false;
 }

 void SetAlwaysOnTop(WId wid, bool ontop)
 {
-    Display *display = QX11Info::display();
-    XEvent event;
-    event.xclient.type = ClientMessage;
-    event.xclient.serial = 0;
-    event.xclient.send_event = True;
-    event.xclient.display = display;
-    event.xclient.window  = wid;
-    event.xclient.message_type = XInternAtom (display, "_NET_WM_STATE", False);
-    event.xclient.format = 32;
-
-    event.xclient.data.l[0] = ontop;
-    event.xclient.data.l[1] = XInternAtom (display, "_NET_WM_STATE_ABOVE", False);
-    event.xclient.data.l[2] = 0; //unused.
-    event.xclient.data.l[3] = 0;
-    event.xclient.data.l[4] = 0;
-
-    XSendEvent(display, DefaultRootWindow(display), False,
-                           SubstructureRedirectMask|SubstructureNotifyMask, &event);
 }

 QString SettingsLocation()

@tidux
Copy link

tidux commented Jun 18, 2017

Baka-mplayer now segfaults under https://github.com/SirCmpwn/Sway

$ baka-mplayer 
qt5ct: using qt5ct plugin
qt5ct: D-Bus global menu: no
Using Wayland-EGL
qt5ct: D-Bus system tray: no
zsh: segmentation fault (core dumped)  baka-mplayer
$ 

@u8sand
Copy link
Owner

u8sand commented Jun 19, 2017

@tidux did you try the patch above? The last person who used wayland didn't get back to us--I don't have a proper wayland setup to test it myself, though I will get one soon.
I expect it would segfault without the patch because it is attempting to access X11 specific attributes which wouldn't be available.

@tidux
Copy link

tidux commented Jun 19, 2017

The patch works to get the UI up and running, but the OpenGL stuff is still dependent on X, leading to a segfault when I actually try to play anything:

~/src/Baka-MPlayer/build > ./baka-mplayer                                                                                           
qt5ct: using qt5ct plugin                                                                                                           
Icon theme "gnome" not found.                                                                                                       
Icon theme "crystalsvg" not found.                                                                                                  
qt5ct: D-Bus global menu: no                                                                                                        
Using Wayland-EGL                                                                                                                   
qt5ct: D-Bus system tray: no                                                                                                        
QObject::connect: invalid null parameter                                                                                            
Using the 'xdg-shell-v6' shell integration                                                                                          
libGL error: failed to create drawable                                                                                              
libGL error: failed to create drawable                                                                                              
zsh: segmentation fault (core dumped)  ./baka-mplayer     

Note that regular mpv works 100% on this setup, so it's got to be baka-mplayer specific code rather than libmpv.

@u8sand
Copy link
Owner

u8sand commented Jun 19, 2017

@tidux You may have some luck playing with the mpv vo parameter in ~/.config/bakamplayer.ini; the default is vdpau which is X11 only. Some things that might work are opengl (safest option) or vaapi (intel va api), there is also a vo called wayland maybe that's what you need.

...

    "mpv": {
...
        "vo": "wayland",
...
    },
...

You can also try removing the vo option to have mpv autoselect (I hope, maybe baka will just put it back though, you can also try making it empty string). Do tell me if any of these things work.

I use i3 myself so I may try setting up Sway.

@tidux
Copy link

tidux commented Jun 19, 2017

vo = opengl crashes again. vo = wayland causes a new empty region (not even blank, just the wallpaper) to work although audio does play. I'm seeing similar behavior for vo = wayland on raw mpv (vo = opengl works there) so it may be a Sway bug.

@u8sand
Copy link
Owner

u8sand commented Jun 19, 2017

@tidux sounds like maybe the vo driver is working properly but passing the win handle to mpv isn't (hence why you aren't seeing anything). I have a feeling this might end up working properly when we use opengl-cb; I'll keep you up to date on if I can get it working on my side. Thanks for trying those things out

@u8sand
Copy link
Owner

u8sand commented Jun 19, 2017

@tidux I installed sway on my system and got it running by making vo a blank string, I was able to watch a video. I'm using archlinux, noveau early KMS, and baka-mplayer-git

@tidux
Copy link

tidux commented Jun 19, 2017

I'm using baka-mplayer from git master, Arch, and Intel drivers. That just crashes for me.

@simonbcn
Copy link

simonbcn commented Jun 11, 2018

Arch Linux
GNOME Shell 3.28.2 on Wayland
Qt 5.11.0
baka-mplayer 2.0.4-3 (installed from Arch official repositories)

qtdiag-qt5

I can't execute baka-mplayer on Wayland, it crashes:

$ baka-mplayer 
Using Wayland-EGL
[1]    7570 segmentation fault (core dumped)  baka-mplayer

I've obtained this stack trace: https://pastebin.com/rN1wUrb9

@u8sand
Copy link
Owner

u8sand commented Jun 11, 2018 via email

@simonbcn
Copy link

mpv works well.

@mufeedali
Copy link

Any progress on this? mpv does work perfectly on Wayland now. By now, KDE's Wayland support is also pretty good. So, it would be cool to have Baka-MPlayer working too.

@ranenvious
Copy link

I don't know if it's unrelated or not (given this thread was last active in 2019) but I am also getting a segmentation fault when running it on an about 3 week old EndeavourOS install that is up to date. If I install the AUR git variant it at least launches, but doesn't seem to play anything ( sometimes I do get audio though )

@u8sand u8sand linked a pull request Jan 29, 2023 that will close this issue
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants