Skip to content

Commit b50a3e9

Browse files
10ne1tiwai
authored andcommitted
sound: usb: format: don't warn that raw DSD is unsupported
UAC 2 & 3 DAC's set bit 31 of the format to signal support for a RAW_DATA type, typically used for DSD playback. This is correctly tested by (format & UAC*_FORMAT_TYPE_I_RAW_DATA), fp->dsd_raw = true; and call snd_usb_interface_dsd_format_quirks(), however a confusing and unnecessary message gets printed because the bit is not properly tested in the last "unsupported" if test: if (format & ~0x3F) { ... } For example the output: usb 7-1: new high-speed USB device number 5 using xhci_hcd usb 7-1: New USB device found, idVendor=262a, idProduct=9302, bcdDevice=0.01 usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=6 usb 7-1: Product: TC44C usb 7-1: Manufacturer: TC44C usb 7-1: SerialNumber: 5000000001 hid-generic 0003:262A:9302.001E: No inputs registered, leaving hid-generic 0003:262A:9302.001E: hidraw6: USB HID v1.00 Device [DDHIFI TC44C] on usb-0000:08:00.3-1/input0 usb 7-1: 2:4 : unsupported format bits 0x100000000 This last "unsupported format" is actually wrong: we know the format is a RAW_DATA which we assume is DSD, so there is no need to print the confusing message. This we unset bit 31 of the format after recognizing it, to avoid the message. Suggested-by: Takashi Iwai <[email protected]> Signed-off-by: Adrian Ratiu <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent c84bd6c commit b50a3e9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sound/usb/format.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,
6060
pcm_formats |= SNDRV_PCM_FMTBIT_SPECIAL;
6161
/* flag potentially raw DSD capable altsettings */
6262
fp->dsd_raw = true;
63+
/* clear special format bit to avoid "unsupported format" msg below */
64+
format &= ~UAC2_FORMAT_TYPE_I_RAW_DATA;
6365
}
6466

6567
format <<= 1;
@@ -71,8 +73,11 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,
7173
sample_width = as->bBitResolution;
7274
sample_bytes = as->bSubslotSize;
7375

74-
if (format & UAC3_FORMAT_TYPE_I_RAW_DATA)
76+
if (format & UAC3_FORMAT_TYPE_I_RAW_DATA) {
7577
pcm_formats |= SNDRV_PCM_FMTBIT_SPECIAL;
78+
/* clear special format bit to avoid "unsupported format" msg below */
79+
format &= ~UAC3_FORMAT_TYPE_I_RAW_DATA;
80+
}
7681

7782
format <<= 1;
7883
break;

0 commit comments

Comments
 (0)