Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-114846

REG: FFMPEG backend for Qt>=6.5 doesn't output audio on Linux System w/o PulseAudio

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5.0, 6.5.1, 6.5.2, 6.5.3, 6.6.0, 6.6.1, 6.6.2, 6.6.3, 6.7.0 FF, 6.7.0 Beta1, 6.7.0 Beta2, 6.7.0 Beta3, 6.7.1, 6.7.2, 6.8.0 Beta1, 6.8.0 Beta2
    • Multimedia
    • Linux/Wayland, Linux/X11, Linux/Yocto, Linux/Other display system
    • Multimedia Next Next

    Description

      QtMultimedia based QML Audio and Video playback applications that worked correctly on a Linux system (Lubuntu 20.04 based dedicated media server and player) without PulseAudio installed, fail to play back audio when using the default FFMPEG backend introduced in Qt6.5.0, 6.5.1 and 6.6.0.

      Formerly, with the gstreamer-based backend used for Qt5.15-Qt6.4.x, these apps played back successfully on this pulse-audio-less system using ALSA alone, with an asoundrc profile that sets the ALSA default and sysdefault device to a specific soundcard and device such that gst-play-1.0 "just works" as do gstreamer based Qt5 and Qt6 apps for versions <6.5.

      Now, with 6.5.0, 6.5.1, and 6.6.0, when using the default FFMPEG backend, no audio is output no matter what. An error message suggests the problem is that the FFMPEG backend expects pulseaudio but doesn't find it:

      PulseAudioService: pa_context_connect() failed
      

      The source code indicates an ALSA backend exists under directory

      6.6.0/Src/qtmultimedia/src/multimedia/alsa

      however there is no clear way (e.g. environment variable) to force ALSA to be invoked over the default pulseaudio service at

      6.6.0/Src/qtmultimedia/src/multimedia/pulseaudio

       

      The only solution to get audio working  with Qt>=6.5 on a Linux system without pulseaudio is to force the gstreamer backend via environment variable:

      QT_MEDIA_BACKEND=gstreamer
      

      With this environment variable forcing the gstreamer backend, audio playback works again on a pulseaudio-less Linux system using only ALSA.

      IMHO, the new ffmpeg media backend should not just abort with a warning on missing pulseaudio, but should then fall-back to use ALSA directly, which is what gstreamer already does.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            artemiy Artem Dyomin
            nielsmayer Niels Mayer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes