Skip to content
Snippets Groups Projects
  1. Oct 04, 2024
  2. Oct 03, 2024
  3. Sep 30, 2024
  4. Sep 12, 2024
  5. Sep 03, 2024
  6. Aug 26, 2024
  7. Aug 14, 2024
  8. Aug 12, 2024
    • Karol Kosik's avatar
      ALSA: usb-audio: Support multiple control interfaces · 6aa87001
      Karol Kosik authored and Takashi Iwai's avatar Takashi Iwai committed
      Registering Numark Party Mix II fails with error 'bogus bTerminalLink 1'.
      The problem stems from the driver not being able to find input/output
      terminals required to configure audio streaming. The information about
      those terminals is stored in AudioControl Interface. Numark device
      contains 2 AudioControl Interfaces and the driver checks only one of them.
      
      According to the USB standard, a device can have multiple audio functions,
      each represented by Audio Interface Collection. Every audio function is
      considered to be closed box and will contain unique AudioControl Interface
      and zero or more AudioStreaming and MIDIStreaming Interfaces.
      
      The Numark device adheres to the standard and defines two audio functions:
      - MIDIStreaming function
      - AudioStreaming function
      It starts with MIDI function, followed by the audio function. The driver
      saves the first AudioControl Interface in `snd_usb_audio` structure
      associated with the entire device. It then attempts to use this interface
      to query for terminals and clocks. However, this fails because the correct
      information is stored in the second AudioControl Interface, defined in the
      second Audio Interface Collection.
      
      This patch introduces a structure holding association between each
      MIDI/Audio Interface and its corresponding AudioControl Interface,
      instead of relying on AudioControl Interface defined for the entire
      device. This structure is populated during usb probing phase and leveraged
      later when querying for terminals and when sending USB requests.
      
      Alternative solutions considered include:
      - defining a quirk for Numark where the order of interface is manually
      changed, or terminals are hardcoded in the driver. This solution would
      have fixed only this model, though it seems that device is USB compliant,
      and it also seems that other devices from this company may be affected.
      What's more, it looks like products from other manufacturers have similar
      problems, i.e. Rane One DJ console
      - keeping a list of all AudioControl Interfaces and querying all of them
      to find required information. That would have solved my problem and have
      low probability of breaking other devices, as we would always start with
      the same logic of querying first AudioControl Interface. This solution
      would not have followed the standard though.
      
      This patch preserves the `snd_usb_audio.ctrl_intf` variable, which holds
      the first AudioControl Interface, and uses it as a fallback when some
      interfaces are not parsed correctly and lack an associated AudioControl
      Interface, i.e., when configured via quirks.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=217865
      
      
      Signed-off-by: default avatarKarol Kosik <k.kosik@outlook.com>
      Link: https://patch.msgid.link/AS8P190MB1285893F4735C8B32AD3886BEC852@AS8P190MB1285.EURP190.PROD.OUTLOOK.COM
      
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      6aa87001
    • Lianqin Hu's avatar
      ALSA: usb-audio: Add delay quirk for VIVO USB-C-XE710 HEADSET · 004eb8ba
      Lianqin Hu authored and Takashi Iwai's avatar Takashi Iwai committed
      
      Audio control requests that sets sampling frequency sometimes fail on
      this card. Adding delay between control messages eliminates that problem.
      
      Signed-off-by: default avatarLianqin Hu <hulianqin@vivo.com>
      Cc: <stable@vger.kernel.org>
      Link: https://patch.msgid.link/TYUPR06MB6217FF67076AF3E49E12C877D2842@TYUPR06MB6217.apcprd06.prod.outlook.com
      
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      004eb8ba
  9. Aug 10, 2024
  10. Aug 09, 2024
  11. Aug 08, 2024
  12. Aug 07, 2024
  13. Aug 06, 2024
  14. Aug 05, 2024
  15. Jul 31, 2024
  16. Jul 22, 2024
  17. Jul 19, 2024
    • wangdicheng's avatar
      ALSA: usb-audio: Fix microphone sound on HD webcam. · 74dba240
      wangdicheng authored and Takashi Iwai's avatar Takashi Iwai committed
      
      I own an external usb Webcam, HD webcam, which had low mic volume and
      inconsistent sound quality. Video works as expected.
      
      (snip)
      [   95.473820][ 1] [   T73] usb 5-2.2: new high-speed USB device number 7 using xhci_hcd
      [   95.773974][ 1] [   T73] usb 5-2.2: New USB device found, idVendor=1bcf, idProduct=2281, bcdDevice= 0.05
      [   95.783445][ 1] [   T73] usb 5-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
      [   95.791872][ 1] [   T73] usb 5-2.2: Product: HD webcam
      [   95.797001][ 1] [   T73] usb 5-2.2: Manufacturer: Sunplus IT Co
      [   95.802996][ 1] [   T73] usb 5-2.2: SerialNumber: 20200513
      [   96.092610][ 2] [ T3680] usb 5-2.2: Warning! Unlikely big volume range (=4096), cval->res is probably wrong.
      [   96.102436][ 2] [ T3680] usb 5-2.2: [5] FU [Mic Capture Volume] ch = 1, val = 0/4096/1
      
      Set up quirk cval->res to 16 for 256 levels,
      Set GET_SAMPLE_RATE quirk flag to stop trying to get the sample rate.
      Confirmed that happened anyway later due to the backoff mechanism,
      After 3 failures.
      
      All audio stream on device interfaces share the same values,
      apart from wMaxPacketSize and tSamFreq :
      
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        3
            bAlternateSetting       4
            bNumEndpoints           1
            bInterfaceClass         1 Audio
      
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        3
        bAlternateSetting       4
        bNumEndpoints           1
        bInterfaceClass         1 Audio
        bInterfaceSubClass      2 Streaming
        bInterfaceProtocol      0
        iInterface              0
        AudioStreaming Interface Descriptor:
          bLength                 7
          bDescriptorType        36
          bDescriptorSubtype      1 (AS_GENERAL)
          bTerminalLink           3
          bDelay                  1 frames
          wFormatTag         0x0001 PCM
        AudioStreaming Interface Descriptor:
          bLength                11
          bDescriptorType        36
          bDescriptorSubtype      2 (FORMAT_TYPE)
          bFormatType             1 (FORMAT_TYPE_I)
          bNrChannels             1
          bSubframeSize           2
          bBitResolution         16
          bSamFreqType            1 Discrete
          tSamFreq[ 0]        48000
        Endpoint Descriptor:
          bLength                 9
          bDescriptorType         5
          bEndpointAddress     0x86  EP 6 IN
          bmAttributes            5
            Transfer Type            Isochronous
            Synch Type               Asynchronous
            Usage Type               Data
          wMaxPacketSize     0x0064  1x 100 bytes
          bInterval               4
          bRefresh                0
          bSynchAddress           0
          AudioStreaming Endpoint Descriptor:
            bLength                 7
            bDescriptorType        37
            bDescriptorSubtype      1 (EP_GENERAL)
            bmAttributes         0x01
              Sampling Frequency
            bLockDelayUnits         0 Undefined
            wLockDelay         0x0000
      (snip)
      
      Testing patch provides consistent good sound recording quality and volume range.
      
      (snip)
      [   95.473820][ 1] [   T73] usb 5-2.2: new high-speed USB device number 7 using xhci_hcd
      [   95.773974][ 1] [   T73] usb 5-2.2: New USB device found, idVendor=1bcf, idProduct=2281, bcdDevice= 0.05
      [   95.783445][ 1] [   T73] usb 5-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
      [   95.791872][ 1] [   T73] usb 5-2.2: Product: HD webcam
      [   95.797001][ 1] [   T73] usb 5-2.2: Manufacturer: Sunplus IT Co
      [   95.802996][ 1] [   T73] usb 5-2.2: SerialNumber: 20200513
      [   96.110630][ 3] [ T3680] usbcore: registered new interface driver snd-usb-audio
      [   96.114329][ 7] [ T3677] usb 5-2.2: Found UVC 1.00 device HD webcam (1bcf:2281)
      [   96.167555][ 7] [ T3677] usbcore: registered new interface driver uvcvideo
      
      Signed-off-by: default avatarwangdicheng <wangdicheng@kylinos.cn>
      Cc: <stable@vger.kernel.org>
      Link: https://patch.msgid.link/20240719020906.8078-1-wangdich9700@163.com
      
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      74dba240
  18. Jul 15, 2024
  19. May 16, 2024
  20. May 12, 2024
  21. May 09, 2024
  22. May 08, 2024
  23. Apr 21, 2024
    • Nathan Chancellor's avatar
      ALSA: scarlett2: Zero initialize ret in scarlett2_ag_target_ctl_get() · 3a56855b
      Nathan Chancellor authored and Takashi Iwai's avatar Takashi Iwai committed
      
      Clang warns (or errors with CONFIG_WERROR):
      
        sound/usb/mixer_scarlett2.c:3697:6: error: variable 'err' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
         3697 |         if (private->autogain_updated) {
              |             ^~~~~~~~~~~~~~~~~~~~~~~~~
        sound/usb/mixer_scarlett2.c:3707:9: note: uninitialized use occurs here
         3707 |         return err;
              |                ^~~
        sound/usb/mixer_scarlett2.c:3697:2: note: remove the 'if' if its condition is always true
         3697 |         if (private->autogain_updated) {
              |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        sound/usb/mixer_scarlett2.c:3688:9: note: initialize the variable 'err' to silence this warning
         3688 |         int err;
              |                ^
              |                 = 0
        1 error generated.
      
      Initialize ret to zero to ensure ret is initialized in all paths within
      scarlett2_ag_target_ctl_get(), which matches the style of other
      functions in this driver.
      
      Fixes: e30ea534 ("ALSA: scarlett2: Add autogain target controls")
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Message-ID: <20240419-alsa-scarlett2-fix-wsometimes-uninitialized-v1-1-e2ace8642e08@kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      3a56855b
  24. Apr 18, 2024
Loading