Commit 0ca29010 authored by Roy Vegard Ovesen's avatar Roy Vegard Ovesen Committed by Takashi Iwai
Browse files

ALSA: usb-audio: add the initial mix for Presonus Studio 1824c

A reasonable initial mix for the 1824c is the one that
Presonus Universal Control calls bypass.
It mutes all the physical inputs, and connects
Daw channel 1 to Line out channel 1 (left)
Daw channel 2 to Line out channel 2 (right)
Daw channel 3 to Line out channel 3 (left)
etc.

To get the most out of the 1824c a mixer application like
Universal Control is needed. One is available for linux
Link: https://github.com/royvegard/baton



Signed-off-by: default avatarRoy Vegard Ovesen <roy.vegard.ovesen@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent eb379c3c
Loading
Loading
Loading
Loading
+138 −89
Original line number Diff line number Diff line
@@ -215,9 +215,11 @@ snd_sc1810c_get_status_field(struct usb_device *dev,
 */
static int snd_s1810c_init_mixer_maps(struct snd_usb_audio *chip)
{
	u32 a, b, c, e, n, off;
	u32 a, b, c, e, n, off, left, right;
	struct usb_device *dev = chip->dev;

	switch (chip->usb_id) {
	case USB_ID(0x194f, 0x010c): /* 1810c */
		/* Set initial volume levels ? */
		a = 0x64;
		e = 0xbc;
@@ -323,7 +325,54 @@ static int snd_s1810c_init_mixer_maps(struct snd_usb_audio *chip)
		/* Again ? */
		snd_s1810c_send_ctl_packet(dev, a, 3, 0, 0, e);
		snd_s1810c_send_ctl_packet(dev, a, 3, 0, 1, e);
		break;

	case USB_ID(0x194f, 0x010d): /* 1824c */
		/* Set all output faders to unity gain */
		a = 0x65;
		c = 0x00;
		e = 0x01000000;

		for (b = 0; b < 9; b++) {
			snd_s1810c_send_ctl_packet(dev, a, b, c, 0, e);
			snd_s1810c_send_ctl_packet(dev, a, b, c, 1, e);
		}

		/* Set
		 * Daw 1 -> Line out 1 (left), Daw 2 -> Line out 2 (right)
		 * Daw 3 -> Line out 3, (left) Daw 4 -> Line out 4 (right)
		 * Daw 5 -> Line out 5, (left) Daw 6 -> Line out 6 (right)
		 * Daw 7 -> Line out 7, (left) Daw 8 -> Line out 8 (right)
		 * Daw 9 -> SPDIF out 1, (left) Daw 10 -> SPDIF out 2 (right)
		 * Daw 11 -> ADAT out 1, (left) Daw 12 -> ADAT out 2 (right)
		 * Daw 13 -> ADAT out 3, (left) Daw 14 -> ADAT out 4 (right)
		 * Daw 15 -> ADAT out 5, (left) Daw 16 -> ADAT out 6 (right)
		 * Daw 17 -> ADAT out 7, (left) Daw 18 -> ADAT out 8 (right)
		 * Everything else muted
		 */
		a = 0x64;
		/* The first Daw channel is channel 18 */
		left = 18;

		for (c = 0; c < 9; c++) {
			right = left + 1;

			for (b = 0; b < 36; b++) {
				if (b == left) {
					snd_s1810c_send_ctl_packet(dev, a, b, c, 0, 0x01000000);
					snd_s1810c_send_ctl_packet(dev, a, b, c, 1, 0x00);
				} else if (b == right) {
					snd_s1810c_send_ctl_packet(dev, a, b, c, 0, 0x00);
					snd_s1810c_send_ctl_packet(dev, a, b, c, 1, 0x01000000);
				} else {
					snd_s1810c_send_ctl_packet(dev, a, b, c, 0, 0x00);
					snd_s1810c_send_ctl_packet(dev, a, b, c, 1, 0x00);
				}
			}
			left += 2;
		}
		break;
	}
	return 0;
}