Bug 380857 - Respect playback device output on systems with pulseaudio (flat-volumes = yes)
Summary: Respect playback device output on systems with pulseaudio (flat-volumes = yes)
Status: RESOLVED DUPLICATE of bug 345651
Alias: None
Product: phonon-backend-vlc
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Harald Sitter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-05 08:58 UTC by Leonard Lausen
Modified: 2017-06-06 12:37 UTC (History)
6 users (show)

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 Leonard Lausen 2017-06-05 08:58:35 UTC
flat-volumes, which is enabled by default in PulseAudio (though many distributions disable it) scales the device-volume with the volume of the "loudest" application. Applications, unaware of this feature, can set their volume to 100% at startup, potentially blowing the speakers or ears of the user.

Unfortunately KDE applications do exactly that, which is not only a health hazard for users but also relatively hard to debug for users unfamiliar with PulseAudio.

KDE Applications should therefore at startup never set their output volume to 100%, but simply to the volume of the playback device to which they are outputting.

I noticed this behaviour in particular with the error messages generated by Dolphin and Okular, but it probably affects more applications.

Related bugs are #346614, #352312, #352176 and #327723
Comment 1 Harald Sitter 2017-06-06 11:31:07 UTC
Which phonon backend are you using?
Comment 2 Leonard Lausen 2017-06-06 11:49:42 UTC
The package is currently build with the following USE flags (gentoo):

➜  ~ equery uses phonon    
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for media-libs/phonon-4.9.1-r1:
 U I
 - - abi_x86_32 : 32-bit (x86) libraries
 - - debug      : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see
                  https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
 + - designer   : Install plugin for dev-qt/designer
 - - gstreamer  : Add support for media-libs/gstreamer (Streaming media)
 + + pulseaudio : Add support for PulseAudio sound server
 + + qt4        : Add support for the Qt GUI/Application Toolkit version 4.x
 + + qt5        : Add support for the Qt 5 application and UI framework
 + - vlc        : Install VLC Phonon backend

I.e. if I understand correctly it should use the pulseaudio backend.

https://packages.gentoo.org/packages/media-libs/phonon
Comment 3 Harald Sitter 2017-06-06 11:56:04 UTC
Run `kcmshell5 phonon` go to the backend tab. What's the first backend in the list?
Comment 4 Leonard Lausen 2017-06-06 12:05:46 UTC
Thanks for the clarification. It turns out only the vlc backend is
listed there..
Comment 5 Harald Sitter 2017-06-06 12:37:48 UTC
The problem is that the vlc backend right now creates all PA streams as category=video (or rather libvlc does and currently has no way to change that), which results in the stream getting a default volume (100%) which combined with flat volumes pushes everything up.
If vlc could set category=notification it would get the default volume inherited from the global notification volume as seen in plasma-pa or pavucontrol rather than max volume.

This is fixed in vlc master (to be vlc 3) and phonon-vlc master. Unfortunately, until that gets released we cannot do much about this.

As far as specific applications (i.e. not notifications) are concerned you'll have to file bugs against the specific applications. If an application wants to explicitly set the volume to 100% that is the application's business.

*** This bug has been marked as a duplicate of bug 345651 ***