Bug 500491 - Audio playback drops randomly when dragging clips to the timeline.
Summary: Audio playback drops randomly when dragging clips to the timeline.
Status: RESOLVED FIXED
Alias: None
Product: kdenlive
Classification: Applications
Component: Monitors & Playback (other bugs)
Version First Reported In: 24.12.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-20 22:19 UTC by Daryl Wood
Modified: 2025-03-03 18:28 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 24.12.3
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daryl Wood 2025-02-20 22:19:09 UTC
SUMMARY
Audio playback drops randomly when dragging clips to the timeline.

STEPS TO REPRODUCE
1. Have audio on an audio track
2. Drag clip(s) to the timeline.
3. Audio playback randomly drops, requiring  a restart to restore.

OBSERVED RESULT
No audio

EXPECTED RESULT
Audio playback

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 

ADDITIONAL INFORMATION
It doesn't take too many clips dragged to the timeline for the audio to randomly drop.
Comment 1 Jarno van der Kolk 2025-03-02 01:41:05 UTC
Apologies if this is a different bug but it sounds very similar to what I am experiencing so I believe it may be caused by the same thing.

Every month, I load all video clips from my bike camera into Kdenlive (~10 hours worth) and play each one at 10x speed to search for notable events. The audio playback sometimes drops when I switch from previewing one clip to the next.

I've been keeping an eye on the playback device for applications in the Plasma volume widget and I notice it switches to "no applications playing or recording sound" when this happens. Like Daryl, only a restart of Kdenlive fixes this.

I think the action of simply selecting a clip (like I do when previewing and what Daryl does when dragging/dropping) sometimes causes the playback device to drop and Kdenlive seems unable to recover from that.

In fact, I can reproduce this by loading a project with a few video clips and rapidly selecting one and then the other several times.

I am also on Arch Linux with Kdenlive 24.12.2.

From the log on the console:

<code>
SETTING AUDIO DATA IN MONITOR NOT EMPTY!!!
====== OPENING CLIP:  "20250207_123212.MOV"
TRACK NOT IN TARGET :  3  =  QList()
TRACK NOT IN TARGET :  3  =  QList(3)
MLT: "[consumer sdl2_audio ] SDL failed to open audio"
ACTION:  "&My Custom job"  =  "custom;"
:::: COMPARING ACTIONTYPE:  ""  =  ClipType::AV
ACTION:  "&Automatische splitsing van scene…"  =  "scenesplit;v"
:::: COMPARING ACTIONTYPE:  "v"  =  ClipType::AV
ACTION:  "&Stabiliseren"  =  "stabilize;v"
:::: COMPARING ACTIONTYPE:  "v"  =  ClipType::AV
ACTION:  "&Clip dupliceren met een verandering van snelheid…"  =  "timewarp;av"
:::: COMPARING ACTIONTYPE:  "av"  =  ClipType::AV
ACTION:  "C&liptaken configureren…"  =  ""
:::: COMPARING ACTIONTYPE:  ""  =  ClipType::AV
=======

The important thing here being (I think!):
MLT: "[consumer sdl2_audio ] SDL failed to open audio"
Comment 2 Jean-Baptiste Mardelle 2025-03-02 19:41:28 UTC
I wonder if this is distro specific, because I never saw this on Ubuntu based distro but can easily reproduce on Manjaro. Will investigate asap.
Comment 3 Jean-Baptiste Mardelle 2025-03-02 20:32:15 UTC
Git commit d0953aa91daf7941a33a4c13fd883763bcfd79b1 by Jean-Baptiste Mardelle.
Committed on 02/03/2025 at 20:31.
Pushed by mardelle into branch 'master'.

Fix audio playback breaks when switching between bin clips
Related to #1963

M  +1    -1    src/monitor/monitor.cpp
M  +20   -6    src/monitor/videowidget.cpp
M  +2    -0    src/monitor/videowidget.h

https://invent.kde.org/multimedia/kdenlive/-/commit/d0953aa91daf7941a33a4c13fd883763bcfd79b1
Comment 4 Jean-Baptiste Mardelle 2025-03-02 20:42:56 UTC
Git commit a57fc2708974c603a9caa58a1c8eadcc367d5f10 by Jean-Baptiste Mardelle.
Committed on 02/03/2025 at 20:40.
Pushed by mardelle into branch 'release/24.12'.

Fix audio playback breaks when switching between bin clips
Related to #1963

M  +1    -1    src/monitor/monitor.cpp
M  +20   -6    src/monitor/videowidget.cpp
M  +2    -0    src/monitor/videowidget.h

https://invent.kde.org/multimedia/kdenlive/-/commit/a57fc2708974c603a9caa58a1c8eadcc367d5f10
Comment 5 Jarno van der Kolk 2025-03-02 22:10:11 UTC
I just compiled Kdenlive with the commit you made to release/24.12 and the issue is gone for me now. Nice!
Comment 6 Daryl Wood 2025-03-03 18:28:32 UTC
Excellent! Thanks for the effort.