[alsa-devel] [PATCH V6 RESEND] ALSA: usb-audio: Scarlett Gen 2 mixer interface

Takashi Iwai tiwai at suse.de
Thu Jul 18 17:53:13 CEST 2019


On Wed, 17 Jul 2019 17:51:05 +0200,
Geoffrey D. Bennett wrote:
> 
> Add mixer quirk for the Focusrite Scarlett 6i6, 18i8, and 18i20 Gen 2
> audio interfaces. Although the interfaces are USB compliant,
> additional input/output level controls and hardware routing/mixing
> functionality are available using proprietary USB requests.
> 
> Signed-off-by: Geoffrey D. Bennett <g at b4.vu>
> ---
> Hi all,
> 
> This patch adds the following controls for the Scarlett 6i6, 18i8, and
> 18i20 Gen 2:
> - Master volume knob indicator (18i20 only)
> - Mute and dim switches (18i20 only)
> - Volume controls for the analogue HW outputs
> - HW/SW volume switches for the 10 analogue HW outputs (18i20 only)
> - Line Level/Instrument Level and Pad controls (6i6 and 18i8 only)
> - Output mux (where the sound for the HW outputs comes from; defaults
>   to PCM outputs)
> - Capture mux (where the sound for PCM recording comes from; defaults
>   to HW inputs)
> - Matrix mux (where the sound going into the mixer comes from; 18
>   inputs default off)
> - Mixer matrix (18 inputs * 10 outputs = 180 controls)
> - Level meters
> 
> Changes since v1:
> - Add support for the Scarlett 18i8 Gen 2
> - Save configuration parameters to NVRAM
> - Implemented feedback from Takashi's email 24/Apr/2019
> - Moved private field from struct snd_usb_audio to struct
>   usb_mixer_interface
> - Added timer and buffer fields to struct usb_mixer_interface
> - Other small code fixes/cleanups/improvements
> 
> Changes since v2:
> - Add support for the Scarlett 6i6 Gen 2
> - Add support for controlling the mute/dim switches (18i20 only)
> - Implemented feedback from Takashi's email 29/Apr/2019: One pointer
>   field private_data and one function pointer private_free. Replaced
>   timer with delayed work (thanks for that suggestion; it makes the
>   code a *lot* simpler!).
> - The new functionality is disabled by default as there were reports
>   of some Gen 2 devices not responding to the initialisation sequence
>   and hanging. Added module parameter "scarlett_gen2_mixer_enable".
>   If this parameter is not set, logs a message "Focusrite Scarlett Gen
>   2 Mixer Driver disabled; use options snd_usb_audio
>   scarlett_gen2_mixer_enable=1 to enable and report any issues to
>   g at b4.vu".
> 
> Changes since v3:
> - No functional changes; fix checkpatch.pl error and typo in
>   declaration.
> 
> Changes since v4:
> - Implemented feedback from Takashi's email 9/Jul/2019: cancel
>   delayed work on suspend, drop copyright texts, remove unnecessary
>   blank lines, and run kmalloc outside the mutex.
> 
> Changes since v5:
> - Implemented feedback from Takashi's emails 9-10/Jul/2019: use
>   chip->setup value (device_setup option) instead of the
>   scarlett_gen2_mixer_enable option and sync config to NVRAM
>   immediately on suspend.
> - Fixed issue where the config save delayed work would be cancelled
>   and not restarted if a scarlett2_*_ctl_put() function was called and
>   the parameter value was not changed.
> - Renaming definitions and functions for consistency and move private
>   free/suspend functions above their use so pre-declaration isn't
>   necessary.

Thanks, the patch looks almost good, but it's already too late for
5.3, so I'm going to queue this for 5.4 after 5.3 merge window is
closed in this week.

But, before that, maybe one more refresh would be appreciated.
Namely,

- We need a verification of the fixed pipe before actually submitting
  urb.  scarlett2_usb() calls with usb_sndctrlpipe(), and this pipe
  has to be verified beforehand.  See the commit 801ebf1043ae for
  details.

- Some pointers seem to be initialized as "0".  Use NULL instead.


Takashi


More information about the Alsa-devel mailing list