Skip to content

Commit

Permalink
ALSA: scarlett2: Default mixer driver to enabled
Browse files Browse the repository at this point in the history
Early versions of this mixer driver did not work on all hardware, so
out of caution the driver was disabled by default and had to be
explicitly enabled with device_setup=1.

Since commit 764fa6e ("ALSA: usb-audio: scarlett2: Fix device
hang with ehci-pci") no more problems of this nature have been
reported. Therefore, enable the driver by default but provide a new
device_setup option to disable the driver in case that is needed.

- device_setup value of 0 now means "enable" rather than "disable".
- device_setup value of 1 is now ignored.
- device_setup value of 4 now means "disable".

Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Link: https://lore.kernel.org/r/89600a35b40307f2766578ad1ca2f21801286b58.1694705811.git.g@b4.vu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Geoffrey D. Bennett authored and Takashi Iwai committed Sep 18, 2023
1 parent b2ce002 commit bc83058
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions sound/usb/mixer_scarlett_gen2.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@

#include "mixer_scarlett_gen2.h"

/* device_setup value to enable */
#define SCARLETT2_ENABLE 0x01

/* device_setup value to allow turning MSD mode back on */
#define SCARLETT2_MSD_ENABLE 0x02

/* device_setup value to disable this mixer driver */
#define SCARLETT2_DISABLE 0x04

/* some gui mixers can't handle negative ctl values */
#define SCARLETT2_VOLUME_BIAS 127

Expand Down Expand Up @@ -4172,19 +4172,20 @@ int snd_scarlett_gen2_init(struct usb_mixer_interface *mixer)
if (!mixer->protocol)
return 0;

if (!(chip->setup & SCARLETT2_ENABLE)) {
if (chip->setup & SCARLETT2_DISABLE) {
usb_audio_info(chip,
"Focusrite Scarlett Gen 2/3 Mixer Driver disabled; "
"use options snd_usb_audio vid=0x%04x pid=0x%04x "
"device_setup=1 to enable and report any issues "
"to g@b4.vu",
"Focusrite Scarlett Gen 2/3 Mixer Driver disabled "
"by modprobe options (snd_usb_audio "
"vid=0x%04x pid=0x%04x device_setup=%d)\n",
USB_ID_VENDOR(chip->usb_id),
USB_ID_PRODUCT(chip->usb_id));
USB_ID_PRODUCT(chip->usb_id),
SCARLETT2_DISABLE);
return 0;
}

usb_audio_info(chip,
"Focusrite Scarlett Gen 2/3 Mixer Driver enabled pid=0x%04x",
"Focusrite Scarlett Gen 2/3 Mixer Driver enabled (pid=0x%04x); "
"report any issues to g@b4.vu",
USB_ID_PRODUCT(chip->usb_id));

err = snd_scarlett_gen2_controls_create(mixer);
Expand Down

0 comments on commit bc83058

Please sign in to comment.