-
Notifications
You must be signed in to change notification settings - Fork 17
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
Allow the user to configure the position update interval #32
Allow the user to configure the position update interval #32
Conversation
287dc63
to
2a13833
Compare
And thank you for this useful application! |
Indeed, it should be polling way less than 0.1 second. I wonder what the default should be? Perhaps a second? AFAIK a lot of mpris clients would just assume that the duration moves forwards even when no events are fired, so the polling is just more of a keep-in-sync. |
37916e2
to
4df8737
Compare
Thanks! Updated the code and readme output based on the suggestion. |
After I started using mpd-mpris on my laptop I noticed significantly more wakeups than before even when mpd is not playing anything. This seemed surprising, because applications using dbus typically do not require polling. Looking more closely, the polling comes from updating the current song position, since this doesn't generate dbus events. As such, this also happens even when mpd is idle. The interval is now configurable, and if set to 0, never updates the status just for position information (although, of course, it will be updated on other changes that result in a status update). On my machine, this renders mpd-mpris significantly more willing to sleep and avoid wakeups, especially since I don't use this feature anyway, so it's nice to be able to disable it with `--interval 0`.
4df8737
to
64dcc86
Compare
Looking great, thank you so much! |
Unfortunately, setting interval to anything other than 0 gives the following error: |
@Barbaross93 "1" isn't a valid time, since it's missing any unit (1 millisecond? 1 second? 1 minute?). If you want 500 milliseconds, then the value should be
Sounds like your terminal font doesn't distinguish |
@cdown Ah, I read the help output too quickly and was confused. I'm pretty used to default values of seconds when specifying units of time (E.g. |
After I started using mpd-mpris on my laptop I noticed significantly
more wakeups than before even when mpd is not playing anything. This
seemed surprising, because applications using dbus typically do not
require polling.
Looking more closely, the polling comes from updating the current song
position, since this doesn't generate dbus events. As such, this also
happens even when mpd is idle.
The interval is now configurable, and if set to 0, never updates the
status just for position information (although, of course, it will be
updated on other changes that result in a status update).
On my machine, this renders mpd-mpris significantly more willing to
sleep and avoid wakeups, especially since I don't use this feature
anyway, so it's nice to be able to disable it with
--interval 0
.