return input_mapping;
}
+void AudioMixer::set_extra_devices(const set<DeviceSpec> &devices)
+{
+ lock_guard<timed_mutex> lock(audio_mutex);
+ extra_devices = devices;
+ for (unsigned card_index = 0; card_index < MAX_ALSA_CARDS; ++card_index) {
+ const DeviceSpec device_spec{InputSourceType::ALSA_INPUT, card_index};
+ start_or_stop_alsa_capture(device_spec);
+ }
+}
+
unsigned AudioMixer::num_buses() const
{
lock_guard<timed_mutex> lock(audio_mutex);
assert(device_spec.type == InputSourceType::ALSA_INPUT);
AudioDevice *device = find_audio_device(device_spec);
bool previously_held = alsa_pool.device_is_held(device_spec.index);
- bool should_be_held = !device->interesting_channels.empty();
+ bool should_be_held = !device->interesting_channels.empty() || extra_devices.count(device_spec);
if (should_be_held) {
alsa_pool.hold_device(device_spec.index);
} else {