Skip to content

Commit 6f4ea20

Browse files
LightBittiwai
authored andcommitted
ALSA: usb-audio: Add quirk for Focusrite Scarlett 2i2
Force it to use asynchronous playback. Same quirk has already been added for Focusrite Scarlett Solo (2nd gen) with a commit 46f5710 ("ALSA: usb-audio: Add quirk for Focusrite Scarlett Solo"). This also seems to prevent regular clicks when playing at 44100Hz on Scarlett 2i2 (2nd gen). I did not notice any side effects. Moved both quirks to snd_usb_audioformat_attributes_quirk() as suggested. Signed-off-by: Gregor Pintar <[email protected]> Reviewed-by: Alexander Tsoy <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent a43c1c4 commit 6f4ea20

File tree

2 files changed

+13
-84
lines changed

2 files changed

+13
-84
lines changed

sound/usb/quirks-table.h

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -2756,90 +2756,6 @@ YAMAHA_DEVICE(0x7010, "UB99"),
27562756
.type = QUIRK_MIDI_NOVATION
27572757
}
27582758
},
2759-
{
2760-
/*
2761-
* Focusrite Scarlett Solo 2nd generation
2762-
* Reports that playback should use Synch: Synchronous
2763-
* while still providing a feedback endpoint. Synchronous causes
2764-
* snapping on some sample rates.
2765-
* Force it to use Synch: Asynchronous.
2766-
*/
2767-
USB_DEVICE(0x1235, 0x8205),
2768-
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
2769-
.ifnum = QUIRK_ANY_INTERFACE,
2770-
.type = QUIRK_COMPOSITE,
2771-
.data = (const struct snd_usb_audio_quirk[]) {
2772-
{
2773-
.ifnum = 1,
2774-
.type = QUIRK_AUDIO_FIXED_ENDPOINT,
2775-
.data = & (const struct audioformat) {
2776-
.formats = SNDRV_PCM_FMTBIT_S32_LE,
2777-
.channels = 2,
2778-
.iface = 1,
2779-
.altsetting = 1,
2780-
.altset_idx = 1,
2781-
.attributes = 0,
2782-
.endpoint = 0x01,
2783-
.ep_attr = USB_ENDPOINT_XFER_ISOC |
2784-
USB_ENDPOINT_SYNC_ASYNC,
2785-
.protocol = UAC_VERSION_2,
2786-
.rates = SNDRV_PCM_RATE_44100 |
2787-
SNDRV_PCM_RATE_48000 |
2788-
SNDRV_PCM_RATE_88200 |
2789-
SNDRV_PCM_RATE_96000 |
2790-
SNDRV_PCM_RATE_176400 |
2791-
SNDRV_PCM_RATE_192000,
2792-
.rate_min = 44100,
2793-
.rate_max = 192000,
2794-
.nr_rates = 6,
2795-
.rate_table = (unsigned int[]) {
2796-
44100, 48000, 88200,
2797-
96000, 176400, 192000
2798-
},
2799-
.clock = 41
2800-
}
2801-
},
2802-
{
2803-
.ifnum = 2,
2804-
.type = QUIRK_AUDIO_FIXED_ENDPOINT,
2805-
.data = & (const struct audioformat) {
2806-
.formats = SNDRV_PCM_FMTBIT_S32_LE,
2807-
.channels = 2,
2808-
.iface = 2,
2809-
.altsetting = 1,
2810-
.altset_idx = 1,
2811-
.attributes = 0,
2812-
.endpoint = 0x82,
2813-
.ep_attr = USB_ENDPOINT_XFER_ISOC |
2814-
USB_ENDPOINT_SYNC_ASYNC |
2815-
USB_ENDPOINT_USAGE_IMPLICIT_FB,
2816-
.protocol = UAC_VERSION_2,
2817-
.rates = SNDRV_PCM_RATE_44100 |
2818-
SNDRV_PCM_RATE_48000 |
2819-
SNDRV_PCM_RATE_88200 |
2820-
SNDRV_PCM_RATE_96000 |
2821-
SNDRV_PCM_RATE_176400 |
2822-
SNDRV_PCM_RATE_192000,
2823-
.rate_min = 44100,
2824-
.rate_max = 192000,
2825-
.nr_rates = 6,
2826-
.rate_table = (unsigned int[]) {
2827-
44100, 48000, 88200,
2828-
96000, 176400, 192000
2829-
},
2830-
.clock = 41
2831-
}
2832-
},
2833-
{
2834-
.ifnum = 3,
2835-
.type = QUIRK_IGNORE_INTERFACE
2836-
},
2837-
{
2838-
.ifnum = -1
2839-
}
2840-
}
2841-
}
2842-
},
28432759

28442760
/* Access Music devices */
28452761
{

sound/usb/quirks.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,6 +1806,19 @@ void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip,
18061806
*/
18071807
fp->attributes &= ~UAC_EP_CS_ATTR_FILL_MAX;
18081808
break;
1809+
case USB_ID(0x1235, 0x8202): /* Focusrite Scarlett 2i2 2nd gen */
1810+
case USB_ID(0x1235, 0x8205): /* Focusrite Scarlett Solo 2nd gen */
1811+
/*
1812+
* Reports that playback should use Synch: Synchronous
1813+
* while still providing a feedback endpoint.
1814+
* Synchronous causes snapping on some sample rates.
1815+
* Force it to use Synch: Asynchronous.
1816+
*/
1817+
if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
1818+
fp->ep_attr &= ~USB_ENDPOINT_SYNCTYPE;
1819+
fp->ep_attr |= USB_ENDPOINT_SYNC_ASYNC;
1820+
}
1821+
break;
18091822
}
18101823
}
18111824

0 commit comments

Comments
 (0)