Bug 462358

Summary: Seeking is Broken
Product: [Applications] kasts Reporter: brady.greenwood
Component: generalAssignee: bart
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description brady.greenwood 2022-11-28 15:43:32 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Pick any podcast episode and either try to seek using the seeker bar or the skip ahead/back buttons.
2. If it works as expected, try again until playback jumps back to the initial playpoint and the time indicator remains static.


OBSERVED RESULT
- Usually by the third or fourth attempt to seek, it will jump back to the initial starting point before any seeking was attempted, and playback from that spot for about 5 seconds until it gives into silence (the time indicator remains still during this playback).
- Restarting Kasts and attempting to play a file will result in a multiple-second silence before playback begins, fixing the issue (until one attempts to seek again).

EXPECTED RESULT
It seeks like any other media playback application and doesn't stop playing back requiring a full restart of the application.

SOFTWARE/OS VERSIONS
Kasts: 22.09
Windows: N/A
macOS: N/A
Linux/KDE Plasma: 6.0.8-1-MANJARO (64-bit)
(available in About System)
KDE Plasma Version: 5.26.3
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.7

ADDITIONAL INFORMATION
I use pipewire and its various implementations to handle ALSA/Pulse/JACK and I suspect it may be related to that, though no other application exhibits this behavior (mpv, elisa, spotify, gpodder, ardour, lmms, etc), so it must be the application itself at fault. I haven't had time to rule it out as it would require upending my workstation. This has been occurring since at least Linux 5.15.

I have re-installed Manjaro since this problem occurred for an unrelated reason and the bug existed in both environments.
Comment 1 bart 2022-11-28 21:47:33 UTC
I'm not sure if it's entirely the same bug, but I can confirm that, when using a recent gstreamer version, the audio playback will freeze on a seek operation after just a few attempts.  I don't recognize the jumping back part, though.

If it's the same bug, then loading another episode fixes the problem, i.e. audio playback resumes on that new episode (so no full restart of app required).  If you are seeing those symptoms, then it's most likely the same bug.  The bad news is that that one is entirely due to gstreamer, and therefore completely out of control of Kasts.
Comment 2 bart 2023-01-16 15:56:38 UTC
Git commit eb07e67f7041407c7fb65afed63a1e8ffe254a08 by Bart De Vries.
Committed on 16/01/2023 at 14:36.
Pushed by bdevries into branch 'master'.

[KMediaSession] Implement dynamic audio backend framework

KMediaSession is an audio player library that has an API which is close
to QMediaPlayer and which allows to use --- and dynamically switch
between --- different audio backends. At this moment there is
implementation for libVLC, gstreamer and QtMultimedia. Only QtMultimedia
is a hard dependency in order to at least have one functional backend on
all platforms; all other dependencies are optional.

KMediaSession has out-of-the-box, built-in MPRIS2 support, sleep inhibit,
and basic metadata support.

Closes #35

M  +28   -0    .flatpak-manifest.json
M  +2    -1    CMakeLists.txt
A  +175  -0    LICENSES/LGPL-2.1-only.txt
A  +175  -0    LICENSES/LGPL-2.1-or-later.txt
A  +304  -0    LICENSES/LGPL-3.0-only.txt
A  +12   -0    LICENSES/LicenseRef-KDE-Accepted-LGPL.txt
M  +4    -1    README.md
M  +19   -34   src/CMakeLists.txt
M  +121  -99   src/audiomanager.cpp
M  +27   -18   src/audiomanager.h
A  +29   -0    src/kmediasession/.patches/vlc-ignore-time-for-cache.patch
A  +151  -0    src/kmediasession/CMakeLists.txt
A  +40   -0    src/kmediasession/androidlogging.h     [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)]
A  +121  -0    src/kmediasession/cmake/FindLIBVLC.cmake
A  +10   -0    src/kmediasession/config-kmediasession.h.in
R  +0    -0    src/kmediasession/dbus-interfaces/org.freedesktop.PowerManagement.Inhibit.xml [from: src/dbus-interfaces/org.freedesktop.PowerManagement.Inhibit.xml - 100% similarity]
R  +0    -0    src/kmediasession/dbus-interfaces/org.gnome.SessionManager.xml [from: src/dbus-interfaces/org.gnome.SessionManager.xml - 100% similarity]
A  +95   -0    src/kmediasession/dbus-interfaces/org.mpris.MediaPlayer2.Player.xml
A  +31   -0    src/kmediasession/dbus-interfaces/org.mpris.MediaPlayer2.xml
A  +29   -0    src/kmediasession/example-app/CMakeLists.txt
A  +50   -0    src/kmediasession/example-app/main.cpp     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +202  -0    src/kmediasession/example-app/qml/main.qml     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +8    -0    src/kmediasession/example-app/resources.qrc
A  +471  -0    src/kmediasession/kmediasession.cpp     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +174  -0    src/kmediasession/kmediasession.h     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +62   -0    src/kmediasession/mediabackends/abstractmediabackend.h     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +635  -0    src/kmediasession/mediabackends/gstmediabackend.cpp     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +58   -0    src/kmediasession/mediabackends/gstmediabackend.h     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +333  -0    src/kmediasession/mediabackends/qtmediabackend.cpp     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +55   -0    src/kmediasession/mediabackends/qtmediabackend.h     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +691  -0    src/kmediasession/mediabackends/vlcmediabackend.cpp     [License: LGPL(v3.0+)]
A  +68   -0    src/kmediasession/mediabackends/vlcmediabackend.h     [License: LGPL(v3.0+)]
A  +105  -0    src/kmediasession/metadata.cpp     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +56   -0    src/kmediasession/metadata.h     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +90   -0    src/kmediasession/mpris2/mediaplayer2.cpp     [License: GPL(v3.0+)]
R  +11   -4    src/kmediasession/mpris2/mediaplayer2.h [from: src/mpris2/mediaplayer2.h - 072% similarity]
A  +519  -0    src/kmediasession/mpris2/mediaplayer2player.cpp     [License: GPL(v3.0+)]
R  +9    -11   src/kmediasession/mpris2/mediaplayer2player.h [from: src/mpris2/mediaplayer2player.h - 083% similarity]
A  +119  -0    src/kmediasession/mpris2/mpris2.cpp     [License: GPL(v3.0+)]
A  +53   -0    src/kmediasession/mpris2/mpris2.h     [License: GPL(v3.0+)]
R  +7    -7    src/kmediasession/powermanagement/powermanagementinterface.cpp [from: src/powermanagementinterface.cpp - 090% similarity]
R  +2    -2    src/kmediasession/powermanagement/powermanagementinterface.h [from: src/powermanagementinterface.h - 091% similarity]
A  +19   -0    src/kmediasession/qml/CMakeLists.txt
A  +30   -0    src/kmediasession/qml/kmediasession-qmlplugin.cpp     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +3    -0    src/kmediasession/qml/qmldir
A  +2    -0    src/kmediasession/qml/qmldir.license
M  +0    -2    src/main.cpp
D  +0    -70   src/mpris2/mediaplayer2.cpp
D  +0    -458  src/mpris2/mediaplayer2player.cpp
D  +0    -121  src/mpris2/mpris2.cpp
D  +0    -67   src/mpris2/mpris2.h
M  +4    -3    src/qml/ChapterListDelegate.qml
M  +5    -5    src/qml/EntryPage.qml
M  +6    -6    src/qml/GenericEntryDelegate.qml
M  +5    -4    src/qml/HeaderBar.qml
M  +4    -4    src/qml/MinimizedPlayerControls.qml
M  +10   -5    src/qml/PlaybackRateDialog.qml
M  +4    -4    src/qml/PlayerControls.qml
M  +32   -1    src/qml/Settings/GeneralSettingsPage.qml
M  +14   -12   src/qml/main.qml

https://invent.kde.org/plasma-mobile/kasts/commit/eb07e67f7041407c7fb65afed63a1e8ffe254a08