Announcements

Wayland support

Wayland support

okidian

Hi,

Can you release a linux package with ozone support built so that we can use the client under Wayland? There have been posts requesting this in the past because it is highly anticipated.

 

It shouldn't be that complicated it seems:

https://www.collabora.com/news-and-blog/blog/2019/05/08/cef-on-wayland-upstreamed/

https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/ozone_overview.md

 

Best,

Reply
9 Replies

joshbode

Oh, yes please!

 

This almost works:

spotify --enable-features=UseOzonePlatform --ozone-platform=wayland

 

However, the content ends up "detached" from the main window, though the detached content is using Wayland:

joshbode_0-1625735433997.png

okidian

okidian_0-1625799910743.png

I'm running on pure wayland and it simply segfaults. dmesg shows

"spotify[53433]: segfault at 0 ip 00007f0ccf1327d4 sp 00007ffdfabb6710 error 4 in libxcb.so.1.1.0[7f0ccf12f000+13000]". afaics it's making a call to libxcb which is not present in the memory, naturally.

 

people have mixed results tho: https://www.reddit.com/r/swaywm/comments/n7kew4/spotify_seems_to_run_natively_in_wayland/ I guess they have xwayland which spotify resorts as a fallback.

 

I'm hopeful a build with latest cef would solve this. but well, it's only a hope hah!

27supergoats

I'm running swaywm on Arch and those chromium flags result in an empty black window. Actual chromium does run with them though, even if not perfectly yet.

jane-0

Got it working by writing some stub implementations of some X11 functions spotify tries to call on launch but doesn't actually need. use `cc xstub.c -o xstub.so -shared` and `LD_PRELOAD=xstub.so spotify --enable-features=UseOzonePlatform --ozone-platform=wayland` to launch.

#include <stdio.h>

#define X_FN(f) int f() { puts("called"); return 0; }
X_FN(XInternAtoms)
X_FN(XChangeProperty)
X_FN(XGetGeometry)
X_FN(XInternAtom)
X_FN(XMoveResizeWindow)
X_FN(XSendEvent)
X_FN(XSetClassHint)
X_FN(XSetErrorHandler)
X_FN(XSetIOErrorHandler)
X_FN(XStoreName)
X_FN(XTranslateCoordinates)

 

T64

The X11 function stub workaround by @jane-0 works in some conditions to prevent Spotify from segfaulting on startup on Wayland, but for me it doesn't solve the problem of the window content being "detached" from the window itself (see first comment).

This makes Spotify almost unusable on Wayland, the window can't be moved or resized.
I'm on KDE neon dev with KWin Wayland.

RicArch97

One issue is that the Spotify client still uses an old version of Electron. The ozone Wayland back-end works really well in newer versions of Chromium, which requires only 1 flag since Chromium 97 to enable Wayland support.  An upgrade to Electron 16 or 17 would be necessary for a mature enough Wayland back-end.

fabi_sh
Spotify doesn't use Electron, but Chromium Embedded Framework

Whj_spot

Here's a temporary solution, since Spotify is running on CEF anyway:

Open Chrome and set 'Preferred Ozone platform' to Wayland in chrome://flags

Restart Chrome and go to open.spotify.com

'Install Spotify' from Chrome menu.

You'll lose settings, but at least should avoid X11

StarterX4

Any Spotify dev work on it?

@jane-O solution doesn't seem to work for me.
Also using Spotify Web in browser isn't a solution.

Suggested posts

Env: prod