Bug 479130 - The QtMultimedia backend is severely broken
Summary: The QtMultimedia backend is severely broken
Status: RESOLVED FIXED
Alias: None
Product: Elisa
Classification: Applications
Component: general (show other bugs)
Version: 24.01.85
Platform: Compiled Sources Linux
: HI major
Target Milestone: ---
Assignee: Matthieu Gallien
URL:
Keywords: qt6
: 479651 483894 485262 485579 486092 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-12-28 18:34 UTC by João Figueiredo
Modified: 2024-04-26 03:22 UTC (History)
8 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description João Figueiredo 2023-12-28 18:34:03 UTC
SUMMARY
If compiling with QtMultimedia instead of VLC, when a song in a playlist ends, the audio stream simply stops. The same thing happens when skipping to the next song while the previous one is playing; in that case, playback will only resume after pressing the play button twice. Also, if the "repeat current track" option is enabled, nothing changes.

STEPS TO REPRODUCE
1. Start playing a playlist;
2. Let the first song end or skip to the next one.

OBSERVED RESULT
The audio stream stops and repeat doesn't work.

EXPECTED RESULT
Playback shouldn't stop, songs should start playing automatically when skipping, the previous one ends, or repeat is enabled.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.91.0
KDE Frameworks Version: 5.247.0
Qt Version: 6.7.0
PipeWire Version: 1.0.0

ADDITIONAL INFORMATION
I'm using pipewire-pulse. I also tried compiling Elisa with VLC to make sure it's a QtMultimedia issue, and indeed the problem doesn't occur there. Both backends work fine with Elisa 23.08.4.
Comment 1 Nate Graham 2024-01-11 19:06:27 UTC
*** Bug 479651 has been marked as a duplicate of this bug. ***
Comment 2 Jack Hill 2024-01-14 21:45:53 UTC
Looks like the problem is QMediaPlayer::playbackStateChanged gets emitted first and then QMediaPlayer::mediaStatusChanged afterwards whilst the Qt5 backend emitted the signals in the reverse order. So the code is set up to assume the media status has changed before the playback state. We could probably just flip the logic around and assume the player status gets changed first, but this might affect the VLC backend (not sure). I guess the "correct" thing to do is to queue a function to recalculate the status that we want after both player and media status have updated.
Comment 3 Bug Janitor Service 2024-01-19 15:07:43 UTC
A possibly relevant merge request was started @ https://invent.kde.org/multimedia/elisa/-/merge_requests/543
Comment 4 Jack Hill 2024-03-18 17:25:08 UTC
*** Bug 483894 has been marked as a duplicate of this bug. ***
Comment 5 Nate Graham 2024-03-18 17:47:23 UTC
Feel free to cherry-pick the fix after 24.02.1 is tagged, which should be today.
Comment 6 Nate Graham 2024-04-09 16:39:16 UTC
*** Bug 485262 has been marked as a duplicate of this bug. ***
Comment 7 Jack Hill 2024-04-15 18:57:56 UTC
*** Bug 485579 has been marked as a duplicate of this bug. ***
Comment 8 Jack Hill 2024-04-25 14:21:54 UTC
*** Bug 486092 has been marked as a duplicate of this bug. ***
Comment 9 Be 2024-04-26 03:22:19 UTC
For anyone coming here encountering this bug in Fedora 40: the Elisa version 24.02.2 with the fix is already available in updates-testing. Run `dnf update --enablerepo=updates-testing elisa-player` to install it before it moves to the main updates repository.