Bug 443556

Summary: Audio control in video playback with strange behaviour
Product: [Applications] kphotoalbum Reporter: Andreas Schleth <schleth_es>
Component: ViewerAssignee: KPhotoAlbum Bugs <kphotoalbum-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: johannes
Priority: NOR    
Version First Reported In: GIT master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: audio contol

Description Andreas Schleth 2021-10-10 15:54:17 UTC
SUMMARY

The audio level control still has some strange behaviour (is this work in progress?):

a) The % shown usually does not change with the slider position. 
I have seen it standing at 0% or 100% or 648% (I am not making this up!), independently of the slider position.

b) After mute, the audio stays mute after un-muting. I have to touch the slider a bit to turn the sound back on.

At the moment I use the phonon backend with v5.8.1-21-g7f709159 and phonon itself set to vlc-backend via phononsettings.

STEPS TO REPRODUCE & OBSERVED RESULT

for a) I have not yet found a causality for the different numbers displayed, only that the percentage never changes when pulling the slider.

for b):
1. play video
2. set audio level to some value (maybe full)
3. mute via the button
4. unmute via the button
5. nothing to be heard
6. shift the audio level slider a bit
7. sound comes back.

EXPECTED RESULT
in a)
percentage should reflect slider position and show values between 0 and 100%

in b)
5. should be 7. 

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSuse Leap 15.3
KDE Plasma Version: 5.18.6 (?)
KDE Frameworks 5.76.0
Qt 5.12.7 (kompiliert gegen 5.12.7)
KPA: v5.8.1-21-g7f709159
Comment 1 Andreas Schleth 2021-10-10 15:55:12 UTC
Created attachment 142302 [details]
audio contol
Comment 2 Johannes Zarl-Zierl 2022-07-07 16:19:39 UTC
Git commit 941bf25dbbff169fb4f7a3cf6c48f64ea0f00457 by Johannes Zarl-Zierl.
Committed on 07/07/2022 at 16:02.
Pushed by johanneszarl into branch 'master'.

Fix mute/unmute for Phonon video backend

M  +11   -1    Viewer/PhononDisplay.cpp
M  +5    -0    Viewer/VideoToolBar.cpp
M  +9    -0    Viewer/VideoToolBar.h

https://invent.kde.org/graphics/kphotoalbum/commit/941bf25dbbff169fb4f7a3cf6c48f64ea0f00457
Comment 3 Johannes Zarl-Zierl 2022-07-07 16:19:47 UTC
Git commit d1a9954aa10321a650be949a5706f10479d01426 by Johannes Zarl-Zierl.
Committed on 22/06/2022 at 23:16.
Pushed by johanneszarl into branch 'master'.

Fix audio volume with Phonon video backend

Phonon::AudioOutput uses volts, not percent of loudness, so that
conversion is needed.
Volume changes were only propagated from KPhotoAlbum to phonon, not
back.

M  +22   -2    Viewer/PhononDisplay.cpp
M  +4    -0    Viewer/PhononDisplay.h

https://invent.kde.org/graphics/kphotoalbum/commit/d1a9954aa10321a650be949a5706f10479d01426
Comment 4 Johannes Zarl-Zierl 2022-07-07 16:32:15 UTC
Displaying the correct mute status in KPhotoAlbum, when one presses the mute button in the plasma volume control widget still doesn't work, but that seems to be a problem with Phonon not triggering the Phonon::AudioOutput::volumeChanged signal in this case.

Both the correct percentage display and the proper function of the mute/unmute button of the video display widget are implemented now.
Comment 5 Andreas Schleth 2022-07-07 18:49:12 UTC
Hi Johannes,

nice, that you found some free time to do this. I just built the new thing (v5.8.1-102-ge1f1d9a2) and there still is a tiny bit of strangeness:

working:
* mute/unmute works (for me)
* the slider works too - but only if it is dragged (click and hold the button, then drag it)

however, the slider does not work if I click somewhere on the line:
* The displayed position changes, but the volume changes not.
* Say, the volume is set to 50%. I click on the 75% position: the slider moves to the right but the volume stays the same.
Comment 6 Johannes Zarl-Zierl 2022-07-07 22:51:25 UTC
Hi Andreas,

Thanks for double-checking the solution this quickly! Indeed I only dragged the slider without clicking. I'll see if I can find a solution...

Cheers,
  Johannes
Comment 7 Johannes Zarl-Zierl 2022-07-07 23:04:36 UTC
Git commit c424b4d690bb524c2064bf4e2e3035e009b2a6b5 by Johannes Zarl-Zierl.
Committed on 07/07/2022 at 23:01.
Pushed by johanneszarl into branch 'master'.

Enable clicking the volume slider to change audio volume.

I did a quick check that this works with all three video backends and
doesn't introduce any regressions with the audio volume slider in any of
them.

M  +1    -1    Viewer/VideoToolBar.cpp

https://invent.kde.org/graphics/kphotoalbum/commit/c424b4d690bb524c2064bf4e2e3035e009b2a6b5
Comment 8 Andreas Schleth 2022-07-08 10:04:30 UTC
I can confirm, that is works nicely here too. This new version is now my daily tool. 

Funny that the version gets reported as 5.8.1 without any git-id ... 
I am always building from git master.

Thanks, Andreas