Multiple instances sometimes get unsynchronized #4

Open
opened 2021-05-21 16:13:36 +02:00 by diegovsky · 8 comments

Hey there, just tested the fixed from #3 and it works wonderfully. However, I noticed sometimes the instances get unsynchronized and don't update accordingly. Currently, I have a dual monitor setup with two instances (player name and track info) in each monitor bar. Here's how it looks after I've watched a video on Qutebrowser (based on chromium I think):
image
On the leftmost bar, it says there is no player active, but it shows the last used player on the rightmost one (green colour).

I'm willing to open a pull request to investigate it and submit a fix. What do you think?

Here are relevant parts of my config:

{
  ...
  "modules-right": [
    "memory",
    "cpu",
    "custom/waypris-status",
    "custom/waypris-player",
    ...
  },
  ...
  "custom/waypris-status": {
    "return-type": "json",
    "exec": "waybar-mpris --position --autofocus --order \"SYMBOL:TITLE:ARTIST\"",
    "on-click": "waybar-mpris --send toggle",
    "max-length": 25,
    "escape": true
  },
  "custom/waypris-player": {
    "return-type": "json",
    "exec": "waybar-mpris --position --autofocus --order \"PLAYER\"",
    "on-scroll-up": "waybar-mpris --send player-next",
    "on-scroll-down": "waybar-mpris --send player-prev",
    "escape": true
  }
}

Edit: removed duplicate images and broken links. Added config.

Hey there, just tested the fixed from #3 and it works wonderfully. However, I noticed sometimes the instances get unsynchronized and don't update accordingly. Currently, I have a dual monitor setup with two instances (player name and track info) in each monitor bar. Here's how it looks after I've watched a video on Qutebrowser (based on chromium I think): ![image](/attachments/970503d5-83b9-416d-9e29-16dc695b6511) On the leftmost bar, it says there is no player active, but it shows the last used player on the rightmost one (green colour). I'm willing to open a pull request to investigate it and submit a fix. What do you think? Here are relevant parts of my config: ``` json { ... "modules-right": [ "memory", "cpu", "custom/waypris-status", "custom/waypris-player", ... }, ... "custom/waypris-status": { "return-type": "json", "exec": "waybar-mpris --position --autofocus --order \"SYMBOL:TITLE:ARTIST\"", "on-click": "waybar-mpris --send toggle", "max-length": 25, "escape": true }, "custom/waypris-player": { "return-type": "json", "exec": "waybar-mpris --position --autofocus --order \"PLAYER\"", "on-scroll-up": "waybar-mpris --send player-next", "on-scroll-down": "waybar-mpris --send player-prev", "escape": true } } ``` Edit: removed duplicate images and broken links. Added config.
Author

Forgot to upload the log. I suspect that one instance which didn't have any output on the leftmost bar is the one that couldn't connect to the socket.

Forgot to upload the log. I suspect that one instance which didn't have any output on the leftmost bar is the one that couldn't connect to the socket.
Owner

Could you send the commands for each of your components? Oh i'm blind, didn't see them.

~~Could you send the commands for each of your components?~~ Oh i'm blind, didn't see them.
Owner

Ok yeah, it looks broken to me too. As soon as i run the instance with just --order "PLAYER" the output stops on the first.

Ok yeah, it looks broken to me too. As soon as i run the instance with just `--order "PLAYER"` the output stops on the first.
hrfee closed this issue 2021-05-21 17:05:39 +02:00
Owner

I think i've got it, the io.Writer I implemented might be giving errors on each write (despite working), and the failure means it doesn't continue to write to stdout. I've just switched round the order to run it last and it seems to be working.

I think i've got it, the io.Writer I implemented might be giving errors on each write (despite working), and the failure means it doesn't continue to write to stdout. I've just switched round the order to run it last and it seems to be working.
Author

Reopened. I'm on fe85127
image
By chance, one bar appears to be working as intended with the new commit, however the problem persists.
image
Now, only one instance is missing.

Reopened. I'm on fe85127 ![image](/attachments/d1ea7875-e3a1-4444-a57d-2bcda34f8774) By chance, one bar appears to be working as intended with the new commit, however the problem persists. ![image](/attachments/e8cce5ff-275d-493d-95d2-3bbb387d29be) Now, only one instance is missing.
Owner

Ok yeah, it's not working for me either. One of the writers was returning a wrong number of bytes written still so i've made it always return the expected number.

Ok yeah, it's not working for me either. One of the writers was returning a wrong number of bytes written still so i've made it always return the expected number.
Author

One thing I noticed was that sometimes one of the instances had no text but were showing on the bar:
image
8340ef1 solved it, thanks :)

One thing I noticed was that sometimes one of the instances had no text but were showing on the bar: ![image](/attachments/8c113e94-704f-483c-8f0a-68fb24acddf2) 8340ef1 solved it, thanks :)
6.2 KiB
Author

Btw, I did some investigation and it turns out it might be a race condition when waybar starts all of the 4 instances.

Here's the screenshot:
image
Here, I started waybar-mpris first and then waybar. If you want, I can investigate it a bit more and submit a pull request. What do you think?

Btw, I did some investigation and it turns out it might be a race condition when waybar starts all of the 4 instances. Here's the screenshot: ![image](/attachments/4dcc523c-971d-4f67-b264-4230696c1265) Here, I started waybar-mpris first and then waybar. If you want, I can investigate it a bit more and submit a pull request. What do you think?
202 KiB
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: hrfee/waybar-mpris#4
No description provided.