Setting volume with library doesn't emit volume changed events
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:
- Have a player (cmus) open
- Follow volume changes using
playerctl volume --follow - 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
- Notice how the volume changes correctly in cmus, but it does not change in
player.props.volumenor are there updates from the--followcommand 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.
This seems to be an issue with cmus only. It works perfectly fine with Spotify, so I will close this issue.
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.