Skip to content
Snippets Groups Projects
  1. Dec 02, 2024
  2. Oct 30, 2024
  3. Oct 29, 2024
  4. Sep 03, 2024
  5. Aug 12, 2024
    • Karol Kosik's avatar
      ALSA: usb-audio: Support multiple control interfaces · 6aa87001
      Karol Kosik authored
      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
  6. Aug 10, 2024
  7. Jul 15, 2024
  8. Apr 18, 2024
  9. Dec 29, 2023
  10. Dec 04, 2023
  11. Oct 27, 2023
  12. Oct 09, 2023
  13. Oct 06, 2023
  14. Sep 18, 2023
  15. Aug 09, 2022
  16. Jul 05, 2022
  17. Jul 04, 2022
    • Jan Schär's avatar
      ALSA: usb-audio: Turn off 'manual mode' on Dell dock · 2e57a335
      Jan Schär authored
      This removes the need to power cycle the Dell WD15 dock if it has been
      attached to a Windows machine.
      
      The Windows driver puts the ALC4020 USB audio controller into
      'manual mode', and then does all the power management and other
      configuration itself, by sending HD audio commands directly to the
      ALC3263 audio codec via vendor-type USB messages. If manual mode is off,
      this is all handled by the firmware, and works well enough.
      
      If manual mode is turned on, the latency of the SET INTERFACE command
      goes from several hundred ms to less than 1 ms
      (see https://bugzilla.suse.com/show_bug.cgi?id=1089467
      
      ), but I'm not
      sure if the additional code that would be required is worth it.
      
      Funnily enough, the Windows driver tries to turn off manual mode when
      the dock is disconnected, which doesn't work for obvious reasons.
      
      Additionally, fix a bug in dell_dock_init_vol, which didn't work because
      the Control Selector was missing.
      Now, it properly resets the volume to 0dB.
      
      Fixes: 964af639 ("ALSA: usb-audio: Initialize Dell Dock playback volumes")
      Signed-off-by: default avatarJan Schär <jan@jschaer.ch>
      Link: https://lore.kernel.org/r/20220627171855.42338-2-jan@jschaer.ch
      
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      2e57a335
    • Jan Schär's avatar
      ALSA: usb-audio: Support jack detection on Dell dock · 4b8ea38f
      Jan Schär authored
      
      The Dell WD15 dock has a headset and a line out port. Add support for
      detecting if a jack is inserted into one of these ports.
      For the headset jack, additionally determine if a mic is present.
      
      The WD15 contains an ALC4020 USB audio controller and ALC3263 audio codec
      from Realtek. It is a UAC 1 device, and UAC 1 does not support jack
      detection. Instead, jack detection works by sending HD Audio commands over
      vendor-type USB messages.
      
      I found out how it works by looking at USB captures on Windows.
      The audio codec is very similar to the one supported by
      sound/soc/codecs/rt298.c / rt298.h, some constant names and the mic
      detection are adapted from there. The realtek_add_jack function is adapted
      from build_connector_control in sound/usb/mixer.c.
      
      I tested this on a WD15 dock with the latest firmware.
      
      Signed-off-by: default avatarJan Schär <jan@jschaer.ch>
      Link: https://lore.kernel.org/r/20220627171855.42338-1-jan@jschaer.ch
      
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      4b8ea38f
  18. Mar 12, 2022
  19. Dec 06, 2021
  20. Dec 02, 2021
  21. Oct 10, 2021
  22. Sep 13, 2021
    • Takashi Iwai's avatar
      ALSA: usb-audio: Unify mixer resume and reset_resume procedure · 7b9cf903
      Takashi Iwai authored
      
      USB-audio driver assumes that the normal resume would preserve the
      device configuration while reset_resume wouldn't, and tries to restore
      the mixer elements only at reset_resume callback.  However, this seems
      too naive, and some devices do behave differently, resetting the
      volume at the normal resume; this resulted in the inconsistent volume
      that surprised users.
      
      This patch changes the mixer resume code to handle both the normal and
      reset resume in the same way, always restoring the original mixer
      element values.  This allows us to unify the both callbacks as well as
      dropping the no longer used reset_resume field, which ends up with a
      good code reduction.
      
      A slight behavior change by this patch is that now we assign
      restore_mixer_value() as the default resume callback, and the function
      is no longer called at reset-resume when the resume callback is
      overridden by the quirk function.  That is, if needed, the quirk
      resume function would have to handle similarly as
      restore_mixer_value() by itself.
      
      Reported-by: default avatarEn-Shuo Hsu <enshuo@chromium.org>
      Cc: Yu-Hsuan Hsu <yuhsuan@chromium.org>
      Link: https://lore.kernel.org/r/CADDZ45UPsbpAAqP6=ZkTT8BE-yLii4Y7xSDnjK550G2DhQsMew@mail.gmail.com
      Link: https://lore.kernel.org/r/20210910105155.12862-1-tiwai@suse.de
      
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      7b9cf903
  23. Aug 14, 2021
  24. Jun 22, 2021
  25. May 21, 2021
  26. Mar 26, 2021
  27. Mar 18, 2021
  28. Mar 02, 2021
  29. Feb 05, 2021
  30. Jan 08, 2021
  31. Sep 23, 2020
  32. Aug 06, 2020
  33. Jun 24, 2020
  34. May 29, 2020
  35. May 15, 2020
Loading