[SDL_OpenAudioDevice] : can we open several recordable devices and select /change the used one?

In my software, I would like to mux several video sources with several audio sources.

For example several webcams (including audio capabilities) or one video playing, or rtsp flow.

Currently I can see everything:

SDL2 Window created 
SDL_VERSION_ATLEAST(2,0,9) 1
SDL_VERSION_ATLEAST(2,0,8) 1
SDL_VERSION_ATLEAST(2,0,7) 1
SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE    SDL_VERSION_ATLEAST(2,0,4) = 1
SDL_HAS_WINDOW_ALPHA                SDL_VERSION_ATLEAST(2,0,5) = 1
SDL_HAS_ALWAYS_ON_TOP               SDL_VERSION_ATLEAST(2,0,5) = 1
SDL_HAS_USABLE_DISPLAY_BOUNDS       SDL_VERSION_ATLEAST(2,0,5) = 1
SDL_HAS_PER_MONITOR_DPI             SDL_VERSION_ATLEAST(2,0,4) = 1
SDL_HAS_VULKAN                      SDL_VERSION_ATLEAST(2,0,6) = 1
SDL_HAS_MOUSE_FOCUS_CLICKTHROUGH    SDL_VERSION_ATLEAST(2,0,5) = 1
We compiled against SDL version 2.0.9 ...
And we are linking against SDL version 2.0.9.
OpenGL version: 4.6 (Core Profile) Mesa 20.1.0-devel (git-c38946e62d)
GLSL version: 4.60
Vendor: Intel Open Source Technology Center
Renderer: Mesa DRI Intel(R) UHD Graphics 620 (WHL GT2)
Audio device (no recording capability)   0: HDA Intel PCH, ALC293 Analog
Audio device (with recording capability) 0: HDA Intel PCH, ALC293 Analog
Audio device (no recording capability)   1: HDA Intel PCH, HDMI 0
Audio device (with recording capability) 1: HD Pro Webcam C920, USB Audio
Audio device (no recording capability)   2: HDA Intel PCH, HDMI 1
Audio device (with recording capability) 2: BRIO 4K Stream Edition, USB Audio
Audio device (no recording capability)   3: HDA Intel PCH, HDMI 2
Audio device (with recording capability) 3: (null)
Audio device (no recording capability)   4: HDA Intel PCH, HDMI 3
Audio device (with recording capability) 4: (null)
Audio device (no recording capability)   5: HDA Intel PCH, HDMI 4
Audio device (with recording capability) 5: (null)
Audio device (no recording capability)   6: (null)
Audio device (with recording capability) 6: (null)
Audio device (no recording capability)   7: (null)
Audio device (with recording capability) 7: (null)
Found Audio device (with recording capability) device number : 0 name : HDA Intel PCH, ALC293 Analog
Audio device (with recording capability) device number : 1 name : HD Pro Webcam C920, USB Audio
Audio device (with recording capability) device number : 2 name : BRIO 4K Stream Edition, USB Audio
3 recordable audio devices.
Number of Audio devices (with recording capability) 3 
Audio driver name :  alsa 
io =  0x560602973b78
style =  0x5606029751b8
Viewport enabled 

My question is about select one recording device, and be able to select another on in runtime.

Currently, I’m able to select one, and change as shown in the log below:

Requested device : 0
Previous device index was : 0 with name : HDA Intel PCH, ALC293 Analog
Current status for previous device is : stopped
New device requested : 0
status of the requested device  : stopped
currentRecordableAudioDevice is now : HDA Intel PCH, ALC293 Analog
Current status for new device is : stopped



Requested device : 1
Previous device index was : 0 with name : HDA Intel PCH, ALC293 Analog
Current status for previous device is : stopped
New device requested : 1
status of the requested device  : stopped
currentRecordableAudioDevice is now : HD Pro Webcam C920, USB Audio
Current status for new device is : stopped



Requested device : 1
Previous device index was : 0 with name : HDA Intel PCH, ALC293 Analog
Current status for previous device is : stopped
New device requested : 1
status of the requested device  : stopped
currentRecordableAudioDevice is now : HD Pro Webcam C920, USB Audio
Current status for new device is : stopped

I think I start to see how make it work, but I prefer ask, to be sure :slight_smile:

My questions:

  1. does SDL2 allow to open several record-able Audio devices (already identified) e.g. at launch time (during initialization), open and set every of them as “paused” ? (current status is stopped)

  2. on demand; set any of them as paused / recording , to be able to record and mix any audio source with any video source, to record them in runtime ? More precisely : record ONLY one at the same time

Thanks in advance for any help, or advice :slight_smile:

Nobody can confirm it is possible … or not ?