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

Not working with playerctl, issue with MPRIS properties #971

Closed
JoeJoeTV opened this issue Jan 14, 2023 · 7 comments
Closed

Not working with playerctl, issue with MPRIS properties #971

JoeJoeTV opened this issue Jan 14, 2023 · 7 comments
Labels
bug Something isn't working fix-available A fix to the issue is available in a new version

Comments

@JoeJoeTV
Copy link

General Information:

- App Version: 1.19.0
- OS: Linux (Linux Mint 21.1 Cinnamon)
- 64 bit

Problem Description:

The application can't be used with playerctl, since for any command I've tried, playerctl outputs No player could handle this command.

Information I have found out about the issue:
Using dbus-monitor as well as my system's MPRIS control panel and playerctl, I have collected more information about the issue.
The system's MPRIS control uses the Get method of the org.freedesktop.DBus.Properties interface to get the different DBus properties, like CanSeek for example.
playerctl though, uses the GetAll method of the same interface to directly get all properties.

I tested the methods and can see, that the Get methods works fine and returns the value of the specified method. But the GetAll method doesn't work at all for youtube-music and returns the following error, which I think means, that there is a bug in youtube-music or the dbus-next module:

g-io-error-quark: GDBus.Error:com.github.dbus_next.ServiceError: Service error: The service threw an error.
TypeError: DBusError is not a constructor
    at PlayerInterface.LoopStatus (/opt/YouTube Music/resources/app.asar/node_modules/mpris-service/src/interfaces/player.js:118:13)
    at handleGetAllProperties (/opt/YouTube Music/resources/app.asar/node_modules/dbus-next/lib/service/handlers.js:125:22)
    at handleStdIfaces (/opt/YouTube Music/resources/app.asar/node_modules/dbus-next/lib/service/handlers.js:240:7)
    at handleMessage (/opt/YouTube Music/resources/app.asar/node_modules/dbus-next/lib/service/handlers.js:280:7)
    at handleMessage (/opt/YouTube Music/resources/app.asar/node_modules/dbus-next/lib/bus.js:136:21)
    at EventEmitter.<anonymous> (/opt/YouTube Music/resources/app.asar/node_modules/dbus-next/lib/bus.js:151:9)
    at EventEmitter.emit (node:events:527:28)
    at /opt/YouTube Music/resources/app.asar/node_modules/dbus-next/lib/connection.js:116:14
    at Socket.<anonymous> (/opt/YouTube Music/resources/app.asar/node_modules/dbus-next/lib/message.js:63:9)
    at Socket.emit (node:events:527:28) (36)

I think(not sure), since playerctl uses the GetAll method, which errors out, it decides, that the service can't handle the commands and exits.

Here are the direct dbus-monitor logs of both tries:

dbus-monitor log for system MPRIS control panel

``` signal time=1673706705.490496 sender=org.freedesktop.DBus -> destination=:1.1754 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired string ":1.1754" signal time=1673706705.490595 sender=org.freedesktop.DBus -> destination=:1.1754 serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost string ":1.1754" method call time=1673706707.996832 sender=:1.52 -> destination=:1.1492 serial=5748 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=PlayPause method call time=1673706707.998371 sender=:1.74 -> destination=org.mpris.MediaPlayer2.youtube-music serial=532 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=Get string "org.mpris.MediaPlayer2.Player" string "CanSeek" method call time=1673706707.999396 sender=:1.74 -> destination=org.mpris.MediaPlayer2.youtube-music serial=533 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=Get string "org.mpris.MediaPlayer2.Player" string "Position" method call time=1673706708.018675 sender=:1.52 -> destination=:1.1492 serial=5749 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=Get string "org.mpris.MediaPlayer2.Player" string "CanSeek" method call time=1673706708.020403 sender=:1.52 -> destination=:1.1492 serial=5750 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=Get string "org.mpris.MediaPlayer2.Player" string "Position" ```

dbus-monitor log for playerctl

``` signal time=1673706711.203084 sender=org.freedesktop.DBus -> destination=:1.1757 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired string ":1.1757" signal time=1673706711.203142 sender=org.freedesktop.DBus -> destination=:1.1757 serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost string ":1.1757" method call time=1673706712.950700 sender=:1.1758 -> destination=:1.1492 serial=17 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=GetAll string "org.mpris.MediaPlayer2.Player" ```

@Araxeus
Copy link
Collaborator

Araxeus commented Jan 14, 2023

This should be probably be an issue in https://github.com/dbusjs/mpris-service since it's the library we use to interact with the MPRIS service

@JoeJoeTV
Copy link
Author

I guess, I'll open an issue over there. What is the version of the library used in 1.19.0?

@Zo-Bro-23
Copy link
Contributor

I guess, I'll open an issue over there. What is the version of the library used in 1.19.0?

"mpris-service": "^2.1.2",

@dgalli1
Copy link

dgalli1 commented Jan 20, 2023

probably duplicated:
#872 (comment)

@JoeJoeTV
Copy link
Author

The rest of the MPRIS service works fine though and is displayed correctly in the MPRIS control panel of my system. From what I can tell, it's only the "GetAll" method that's broken.

@amplexus
Copy link

I raised a dbusjs/mpris-service#52 to fix this. Tested locally (Ubuntu 22.10) with playerctl and youtube-music (built from source) and works for me.

@Araxeus
Copy link
Collaborator

Araxeus commented Apr 17, 2023

I raised a dbusjs/mpris-service#52 to fix this. Tested locally (Ubuntu 22.10) with playerctl and youtube-music (built from source) and works for me.

That PR will sadly probably never get merged as that repo is unmaintained

@JellyBrick JellyBrick added the bug Something isn't working label Oct 7, 2023
@JellyBrick JellyBrick added the fix-available A fix to the issue is available in a new version label Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix-available A fix to the issue is available in a new version
Projects
None yet
Development

No branches or pull requests

6 participants