[Bug]: MPRIS: precise-volume: Volume property unsyncs if set through MPRIS #3225

Closed
opened 2025-04-12 03:15:12 +00:00 by h-banii · 0 comments
h-banii commented 2025-04-12 03:15:12 +00:00 (Migrated from github.com)

Preflight Checklist

  • I use the latest version of YouTube Music (Application).
  • I have searched the issue tracker for a bug report that matches the one I want to file, without success.
  • I understand that th-ch/youtube-music has NO affiliation with Google or YouTube

YouTube Music (Application) Version

master

Checklists

What operating system are you using?

Other Linux

Operating System Version

NixOS 25.05 (Warbler) x86_64 [nixpkgs rev: github:NixOS/nixpkgs/2c8d3f4]

What CPU architecture are you using?

x64

Last Known Working YouTube Music (Application) version

likely introduced in 9da0e43 (not entirely sure, I didn't bisect, just git blame)

Reproduction steps

  1. open youtube-music with shortcuts and precise-volume plugins
  2. set volume through mpris (playerctl --player=YoutubeMusic volume 0.5)
  3. get volume through mpris (playerctl --player=YoutubeMusic volume)
  4. repeat steps 2 and 3 as many times as you want

Expected Behavior

Each call to set the volume property through mpris should update the volume property in the mpris object.

So we should see something like:

$ playerctl --player=YoutubeMusic volume 0.7
$ playerctl --player=YoutubeMusic volume
0.700000
$ playerctl --player=YoutubeMusic volume 0.2
$ playerctl --player=YoutubeMusic volume
0.200000
$ playerctl --player=YoutubeMusic volume 0.8
$ playerctl --player=YoutubeMusic volume
0.800000

Actual Behavior

It doesn't update the mpris object, so when we ask the volume property, it returns an outdated value.

The volume in the actual player does update (in most cases*), it's just the mpris object that doesn't. So we should hear the volume changing in the application, but mpris says otherwise:

$ playerctl --player=YoutubeMusic volume 0.7
$ playerctl --player=YoutubeMusic volume
1.000000
$ playerctl --player=YoutubeMusic volume 0.2
$ playerctl --player=YoutubeMusic volume
1.000000
$ playerctl --player=YoutubeMusic volume 0.8
$ playerctl --player=YoutubeMusic volume
1.000000

*: There's a case where it does not update the actual player's volume:

Let's suppose MPRIS volume froze on 1.0, like in the case above, if we try to set the volume to 1.0 through mpris, it'll not update the actual player's volume.

Enabled plugins

  • shortcuts (mpris)
  • precise-volume

Additional Information

Another side consequence is that this doesn't work

playerctl --player=YoutubeMusic volume 0.1+

(it gets the current volume and adds 0.1 to it)

### Preflight Checklist - [x] I use the latest version of YouTube Music (Application). - [x] I have searched the [issue tracker](https://github.com/th-ch/youtube-music/issues) for a bug report that matches the one I want to file, without success. - [x] I understand that **th-ch/youtube-music has NO affiliation with Google or YouTube** ### YouTube Music (Application) Version master ### Checklists - [ ] I use the portable version of the YouTube Music Application. - [ ] I can reproduce this issue in the [official version of (WEB) YTM](https://music.youtube.com). ### What operating system are you using? Other Linux ### Operating System Version NixOS 25.05 (Warbler) x86_64 [nixpkgs rev: github:NixOS/nixpkgs/2c8d3f4] ### What CPU architecture are you using? x64 ### Last Known Working YouTube Music (Application) version likely introduced in 9da0e43 (not entirely sure, I didn't bisect, just git blame) ### Reproduction steps 1. open youtube-music with **shortcuts** and **precise-volume** plugins 2. set volume through mpris (`playerctl --player=YoutubeMusic volume 0.5`) 3. get volume through mpris (`playerctl --player=YoutubeMusic volume`) 4. repeat steps 2 and 3 as many times as you want ### Expected Behavior Each call to set the `volume` property through mpris should update the `volume` property in the mpris object. So we should see something like: ```console $ playerctl --player=YoutubeMusic volume 0.7 $ playerctl --player=YoutubeMusic volume 0.700000 $ playerctl --player=YoutubeMusic volume 0.2 $ playerctl --player=YoutubeMusic volume 0.200000 $ playerctl --player=YoutubeMusic volume 0.8 $ playerctl --player=YoutubeMusic volume 0.800000 ``` ### Actual Behavior It doesn't update the mpris object, so when we ask the `volume` property, it returns an outdated value. The volume in the actual player **does** update (in most cases*), it's just the mpris object that doesn't. So we should hear the volume changing in the application, but mpris says otherwise: ```console $ playerctl --player=YoutubeMusic volume 0.7 $ playerctl --player=YoutubeMusic volume 1.000000 $ playerctl --player=YoutubeMusic volume 0.2 $ playerctl --player=YoutubeMusic volume 1.000000 $ playerctl --player=YoutubeMusic volume 0.8 $ playerctl --player=YoutubeMusic volume 1.000000 ``` *: There's a case where it does **not** update the actual player's volume: Let's suppose MPRIS volume froze on `1.0`, like in the case above, if we try to set the volume to 1.0 through mpris, it'll **not** update the actual player's volume. ### Enabled plugins - shortcuts (mpris) - precise-volume ### Additional Information Another side consequence is that this doesn't work ```sh playerctl --player=YoutubeMusic volume 0.1+ ``` (it gets the current volume and adds 0.1 to it)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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: YTMD/youtube-music#3225
No description provided.