KRTirtho / spotube

🎧 Open source Spotify client that doesn't require Premium nor uses Electron! Available for both desktop & mobile!
https://spotube.krtirtho.dev/
Other
29.45k stars 1.21k forks source link

[Linux][Flatpak] OS Media Controls not working #1627

Closed jojommeke closed 1 week ago

jojommeke commented 3 months ago

Is there an existing issue for this?

Current Behavior

if i open spotube 3.7.1 the icon tray works now, big thanks btw but archlinux + kde (steamos) doesn't detect the media, i can't use my play/pause or skip key, just my system doesn't detect it as media, i am using flatpak version

Expected Behavior

media shows up in tray, is detected by the system and media control keys work

Steps to reproduce

  1. opened the app
  2. play music
  3. no media control

Operating System

          .,,,,.                  deck@steamdeck          .,'onNMMMMMNNnn',.            --------------       .'oNMANKMMMMMMMMMMMNNn'.         OS: SteamOS Holo x86_64     .'ANMMMMMMMXKNNWWWPFFWNNMNn.       Host: Jupiter 1    ;NNMMMMMMMMMMNWW'' ,.., 'WMMM,      Kernel: 6.1.52-valve16-1-neptune-61   ;NMMMMV+##+VNWWW' .+;'':+, 'WMW,     Uptime: 1 day, 6 hours, 16 mins  ,VNNWP+######+WW,  +:    :+, +MMM,    Packages: 1094 (pacman), 42 (flatpak)  '+#############,   +.    ,+' +NMMM    Shell: bash 5.1.16    '*#########*'     '*,,*' .+NMMMM.   Resolution: 1280x800, 1920x1080       `'*###*'          ,.,;###+WNM,   DE: Plasma 5.27.5           .,;;,      .;##########+W    WM: KWin  ,',.         ';  ,+##############'    WM Theme: Sweet-Dark   '###+. :,. .,; ,###############'     Theme: [Plasma], Space-dark [GTK2/3]    '####.. `'' .,###############'      Icons: breeze-dark [Plasma], breeze-dark [GTK2/3]      '#####+++################'        Terminal: konsole        '*##################*'          CPU: AMD Custom APU 0405 (8) @ 2.800GHz           ''*##########*''             GPU: AMD ATI AMD Custom GPU 0405                ''''''                  Memory: 10093MiB / 14814MiB 

Spotube version

3.7.1

Installation source

Flathub (Flatpak)

Additional information

No response

Self grab

bayang commented 3 months ago

same here on manjaro with spotube flatpak 3.7.1. It seems that MPRIS is broken or not working.

So media keys do not work, neither do external devices (bluetooth, usb , headsets etc...)

For example I often use playerctl to see what devices are up, but with spotube 3.7.1 I get this :

> playerctl -l
No players found
forteller commented 3 months ago

Same issue in Nobara (based on Fedora).

Thanks for a great app!

diegopvlk commented 2 months ago

Seems to work if you change the session bus org.mpris.MediaPlayer2.Spotube.* to org.mpris.MediaPlayer2.com.krtirtho.Spotube.* (use flatseal or something similar)

forteller commented 2 months ago

Thanks for the workaround! It works! Hope this can be implemented in the app :)

KRTirtho commented 2 months ago

@diegopvlk when you're free can you update this permission in the flathub/com.github.KRTirtho.Spotube repo please?

arnavpadwal commented 2 months ago

Fixed the same issue on arch (kde), thanks @diegopvlk for workaround! image

C-512L commented 2 months ago

@diegopvlk when you're free can you update this permission in the flathub/com.github.KRTirtho.Spotube repo please?

Is this a good resolution? According to the MPRIS spec and D-BUS spec names should only contain ASCII characters '[A-Z][a-z][0-9]_-' and in case of MPRIS dots should only be used for handling multiple instances (which Spotube doesn't do). The examples shown don't use reverse dns names either because of that so I think this could be a spec violation and/or undefined behavior.

KRTirtho commented 2 months ago

@C-512L that makes sense. I realized that the underlying plugin didn't require a separate specification for Linux instead it continued using android's notification channel name. Changing that com.krtirtho.Spotube to just spotube fixed the issue.

matyas-zavora commented 1 month ago

Since v3.8.0 the session bus is now set to org.mpris.MediaPlayer2.Spotube.*, but the media controls still don't work

forteller commented 1 month ago

Yeah, doesn't work for me either, unfortunately

jojommeke commented 1 month ago

the flatpak version of 3.8.0 isn't out yet(or "discover" is telling me lies)? so i we can't judge yet if it works or can we?

bayang commented 1 month ago

I have spotube 3.8.0 installed. To get mpris working again, I opened flatseal and clicked on the "reset" button to revert to default settings (because I had manually changed the mpris bus to get it working with the previous workaround). It was still not working, but if you look closely in flatseal the Session BUS permission was unticked so I gave the permission and now it is working.

oktayacikalin commented 1 month ago

in flatseal the Session BUS permission was unticked so I gave the permission and now it is working

Same here. Thank you very much 😁👍️

forteller commented 1 month ago

I can't change the ticks under Session BUS in Flatseal. It looks like this:

image

I tried clicking Reset, but media keys still don't work

C-512L commented 1 month ago

Since v3.8.0 the session bus is now set to org.mpris.MediaPlayer2.Spotube.*, but the media controls still don't work

I tested and according to https://github.com/KRTirtho/spotube/commit/a6e13ffc08691b264bd9fd2e60b53b8762e6f601 the session bus name now is org.mpris.MediaPlayer2.spotube.*, not org.mpris.MediaPlayer2.Spotube.*. The flatpak manifest and the code declare different session bus names. Personally I would go with the updating the manifest approach but @KRTirtho probably knows better than me on what side should this be fixed.

oktayacikalin commented 1 month ago

@forteller Hmm... I completely missed what @C-512L just pointed out and ticked the general right for the session D-Bus ("socket=session-bus"). But just changing "Spotube" to "spotube" in "Owns" does the trick. :+1:

matyas-zavora commented 1 month ago

I would like to confirm that ticking D-Bus session bus in flatseal fixes the issue.

![image](https://github.com/user-attachments/assets/7ef021c3-4afb-40ef-861a-5d07bc6160cc) ![image](https://github.com/user-attachments/assets/a785943f-d9b2-4f41-b4f3-fa4048ecae53)
forteller commented 1 month ago

Thanks, @matyas-zavora, yes that worked for me too!

Hopefully this should mean that it's fairly easy to fix.

KRTirtho commented 1 week ago

Fixed by https://github.com/flathub/com.github.KRTirtho.Spotube/pull/101