From 834f0b09557a607f04f7f78544d80a9ad7aeb268 Mon Sep 17 00:00:00 2001 From: jpka Date: Sun, 31 May 2026 10:51:19 +0300 Subject: [PATCH 1/3] Update alsaloop.c --- alsaloop/alsaloop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alsaloop/alsaloop.c b/alsaloop/alsaloop.c index b9748db5..c4347000 100644 --- a/alsaloop/alsaloop.c +++ b/alsaloop/alsaloop.c @@ -472,11 +472,11 @@ static int parse_config(int argc, char *argv[], snd_output_t *output, break; case 'c': err = atoi(optarg); - arg_channels = err >= 1 && err < 1024 ? err : 1; + arg_channels = err >= 1 && err < SND_PCM_LIMIT_HW_CHANNELS_MAX ? err : 1; break; case 'r': err = atoi(optarg); - arg_rate = err >= 4000 && err < 200000 ? err : 44100; + arg_rate = err >= SND_PCM_LIMIT_HW_RATE_MIN && err < SND_PCM_LIMIT_HW_RATE_MAX ? err : 44100; break; case 'B': err = atoi(optarg); From 0c426278d3a609ee6567cc8118f9bda69bb2b133 Mon Sep 17 00:00:00 2001 From: jpka Date: Sun, 31 May 2026 10:52:18 +0300 Subject: [PATCH 2/3] Update aplay.c --- aplay/aplay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aplay/aplay.c b/aplay/aplay.c index 20fde77d..0ba8d089 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -660,7 +660,7 @@ int main(int argc, char *argv[]) if (tmp < 1000) tmp *= 1000; rhwparams.rate = tmp; - if (tmp < 2000 || tmp > 768000) { + if (tmp < SND_PCM_LIMIT_HW_RATE_MIN || tmp > SND_PCM_LIMIT_HW_RATE_MAX) { error(_("bad speed value %i"), tmp); return 1; } From 9513f1a3673a195a6d26210f2f561fff1a6ba6a3 Mon Sep 17 00:00:00 2001 From: jpka Date: Sun, 31 May 2026 10:53:18 +0300 Subject: [PATCH 3/3] Update speaker-test.c --- speaker-test/speaker-test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/speaker-test/speaker-test.c b/speaker-test/speaker-test.c index b865a00c..88bbd996 100644 --- a/speaker-test/speaker-test.c +++ b/speaker-test/speaker-test.c @@ -1123,13 +1123,13 @@ int main(int argc, char *argv[]) { break; case 'r': rate = atoi(optarg); - rate = rate < 4000 ? 4000 : rate; - rate = rate > 768000 ? 768000 : rate; + rate = rate < SND_PCM_LIMIT_SW_RATE_MIN ? SND_PCM_LIMIT_SW_RATE_MIN : rate; + rate = rate > SND_PCM_LIMIT_SW_RATE_MAX ? SND_PCM_LIMIT_SW_RATE_MAX : rate; break; case 'c': channels = atoi(optarg); channels = channels < 1 ? 1 : channels; - channels = channels > 1024 ? 1024 : channels; + channels = channels > SND_PCM_LIMIT_SW_CHANNELS_MAX ? SND_PCM_LIMIT_SW_CHANNELS_MAX : channels; break; case 'f': freq = atof(optarg);