Bug 426951 - Digikam multimedia issue
Summary: Digikam multimedia issue
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Preview-Video (show other bugs)
Version: 8.0.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-25 10:03 UTC by maderios
Modified: 2022-10-15 10:21 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description maderios 2020-09-25 10:03:54 UTC
Since many many versions, when Digikam is running, I can't get audio for other users
STEPS TO REPRODUCE
1. Launch two X sessions for two users ins ame time, in tty1 and tty2
2. Launch digikam in tty2 X session
3. Go to tty1 X session, try  video/audio app like firefox, avidemux...
OBSERVED RESULT
Multimedia apps don't work no more in tty1 but they work in tty2 where DK is launched. 
If I close digikam, they work again normally in tty1.
Same issue with Wayland
Arch Linux
lts kernel
Digikam Git master
Comment 1 Maik Qualmann 2020-09-25 10:36:22 UTC
Does the problem only occur with 2 X sessions? I can play sound here under a KF5 desktop without any problems while digikam is also playing a video. For such things, a sound server must normally be installed in the system, which mixes the sounds from different programs. Check the debug output of digiKam to see which sound backends are available:

digikam.general: Audio output backends: ("OpenAL", "Pulse", "null")

Maik
Comment 2 maderios 2020-09-26 08:55:59 UTC
Issue happens only with two X  sessions or two X wayland sessions, two users, in same time.
No any "audio" in output debug.
Digikam uses pulseaudio, i checked it in 'pavucontrol'
Precisions:
In tty1 X/wayland: firefox video+audio doesn't work.
Video works with multimedia apps (vlc, rage...). Audio doesn't work in these apps.
tty1 user issue disappears after closing Digikam in X/wayland tty2 user
Comment 3 maderios 2020-12-14 15:30:12 UTC
Issue doesn't happen with video in tty1 X session when i launch digikam (from tty2 X session) with optirun.
With command 'optirun digikam', digikam is launched with nvidia driver, not default intel driver (i915)
Comment 4 maderios 2020-12-17 15:09:31 UTC
Issue happens again with 'optirun digikam'. Video is frozen again for other user.
Comment 5 maderios 2020-12-22 17:01:23 UTC
I just built now digikam git master without qtav and with option
-DENABLE_MEDIAPLAYER=OFF \
That solved audio issue for other user.
Comment 6 Maik Qualmann 2020-12-23 06:45:25 UTC
I cannot reproduce the behavior here under openSUSE. When I log in 2 users, the sound of the respective desktop starts after the switch and the other one stops. This is independent of digiKam, the same behavior with 2 Firfox or Chromium instances. If I start digiKam and play a video and switch to the other user / desktop, the sound stops, I can then easily play a different sound on the desktop that has been switched.

Maik
Comment 7 maderios 2020-12-27 18:38:01 UTC
Which desktop environment?
I tested with two DE: enlightenment and xfce4. Same issue.
Conditions:
Linux Arch system
lts kernel
Laptop
Pulseaudio
Comment 8 caulier.gilles 2022-05-12 11:25:02 UTC
Git commit 5aae9b7c21ab662d63b49f165163984809c1d585 by Gilles Caulier.
Committed on 12/05/2022 at 11:10.
Pushed by cgilles into branch 'master'.

Move AVPlayer config widgets to core/QtAV to allow to re-use these settings view in a new Video section from digiKam Setup dialog.
the goal is to be able to configure the video decoder, the audio backend, and the video renderer with video preview framework,
to prevent dysfunctions while playing audio and video media if wrong decoder/backend/renderer is selected by default.

Currently none of these settings is possible in digiKam and playing video and audio always depends of default settings done in QtAV
framework which can be badly configured for the available hardwares and modules in client computer.

TODO: add the new video config pannel in digiKam Setup dialog to configure decoder/backend/renderer.
Related: bug 435660, bug 382582, bug 445422, bug 430873, bug 437328, bug 388475, bug 440668, bug 415778, bug 442802, bug 423580

M  +2    -14   core/avplayer/CMakeLists.txt
M  +3    -6    core/avplayer/main/MainWindow.cpp
M  +7    -7    core/avplayer/main/MainWindow.h
R  +2    -0    core/avplayer/utils/ConfigDialog.cpp [from: core/avplayer/config/ConfigDialog.cpp - 099% similarity]
R  +8    -5    core/avplayer/utils/ConfigDialog.h [from: core/avplayer/config/ConfigDialog.h - 090% similarity]
M  +2    -0    core/avplayer/utils/common.cpp
M  +12   -0    core/libs/video/qtav/CMakeLists.txt
R  +2    -2    core/libs/video/qtav/widgets/config/AVFilterConfigPage.cpp [from: core/avplayer/config/AVFilterConfigPage.cpp - 098% similarity]
R  +7    -6    core/libs/video/qtav/widgets/config/AVFilterConfigPage.h [from: core/avplayer/config/AVFilterConfigPage.h - 086% similarity]
R  +2    -2    core/libs/video/qtav/widgets/config/AVFormatConfigPage.cpp [from: core/avplayer/config/AVFormatConfigPage.cpp - 098% similarity]
R  +7    -6    core/libs/video/qtav/widgets/config/AVFormatConfigPage.h [from: core/avplayer/config/AVFormatConfigPage.h - 084% similarity]
R  +2    -2    core/libs/video/qtav/widgets/config/AVPlayerConfigMngr.cpp [from: core/avplayer/config/AVPlayerConfigMngr.cpp - 099% similarity]
R  +10   -6    core/libs/video/qtav/widgets/config/AVPlayerConfigMngr.h [from: core/avplayer/config/AVPlayerConfigMngr.h - 098% similarity]
R  +2    -2    core/libs/video/qtav/widgets/config/CaptureConfigPage.cpp [from: core/avplayer/config/CaptureConfigPage.cpp - 099% similarity]
R  +7    -6    core/libs/video/qtav/widgets/config/CaptureConfigPage.h [from: core/avplayer/config/CaptureConfigPage.h - 086% similarity]
R  +2    -2    core/libs/video/qtav/widgets/config/ClickableMenu.cpp [from: core/avplayer/utils/ClickableMenu.cpp - 097% similarity]
R  +10   -6    core/libs/video/qtav/widgets/config/ClickableMenu.h [from: core/avplayer/utils/ClickableMenu.h - 082% similarity]
R  +2    -2    core/libs/video/qtav/widgets/config/ConfigPageBase.cpp [from: core/avplayer/config/ConfigPageBase.cpp - 097% similarity]
R  +10   -6    core/libs/video/qtav/widgets/config/ConfigPageBase.h [from: core/avplayer/config/ConfigPageBase.h - 087% similarity]
R  +34   -37   core/libs/video/qtav/widgets/config/DecoderConfigPage.cpp [from: core/avplayer/config/DecoderConfigPage.cpp - 098% similarity]
R  +11   -6    core/libs/video/qtav/widgets/config/DecoderConfigPage.h [from: core/avplayer/config/DecoderConfigPage.h - 082% similarity]
R  +2    -2    core/libs/video/qtav/widgets/config/MiscPage.cpp [from: core/avplayer/config/MiscPage.cpp - 099% similarity]
R  +10   -6    core/libs/video/qtav/widgets/config/MiscPage.h [from: core/avplayer/config/MiscPage.h - 086% similarity]
R  +2    -2    core/libs/video/qtav/widgets/config/PropertyEditor.cpp [from: core/avplayer/config/PropertyEditor.cpp - 099% similarity]
R  +10   -6    core/libs/video/qtav/widgets/config/PropertyEditor.h [from: core/avplayer/config/PropertyEditor.h - 093% similarity]
R  +2    -2    core/libs/video/qtav/widgets/config/ShaderPage.cpp [from: core/avplayer/config/ShaderPage.cpp - 098% similarity]
R  +7    -6    core/libs/video/qtav/widgets/config/ShaderPage.h [from: core/avplayer/config/ShaderPage.h - 085% similarity]
R  +2    -2    core/libs/video/qtav/widgets/config/Slider.cpp [from: core/avplayer/utils/Slider.cpp - 099% similarity]
R  +10   -6    core/libs/video/qtav/widgets/config/Slider.h [from: core/avplayer/utils/Slider.h - 088% similarity]
R  +2    -2    core/libs/video/qtav/widgets/config/VideoEQConfigPage.cpp [from: core/avplayer/config/VideoEQConfigPage.cpp - 099% similarity]
R  +10   -6    core/libs/video/qtav/widgets/config/VideoEQConfigPage.h [from: core/avplayer/config/VideoEQConfigPage.h - 088% similarity]

https://invent.kde.org/graphics/digikam/commit/5aae9b7c21ab662d63b49f165163984809c1d585
Comment 9 caulier.gilles 2022-05-12 13:58:17 UTC
Git commit 505bc17cd39702e14446c15d79d44d14d80fe005 by Gilles Caulier.
Committed on 12/05/2022 at 13:56.
Pushed by cgilles into branch 'master'.

Add Setup Video page from digiKam configuration dialog.
This allow to setup few options for media player as the decoder priority to use.
Related: bug 435660, bug 382582, bug 445422, bug 430873, bug 437328, bug 388475, bug 440668, bug 415778, bug 442802, bug 423580

M  +24   -12   core/libs/video/player/mediaplayerview.cpp
M  +1    -0    core/libs/video/player/mediaplayerview.h
M  +22   -10   core/libs/video/player/slidevideo.cpp
M  +4    -0    core/libs/video/player/slidevideo.h
M  +2    -2    core/libs/video/qtav/widgets/config/AVPlayerConfigMngr.cpp
M  +1    -1    core/libs/video/qtav/widgets/config/DecoderConfigPage.cpp
M  +1    -0    core/utilities/setup/CMakeLists.txt
M  +29   -0    core/utilities/setup/setup.cpp
M  +2    -0    core/utilities/setup/setup.h
M  +1    -1    core/utilities/setup/setuptemplate.cpp
A  +69   -0    core/utilities/setup/setupvideo.h     [License: GPL (v2+)]

https://invent.kde.org/graphics/digikam/commit/505bc17cd39702e14446c15d79d44d14d80fe005
Comment 10 caulier.gilles 2022-05-12 15:26:59 UTC
Git commit 0e2bc2695efc7d6d0d2ec52731c3f69095554b7f by Gilles Caulier.
Committed on 12/05/2022 at 15:24.
Pushed by cgilles into branch 'master'.

Hide advanced settings for each decoder as nothing is saved and restored between the sessions. Only the list of decoder and the priority is saved
Related: bug 435660, bug 382582, bug 445422, bug 430873, bug 437328, bug 388475, bug 440668, bug 415778, bug 442802, bug 423580

M  +6    -4    core/libs/video/qtav/widgets/config/DecoderConfigPage.cpp
M  +1    -1    core/libs/video/qtav/widgets/config/DecoderConfigPage.h
M  +1    -1    core/utilities/setup/setupvideo.cpp

https://invent.kde.org/graphics/digikam/commit/0e2bc2695efc7d6d0d2ec52731c3f69095554b7f
Comment 11 Maik Qualmann 2022-05-21 17:30:57 UTC
This is now fixed with Bug 454090. The audio is always closed when no video is playing and the media player view is not open.

Maik
Comment 12 maderios 2022-08-23 15:23:29 UTC
Issue is still present with last git version. Audio & video are concerned.
Issue disappears if i close Digikam
No issue if I compile digikam with option
-DENABLE_MEDIAPLAYER=OFF
Comment 13 Maik Qualmann 2022-08-23 16:25:46 UTC
The patch was temporarily removed because we don't have any sound in the AppImage at the moment. However, the patch was not the cause and will be applied again.

Maik
Comment 14 maderios 2022-10-03 18:23:24 UTC
With last git version, I get nearly same issue but now inside same X session where Digikam is running:
I tried with mkv, avi and mp4 video
1) launch digikam
2) from Digikam or out of Digikam,  try to open video with smplayer or mpv or avidemux
2) video is opened but it freezes
3) closing Digikam solves issue
This issue doesn't happen when i open video with Qtavplayer and Rage (Enlightenment videoplayer  https://git.enlightenment.org/enlightenment/rage )
Comment 15 Maik Qualmann 2022-10-03 19:58:05 UTC
I can't reproduce that here either, I can easily play a video with other video players (Dragon, VLC) while digiKam is playing a video, the sound also comes from all programs and can be controlled individually in the mixer in the taskbar.

Maik
Comment 16 caulier.gilles 2022-10-04 00:23:09 UTC
It"s the same here. Not reproducible...

Gilles
Comment 17 maderios 2022-10-04 07:30:58 UTC
Yes, it works with VLC in any case but it doesn't work with SmPlayer/ MPV or Avidemux
It's clearer now: issue happens  while other X session is running with Firefox launched
To reproduce:
1) start X session in tty1 for user-1
2) launch Digikam
3) open video file from Digikam with VLC, SmPlayer or Avidemux : it works normally
Then :
1) from tty2, start other  X session for user-2 and launch firefox
2) go back to user-1
3) open video file from Digikam with VLC: it works normally
4) open video from Digikam with SmPlayer/ Mpv  or Avidemux : it doesn't work
Comment 18 maderios 2022-10-05 14:59:41 UTC
Same issue when connecting user2 inside user1 X session  with ssh:
1)  launch user1 X session
2) in a terminal, I connect to user2 with ssh:
 'ssh  -X  user2@localhost'
3) launch digikam in this user2 terminal
4) Launch video inside user1 X session : it's freezed
5) close user2 digikam 
6)  Launch video in user1 X session : it works
Comment 19 maderios 2022-10-07 12:11:24 UTC
(In reply to maderios from comment #17)
> Yes, it works with VLC in any case but it doesn't work with SmPlayer/ MPV or
> Avidemux
> It's clearer now: issue happens  while other X session is running with
> Firefox launched
> To reproduce:
> 1) start X session in tty1 for user-1
> 2) launch Digikam
> 3) open video file from Digikam with VLC, SmPlayer or Avidemux : it works
> normally
> Then :
> 1) from tty2, start other  X session for user-2 and launch firefox
> 2) go back to user-1
> 3) open video file from Digikam with VLC: it works normally
> 4) open video from Digikam with SmPlayer/ Mpv  or Avidemux : it doesn't work

*Now*, I can't reproduce this issue with ab8b3a77  git version
Comment 20 maderios 2022-10-11 10:51:31 UTC
bug described here in https://bugs.kde.org/show_bug.cgi?id=426951#c0 is still present
Comment 21 Maik Qualmann 2022-10-11 16:56:50 UTC
Git commit b2a3de84a232215d8cf6e8378c92cc01ed78e473 by Maik Qualmann.
Committed on 11/10/2022 at 16:55.
Pushed by mqualmann into branch 'master'.

close audio when leave media player view

M  +3    -0    core/libs/video/player/mediaplayerview.cpp

https://invent.kde.org/graphics/digikam/commit/b2a3de84a232215d8cf6e8378c92cc01ed78e473
Comment 22 maderios 2022-10-11 17:57:53 UTC
(In reply to Maik Qualmann from comment #21)
> Git commit b2a3de84a232215d8cf6e8378c92cc01ed78e473 by Maik Qualmann.
> Committed on 11/10/2022 at 16:55.
> Pushed by mqualmann into branch 'master'.
> 
> close audio when leave media player view
> 
> M  +3    -0    core/libs/video/player/mediaplayerview.cpp
> 
> https://invent.kde.org/graphics/digikam/commit/
> b2a3de84a232215d8cf6e8378c92cc01ed78e473

This issue https://bugs.kde.org/show_bug.cgi?id=426951#c0 seems partially solved : i can play video now in X session when Digikam is launched in other X/user session.
But, issue is still present, nearly like in Comment 17
To reproduce:
1) start X session in tty1 for user-1
2) launch Digikam
3) open video file from Digikam with VLC, SmPlayer, MPV or Avidemux : it works normally
Then :
1) from tty2, start other  X session
2) go back to user-1
3) open video file from Digikam with VLC, Avidemux, QtAvplayer, Rage: it works normally
4) open video from Digikam with SmPlayer, MPV or Mplayer : it doesn't work
Strangely, now, issue happens only with SmPlayer, MPV or Mplayer

I get same issue after compiling with ffmpeg4 or ffmpeg5
(Digikam video player works now with ffmpeg5)
Comment 23 Maik Qualmann 2022-10-11 18:16:19 UTC
I can't reproduce any problems here, 2 KF5 Plasma sessions, both digiKam and Mplayer started with a video (so digiKam+MPlayer session 1 and a 2nd user on session 2 also digiKam+Mplayer), all have sound and play video. When changing with CTRL+ALT+F7/F8 the sound mixed at the session is played.

Maik
Comment 24 maderios 2022-10-11 20:52:29 UTC
It seems there's some interaction between Digikam and SmPlayer/MPV on my system:
After launching Digikam, SmPlayer/MPV freezes video launched from Digikam or out of Digikam. After closing Digikam, freeze is still present.
I get rid of this issue by deleting  .Xauthority then login out. After that, SmPlayer/MPV works normally but, if I launch Digikam, issue is back. 
No idea at all about this issue...
Comment 25 maderios 2022-10-11 20:55:26 UTC
This issue happens too with Wayland session
Comment 26 Maik Qualmann 2022-10-11 21:11:06 UTC
I don't even know what SMPlayer is based on at the moment. It is possible that the player hardware decoding in your system use and the problem occurs there.

Maik
Comment 27 Maik Qualmann 2022-10-11 21:14:16 UTC
In digiKam-8.0.0 there are video settings in digiKam setup. Maybe they can change something there.

Maik
Comment 28 maderios 2022-10-12 09:50:53 UTC
Digikam video settings change nothing.
SmPlayer is a kind of MPV or Mplayer frontend
Good news:
After lauching Digikam, Pipewire and Wireplumber are not started by Digikam but they are started by SmPlayer.
If I kill pipewire and wireplumber, SmPlayer works again (with pipewire and wireplumber). But If launch Digikam again, SmpLayer doesn't work anymore.
After installing 'pipewire-pulse' package (pulseaudio replacement), SmPlayer works normally with Digikam.
Without pipewire-pulse, SmPlayer doesn't work with Digikam
Installed on my system:
pipewire-pulse 1:0.3.59-2 
pipewire 1:0.3.59-2 
pipewire-audio 1:0.3.59-2
pipewire-jack 1:0.3.59-2
pipewire-alsa 1:0.3.59-2
wireplumber 0.4.12-1
libpulse 16.1-1
paprefs 1.2-1
pavucontrol 1:5.0+r61+gee77d86-2
https://archlinux.org/packages/?q=pipewire
Comment 29 maderios 2022-10-12 10:02:48 UTC
Issue Description https://bugs.kde.org/show_bug.cgi?id=426951#c0 seems solved too.
Now, any video works with Digikam, even if two X sessions are launched in same time.
I understand now why Pulseaudio is replaced by Pipewire
Comment 30 maderios 2022-10-15 10:21:19 UTC
I confirm this issue is solved by replacing Pulseaudio by Pipewire and Wireplumber