Skip to content

Commit

Permalink
ALSA: scarlett2: Add mux notification callback for Solo Gen 4
Browse files Browse the repository at this point in the history
When the Direct button the Solo Gen 4 is held for 3 seconds, the PCM 1
and 2 inputs are toggled between DSP Outputs 1 and 2, and Mixer
Outputs E and F. This patch adds a notification callback to re-read
the mux controls when that happens.

Signed-off-by: Geoffrey D. Bennett <[email protected]>
  • Loading branch information
geoffreybennett committed Nov 27, 2023
1 parent 37f5b31 commit 8e55fa2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions sound/usb/mixer_scarlett2.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ static void scarlett2_notify_input_safe(struct usb_mixer_interface *mixer);
static void scarlett2_notify_monitor_other(struct usb_mixer_interface *mixer);
static void scarlett2_notify_direct_monitor(struct usb_mixer_interface *mixer);
static void scarlett2_notify_power_status(struct usb_mixer_interface *mixer);
static void scarlett2_notify_mux(struct usb_mixer_interface *mixer);

/* Arrays of notification callback functions */

Expand Down Expand Up @@ -343,6 +344,7 @@ static const struct scarlett2_notification scarlett4_solo_notifications[] = {
{ 0x00800000, scarlett2_notify_direct_monitor },
{ 0x01000000, scarlett2_notify_input_level },
{ 0x02000000, scarlett2_notify_input_phantom },
{ 0x04000000, scarlett2_notify_mux },
{ 0, NULL }
};

Expand Down Expand Up @@ -6479,6 +6481,20 @@ static void scarlett2_notify_power_status(struct usb_mixer_interface *mixer)
&private->power_status_ctl->id);
}

/* Notify on mux change */
static void scarlett2_notify_mux(struct usb_mixer_interface *mixer)
{
struct snd_card *card = mixer->chip->card;
struct scarlett2_data *private = mixer->private_data;
int i;

private->mux_updated = 1;

for (i = 0; i < private->num_mux_dsts; i++)
snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE,
&private->mux_ctls[i]->id);
}

/* Interrupt callback */
static void scarlett2_notify(struct urb *urb)
{
Expand Down

0 comments on commit 8e55fa2

Please sign in to comment.