Bug 495056 - [Wayland] Kodi crashes when playing video with "Sync playback to display" enabled
Summary: [Wayland] Kodi crashes when playing video with "Sync playback to display" ena...
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-19 19:26 UTC by Oded Arbel
Modified: 2024-12-12 20:29 UTC (History)
1 user (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 Oded Arbel 2024-10-19 19:26:27 UTC
SUMMARY
When enabling "Sync playback to display" in Kodi (Settings -> Player), Kodi crashes immediately when trying to play a video, with a division by zero exception.

STEPS TO REPRODUCE
1. Log in to a Plasma Wayland session
2. Run Kodi (either a local installation, Snap or Flatpak)
3. Go into settings -> Player and make sure "Sync playback to display" is on (this may require changing the "settings mode" to "Standard" or higher).
4. Go to the main view and try to play a video from Kodi's library (you may need to add a video source to some place where there are playable videos).

OBSERVED RESULT
Kodi immediately crashes

EXPECTED RESULT
The video should play

SOFTWARE/OS VERSIONS
Operating System: KDE neon Testing Edition
KDE Plasma Version: 6.2.80
KDE Frameworks Version: 6.7.0
Qt Version: 6.7.2
Kernel Version: 6.8.0-45-generic (64-bit)
Graphics Platform: Wayland
Processors: 20 × 12th Gen Intel® Core™ i7-12700H
Memory: 31.0 GiB of RAM
Graphics Processor: Mesa Intel® Graphics

ADDITIONAL INFORMATION
According to the discussion in the open Kodi issue here - https://github.com/xbmc/xbmc/issues/25850 - the problem is that kwin_wayland does not send the `sync_output` event before calling the `presented` presentation feedback event. From a quick review of the code - I don't think kwin_wayland ever calls `sync_output` - which Kodi relies upon to detect the refresh rate of the display it is playing on. According to the developer - other compositors are doing this "correctly".
Comment 1 Oded Arbel 2024-10-19 21:37:49 UTC
The Bug Janitor changed the severity to "crash", which I purposefully not selected. There is a crash, but not of KWin and it is (somewhat) easily worked around.