I've attached a patch for the Debian cubicsdr-0.2.7+dfsg package which
fixes device enumeration with RTAudio's 6.0 API.

Older versions of the RTAudio API referenced audio devices by their
enumerated index. Version 6.0.0 completely changed the device enumeration
API such that devices are referenced by their integer deviceId instead.
Since index and deviceId are both ints, this weirdly didn't change the
method signature for getDeviceInfo(), so code continued to compile but
didn't actually return valid audio device info.

https://caml.music.mcgill.ca/~gary/rtaudio/probe.html

The Debian package was patched with `rtaudio6.patch` to deal with error
handling API changes, but no patches were applied for device enumeration.

Like the other reports for this issue, the out-of-the-box Trixie package
failed to enumerate my audio devices, though it knew how many audio devices
I had. After rebuilding with this patch, CubicSDR finally enumerates their
details, defaults to the default ALSA output device, and actually lets me
hear demodulated SDR signals. I've also attached the console output showing
that it correctly enumerated six audio devices on my system.

Another comment on this issue suggests a SoapySDR issue as cause and
referenced Ubuntu bug 2098548, and I confirm that `SoapySDRUtil --find`
fails to enumerate audio devices and references this same RTAudio
`getDeviceInfo()` API. However I believe CubicSDR uses SoapySDR for SDR
enumeration, not audio device enumeration. So it may be that the same bug
exists independently in SoapySDR, but it doesn't actually affect CubicSDR.
A quick grep through the SoapySDR 0.8 source didn't turn up direct RTAudio
use, so I'm not sure how they're connected. Other SoapySDR applications
work out of the box on Trixie, including Gqrx.

- DR

-- 
David A. Riggs <[email protected]>
Loading:: configuration file '/home/driggs/.CubicSDR/config.xml'
Loaded 313 rig models via hamlib.

Audio Device #129 Default ALSA Device
        Default Output? Yes
        Default Input? Yes
        Input channels: 64
        Output channels: 64
        Duplex channels: 64
        Native formats:
                16-bit signed integer.
                24-bit signed integer.
                32-bit signed integer.
                32-bit float normalized between plus/minus 1.0.
        Supported sample rates:
                4000hz
                5512hz
                8000hz
                9600hz
                11025hz
                16000hz
                22050hz
                32000hz
                44100hz
                48000hz
                88200hz
                96000hz
                176400hz
                192000hz


Audio Device #130 HD-Audio Generic (HDMI 0)
        Default Output? No
        Default Input? No
        Input channels: 0
        Output channels: 8
        Duplex channels: 0
        Native formats:
                16-bit signed integer.
                32-bit signed integer.
        Supported sample rates:
                32000hz
                44100hz
                48000hz
                88200hz
                96000hz
                176400hz
                192000hz


Audio Device #131 HD-Audio Generic (HDMI 1)
        Default Output? No
        Default Input? No
        Input channels: 0
        Output channels: 2
        Duplex channels: 0
        Native formats:
                16-bit signed integer.
                32-bit signed integer.
        Supported sample rates:
                32000hz
                44100hz
                48000hz
                96000hz


Audio Device #132 HD-Audio Generic (HDMI 2)
        Default Output? No
        Default Input? No
        Input channels: 0
        Output channels: 8
        Duplex channels: 0
        Native formats:
                16-bit signed integer.
                32-bit signed integer.
        Supported sample rates:
                32000hz
                44100hz
                48000hz
                88200hz
                96000hz
                176400hz
                192000hz


Audio Device #133 HD-Audio Generic (ALC257 Analog)
        Default Output? No
        Default Input? No
        Input channels: 2
        Output channels: 2
        Duplex channels: 2
        Native formats:
                16-bit signed integer.
                32-bit signed integer.
        Supported sample rates:
                44100hz
                48000hz


Audio Device #134 acp (DMIC capture dmic-hifi-0)
        Default Output? No
        Default Input? No
        Input channels: 2
        Output channels: 0
        Duplex channels: 0
        Native formats:
                32-bit signed integer.
        Supported sample rates:
                48000hz

SDR enumerator starting.
SoapySDR init..
        API Version: v0.8.0
        ABI Version: v0.8
        Install root: /usr
        Loading modules... 
        Available factories...airspy, audio, bladerf, hackrf, lime, miri, null, 
osmosdr, redpitaya, remote, rfspace, rtlsdr, sdrplay, uhd
Available vertical sync SwapInterval functions: 
        glxSwapIntervalEXT: Yes
        DRI2SwapInterval: No
        glxSwapIntervalMESA: Yes
        glxSwapIntervalSGI: Yes
Using glxSwapIntervalEXT.

Loaded font 'Bitstream Vera Sans Mono' from 
'/usr/share/cubicsdr/fonts/vera_sans_mono12_0.png', parsed 255 characters.
Loaded font 'Bitstream Vera Sans Mono' from 
'/usr/share/cubicsdr/fonts/vera_sans_mono16_0.png', parsed 255 characters.
Loaded font 'Bitstream Vera Sans Mono' from 
'/usr/share/cubicsdr/fonts/vera_sans_mono18_0.png', parsed 255 characters.
Loaded font 'Bitstream Vera Sans Mono' from 
'/usr/share/cubicsdr/fonts/vera_sans_mono24_0.png', parsed 255 characters.
Loaded font 'Bitstream Vera Sans Mono' from 
'/usr/share/cubicsdr/fonts/vera_sans_mono27_0.png', parsed 255 characters.
Loaded font 'Bitstream Vera Sans Mono' from 
'/usr/share/cubicsdr/fonts/vera_sans_mono32_0.png', parsed 255 characters.
Loaded font 'Bitstream Vera Sans Mono' from 
'/usr/share/cubicsdr/fonts/vera_sans_mono36_0.png', parsed 255 characters.
  driver = sdrplay
  label = SDRplay Dev0 RSP1B 240515DF60
  serial = 240515DF60
Make device 0
  sdrplay_api_api_version=3.150000
  sdrplay_api_hw_version=6


Reporting enumeration complete.
SDR enumerator done.
SDR thread starting.
device init()
SDRThread : Device Stream set to MTU: 65536
starting readLoop()

Audio Device #129 Default ALSA Device
        Default Output? Yes
        Default Input? Yes
        Input channels: 64
        Output channels: 64
        Duplex channels: 64
        Native formats:
                16-bit signed integer.
                24-bit signed integer.
                32-bit signed integer.
                32-bit float normalized between plus/minus 1.0.
        Supported sample rates:
                4000hz
                5512hz
                8000hz
                9600hz
                11025hz
                16000hz
                22050hz
                32000hz
                44100hz
                48000hz
                88200hz
                96000hz
                176400hz
                192000hz


Audio Device #130 HD-Audio Generic (HDMI 0)
        Default Output? No
        Default Input? No
        Input channels: 0
        Output channels: 8
        Duplex channels: 0
        Native formats:
                16-bit signed integer.
                32-bit signed integer.
        Supported sample rates:
                32000hz
                44100hz
                48000hz
                88200hz
                96000hz
                176400hz
                192000hz


Audio Device #131 HD-Audio Generic (HDMI 1)
        Default Output? No
        Default Input? No
        Input channels: 0
        Output channels: 2
        Duplex channels: 0
        Native formats:
                16-bit signed integer.
                32-bit signed integer.
        Supported sample rates:
                32000hz
                44100hz
                48000hz
                96000hz


Audio Device #132 HD-Audio Generic (HDMI 2)
        Default Output? No
        Default Input? No
        Input channels: 0
        Output channels: 8
        Duplex channels: 0
        Native formats:
                16-bit signed integer.
                32-bit signed integer.
        Supported sample rates:
                32000hz
                44100hz
                48000hz
                88200hz
                96000hz
                176400hz
                192000hz


Audio Device #133 acp (DMIC capture dmic-hifi-0)
        Default Output? No
        Default Input? No
        Input channels: 2
        Output channels: 0
        Duplex channels: 0
        Native formats:
                32-bit signed integer.
        Supported sample rates:
                48000hz

Terminating SDR thread..
SDRThread::readStream(): 3.1 iqDataOutQueue output queue is full, discard 
processing of the batch...
readLoop() ended.
device deinit()
SDR thread done.
Terminating SDR post-processing thread..
Terminating All Demodulators..
Terminating Visual Processor threads..
Garbage collected demodulator instance '90.500'... 
Application termination complete.
Description: Fix audio device enumeration for RtAudio 6
 RtAudio 6 changed the device enumeration API. Device IDs are no longer
 sequential indices (0, 1, 2...) but arbitrary values returned by
 getDeviceIds(). The getDeviceInfo() function now expects these device
 IDs rather than sequential indices.
 .
 This patch updates the enumeration code to:
  - Use getDeviceIds() to get the list of valid device IDs
  - Use device.ID as the map key instead of a loop counter
 .
 Without this fix, CubicSDR fails to enumerate audio devices on systems
 using RtAudio 6, resulting in no audio output capability.
Author: David Riggs <[email protected]>
Bug-Debian: https://bugs.debian.org/1084177
Forwarded: no
Last-Update: 2026-02-01
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/audio/AudioThread.cpp
+++ b/src/audio/AudioThread.cpp
@@ -246,16 +246,16 @@ static int audioCallback(void *outputBuffer, void * /* inputBuffer */, unsigned
 void AudioThread::enumerateDevices(std::vector<RtAudio::DeviceInfo> &devs) {
     RtAudio endac;

-    unsigned int numDevices = endac.getDeviceCount();
+    std::vector<unsigned int> deviceIds = endac.getDeviceIds();

-    for (unsigned int i = 0; i < numDevices; i++) {
-        RtAudio::DeviceInfo info = endac.getDeviceInfo(i);
+    for (unsigned int deviceId : deviceIds) {
+        RtAudio::DeviceInfo info = endac.getDeviceInfo(deviceId);

         devs.push_back(info);

         std::cout << std::endl;

-        std::cout << "Audio Device #" << i << " " << info.name << std::endl;
+        std::cout << "Audio Device #" << info.ID << " " << info.name << std::endl;
         std::cout << "\tDefault Output? " << (info.isDefaultOutput ? "Yes" : "No") << std::endl;
         std::cout << "\tDefault Input? " << (info.isDefaultInput ? "Yes" : "No") << std::endl;
         std::cout << "\tInput channels: " << info.inputChannels << std::endl;
--- a/src/CubicSDR.cpp
+++ b/src/CubicSDR.cpp
@@ -228,16 +228,13 @@ void CubicSDR::initAudioDevices() const {

     AudioThread::enumerateDevices(devices);

-    int i = 0;
-
     for (auto & device : devices) {
         if (device.inputChannels) {
-            inputDevices[i] = device;
+            inputDevices[device.ID] = device;
         }
         if (device.outputChannels) {
-            outputDevices[i] = device;
+            outputDevices[device.ID] = device;
         }
-        i++;
     }

     wxGetApp().getDemodMgr().setOutputDevices(outputDevices);
--- a/src/ModemProperties.cpp
+++ b/src/ModemProperties.cpp
@@ -58,17 +58,14 @@ void ModemProperties::initDefaultProperties() {
         std::vector<string> outputOptNames;

         AudioThread::enumerateDevices(audioDevices);
-
-        int i = 0;
-
+
         for (const auto& aDev : audioDevices) {
             if (aDev.inputChannels) {
-                audioInputDevices[i] = aDev;
+                audioInputDevices[aDev.ID] = aDev;
             }
             if (aDev.outputChannels) {
-                audioOutputDevices[i] = aDev;
+                audioOutputDevices[aDev.ID] = aDev;
             }
-            i++;
         }

         // int defaultDevice = 0;

Reply via email to