Patch "sound: usb: format: don't warn that raw DSD is unsupported" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    sound: usb: format: don't warn that raw DSD is unsupported

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     sound-usb-format-don-t-warn-that-raw-dsd-is-unsuppor.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit ab352cfdfcb200524ca429783e10936b6b2f5d62
Author: Adrian Ratiu <adrian.ratiu@xxxxxxxxxxxxx>
Date:   Mon Dec 9 11:05:29 2024 +0200

    sound: usb: format: don't warn that raw DSD is unsupported
    
    [ Upstream commit b50a3e98442b8d72f061617c7f7a71f7dba19484 ]
    
    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 <tiwai@xxxxxxxx>
    Signed-off-by: Adrian Ratiu <adrian.ratiu@xxxxxxxxxxxxx>
    Link: https://patch.msgid.link/20241209090529.16134-2-adrian.ratiu@xxxxxxxxxxxxx
    Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/usb/format.c b/sound/usb/format.c
index 3b45d0ee7693..3b3a5ea6fcbf 100644
--- a/sound/usb/format.c
+++ b/sound/usb/format.c
@@ -60,6 +60,8 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,
 			pcm_formats |= SNDRV_PCM_FMTBIT_SPECIAL;
 			/* flag potentially raw DSD capable altsettings */
 			fp->dsd_raw = true;
+			/* clear special format bit to avoid "unsupported format" msg below */
+			format &= ~UAC2_FORMAT_TYPE_I_RAW_DATA;
 		}
 
 		format <<= 1;
@@ -71,8 +73,11 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,
 		sample_width = as->bBitResolution;
 		sample_bytes = as->bSubslotSize;
 
-		if (format & UAC3_FORMAT_TYPE_I_RAW_DATA)
+		if (format & UAC3_FORMAT_TYPE_I_RAW_DATA) {
 			pcm_formats |= SNDRV_PCM_FMTBIT_SPECIAL;
+			/* clear special format bit to avoid "unsupported format" msg below */
+			format &= ~UAC3_FORMAT_TYPE_I_RAW_DATA;
+		}
 
 		format <<= 1;
 		break;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux