Skip to content

Commit 7141cb1

Browse files
jlaakotiwai
authored andcommitted
ALSA: usb-audio: Do not expose PCM and DSD on same altsetting unless DoP
Do not expose DSD altsetting as a PCM one, even if the descriptor claims it to be PCM instead of special format. Signed-off-by: Jussi Laako <jussi@sonarnerd.net> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20251211152224.1780782-3-jussi@sonarnerd.net
1 parent 7fde617 commit 7141cb1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

sound/usb/format.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,
3434
{
3535
int sample_width, sample_bytes;
3636
u64 pcm_formats = 0;
37+
u64 dsd_formats = 0;
3738

3839
switch (fp->protocol) {
3940
case UAC_VERSION_1:
@@ -154,7 +155,9 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,
154155
fp->iface, fp->altsetting, format);
155156
}
156157

157-
pcm_formats |= snd_usb_interface_dsd_format_quirks(chip, fp, sample_bytes);
158+
dsd_formats |= snd_usb_interface_dsd_format_quirks(chip, fp, sample_bytes);
159+
if (dsd_formats && !fp->dsd_dop)
160+
pcm_formats = dsd_formats;
158161

159162
return pcm_formats;
160163
}

0 commit comments

Comments
 (0)