* [PATCH] ALSA: usb-audio: tidy up the AF16Rig quirks
@ 2026-03-28 16:02 Phil Willoughby
2026-03-29 9:06 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Phil Willoughby @ 2026-03-28 16:02 UTC (permalink / raw)
To: linux-sound; +Cc: Phil Willoughby, Jaroslav Kysela, Takashi Iwai
Use macros to make the AF16Rig quirk table smaller.
Add a disabled block containing the theoretical quirks for the other
clock sources that the AF16Rig has. It's disabled because I cannot test
it.
Tested-By: Phil Willoughby <willerz@gmail.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Signed-off-by: Phil Willoughby <willerz@gmail.com>
---
sound/usb/quirks-table.h | 200 ++++++++++-----------------------------
1 file changed, 50 insertions(+), 150 deletions(-)
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index 8f79a15055a6..b6dfe3b63c67 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -3900,6 +3900,44 @@ YAMAHA_DEVICE(0x7010, "UB99"),
QUIRK_RME_DIGIFACE(0x3f8c),
QUIRK_RME_DIGIFACE(0x3fa0),
+#define QUIRK_AF16RIG(channel_count_, alt_setting_, \
+ low_rate_, high_rate_, pack_size_, \
+ clock_, interface_, endpoint_) \
+ { \
+ QUIRK_DATA_AUDIOFORMAT(interface_) { \
+ .formats = SNDRV_PCM_FMTBIT_S32_LE, \
+ .channels = channel_count_, \
+ .fmt_type = UAC_FORMAT_TYPE_I_PCM, \
+ .fmt_bits = 24, \
+ .fmt_sz = 4, \
+ .iface = interface_, \
+ .altsetting = alt_setting_, \
+ .altset_idx = alt_setting_, \
+ .endpoint = endpoint_, \
+ .ep_attr = USB_ENDPOINT_XFER_ISOC | \
+ USB_ENDPOINT_SYNC_ASYNC, \
+ .datainterval = 1, \
+ .protocol = UAC_VERSION_2, \
+ .maxpacksize = pack_size_, \
+ .rates = SNDRV_PCM_RATE_##low_rate_ | \
+ SNDRV_PCM_RATE_##high_rate_, \
+ .rate_min = low_rate_, \
+ .rate_max = high_rate_, \
+ .nr_rates = 2, \
+ .rate_table = (unsigned int[]) { \
+ low_rate_, high_rate_ }, \
+ .clock = clock_, \
+ } \
+ }
+
+#define QUIRK_AF16RIG_CLOCK(clock) \
+ QUIRK_AF16RIG(34, 1, 44100, 48000, 0x3b8, clock, 1, 0x01), \
+ QUIRK_AF16RIG(34, 1, 44100, 48000, 0x3b8, clock, 2, 0x81), \
+ QUIRK_AF16RIG(18, 2, 88200, 96000, 0x3a8, clock, 1, 0x01), \
+ QUIRK_AF16RIG(18, 2, 88200, 96000, 0x3a8, clock, 2, 0x81), \
+ QUIRK_AF16RIG(10, 3, 176400, 192000, 0x3e8, clock, 1, 0x01), \
+ QUIRK_AF16RIG(10, 3, 176400, 192000, 0x3e8, clock, 2, 0x81)
+
/* Arturia AudioFuse 16Rig Audio */
/* AF16Rig MIDI has USB PID 0xaf21 and appears to work OK without quirks */
{
@@ -3909,161 +3947,23 @@ QUIRK_RME_DIGIFACE(0x3fa0),
.product_name = "AF16Rig",
QUIRK_DATA_COMPOSITE {
{ QUIRK_DATA_STANDARD_MIXER(0) },
- {
- QUIRK_DATA_AUDIOFORMAT(1) { /* Playback */
- .formats = SNDRV_PCM_FMTBIT_S32_LE,
- .channels = 34,
- .fmt_type = UAC_FORMAT_TYPE_I_PCM,
- .fmt_bits = 24,
- .fmt_sz = 4,
- .iface = 1,
- .altsetting = 1,
- .altset_idx = 1,
- .endpoint = 0x01,
- .ep_attr = USB_ENDPOINT_XFER_ISOC|
- USB_ENDPOINT_SYNC_ASYNC,
- .datainterval = 1,
- .protocol = UAC_VERSION_2,
- .maxpacksize = 0x03b8,
- .rates = SNDRV_PCM_RATE_44100|
- SNDRV_PCM_RATE_48000,
- .rate_min = 44100,
- .rate_max = 48000,
- .nr_rates = 2,
- .rate_table = (unsigned int[]) { 44100, 48000 },
- .clock = 41,
- }
- },
- {
- QUIRK_DATA_AUDIOFORMAT(1) { /* Playback */
- .formats = SNDRV_PCM_FMTBIT_S32_LE,
- .channels = 18,
- .fmt_type = UAC_FORMAT_TYPE_I_PCM,
- .fmt_bits = 24,
- .fmt_sz = 4,
- .iface = 1,
- .altsetting = 1,
- .altset_idx = 1,
- .endpoint = 0x01,
- .ep_attr = USB_ENDPOINT_XFER_ISOC|
- USB_ENDPOINT_SYNC_ASYNC,
- .datainterval = 1,
- .protocol = UAC_VERSION_2,
- .maxpacksize = 0x03a8,
- .rates = SNDRV_PCM_RATE_88200|
- SNDRV_PCM_RATE_96000,
- .rate_min = 88200,
- .rate_max = 96000,
- .nr_rates = 2,
- .rate_table = (unsigned int[]) { 88200, 96000 },
- .clock = 41,
- }
- },
- {
- QUIRK_DATA_AUDIOFORMAT(1) { /* Playback */
- .formats = SNDRV_PCM_FMTBIT_S32_LE,
- .channels = 10,
- .fmt_type = UAC_FORMAT_TYPE_I_PCM,
- .fmt_bits = 24,
- .fmt_sz = 4,
- .iface = 1,
- .altsetting = 3,
- .altset_idx = 3,
- .endpoint = 0x01,
- .ep_attr = USB_ENDPOINT_XFER_ISOC|
- USB_ENDPOINT_SYNC_ASYNC,
- .datainterval = 1,
- .protocol = UAC_VERSION_2,
- .maxpacksize = 0x03e8,
- .rates = SNDRV_PCM_RATE_176400|
- SNDRV_PCM_RATE_192000,
- .rate_min = 176400,
- .rate_max = 192000,
- .nr_rates = 2,
- .rate_table = (unsigned int[]) { 176400, 192000 },
- .clock = 41,
- }
- },
- {
- QUIRK_DATA_AUDIOFORMAT(2) { /* Capture */
- .formats = SNDRV_PCM_FMTBIT_S32_LE,
- .channels = 34,
- .fmt_type = UAC_FORMAT_TYPE_I_PCM,
- .fmt_bits = 24,
- .fmt_sz = 4,
- .iface = 2,
- .altsetting = 1,
- .altset_idx = 1,
- .endpoint = 0x81,
- .ep_attr = USB_ENDPOINT_XFER_ISOC|
- USB_ENDPOINT_SYNC_ASYNC,
- .datainterval = 1,
- .protocol = UAC_VERSION_2,
- .maxpacksize = 0x03b8,
- .rates = SNDRV_PCM_RATE_44100|
- SNDRV_PCM_RATE_48000,
- .rate_min = 44100,
- .rate_max = 48000,
- .nr_rates = 2,
- .rate_table = (unsigned int[]) { 44100, 48000 },
- .clock = 41,
- }
- },
- {
- QUIRK_DATA_AUDIOFORMAT(2) { /* Capture */
- .formats = SNDRV_PCM_FMTBIT_S32_LE,
- .channels = 18,
- .fmt_type = UAC_FORMAT_TYPE_I_PCM,
- .fmt_bits = 24,
- .fmt_sz = 4,
- .iface = 2,
- .altsetting = 2,
- .altset_idx = 2,
- .endpoint = 0x81,
- .ep_attr = USB_ENDPOINT_XFER_ISOC|
- USB_ENDPOINT_SYNC_ASYNC,
- .datainterval = 1,
- .protocol = UAC_VERSION_2,
- .maxpacksize = 0x03a8,
- .rates = SNDRV_PCM_RATE_88200|
- SNDRV_PCM_RATE_96000,
- .rate_min = 88200,
- .rate_max = 96000,
- .nr_rates = 2,
- .rate_table = (unsigned int[]) { 88200, 96000 },
- .clock = 41,
- }
- },
- {
- QUIRK_DATA_AUDIOFORMAT(2) { /* Capture */
- .formats = SNDRV_PCM_FMTBIT_S32_LE,
- .channels = 10,
- .fmt_type = UAC_FORMAT_TYPE_I_PCM,
- .fmt_bits = 24,
- .fmt_sz = 4,
- .iface = 2,
- .altsetting = 3,
- .altset_idx = 3,
- .endpoint = 0x81,
- .ep_attr = USB_ENDPOINT_XFER_ISOC|
- USB_ENDPOINT_SYNC_ASYNC,
- .datainterval = 1,
- .protocol = UAC_VERSION_2,
- .maxpacksize = 0x03e8,
- .rates = SNDRV_PCM_RATE_176400|
- SNDRV_PCM_RATE_192000,
- .rate_min = 176400,
- .rate_max = 192000,
- .nr_rates = 2,
- .rate_table = (unsigned int[]) { 176400, 192000 },
- .clock = 41,
- }
- },
+ QUIRK_AF16RIG_CLOCK(41), /* Internal clock */
+#if 0
+/* These are disabled because I don't have the required hardware to test
+ * them. I suspect that the ADAT clock might not follow 176400 or 192000
+ * because the AF16Rig won't accept ADAT audio data at those rates.
+ */
+ QUIRK_AF16RIG_CLOCK(43), /* ADAT clock */
+ QUIRK_AF16RIG_CLOCK(44), /* BNC word clock */
+#endif
{ QUIRK_DATA_IGNORE(3) }, /* Firmware update */
QUIRK_COMPOSITE_END
}
}
},
+#undef QUIRK_AF16RIG_CLOCK
+#undef QUIRK_AF16RIG
+
#undef USB_DEVICE_VENDOR_SPEC
#undef USB_AUDIO_DEVICE
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] ALSA: usb-audio: tidy up the AF16Rig quirks
2026-03-28 16:02 [PATCH] ALSA: usb-audio: tidy up the AF16Rig quirks Phil Willoughby
@ 2026-03-29 9:06 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2026-03-29 9:06 UTC (permalink / raw)
To: Phil Willoughby; +Cc: linux-sound, Jaroslav Kysela, Takashi Iwai
On Sat, 28 Mar 2026 17:02:58 +0100,
Phil Willoughby wrote:
>
> Use macros to make the AF16Rig quirk table smaller.
>
> Add a disabled block containing the theoretical quirks for the other
> clock sources that the AF16Rig has. It's disabled because I cannot test
> it.
>
> Tested-By: Phil Willoughby <willerz@gmail.com>
> Cc: Jaroslav Kysela <perex@perex.cz>
> Cc: Takashi Iwai <tiwai@suse.com>
> Signed-off-by: Phil Willoughby <willerz@gmail.com>
Applied now to for-next branch.
thanks,
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-29 9:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-28 16:02 [PATCH] ALSA: usb-audio: tidy up the AF16Rig quirks Phil Willoughby
2026-03-29 9:06 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox