playerctl icon indicating copy to clipboard operation
playerctl copied to clipboard

Setting volume with library doesn't emit volume changed events

Open jdholtz opened this issue 2 years ago • 2 comments

The player I am using is cmus.

When setting the volume with either player.set_volume or player.props.volume = .., the volume gets changed correctly on the player, but the player volume property does not update to the new volume. Here are steps to reproduce it:

  1. Have a player (cmus) open
  2. Follow volume changes using playerctl volume --follow
  3. Use the following code to change the volume of the player using the Python library
from gi.repository import GLib, Playerctl
manager = Playerctl.PlayerManager()
player = Playerctl.Player.new_from_name(manager.props.player_names[0])  # Make sure cmus is the only open player
player.set_volume(0.8)  # Set to a different volume
  1. Notice how the volume changes correctly in cmus, but it does not change in player.props.volume nor are there updates from the --follow command executed in step 2

Edit: I also see very similar issues with the shuffle and loop_status properties (shuffle events don’t even work at all). This could be a problem with how cmus integrates with MPRIS.

jdholtz avatar Jul 27 '23 13:07 jdholtz

This seems to be an issue with cmus only. It works perfectly fine with Spotify, so I will close this issue.

jdholtz avatar Jul 27 '23 14:07 jdholtz

However, I wonder why playerctl detects volume updates when using playerctl volume 0.1 compared to not detecting volume updates when using player.set_volume(0.1). I’ll reopen this issue due to this inconsistency.

jdholtz avatar Jul 27 '23 15:07 jdholtz