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

(at least) opt-in for wayland support #275

Closed
ahjolinna opened this issue Feb 28, 2024 · 19 comments
Closed

(at least) opt-in for wayland support #275

ahjolinna opened this issue Feb 28, 2024 · 19 comments

Comments

@ahjolinna
Copy link

follow up on previous discussion in issue #239 (comment), I'm suggesting the addition of Wayland support.

Enabling Wayland support, even optionally, would significantly enhance the user experience, especially for NVIDIA users who currently experience xwayland flickering and it would lead to a smoother and more stable performance overall.

I did notice a minor issue with the display of generic Wayland icons, but I believe this can be addressed

@LoneWolf4713
Copy link

I second this, on my Arch Linux machine, spotify running under XWayland takes 800MB - 1GB of memory, that is too much for a music player..... but I've had experiences where native wayland version of some apps consumed way less memory than Xwayland versions.
I'm on Arch Linux with Hyprland. Running Spotify Flatpak.

@Erick555
Copy link
Contributor

Erick555 commented Mar 5, 2024

Note that everyone can opt-in already by adding relevant flags in config

@justin13888
Copy link

I second this, on my Arch Linux machine, spotify running under XWayland takes 800MB - 1GB of memory, that is too much for a music player..... but I've had experiences where native wayland version of some apps consumed way less memory than Xwayland versions. I'm on Arch Linux with Hyprland. Running Spotify Flatpak.

True! Didn't even notice it until you mentioned it lol. The biggest gripe for me is that in my multi-monitor setup, I'm forced to use fractional scaling which means blurry text on XWayland. I'm running GNOME 45 on Fedora 39 Workstation

@justin13888
Copy link

Note that everyone can opt-in already by adding relevant flags in config

I haven't been able to get Wayland to work. What command were you using?

This command wouldn't open any window: flatpak run com.spotify.Client --enable-features=UseOzonePlatform --ozone-platform=wayland

This command would hang up my desktop environment (GNOME 45 on Wayland): flatpak run --socket=wayland com.spotify.Client --enable-features=UseOzonePlatform --ozone-platform=wayland

For reference, I'm running version the latest version as of writing (version 1.2.31) on FlatHub and the Spotify snap version works besides improperly styled window decoration.

@Erick555
Copy link
Contributor

Erick555 commented Mar 9, 2024

To match what discord does (and what this issue proposes) try:

flatpak run --socket=wayland com.spotify.Client --enable-features=WaylandWindowDecorations --ozone-platform-hint=auto

@LoneWolf4713
Copy link

LoneWolf4713 commented Mar 14, 2024

Hi, @justin13888 's answer is correct and this below produces no window.

❯ flatpak run com.spotify.Client --enable-features=UseOzonePlatform --ozone-platform=wayland

/app/extra/bin/spotify: /usr/lib/x86_64-linux-gnu/libcurl.so.4: no version information available (required by /app/extra/bin/spotify)
~
❯ [spotifywm] attached to spotify
/app/extra/share/spotify/spotify: /usr/lib/x86_64-linux-gnu/libcurl.so.4: no version information available (required by /app/extra/share/spotify/spotify)
/app/extra/share/spotify/spotify: /usr/lib/x86_64-linux-gnu/libcurl.so.4: no version information available (required by /app/extra/share/spotify/spotify)
[spotifywm] attached to spotify
[spotifywm] attached to spotify 

but as @Erick555 's answer produces a window that is still running in XWayland, here is the output:

 ❯ flatpak run --socket=wayland com.spotify.Client --enable-features=WaylandWindowDecorations --ozone-platform-hint=auto

/app/extra/bin/spotify: /usr/lib/x86_64-linux-gnu/libcurl.so.4: no version information available (required by /app/extra/bin/spotify)
~
❯ [spotifywm] attached to spotify
/app/extra/share/spotify/spotify: /usr/lib/x86_64-linux-gnu/libcurl.so.4: no version information available (required by /app/extra/share/spotify/spotify)
/app/extra/share/spotify/spotify: /usr/lib/x86_64-linux-gnu/libcurl.so.4: no version information available (required by /app/extra/share/spotify/spotify)
[spotifywm] attached to spotify
[spotifywm] attached to spotify
[spotifywm] spotify window a00004 found
/proc/self/exe: /usr/lib/x86_64-linux-gnu/libcurl.so.4: no version information available (required by /proc/self/exe)
~
❯ [spotifywm] attached to spotify
[spotifywm] spotify window 1000007 found
/app/bin/spotify: line 45: Xlib.xauth:: command not found

can anybody tell what I'm doing wrong here..?!

@Erick555
Copy link
Contributor

You may try to force wayland by:
flatpak run --socket=wayland --nosocket=x11 com.spotify.Client --enable-features=WaylandWindowDecorations --ozone-platform-hint=auto

@LoneWolf4713
Copy link

LoneWolf4713 commented Mar 22, 2024

None of the solutions on this page worked for me. I guess the Flatpak version doesn't support Wayland in a stable way yet. I ended up installing spotify AUR Package (not spotify-launcher). and it launches in native wayland beautifully with command:
❯ spotify --enable-features=UseOzonePlatform --ozone-platform=wayland

Also, it's resource usage is way less than Flatpak version too. @justin13888 . Around 300MB as compared to 700MB-1.5GB of Flatpak version.
Hence it feels a lot snappier and faster than the Flatpak counterpart.
I guess you can install AUR Version on any distro with a little tweaking.

@Erick555
Copy link
Contributor

I guess the Flatpak version doesn't support Wayland in a stable way yet. I ended up installing spotify AUR Package (not spotify-launcher).

You may note Flatpak has exact same spotify versions as AUR and snap.

@ahjolinna
Copy link
Author

here is a fix for cursor scaling on wayland, for those who have HIDPI screen
--env=XCURSOR_PATH=/run/host/user-share/icons:/run/host/share/icons

electron/electron#19810

@ahjolinna
Copy link
Author

I used this and it works for me

flatpak run --branch=stable --socket=wayland --arch=x86_64 --command=/app/extra/bin/spotify --file-forwarding com.spotify.Client --enable-gpu-rasterization --enable-zero-copy --enable-gpu-compositing --enable-native-gpu-memory-buffers --enable-oop-rasterization --enable-features=UseSkiaRenderer --ozone-platform=wayland --disable-gpu-sandbox '--enable-features=UseSkiaRenderer,WaylandWindowDecorations
' @@u %U @@

... not sure if all of these are needed, anyway : --disable-gpu-sandbox is only needed if you are using the nvidia drivers

@justin13888
Copy link

None of the solutions on this page worked for me. I guess the Flatpak version doesn't support Wayland in a stable way yet. I ended up installing spotify AUR Package (not spotify-launcher). and it launches in native wayland beautifully with command: ❯ spotify --enable-features=UseOzonePlatform --ozone-platform=wayland

Also, it's resource usage is way less than Flatpak version too. @justin13888 . Around 300MB as compared to 700MB-1.5GB of Flatpak version. Hence it feels a lot snappier and faster than the Flatpak counterpart. I guess you can install AUR Version on any distro with a little tweaking.

Interesting. I didn't notice how much RAM it's using until you mentioned!

@justin13888
Copy link

I used this and it works for me

flatpak run --branch=stable --socket=wayland --arch=x86_64 --command=/app/extra/bin/spotify --file-forwarding com.spotify.Client --enable-gpu-rasterization --enable-zero-copy --enable-gpu-compositing --enable-native-gpu-memory-buffers --enable-oop-rasterization --enable-features=UseSkiaRenderer --ozone-platform=wayland --disable-gpu-sandbox '--enable-features=UseSkiaRenderer,WaylandWindowDecorations
' @@u %U @@

... not sure if all of these are needed, anyway : --disable-gpu-sandbox is only needed if you are using the nvidia drivers

Thanks! I could confirm this also works on my system (Fedora 39, with MESA AMD drivers)

@daenney
Copy link

daenney commented Apr 13, 2024

Does anyone have cursor issues with this? I don't mean the cursor theme missing, I mean the cursor not clicking where you think it should be. It seems to be off by quite a lot, resulting in completely different UI elements being activated that aren't under the cursor.

@hoshsadiq
Copy link

I have the same issue, I commented in #239, but maybe this thread is more relevant to it.

@justin13888
Copy link

Hi, @justin13888 's answer is correct and this below produces no window.

❯ flatpak run com.spotify.Client --enable-features=UseOzonePlatform --ozone-platform=wayland

/app/extra/bin/spotify: /usr/lib/x86_64-linux-gnu/libcurl.so.4: no version information available (required by /app/extra/bin/spotify)
~
❯ [spotifywm] attached to spotify
/app/extra/share/spotify/spotify: /usr/lib/x86_64-linux-gnu/libcurl.so.4: no version information available (required by /app/extra/share/spotify/spotify)
/app/extra/share/spotify/spotify: /usr/lib/x86_64-linux-gnu/libcurl.so.4: no version information available (required by /app/extra/share/spotify/spotify)
[spotifywm] attached to spotify
[spotifywm] attached to spotify 

but as @Erick555 's answer produces a window that is still running in XWayland, here is the output:

 ❯ flatpak run --socket=wayland com.spotify.Client --enable-features=WaylandWindowDecorations --ozone-platform-hint=auto

/app/extra/bin/spotify: /usr/lib/x86_64-linux-gnu/libcurl.so.4: no version information available (required by /app/extra/bin/spotify)
~
❯ [spotifywm] attached to spotify
/app/extra/share/spotify/spotify: /usr/lib/x86_64-linux-gnu/libcurl.so.4: no version information available (required by /app/extra/share/spotify/spotify)
/app/extra/share/spotify/spotify: /usr/lib/x86_64-linux-gnu/libcurl.so.4: no version information available (required by /app/extra/share/spotify/spotify)
[spotifywm] attached to spotify
[spotifywm] attached to spotify
[spotifywm] spotify window a00004 found
/proc/self/exe: /usr/lib/x86_64-linux-gnu/libcurl.so.4: no version information available (required by /proc/self/exe)
~
❯ [spotifywm] attached to spotify
[spotifywm] spotify window 1000007 found
/app/bin/spotify: line 45: Xlib.xauth:: command not found

can anybody tell what I'm doing wrong here..?!
How to see spotify stats
To see your Spotify stats, use Spotify Wrapped for annual highlights. For detailed insights, try SpotiPie. Log in with spotipie.com to view your top tracks and hours listened. Artists use Spotify for Artists.

About the second command, setting platform hint to auto doesn't guarantee that Ozone uses Wayland.

I got it working on Fedora 39 Workstation as mentioned previously but the other problem is that the client-side window decoration on Spotify is hidious. On GNOME, since server side decoration has been rejected, the only solution that would work on GNOME/Mutter would be for Spotify devs to add back a GTK decoration (or perhaps it could be possible to modify the community's Flatpak version?)

@TingPing
Copy link
Member

Done in 5248553

@d3vilguard
Copy link

Why is my mouse so small with this :D (125 fractional, Gnome 47, wayland opt-in)
image

@TingPing
Copy link
Member

TingPing commented Oct 1, 2024

On Wayland the application controls the cursor. It is using the wrong size, probably nothing we can do about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants