Skip to contentSkip to conversation

ALSA: usb-audio: Add quirks for Arturia AF16Rig

PATCH Applied Phil Willoughby 2 participants 3 messages Mar 28 Sound

lore
Share & tools
lore
Applied
#1 lore raw
In reply to Phil Willoughby
Quoted 13 lines · Phil Willoughby

The AF16Rig supports 34 channels at 44.1k/48k, 18 channels at 88.2k/96k and 10 channels at 176.4k/192k.

This quirks is necessary because the automatic probing process we would otherwise use fails. The root cause of that is that the AF16Rig clock is not readable (its descriptor says that it is but the reads fail).

Except as described below, the values in the audio format quirks were copied from the USB descriptors of the device. The rate information is from the datasheet of the device. The clock is the internal clock of the AF16Rig.

Quoted 6 lines

I have tested all the configurations enabled by this patch.

Cc Jaroslav Kysela <[email protected]>
Cc Takashi Iwai <[email protected]>

Thanks, applied to for-next branch now.

Quoted 10 lines

---
Thank you all for your time and considered feedback.

There are two other clock sources the AF16Rig can use: an ADAT clock and a BNC word clock. In theory the correct support for those would be copies of these audioformat quirks with the clock changed to 43 (ADAT) or 44 (BNC). The reason that I did not include those quirks in this patch is that I cannot test them (because I do not have any other device that can act as an ADAT or BNC clock source).

Quoted 3 lines

I think that what I want to do is:
1. Macro-ise these quirks so the common stuff isn't repeated as much. This will be v5 of this patch.

This could be a good cleanup, yes. You can submit as an incremental cleanup.

Quoted 6 lines

Then a separate patch where I:
2. Add the external clock quirks and locally test that it doesn't break anything for people who don't have the external clocks
3. Wrap the external clock quirks in #if 0 and a comment that they are disabled because they haven't been tested.
4. This will be marked signed-off but not tested-by me.

Hm, a better approach would be rather a creation of a mixer element to switch the clock source, I suppose. But it'll be more complex, of course.

thanks,

Takashi

#0 lore raw

PATCH v4 1/1 ALSA: usb-audio: Add quirks for Arturia AF16Rig

The AF16Rig supports 34 channels at 44.1k/48k, 18 channels at 88.2k/96k and 10 channels at 176.4k/192k.

This quirks is necessary because the automatic probing process we would otherwise use fails. The root cause of that is that the AF16Rig clock is not readable (its descriptor says that it is but the reads fail).

Except as described below, the values in the audio format quirks were copied from the USB descriptors of the device. The rate information is from the datasheet of the device. The clock is the internal clock of the AF16Rig.

I have tested all the configurations enabled by this patch.

Cc Jaroslav Kysela <[email protected]>
Cc Takashi Iwai <[email protected]>

---
Thank you all for your time and considered feedback.

There are two other clock sources the AF16Rig can use: an ADAT clock and a BNC word clock. In theory the correct support for those would be copies of these audioformat quirks with the clock changed to 43 (ADAT) or 44 (BNC). The reason that I did not include those quirks in this patch is that I cannot test them (because I do not have any other device that can act as an ADAT or BNC clock source).

I think that what I want to do is:
1. Macro-ise these quirks so the common stuff isn't repeated as much. This will be v5 of this patch.

Then a separate patch where I:
2. Add the external clock quirks and locally test that it doesn't break anything for people who don't have the external clocks
3. Wrap the external clock quirks in #if 0 and a comment that they are disabled because they haven't been tested.
4. This will be marked signed-off but not tested-by me.

 sound/usb/quirks-table.h | 165 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 165 insertions(+)
sound/usb/quirks-table.h +165 -0
index eafc0d73cca1..8f79a15055a6 100644
@@ -3900,5 +3900,170 @@ YAMAHA_DEVICE(0x7010, "UB99"),
 QUIRK_RME_DIGIFACE(0x3f8c),
 QUIRK_RME_DIGIFACE(0x3fa0),
 
+/* Arturia AudioFuse 16Rig Audio */
+/* AF16Rig MIDI has USB PID 0xaf21 and appears to work OK without quirks */
+{
+	USB_DEVICE(0x1c75, 0xaf20),
+	QUIRK_DRIVER_INFO {
+		.vendor_name = "Arturia",
+		.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_DATA_IGNORE(3) }, /* Firmware update */
+			QUIRK_COMPOSITE_END
+		}
+	}
+},
+
 #undef USB_DEVICE_VENDOR_SPEC
 #undef USB_AUDIO_DEVICE
Signature · 1 line
2.53.0
#2 lore raw
In reply to Takashi Iwai
Quoted 11 lines · On Saturday, 28 March 2026 13:17:21 Greenwich Mean Time you wrote:
Quoted 5 lines · Phil Willoughby

2. Add the external clock quirks and locally test that it doesn't break anything for people who don't have the external clocks
3. Wrap the external clock quirks in #if 0 and a comment that they are disabled because they haven't been tested.
4. This will be marked signed-off but not tested-by me.

Hm, a better approach would be rather a creation of a mixer element to switch the clock source, I suppose. But it'll be more complex, of course.

The standard mixer code path seems to be creating that element already:

$ amixer -c AF16Rig contents
numid=2,iface=CARD,name='ARTURIA ADAT Clock Validity'
  ; type=BOOLEAN,access=r-------,values=1
  : values=on
numid=1,iface=CARD,name='ARTURIA Internal Clock Validity'
  ; type=BOOLEAN,access=r-------,values=1
  : values=on
numid=3,iface=CARD,name='ARTURIA WORD Clock Validity'
  ; type=BOOLEAN,access=r-------,values=1
  : values=on
numid=4,iface=MIXER,name='ARTURIA Clock Selector Clock Source'
  ; type=ENUMERATED,access=rw------,values=1,items=3
  ; Item #0 'ARTURIA Internal Clock'
  ; Item #1 'ARTURIA ADAT Clock'
  ; Item #2 'ARTURIA WORD Clock'
  : values=0

I also see it in the alsamixer UI. I tried switching it, and it does communicate that change to the AF16Rig. Of course then it doesn't work because I have nothing attached as an external clock.