10000 mpd plugin shows wrong elapsed time · Issue #915 · polybar/polybar · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

mpd plugin shows wrong elapsed time #915

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

Closed
evgfilim1 opened this issue Dec 22, 2017 · 5 comments
Closed

mpd plugin shows wrong elapsed time #915

evgfilim1 opened this issue Dec 22, 2017 · 5 comments
Assignees
Labels

Comments

@evgfilim1
Copy link
evgfilim1 commented Dec 22, 2017

Steps to reproduce:

  1. Install and configure mpd, set up polybar to use mpd plugin with <label-time> in format-online (as shown below), then run polybar main:
[bar/main]
font-0 = Noto Sans:pixelsize=11;1
# FontAwesome is needed to display "" symbol
font-1 = FontAwesome:pixelsize=11;1
modules-center = mpd

[module/mpd]
type = internal/mpd
format-online = %{F#6b6b6b}[<label-time>]%{F-}  <label-song>
  1. Start playing music from mpd
  2. Suspend your PC (for example, run systemctl suspend in terminal)
  3. Wait for ~10 minutes, then turn on your PC

Expected behaviour:

mpd plugin shows normal elapsed time

Actual behaviour:

22-12-2017_08-12-39

UPD. This happens not only after waking up, see #915 (comment)

@patrick96
Copy link
Member

I just noticed the same thing after rebooting the PC. Can you check that this only happens in polybar by also running

while true; do mpc status | awk 'NR==2'; sleep 2; done

while reproducing this (it prints the current song time continuously to the screen).

@patrick96 patrick96 added the bug label Dec 22, 2017
@evgfilim1
Copy link
Author

@patrick96 Yes, this happens only in polybar.

23-12-2017_05-31-33

@evgfilim1 evgfilim1 changed the title [Bug] mpd plugin shows wrong time after waking up PC mpd plugin shows wrong time after waking up PC Dec 23, 2017
@evgfilim1
Copy link
Author
evgfilim1 commented Dec 26, 2017

Also, when I start the first track in my mpd playlist and press "Previous track" on the bar, the track starts from the beginning, but the time on the bar doesn't. I think it's related to this bug.
26-12-2017_06-17-10

@evgfilim1 evgfilim1 changed the title mpd plugin shows wrong time after waking up PC mpd plugin shows wrong elapsed time Dec 26, 2017
@patrick96 patrick96 self-assigned this Dec 27, 2017
patrick96 added a commit to patrick96/polybar that referenced this issue Dec 27, 2017
Only updating when an mpd event occurred would cause issues when mpd was
playing and the machine was put to sleep because the elapsed time was
calculated by taking the time difference of the last update and now
which would give you wrong numbers, if the machine was in standby in
between.

Since the update function on the module is only called once a second (or
when an event happens), we can just update the data every time without a
huge performance hit.

Fixes polybar#915
@patrick96
Copy link
Member

Just opened a PR with a fix. I was able to reproduce this on my system and the patch fixes it for me, please try it out and tell me if it works for you too

@evgfilim1
Copy link
Author

@patrick96 Yes, it works for me too.

patrick96 added a commit that referenced this issue Jan 15, 2018
Only updating when an mpd event occurred would cause issues when mpd was
playing and the machine was put to sleep because the elapsed time was
calculated by taking the time difference of the last update and now
which would give you wrong numbers, if the machine was in standby in
between.

Since the update function on the module is only called once a second (or
when an event happens), we can just update the data every time without a
huge performance hit.

Fixes #915
NBonaparte pushed a commit to NBonaparte/lemonbuddy that referenced this issue Jan 27, 2018
Only updating when an mpd event occurred would cause issues when mpd was
playing and the machine was put to sleep because the elapsed time was
calculated by taking the time difference of the last update and now
which would give you wrong numbers, if the machine was in standby in
between.

Since the update function on the module is only called once a second (or
when an event happ
8000
ens), we can just update the data every time without a
huge performance hit.

Fixes polybar#915
patrick96 added a commit that referenced this issue Jul 23, 2018
Breaking Changes:

* `0 < label-NAME-maxlen < 3` will now throw an exception and disable the containing module, if ellipsis is enabled for that label. (#1198)

Changelog:

Deprecations:
* `internal/volume` is now called `internal/alsa` (#967)
* temperature: The `%temperature%` is deprecated in favor of `%temperature-c%`(#897)
* mpd: `icon-repeatone` is deprecated in favor of `icon-single` (#1295), see #1279

Features:
* feat(mpd): Add support for icon-consume (#861)
* feat(bspwm): Add workspace separator (#942) 
* feat(i3): Add workspace separator (#938), see #929
* feat(build): Make polybar build on FreeBSD (#931, polybar/xpp#8), see #239
* feat(volume): Add pulseaudio backend (#779)
* feat(script): Add %pid% token for tail commands (#934)
* feat(temp): Add temperature tokens without unit (#897)
* feat(memory): Add memory used/free ramp (#1038), see #1037
* feat(memory): Add swap tokens (#1018) 
* feat(net): Add unknown-as-up option (#1077), see #457
* feat(config): Support fractional size and offset (#972), see #953
* feat(xwindow): Add label-empty (#1136)
* feat(battery): Add animation-discharging (analog to animation-charging) (#1190)
* feat(config): Support pixel offset for bar size and offset values (#1224)
* feat(mpd): Add `%album-artist%` token (#1263)
* feat(net): Add local_ip6 token (#1239), see #1234
* feat(net): Add nl80211 support (#1009), see #277

Fixes:
* fix(mpd): Wrong elapsed time when after standby (#921), see #915
* fix(config): Wrong min, maxlen when using the same token multiple times (#974), see #971
* fix(battery): use power_now correctly (#958), see #928
* fix(mpd): Crash when mpd isn't running (#983), see #979
* fix(xworkspaces): Respect 'enable-scroll' (#1002)
* fix(xbacklight): Respect 'enable-scroll' (#1014)
* fix(build): support xcb-proto >=1.13 (polybar/xpp#11), see #973
* fix(mpd): Respect MPD_HOST env variable (#1025), see #1007
* fix(i3): Reconnect i3 IPC socket on restart/error (#1099), see #762
* fix(cursor): Occasional crash on mouseover (#1124), see #1117
* fix(net): Mark 'not connected' on querying failure (#1171), see #1163
* fix(gcc): Fix -Wstringop-truncation warning (#1216, polybar/i3ipcpp#7), see #1215
* fix(builder): Don't truncate colors with same channels (#1217), see #1183
* fix(bspwm): Consistent behavior when scrolling through multiple desktops (#986), see #981
* fix(builder): Respect label-ellipsis option (#1198), see #1194
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
0