Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Multimedia
  4. Qt6 Qml MediaDevices does not show all audio output devices
Forum Updated to NodeBB v4.3 + New Features

Qt6 Qml MediaDevices does not show all audio output devices

Scheduled Pinned Locked Moved Unsolved Qt Multimedia
1 Posts 1 Posters 36 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fisiu
    wrote last edited by
    #1

    I have very simple player, the most relevant code is:

    PlasmoidItem {
        id: root
    
        MediaDevices {
            id: mediaDevices
        }
    
        AudioOutput {
            id: audioOutput
            volume: 0.75
    
            Component.onCompleted: {
                for (var i = 0; i < mediaDevices.audioOutputs.length; i++) {
                    console.log("Index " + i + ": " + mediaDevices.audioOutputs[i].description)
                }
            }
        }
    
        MediaPlayer {
            id: playMusic
            audioOutput: audioOutput
        }
    }
    

    onCompleted prints:

    qml: Index 0: Jabra Link 380 Analog Stereo
    qml: Index 1: Ryzen HD Audio Controller Analog Stereo
    

    In the same time, when I check devices with pactl list sinks short:

    739     alsa_output.usb-0b0e_Jabra_Link_380_50C2EDC0E492-00.analog-stereo       PipeWire        s16le 2ch 48000Hz       SUSPENDED
    742     alsa_output.pci-0000_0c_00.6.analog-stereo      PipeWire        s32le 2ch 48000Hz       SUSPENDED
    994     bluez_output.98:47:44:7F:97:F0  PipeWire        float32le 2ch 48000Hz   SUSPENDED
    

    And pactl get-default-sink:

    bluez_output.98:47:44:7F:97:F0
    

    I am experiencing issues with audio output selection and routing in a Plasma plasmoid using Qt6.5+. Despite changing the default device in plasma-pa or pavucontrol, the application does not respect these settings consistently.

    As you can see I have 3 audio devices available and bluetooth headphones are set as default.

    1. ffmpeg
      Playback is handled by the Jabra headset (if connected). When the Jabra dongle is removed from the USB port, playback switches to the speakers (line out). Regardless of which device is selected as the default in the audio mixer (plasma-pa or pavucontrol), playback always falls back to a 'some-kind-of-default' device.

    2. gstreamer
      Playback is handled by the Jabra headset (if connected). However, if I switch the default output device in the audio mixer from Bluetooth to Jabra and then back to Bluetooth, the sounds play on the Bluetooth headphones instead. Restarting the plasmoid resets playback back to Jabra. The same issue occurs when the Jabra dongle is disconnected: playback defaults to speakers, but switching the default from Bluetooth to speakers and then back to Bluetooth routes the sounds to the Bluetooth headphones.

    There are actually multiple issues. The most important one is: why doesn't MediaDevices.audioOutputs list all audio devices? Is this a known issue?
    What about not working audio device routing when using the ffmpeg backend? Is it a known issue?
    And last but not least: with the gstreamer backend, playback works, but not immediately after the plasmoid starts — only after switching the default audio device back and forth. Is this a known issue?

    Stack:

    $ kinfo --version
    Operating System: CachyOS Linux 
    KDE Plasma Version: 6.5.4
    KDE Frameworks Version: 6.21.0
    Qt Version: 6.10.1
    Kernel Version: 6.18.3-2-cachyos (64-bit)
    Graphics Platform: X11
    

    Qt Multimedia backend:

    qt.multimedia.ffmpeg: Using Qt multimedia with FFmpeg version n8.0.1 GPL version 3 or later
    

    VS

    qt.multimedia.gstreamer: Using Qt multimedia with GStreamer version: "GStreamer 1.26.10"
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved