Skip to content

Commit 6e2c910

Browse files
John Venesstiwai
authored andcommitted
ALSA: usb-audio: Add quirks for MacroSilicon MS2100/MS2106 devices
Treat the claimed 96kHz 1ch in the descriptors as 48kHz 2ch, so that the audio stream doesn't sound mono. Also fix initial stream alignment, so that left and right channels are in the correct order. Signed-off-by: John Veness <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent ae8b163 commit 6e2c910

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

sound/usb/quirks-table.h

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3802,6 +3802,54 @@ YAMAHA_DEVICE(0x7010, "UB99"),
38023802
}
38033803
},
38043804

3805+
/*
3806+
* MacroSilicon MS2100/MS2106 based AV capture cards
3807+
*
3808+
* These claim 96kHz 1ch in the descriptors, but are actually 48kHz 2ch.
3809+
* They also need QUIRK_FLAG_ALIGN_TRANSFER, which makes one wonder if
3810+
* they pretend to be 96kHz mono as a workaround for stereo being broken
3811+
* by that...
3812+
*
3813+
* They also have an issue with initial stream alignment that causes the
3814+
* channels to be swapped and out of phase, which is dealt with in quirks.c.
3815+
*/
3816+
{
3817+
USB_AUDIO_DEVICE(0x534d, 0x0021),
3818+
.driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
3819+
.vendor_name = "MacroSilicon",
3820+
.product_name = "MS210x",
3821+
.ifnum = QUIRK_ANY_INTERFACE,
3822+
.type = QUIRK_COMPOSITE,
3823+
.data = &(const struct snd_usb_audio_quirk[]) {
3824+
{
3825+
.ifnum = 2,
3826+
.type = QUIRK_AUDIO_STANDARD_MIXER,
3827+
},
3828+
{
3829+
.ifnum = 3,
3830+
.type = QUIRK_AUDIO_FIXED_ENDPOINT,
3831+
.data = &(const struct audioformat) {
3832+
.formats = SNDRV_PCM_FMTBIT_S16_LE,
3833+
.channels = 2,
3834+
.iface = 3,
3835+
.altsetting = 1,
3836+
.altset_idx = 1,
3837+
.attributes = 0,
3838+
.endpoint = 0x82,
3839+
.ep_attr = USB_ENDPOINT_XFER_ISOC |
3840+
USB_ENDPOINT_SYNC_ASYNC,
3841+
.rates = SNDRV_PCM_RATE_CONTINUOUS,
3842+
.rate_min = 48000,
3843+
.rate_max = 48000,
3844+
}
3845+
},
3846+
{
3847+
.ifnum = -1
3848+
}
3849+
}
3850+
}
3851+
},
3852+
38053853
/*
38063854
* MacroSilicon MS2109 based HDMI capture cards
38073855
*

sound/usb/quirks.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,6 +1478,7 @@ void snd_usb_set_format_quirk(struct snd_usb_substream *subs,
14781478
case USB_ID(0x041e, 0x3f19): /* E-Mu 0204 USB */
14791479
set_format_emu_quirk(subs, fmt);
14801480
break;
1481+
case USB_ID(0x534d, 0x0021): /* MacroSilicon MS2100/MS2106 */
14811482
case USB_ID(0x534d, 0x2109): /* MacroSilicon MS2109 */
14821483
subs->stream_offset_adj = 2;
14831484
break;
@@ -1908,6 +1909,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
19081909
QUIRK_FLAG_IGNORE_CTL_ERROR),
19091910
DEVICE_FLG(0x413c, 0xa506, /* Dell AE515 sound bar */
19101911
QUIRK_FLAG_GET_SAMPLE_RATE),
1912+
DEVICE_FLG(0x534d, 0x0021, /* MacroSilicon MS2100/MS2106 */
1913+
QUIRK_FLAG_ALIGN_TRANSFER),
19111914
DEVICE_FLG(0x534d, 0x2109, /* MacroSilicon MS2109 */
19121915
QUIRK_FLAG_ALIGN_TRANSFER),
19131916
DEVICE_FLG(0x1224, 0x2a25, /* Jieli Technology USB PHY 2.0 */

0 commit comments

Comments
 (0)