Bug 498872 - Haruna always reports volume 0 via MPRIS, breaks media keys and widgets
Summary: Haruna always reports volume 0 via MPRIS, breaks media keys and widgets
Status: RESOLVED FIXED
Alias: None
Product: Haruna
Classification: Applications
Component: generic (show other bugs)
Version: 1.3.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: george fb
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-19 03:20 UTC by pallaswept
Modified: 2025-01-19 17:33 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pallaswept 2025-01-19 03:20:42 UTC
SUMMARY
Changing volume from external controls (keyboard, scrolling mouse on Media Player widget) causes volume to snap to muted and then get stuck between 5% and 10%

STEPS TO REPRODUCE
1. Start haruna, play media
2. Change volume with media keys or by scrolling mouse over Media Player plasma widget

OBSERVED RESULT
Volume jumps to 0 on the first input, and cannot be raised above 10. Increasing volume from 10 causes volume to become 5.

EXPECTED RESULT
Increment/decrement volume in steps of 5

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
Operating System: openSUSE Tumbleweed 20250117
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1


ADDITIONAL INFORMATION
Comment 1 pallaswept 2025-01-19 14:46:35 UTC
I believe that this is occurring because Haruna always reports the volume via MPRIS, as 0, if it is less than 1.

The widget gets the current volume, and it tries to set the volume relative to that. Because haruna says its volume is 0, the volume control only sets it to 5%

If I manually set the volume to 1 via MPRIS, it does work, and I can see the property's value change to 1. 
If I then scroll down on the widget, it will attempt to set 95, and succeed, but report that it has set 0:


method call time=1737297065.746882 sender=:1.21 -> destination=org.mpris.MediaPlayer2.haruna serial=1537 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=Set
   string "org.mpris.MediaPlayer2.Player"
   string "Volume"
   variant       double 0.95
signal time=1737297065.747893 sender=:1.147 -> destination=(null destination) serial=177 path=/org/mpris/MediaPlayer2; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.mpris.MediaPlayer2.Player"
   array [
      dict entry(
         string "Volume"
         variant             double 0
      )
   ]
   array [
   ]


If I change volume in the app, I see a propertychanged notification, but the value is always 0 except for at 100% when it is 1
Getting the value always reads 0 except 1 at 100% volume

Hope this helps.
Comment 2 george fb 2025-01-19 17:30:05 UTC
Git commit 645fe07b96ae56b471130de4fa5d849210cb58f2 by George Florea Bănuș.
Committed on 19/01/2025 at 17:29.
Pushed by georgefb into branch 'master'.

mpris2: fix setting volume

M  +1    -1    src/mpris2/mediaplayer2player.cpp

https://invent.kde.org/multimedia/haruna/-/commit/645fe07b96ae56b471130de4fa5d849210cb58f2
Comment 3 pallaswept 2025-01-19 17:33:16 UTC
Thanks mate!