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

DBus Play/Pause actions are very slow #591

Closed
phenax opened this issue May 18, 2020 · 11 comments
Closed

DBus Play/Pause actions are very slow #591

phenax opened this issue May 18, 2020 · 11 comments
Labels
bug A functionality or parts of a program that do not work as intended wontfix Issues that will not be fixed under any circumstances

Comments

@phenax
Copy link

phenax commented May 18, 2020

Description
All actions taken via the dbus api are very slow and take at least 2 seconds to reflect

To Reproduce

  • I installed spotifyd-dbus-mpris from AUR
  • I ran playerctl play-pause

Expected behavior
I'd expect the interaction to be instant

Versions (please complete the following information):

  • OS: Arch
  • Spotifyd: 0.2.24
  • cargo: 1.43.0
@phenax phenax added the bug A functionality or parts of a program that do not work as intended label May 18, 2020
@awerlang
Copy link
Contributor

For me sp play is instant (media key still pressed when playback resumes), sp pause takes about a second, so I guess it's a buffer thing. Using alsa backend. Which backend are you running?

@awerlang
Copy link
Contributor

I tried with the pulseaudio backend, and now both pause/resume is instant.

@phenax
Copy link
Author

phenax commented May 19, 2020

I'm using alsa. I'll try using pulseaudio.

@karl-malakoff
Copy link

I'm also having this issue using the same versions using pulseaudio. I've tried both playerctl and sp.

@phenax
Copy link
Author

phenax commented May 22, 2020

Yeah pulseaudio didn't work either. Any ideas?

@phenax phenax changed the title Interacting with it through the dbus api is very slow DBus Play/Pause actions are very slow May 24, 2020
@karl-malakoff
Copy link

It works quickly when using /~https://github.com/hugosenari/mpris2 in iPython

It must be an issue with playerctl/sp and the way they use dbus, they could be making a new connection each time which would take time.

@phenax
Copy link
Author

phenax commented May 28, 2020

I'm not sure if its a playerctl thing. I use playerctl for the official spotify client and other media as well without any delay. I've only noticed it with spotifyd.

@ayosec
Copy link

ayosec commented Oct 5, 2020

If you monitor the D-Bus messages with dbus-monitor you can see that every time playerctl is executed it tries to get all properties from spotifyd. The metadata property (and maybe something else) requires a call to the Spotify API. I think that this is the cause of the issue with playerctl.

Now I'm using a simple script to invoke the D-Bus methods (play, next, etc) with dbus-send, so no metadata is required. playerctl is still used to get the player name, but this operation is always fast.

@stale
Copy link

stale bot commented Jan 13, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix Issues that will not be fixed under any circumstances label Jan 13, 2021
@stale stale bot closed this as completed Jan 23, 2021
@7ijme
Copy link

7ijme commented Jan 26, 2025

Has anyone found a fix for this? I'm still experiencing slow play and pause times.

@eladyn
Copy link
Member

eladyn commented Jan 28, 2025

This should hopefully be fixed in the next release. If you want, you can try one of these PRs: #1317 or #1321. They both include a change to do all the MPRIS handling without the Web API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A functionality or parts of a program that do not work as intended wontfix Issues that will not be fixed under any circumstances
Projects
None yet
Development

No branches or pull requests

6 participants