https://bugs.kde.org/show_bug.cgi?id=520590

            Bug ID: 520590
           Summary: [plasma-camera] No audio devices found for recording
                    on Wayland/PipeWire with Qt 6.10
    Classification: Applications
           Product: Kamera
      Version First unspecified
       Reported In:
          Platform: Ubuntu
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: General
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

---
Version: plasma-camera 2.1.1-2build1
System: Ubuntu 26.04, KDE Plasma, Wayland, PipeWire
Qt: 6.10.2
---

I published this bug here since I couldn't find the category for the
plasma-camera application anywhere

Bug:
plasma-camera reports "No audio devices found for recording" even though
PipeWire correctly exposes audio input devices via Qt Multimedia.

Steps to reproduce:
simply open plasma-camera, register a video and open the generated video file.
There will be no audio.

Root cause in `plasmacameramanager.cpp`, `findAndSetDefaultRecordingDevice()`:

```cpp
    for (const QAudioDevice &device : QMediaDevices::audioInputs()) {
        if (device.isDefault() && device.mode() == QAudioDevice::Input) {
            audioDevice = device;
        }
    }
```

Qt Multimedia lists the devices correctly (confirmed via QT_LOGGING_RULES),
but device.isDefault() returns false for all devices under Qt 6.10 + PipeWire,
so audioDevice remains null and recording fails.

Additionally: the .desktop file is missing from the package, causing portal
registration to fail ("App info not found for 'org.kde.plasma-camera'").
Workaround: plasma-camera --desktop-file-name=org.kde.plasma-camera

Fix for the audio bug:

```cpp
    for (const QAudioDevice &device : QMediaDevices::audioInputs()) {
        if (device.isDefault()) {
            audioDevice = device;
            break;
        }
    }
    if (audioDevice.isNull() && !QMediaDevices::audioInputs().isEmpty()) {
        audioDevice = QMediaDevices::audioInputs().first();
    }
```

With this fix applied and recompiled, audio recording works correctly.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to