greshake / i3status-rust

Very resourcefriendly and feature-rich replacement for i3status, written in pure Rust
GNU General Public License v3.0
2.82k stars 472 forks source link

music block not picking up player/interface #1920

Closed asegarra closed 10 months ago

asegarra commented 1 year ago

Just updated to the latest 0.31.8 and music block is no longer picking up songs when using the 'player' or 'interface_name_excludes' config options. e.g. Setting player to ["spotify"] and it is not picking up the current song unless I reload the bar then it's picked up until I close spotify and reopen it.

MaxVerevkin commented 1 year ago

Was 0.31.7 working as expected?

asegarra commented 1 year ago

Yes it was.

MaxVerevkin commented 1 year ago

Can you share the output of

busctl --user monitor --match "type='signal',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0namespace='org.mpris.MediaPlayer2'"

when you start spotify?

asegarra commented 1 year ago

I just noticed, it's picking up spotify on a fresh load of the bar, but if I close and reopen spotify it's not picked up.

Here is the output when I open spotify:

Monitoring bus message stream.
‣ Type=signal  Endian=l  Flags=1  Version=1 Cookie=18  Timestamp="Fri 2023-06-30 19:37:29.502773 UTC"
  Sender=org.freedesktop.DBus  Path=/org/freedesktop/DBus  Interface=org.freedesktop.DBus  Member=NameOwnerChanged
  MESSAGE "sss" {
          STRING "org.mpris.MediaPlayer2.spotify";
          STRING "";
          STRING ":1.207";
  };
MaxVerevkin commented 1 year ago

Does it happen only with spotify?

it's picking up spotify on a fresh load of the bar, but if I close and reopen spotify it's not picked up

This sounds so similar to #1914...

asegarra commented 1 year ago

Can't explain it but I just upgraded again to retest this with another player and lo and behold I can't reproduce it anymore. Don't know what's different now because I even rebooted before and consistently had the behavior I described. And yes, it sounds pretty much like 1914 except without the dashes in the name. My apologies about this.

asegarra commented 1 year ago

ah sorry this is happening to me again, same thing as originally described and in https://github.com/greshake/i3status-rust/issues/1914. Happens all mpris2 players I tried. I'm using the player option so it only picks up specific inputs. If I don't use this option and just let it pick up everything there's no issue.

asegarra commented 1 year ago

what I have found is that I can reproduce this only after I open chromium(xwayland) and have it take a mpris entry by playing something e.g. youtube. After that if I close spotify it won't pick up again unless I reboot the bar. It continues to behave this way until i close chromium.

MaxVerevkin commented 1 year ago

Does the value of $avail not change too?

MaxVerevkin commented 1 year ago

chromium(xwayland)

is the xwayland part relevant? Does it not happen when you enable native Wayland support?

asegarra commented 1 year ago

Sorry it's not relevant, switched chromium to wayland to make sure, and to add to what I said I found I have to have firefox, chromium and spotify open along with the player option for this to happen.

$avail goes from 1 to not rendering the block if I have nothing open or it's not picking up the player.

asegarra commented 1 year ago

Tried a couple of other players and looks like it happens as long as I have 3 of them in mpris.

MaxVerevkin commented 1 year ago

Hm, I'll add a few debug log prints later

MaxVerevkin commented 1 year ago

Can you run RUST_LOG=music=debug cargo r >/dev/null on latest master and share the output?

asegarra commented 1 year ago
    Running `target/debug/i3status-rs`
[2023-07-04T17:35:49Z DEBUG music] available players:
[2023-07-04T17:36:10Z DEBUG music] available players:
[2023-07-04T17:36:10Z DEBUG music] available players:
[2023-07-04T17:36:24Z DEBUG music] new player org.mpris.MediaPlayer2.spotify owned by :1.38
MaxVerevkin commented 1 year ago

That's it? Normally a log sequence should end with a list of available players.

asegarra commented 1 year ago

yeah thats with the players option in the music block with only spotify.

On Tue, Jul 4, 2023 at 1:47 PM Max Verevkin @.***> wrote:

That's it? Normally a log sequence should end with a list of available players.

— Reply to this email directly, view it on GitHub https://github.com/greshake/i3status-rust/issues/1920#issuecomment-1620579154, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC7TMS5VQYPNZOC45M4CTPLXORJMZANCNFSM6AAAAAAZ2GQ4CI . You are receiving this because you authored the thread.Message ID: @.***>

MaxVerevkin commented 1 year ago

Okay, I added a few more prints, can you try now?

asegarra commented 1 year ago
   Finished dev [unoptimized + debuginfo] target(s) in 0.06s
     Running `target/debug/i3status-rs`
[2023-07-04T21:05:49Z DEBUG music] available players: []
[2023-07-04T21:05:54Z DEBUG music] new player org.mpris.MediaPlayer2.spotify owned by :1.217
[2023-07-04T21:05:54Z DEBUG music] creating Player for org.mpris.MediaPlayer2.spotify
[2023-07-04T21:05:54Z DEBUG music] querying player info
MaxVerevkin commented 1 year ago

Huh, so it gets stuck at querying player info. Since it started to happen with v0.31.8, which basically just updated zbus, our dbus dependency, it looks like an upstream bug. I'll try to look into it later (not sure if I will be able to because I couldn't reproduce it yet).

asegarra commented 1 year ago

thanks, i appreciate it. Let me know if you need anything else from me.

MaxVerevkin commented 1 year ago

Can you try it now?

asegarra commented 1 year ago

I'm away from my main machine running Arch but have a similar setup on my laptop running Fedora 38 and I can't reproduce it with the latest git, but I've found it also works fine without the latest commit. It seems whatever the issue is it's specific to Arch. I'll get back to my computer in a couple of days and I can retest there if still required.

asegarra commented 10 months ago

Hi, sorry about the late update. Not sure what update fixed this, but I can no longer forcibly reproduce this anymore. So I believe this is fixed! Thanks!.