ALSA: request device to query its settings

Querying available buffersizes and sample-rates requires access
to the device. Almost all ALSA devices are limited to
a single user-space application so we unconditionally try
to request access to the device.
This commit is contained in:
Robin Gareus 2022-09-12 16:34:25 +02:00
parent 18474d89f8
commit 46deb15d12
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 2 additions and 0 deletions

View File

@ -346,8 +346,10 @@ AlsaAudioBackend::set_input_device_name (const std::string& d)
_input_audio_device_info.valid = false;
return 1;
}
_device_reservation.acquire_device (alsa_device.c_str ());
/* device will be busy once used, hence cache the parameters */
/* return */ get_alsa_device_parameters (alsa_device.c_str (), false, &_input_audio_device_info);
_device_reservation.release_device ();
return 0;
}