hoyon / mpv-mpris

MPRIS plugin for mpv
MIT License
607 stars 35 forks source link

MediaPlayer2 bad Volume value for PulseAudio on PipeWire. #110

Closed LurkAndLoiter closed 1 month ago

LurkAndLoiter commented 1 month ago
#!/usr/bin/sh

ProvidedVolume=$(gdbus introspect -p --session --dest "org.mpris.MediaPlayer2.mpv" --object-path /org/mpris/MediaPlayer2 | awk -F"= |;" '/Volume/{print $2}')
RealVolume=$(pactl --format=json list sink-inputs | jq -r '.[] | select(.properties["application.name"]=="mpv") | .volume["front-left"]["value_percent"][:-1]|tonumber/100')

printf "Received: %s\nExpected: %s\n" $ProvidedVolume $RealVolume

Recreate: run mpv instance. create a non default value for player. run above command to see actual vs mpris volume values. This is running on Pipewire/Wireplumber. I'm unaware if this is repeatable in a stock PulseAudio config.

Edit: Probably a false flag From what I can see there are 3 volumes from mpv.

  1. output device volume (Output Devices in pavucontrol )
  2. audio sink volume (Playback in pavucontrol)
  3. audio player volume (Not Available in pavucontrol)

Typically Mpris is reporting 2. For mpv-mpris it seems we receive 3.

CLOSED ISSUE

mpv provides an option --pipewire-volume-mode=<channel|global> Though it appears to be broken from my attempts and per mpv:14095

This appears to be an upstream issue. Please reopen if you're in disagreement with current functionality.