From 3f483f61fc6024b170d3cfc215b0460236647868 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 14 Nov 2021 17:50:34 +1000 Subject: [PATCH 1/2] ALSA: Fix enumeration of devices that support playback and capture. It looks like IOID will be null when both modes are supported. Public issue https://github.com/mackron/miniaudio/issues/365 --- miniaudio.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/miniaudio.h b/miniaudio.h index b5ae38f6..bd8a2845 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -20392,10 +20392,11 @@ static ma_result ma_context_enumerate_devices__alsa(ma_context* pContext, ma_enu /* Some devices are both playback and capture, but they are only enumerated by ALSA once. We need to fire the callback - again for the other device type in this case. We do this for known devices. + again for the other device type in this case. We do this for known devices and where the IOID hint is NULL, which + means both Input and Output. */ if (cbResult) { - if (ma_is_common_device_name__alsa(NAME)) { + if (ma_is_common_device_name__alsa(NAME) || IOID == NULL) { if (deviceType == ma_device_type_playback) { if (!ma_is_capture_device_blacklisted__alsa(NAME)) { cbResult = callback(pContext, ma_device_type_capture, &deviceInfo, pUserData); @@ -69441,6 +69442,7 @@ REVISION HISTORY ================ v0.10.43 - TBD - ALSA: Fix use of uninitialized variables + - ALSA: Fix enumeration of devices that support both playback capture. v0.10.42 - 2021-08-22 - Fix a possible deadlock when stopping devices. From c221402e9cae214c0d623a83b7f986e14e8bf896 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 14 Nov 2021 17:50:53 +1000 Subject: [PATCH 2/2] Update revision history. --- miniaudio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miniaudio.h b/miniaudio.h index bd8a2845..e38325da 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -69442,7 +69442,7 @@ REVISION HISTORY ================ v0.10.43 - TBD - ALSA: Fix use of uninitialized variables - - ALSA: Fix enumeration of devices that support both playback capture. + - ALSA: Fix enumeration of devices that support both playback and capture. v0.10.42 - 2021-08-22 - Fix a possible deadlock when stopping devices.