linux-sound.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: Allow Focusrite devices to use low samplerates
@ 2025-09-01  9:20 Tina Wuest
  2025-09-01 11:15 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Tina Wuest @ 2025-09-01  9:20 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela, linux-sound; +Cc: Tina Wuest

Commit 05f254a6369ac020fc0382a7cbd3ef64ad997c92 ("ALSA: usb-audio:
Improve filtering of sample rates on Focusrite devices") changed the
check for max_rate in a way which was overly restrictive, forcing
devices to use very high samplerates if they support them, despite
support existing for lower rates as well.

This maintains the intended outcome (ensuring samplerates selected are
supported) while allowing devices with higher maximum samplerates to be
opened at all supported samplerates.

This patch was tested with a Clarett+ 8Pre USB

Signed-off-by: Tina Wuest <tina@wuest.me>
---
 sound/usb/format.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/sound/usb/format.c b/sound/usb/format.c
index 0ee532acbb60..ec95a063beb1 100644
--- a/sound/usb/format.c
+++ b/sound/usb/format.c
@@ -327,12 +327,16 @@ static bool focusrite_valid_sample_rate(struct snd_usb_audio *chip,
 		max_rate = combine_quad(&fmt[6]);
 
 		switch (max_rate) {
+		case 192000:
+			if (rate == 176400 || rate == 192000)
+				return true;
+			fallthrough;
+		case 96000:
+			if (rate == 88200 || rate == 96000)
+				return true;
+			fallthrough;
 		case 48000:
 			return (rate == 44100 || rate == 48000);
-		case 96000:
-			return (rate == 88200 || rate == 96000);
-		case 192000:
-			return (rate == 176400 || rate == 192000);
 		default:
 			usb_audio_info(chip,
 				"%u:%d : unexpected max rate: %u\n",
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ALSA: Allow Focusrite devices to use low samplerates
  2025-09-01  9:20 [PATCH] ALSA: Allow Focusrite devices to use low samplerates Tina Wuest
@ 2025-09-01 11:15 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2025-09-01 11:15 UTC (permalink / raw)
  To: Tina Wuest; +Cc: Takashi Iwai, Jaroslav Kysela, linux-sound

On Mon, 01 Sep 2025 11:20:24 +0200,
Tina Wuest wrote:
> 
> Commit 05f254a6369ac020fc0382a7cbd3ef64ad997c92 ("ALSA: usb-audio:
> Improve filtering of sample rates on Focusrite devices") changed the
> check for max_rate in a way which was overly restrictive, forcing
> devices to use very high samplerates if they support them, despite
> support existing for lower rates as well.
> 
> This maintains the intended outcome (ensuring samplerates selected are
> supported) while allowing devices with higher maximum samplerates to be
> opened at all supported samplerates.
> 
> This patch was tested with a Clarett+ 8Pre USB
> 
> Signed-off-by: Tina Wuest <tina@wuest.me>

Applied now.  Thanks.


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-09-01 11:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-01  9:20 [PATCH] ALSA: Allow Focusrite devices to use low samplerates Tina Wuest
2025-09-01 11:15 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).