Kdenlive Audio Stops Working - "SDL Failed to Open Audio" & ALSA Underrun Issues

System info

Name : kdenlive
Version : 24.12.2-1

❱inxi -b
System:
Host: greg-venusseries Kernel: 6.13.1-2-MANJARO arch: x86_64 bits: 64
Desktop: KDE Plasma v: 6.2.5 Distro: Manjaro Linux
Machine:
Type: Desktop System: Micro (HK) Tech product: Venus Series v: N/A
serial:
Mobo: Shenzhen Meigao Equipment model: AHWSA serial:
UEFI: American Megatrends LLC. v: AHWSA.1.22 date: 03/12/2024
CPU:
Info: 14-core (6-mt/8-st) 13th Gen Intel Core i9-13900H [MST AMCP]
speed (MHz): avg: 400 min/max: 400/5200:5400:4100
Graphics:
Device-1: Intel Raptor Lake-P [Iris Xe Graphics] driver: i915 v: kernel
Display: x11 server: X.Org v: 21.1.15 with: Xwayland v: 24.1.5 driver: X:
loaded: modesetting dri: iris gpu: i915 resolution: 3840x2160~60Hz
API: OpenGL v: 4.6 compat-v: 4.5 vendor: intel mesa v: 24.3.4-arch1.1
renderer: Mesa Intel Iris Xe Graphics (RPL-P)
Info: Tools: api: clinfo, eglinfo, glxinfo, vulkaninfo
de: kscreen-console,kscreen-doctor wl: wayland-info
x11: xdpyinfo, xprop, xrandr
Network:
Device-1: Intel Ethernet I226-V driver: igc
Device-2: MEDIATEK MT7922 802.11ax PCI Express Wireless Network Adapter
driver: mt7921e
Drives:
Local Storage: total: 1.84 TiB used: 269.66 GiB (14.3%)
Info:
Memory: total: 32 GiB note: est. available: 31.07 GiB used: 7.52 GiB (24.2%)
Processes: 418 Uptime: 1d 1h 7m Shell: fish inxi: 3.3.37

I’m running Kdenlive on Manjaro KDE and experiencing a recurring issue where all sound output stops after a while. Initially, everything works fine, and I can see SDL Application: Audio Stream in my desktop audio settings. However, after some time, audio cuts out, and SDL Application: Audio Stream disappears entirely. Nothing i do can get it working again except to restart kdenlive.

Running Kdenlive from the terminal gives repeated errors:

MLT: "[consumer sdl2_audio ] SDL failed to open audio"
ALSA lib pcm.c:8772:(snd_pcm_recover) underrun occurred
ERROR: ALSA: period size = 1024, periods = 2, buffer size = 2048
MLT: "[consumer sdl2_audio ] SDL failed to open audio"
pos:  412 out:  624
MLT: "[consumer sdl2_audio ] SDL failed to open audio"
pos:  442 out:  624
MLT: "[consumer sdl2_audio ] SDL failed to open audio"
pos:  497 out:  624
MLT: "[consumer sdl2_audio ] SDL failed to open audio"
pos:  530 out:  624
MLT: "[consumer sdl2_audio ] SDL failed to open audio"
pos:  582 out:  624

I’ve tried different environment variables to force ALSA, PulseAudio, and JACK:

KDENLIVE_AUDIO_BACKEND=alsa SDL_AUDIODRIVER=alsa kdenlive
KDENLIVE_AUDIO_BACKEND=jack kdenlive

But the issue persists regardless of backend. Even switching to JACK (after installing jack2 and qjackctl) didn’t resolve the issue, and the errors still appear.

Things I’ve Tried:

  • Increasing ALSA buffer size (ALSA_PCM_BUFFER_SIZE=8192)
  • Setting PipeWire to prevent suspending (session.suspend-timeout 0)
  • Giving Kdenlive real-time priority (chrt -f 99)

Does anyone know a fix or workaround for this? Is there a way to get Kdenlive to properly hold onto the audio stream without it vanishing mid-session?

Thanks in advance!

Is sdl2 or sdl2-compat installed? It is an optional dependency of mlt.

yes sdl2-compat is installed

2 extra/sdl2-compat 2.30.52-1 (400.7 KiB 2.7 MiB) (Installed)
    An SDL2 compatibility layer that uses SDL3 behind the scenes

Im going to post a video of how to reproduce to see if anyone else can reproduce.

If you just load a couple of video clips and simply switch back and forth between them, after a very short while the SDL Application: Audio Stream disappears and will never come back until you restart kdenlive.

Watch the left-hand side at the bottom (the sound setting window behind kdenlive). watch SDL Application: Audio Stream.

Try the real sdl2 (AUR (en) - sdl2). It has been dropped to AUR recently. Or use the official AppImage: https://download.kde.org/stable/kdenlive/24.12/linux/kdenlive-24.12.2-x86_64.AppImage which should include sdl2.

2 Likes

Audio muting while using Kdenlive - #6 by Ron - Help - KDE Discuss

the OP confirmed the problem went away when they stopped using the Arch package … and the people here don’t maintain the Arch package.

If you have this problem with the Appimage, it’s something we should investigate. If you don’t you’ll need to talk to the Arch packager (or just use the Appimage …)

$ pamac info kdenlive
Name                  : kdenlive
Version               : 24.12.2-1

Packager              : Antonio Rojas <arojas@archlinux.org>

ah ha, well done :smile:

Yes the removal and install of
Packages (2) sdl2-compat-2.30.52-1 [removal] sdl2-2.32.0-1

from the AUR has worked.

I now don’t get the SDL Application: Audio Stream at all.

I now get the kdenlive audio stream in the sound output settings and it works properly without crashing!

EDIT: @nikgnomic

Im already using the official package

1 extra/kdenlive 24.12.2-1 (17.5 MiB 75.8 MiB) [kde-applications kde-multimedia] (Installed)
    A non-linear video editor for Linux using the MLT video framework

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.