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

[Linux] Media Keys not working, and Cider2 not showing in KDE Media Player #903

Closed
4 tasks done
rycon opened this issue Jan 9, 2025 · 17 comments
Closed
4 tasks done
Assignees
Labels
confirmed Issue is on the roadmap but not yet implemented pkg/genten-client Issues related to the Electron backend renderer platform: linux Issues specifically occurring on Linux builds.

Comments

@rycon
Copy link

rycon commented Jan 9, 2025

Preflight Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a bug report that matches the one I want to file, without success.
  • I have checked that the correct behavior occurs on Apple Music Web (if applicable).
  • I have verified that my issue is with a supported version and that it is with the desktop app (Support for other areas can be found in our Discord / on the appropriate repo).

How did you download Cider?

Cider Taproom

Operating System

Bazzite Linux 41 (Fedora 41 based)

Commit Hash

No response

Build Timestamp

No response

Describe the Bug

Media controls such as play/pause, and skip forward/back don't work, and when playing music in Cider2, KDE's "Now Playing" Media Player is not showing at all.

Other media source such as youtube, spotify, and other apps show in KDE "now playing" and my media keys work as expected.

Other Details:

  • On Bazzite Linux 41 with KDE v6.2.5 (image below)
  • using Flatpak version 2.6.0.13 downloaded from Taproot
  • Checked in flatsteal, nothing obvious to change

Steps to Reproduce

  1. In Cider2, started playback with mouse, observe KDE media player (from KDE system tray) is not displayed
  2. Pressed play/pause media button on keyboard, observe "nothing happens".
  3. Clicked play/pause in app with mouse, media pauses as expected.
  4. Try keyboard pause again, observe "nothing happens".
  5. Play a YouTube video, all media buttons work in YouTube, and KDE media player shows current youtube video
  6. Start music on Cider2 again, try media buttons, observe "nothing happens".

Anything else?

Cider2 with music playing, KDE media player not displayed at all (expected behaviour when KDE does not see media playing)
image

Youtube video playing, KDE media player displaying video detials, and media keys work
image

On Version 2.6.0.13
image

Latest Bazzite Linux version
image

@cider-collective
Copy link

Hello @rycon 👋

We really appreciate you taking the time to report this issue, please double check your issue to make sure you are clear and concise in your description. This will help us to help you as quickly as possible.

We'd like to ask you be patient and we will get back to you as soon as we can.

In the meantime, take a look at our FAQs which may answer your question.

Thanks again and we hope you enjoy the app! 😃

@rycon rycon changed the title [Linux] Media Keys not working, and Cider2 not showing in now playing [Linux] Media Keys not working, and Cider2 not showing in KDE Media Player Jan 9, 2025
@coredev-uk
Copy link
Member

What package release are you using, e.g. AppImage, deb, rpm etc.

@rycon
Copy link
Author

rycon commented Jan 11, 2025

I downloaded the Flatpak version 2.6.0.13 from Taproot

@coredev-uk coredev-uk added platform: linux Issues specifically occurring on Linux builds. pkg/genten-client Issues related to the Electron backend renderer labels Jan 16, 2025
@coredev-uk coredev-uk self-assigned this Jan 16, 2025
@rycon
Copy link
Author

rycon commented Jan 17, 2025

I moved from Bazzite to Nobara, and the media keys on the latest rpm are working. The issue may still persist on the flatpak version, but I won't be able to provide more details.

@Thomas-Philippot
Copy link

Thomas-Philippot commented Jan 20, 2025

Same issue using the flatpak build on Arch, no media playing when using cider, no tray icon but it works on the AppImage build

@itz-Jana
Copy link

itz-Jana commented Jan 21, 2025

I had the same issue and it's a pretty common one among audio applications in Flatpak.

In order to get both working, the Flatpak requires permission to the D-Bus session bus (socket=session-bus).

EDIT: Actually that is overkill. It seems like the Flatpak permissions are only missing the reference to which org.mpris.MediaPlayer2 object Cider is allowed to own. I guessed it as org.mpris.MediaPlayer2.cider and was correct. Setting that as "Session Bus Owns" resolves the issue and setting the socket=session-bus permission in not necessary.

Image

One can use Flatseal to grant this permission to the Cider Flatpak (sh.cider.genten).
Then just restart Cider and it will work.

Ideally this permission should be pre-configured in the Flatpak.

@itz-Jana
Copy link

Cider also tries to connect to the D-Bus system socket and throws this error:

[3:0121/140043.792135:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory

Yet I don't see why it should access that, as with the session bus no functionality is missing anymore to my knowledge. So I keep it disabled.

@coredev-uk
Copy link
Member

Due to how Flatpak has been packaged, and how Electron Forge's maker does it, we cannot apply any explicit modification to fix these issues, and unfortunately it is out of our scope to create our own.

@itz-Jana
Copy link

itz-Jana commented Jan 22, 2025

@coredev-uk That is completely understandable, yet I think this issue is fixable.

I looked into the root of the issue a bit more and found this:
According to the flatpak documentation a relevant MPRIS access to DBus is granted by default in the format of org.mpris.MediaPlayer2.$FLATPAK_ID.
Ciders flatpak ID is sh.cider.genten, but the application registers for MPRIS only as cider, which is why this fix is necessary.

If you could change it to use org.mpris.MediaPlayer2.sh.cider.genten instead, it should just work without the modification that I described.
I don't think changing it would break something for the other packaging methods and it should be the cleanest solution.

Yet if you're opposed to this or there is some other technical reason as to why you can't modify how it registers, I want to suggest this second possible solution:

You mention that you are using the Electron Forge Maker for Flatpak.
It allows for some config options in the module.exports, among them is an option to add finish-args to the Flatpak manifest, seen here.
finishArgs can be used to configure this using --own-name=org.mpris.MediaPlayer2.cider, seen here

So theoretically adding that setting something like this should work, but obviously I can't test it myself:

module.exports = {
  makers: [
    {
      name: '@electron-forge/maker-flatpak',
      config: {
        options: {
          categories: ['Audio'],
          finishArgs: ['--own-name=org.mpris.MediaPlayer2.cider']
        }
      }
    }
  ]
};

@coredev-uk
Copy link
Member

Since (afaik) most apps do not follow that name schema for mpris id, rather just the app name. So I will probably try and opt for the finishArgs that you mentioned. I have applied that change, and the experimental build on taproom should have it.

@itz-Jana
Copy link

That permission is now correctly set.

Yet the Context and Environment sections seem to be missing in the latest experimental build, so without re-granting it network, x11 and pulseaudio permissions it can't even start the GUI right now.

Specifically this used to be in the manifest and is now gone:

[Context]
shared=network;ipc;
sockets=x11;pulseaudio;
devices=dri;
filesystems=home;

[Session Bus Policy]
org.freedesktop.Notifications=talk

[Environment]
TMPDIR=/var/tmp

Don't know if this was already an issue on the experimental builds, or if this change somehow overwrote existing parameters.

@Thomas-Philippot
Copy link

Tried the experimental build as well and the app doesn't open.

[3:0122/173215.534818:ERROR:ozone_platform_x11.cc(245)] Missing X server or $DISPLAY
[3:0122/173215.534828:ERROR:env.cc(258)] The platform failed to initialize. Exiting.

@coredev-uk
Copy link
Member

Yeah fixing it rn, changing the finishArgs doesnt seem to add onto the preset, but replaces them entirely.

@coredev-uk
Copy link
Member

There is a build compiling to taproom right now, this should contain the fix for this, and resolve any issues with the dep versions

@coredev-uk
Copy link
Member

Please try the latest experimental release on Taproom.

@coredev-uk coredev-uk added confirmed Issue is on the roadmap but not yet implemented and removed bug labels Jan 22, 2025
@itz-Jana
Copy link

Latest experimental works as expected!
Thanks!

@Thomas-Philippot
Copy link

Thomas-Philippot commented Jan 23, 2025

Works perfectly, thanks a lot !

I still have no tray icon (only on the flatpak build) though, but that's a whole other issue

@github-project-automation github-project-automation bot moved this from Backlog 📖 to Completed 🚀 in Cider - Bug Reports Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed Issue is on the roadmap but not yet implemented pkg/genten-client Issues related to the Electron backend renderer platform: linux Issues specifically occurring on Linux builds.
Projects
Status: Completed 🚀
Development

No branches or pull requests

4 participants