Revise device configuration logic and settings
The ALSA device scanner no longer inserts default sample rates when it cannot read them, preventing invalid frequency choices Jack server settings now accept independent input and output devices during construction The latency test utility was updated to handle separate input and output device parameters and display them accordingly The help text for the latency tool documents the new usage with optional output device specification Device lists in the configuration dialog are sorted to prefer devices supporting capture and playback, then USB devices, while refresh preserves existing selections
This commit is contained in:
+13
-20
@@ -119,21 +119,10 @@ std::vector<AlsaDeviceInfo> PiPedalAlsaDevices::GetAlsaDevices()
|
||||
int dir;
|
||||
|
||||
err = snd_pcm_hw_params_get_rate_min(params, &minRate, &dir);
|
||||
if (err != 0)
|
||||
if (err == 0)
|
||||
{
|
||||
Lv2Log::warning(SS("Failed to get minimum sample rate for device '" << info.name_ << "'. Using default 48000."));
|
||||
info.sampleRates_.push_back(48000);
|
||||
err = 0; // continue using fallback rate
|
||||
}
|
||||
else
|
||||
{
|
||||
int err2 = snd_pcm_hw_params_get_rate_max(params, &maxRate, &dir);
|
||||
if (err2 != 0)
|
||||
{
|
||||
Lv2Log::warning(SS("Failed to get maximum sample rate for device '" << info.name_ << "'. Using default 48000."));
|
||||
info.sampleRates_.push_back(48000);
|
||||
}
|
||||
else
|
||||
int err2 = snd_pcm_hw_params_get_rate_max(params, &maxRate, &dir);
|
||||
if (err2 == 0)
|
||||
{
|
||||
for (size_t i = 0; i < sizeof(RATES) / sizeof(RATES[0]); ++i)
|
||||
{
|
||||
@@ -142,14 +131,18 @@ std::vector<AlsaDeviceInfo> PiPedalAlsaDevices::GetAlsaDevices()
|
||||
{
|
||||
info.sampleRates_.push_back(rate);
|
||||
}
|
||||
}
|
||||
if (info.sampleRates_.empty())
|
||||
{
|
||||
Lv2Log::warning(SS("No supported sample rates for device '" << info.name_ << "'. Using default 48000."));
|
||||
info.sampleRates_.push_back(48000);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Lv2Log::warning(SS("Failed to get maximum sample rate for device '" << info.name_ << "'."));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Lv2Log::warning(SS("Failed to get minimum sample rate for device '" << info.name_ << "'."));
|
||||
err = 0; // continue using fallback rate for other parameters
|
||||
}
|
||||
|
||||
err = snd_pcm_hw_params_get_buffer_size_min(params, &minBufferSize);
|
||||
if (err == 0)
|
||||
|
||||
Reference in New Issue
Block a user