From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.161.46 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796057125; b=y4tU0e6Cqo5YevpJ7+eWilq4rEJYqTWi6amqPFGKLB97NW8wHmNEck6ViD0UUyYgfwqD W+bM2J1Bc9G+6cECgMowUj8QT0nZkcPuTPJiPeRY3BDPbwpSnxvCKOdi9QvzxBjPUvy8B fsmL0RrUsowKCA17JOmEYEGtTjwCocnI6/UnZRWp8fv/CRrrtMy+y7YmgSDdHukTpWcDa q5OUHTtzYATeYG6xCrIVwy6GXerpnXvesKt6a58SAKPkH7N6Nn1mLLKwHfwTv+mWOhvpe yC/pRzDvl3VUBL0AEKkzcG2A6SRLarDGBgn2Odo74jZkTxBFqJbY5w18Hx2PDl6yC4A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796057125; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=/13jWHe1C90Hf2exECrNqRbZ8mBsv2EFj6Bcx8Cznss=; b=l2ui8qPxBm/uiGJQTK15q7fFsJJdBY2aCAUKvU8jL1nl7TXnLsnLKpqhKKrk8d6T+ifE goJGBZPeD9dZbm2yIlwuVKzNlBhg4t1pAP9ErqAra8wbbf0l7BUVOmcXiZpEcUvPX9uu7 FDzX/C2Y6510j7lOjo0+uRMg9KzQ6HELUbxwgQMQ4yU6ylz3uAhzTGrxdoG+GVzNNUswD skQ7XQrSc3Gu6XY5ILCqhpcjlQjHyFNyEIdF862WTpzsB/WTzV20x6n23yOROhQCtm0dh U1cj1U73H5+q48rWqk9Vkk94BSiY8tdTeBosSehEcPwuoow4o0YvsN5eoU/nJLFa7lg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=meuLjHCc; arc=none smtp.remote-ip=209.85.161.46 Received: from mail-oo1-f46.google.com (mail-oo1-f46.google.com [209.85.161.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 481AD60A261C for ; Mon, 30 Nov 2026 16:45:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 481AD60A261C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=meuLjHCc Received: by mail-oo1-f46.google.com with SMTP id 006d021491bc7-703be215729so4696610eaf.1 for ; Mon, 30 Nov 2026 08:45:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796057124; x=1796661924; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/13jWHe1C90Hf2exECrNqRbZ8mBsv2EFj6Bcx8Cznss=; b=meuLjHCcQ+u2W1MrDYPzsB6YumkfMPYmBQ/A8oCjcpi/mGPzeP5WQFpczQSPYihhoc Ffu7YNkBEfnqZYOAYJIlsUZlKbrGdifGR5dIzzaMpjNoGcpMDTWTt2WlprqDcCVjmyGc AOic9fVvKZS2gc5d5rEMCPRg+2vN4eDE77bV08rmupJA6wrEtRjZw2pWPDHWWI+9MB1f emC6gQnNzalDTzIRISBkHWJlUOTEXU2mIt/ed2LaZ1Rdnl+A/t4zzKe47nq3SPeCuzx3 5+N0c+gXxCVdVa2yUkku418ZyaZzMMIq1xDgKjsyIR/Kk07ObINdeoTKiJMSAq+uiIaN 8kMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796057124; x=1796661924; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=/13jWHe1C90Hf2exECrNqRbZ8mBsv2EFj6Bcx8Cznss=; b=H0Vx3txbBQemh2QcHRCv8/xLvLldEHKEY4izt1V3uqXsbAMl+A0NVT8oCTDYk6JGyn gd27w5RGI5aBfFwNmQWCGz40MCt7gdM3jv6KUDHgua4VmdDl7C5otC6DLHwUCEUHHulB L9HPfXXwn9rRnzFinMKtSxqLkj0AGeALpBENNg32qD9g6JAczaG44YJj6XdXhd7udFda LFxpE9CIg2xdzVy070wrIVBQBo0XgaHicU4xREoEbQiV70Yf9qCc0isYOCk7zohITYmY ut+3flq9RPBOjNkN78DRYofMC1fHSVJ5ps/zaXripxew2LCcbHtWLACgkH7J/LX/dAON xcgQ== X-Forwarded-Encrypted: i=1; AL+hErEJ/eFEilDwGxNFI3mQph8ekGaf6P7ynT6fI62JpBgwBsPCkItBv78lu+BJ0XyPqsFBT82Zby3H3XGKPw==@vger.kernel.org X-Gm-Message-State: APuU4Z91XPQzZn5xV1wRmk7Q+ubYZyTI8au3YbGkOFaKcXNmSnUw6IAo E0HjyzY88wVd4X+wl+p0QxW586r1afqwlDPM5DbkBtEVCElqpnAluQIE X-Gm-Gg: AZFdTZecwSLFmTDDNGGGz0zHkyDo3IXwpLkFWtK+/uZ/RyrtrNAhZciap6Pnx7Zsjwu Z2MDhPrfp8tMx0Duf8sm4GKBEQaECawFU2D8KgZDqK2Q90AVWjU5O1PRaGUQQlCh7rTI+iZR/JL LsgYQPuGpt4dbHDEcrZaxzei0pyih2qqI9TaqWbr6wtMV63k5H7oeMsXW8KifpS5jJTS9yH5XxW snM/FL2W66Esg1Zrl4IiUJlSQOUIhm0ESXTnjGOnK27OL+Xl+svyvkY09Gaa7bcLeAOE9fCWrFq YMWML3LxIZk1Y6sjxitm6MgxxBZGAGMpUCS6MyGxmXiVpRkb7TizO8u/8saT8aGimPYn4elJK+M 5kQ2MfKgto5DuAx9kWhjwH2wchlfYB9I+cGLSpH8+A5G5p2EMeQbz7FCD4qZwhAaf9ZFuf2txhO GbIdfOe7hQfRhfy4VS9F6nJBB3tO/jOiqhDtxmv0hQq+/2XRkgAJViixgjfwY2dGR5Ki+jNy0iV Xr9DLKNAKr5JvO6dzajBEuZU5wUvjzqKUwL9YQF2Ed1l9w/WXG6LFRlKbNqj3c8VuVRAto6ocnb ZyKxH60IrdBzfQxNwsrliOelxgIE5RBVOrrklRmCozaT3Q== X-Received: by 2002:a05:6820:a511:10b0:71b:3b7:f5c0 with SMTP id 006d021491bc7-71b3955ed62mr18245906eaf.66.1796057124071; Mon, 30 Nov 2026 08:45:24 -0800 (PST) Received: from localhost.localdomain ([2600:1702:4ff0:baa0:5054:ff:fe3d:4ddb]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4bc5f7ae7dcsm28002053fac.8.2026.11.30.08.45.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 08:45:23 -0800 (PST) From: Will Porter To: Takashi Iwai , Jaroslav Kysela Cc: Christian Ruppert , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Andrews , Nikita Tarasov Subject: [PATCH v2 19/21] ALSA: mixer_audient: Add Audient iD14 MkI controls Date: Mon, 30 Nov 2026 10:44:26 -0600 Message-ID: <20261130164428.2930348-20-mrwillporter@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261130164428.2930348-1-mrwillporter@gmail.com> References: <20261130164428.2930348-1-mrwillporter@gmail.com> X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The iD14 MkI (2708:0002) has its monitor controller on extension unit 54 and its output routing on extension unit 51. The headphone level is on feature unit 10 (CN 3-4, which the descriptor does not declare). The mixer is mixer unit 60. The generic driver cannot find the vendor controls and creates wrong controls for mixer unit 60 and feature unit 11. Add the MkI as a device with these tables. Apart from the tables and their macros, the patch adds the device ID, its case in mixer_quirks.c and the map entries that hide the generic controls. Monitor and routing controls: speaker volume, cut, dim, dim level, mono, mono mode, polarity, talkback, headphone volume and mute, and one routing selector per output channel. All of them read the device on every get: the front panel knob changes the volumes and the cut and mute states. The volumes are s16 values in 1/256 dB from -128 to 0 dB, in the 1 dB steps of the knob. -128 dB does not mute the headphones, so the TLV does not declare a mute. DAW Thru plays the USB stream past the monitor controller, so the main output selectors name it "DAW Thru (full scale)". The headphone volume and mute still act on every headphone source, so the headphone selectors name it "DAW Thru". Mixer matrix: mixer unit 60 mixes 14 inputs (Mic 1-2, Digi 1-8, DAW 1-4) into four outputs (Main L/R, Cue L/R), CN = input * 4 + output. GET RANGE reports -127 to 0 dB in 1 dB steps, so the generic driver creates four "Analogue 4 Volume" controls with values from 0 to 127. The crosspoints take -128 dB (mute) to +6 dB in 1/256 dB steps, as on the EVO4, so they use the same control type. Add one stereo control per input and output pair: "Mix Main Playback Volume" and "Mix Cue Playback Volume". Hide the generic controls in the MkI map. The driver reads each crosspoint at probe and writes nothing to the mixer. Write-only controls: some MkI controls cannot be read back: - GET stalls for the input gain boost and polarity (feature unit 11), the iD key function and the digital input mode. - GET of the talkback source answers 0, whatever value a SET wrote. For FU 11 the generic driver creates "Input Gain Control" and "Phase Inverter Control" and logs "cannot get min/max values". Add: - Mic 1/2 Boost Capture Switch (+10 dB) - Mic 1/2 and Digi 1/2 Polarity Invert Capture Switch - iD Key Function Playback Enum (ScrollControl, Mono, Mono + Polarity, Dim, Talkback) - Talkback Source Capture Enum (None, Mic 1-2, Digi 1-8) - Digital In Mode Capture Enum (ADAT, S/PDIF) and hide the generic FU 11 controls in the MkI map. The device refuses polarity on Digi 3-8 with EPIPE, in ADAT and in S/PDIF mode, so Digi 3-8 have no polarity control. These controls use the cache, init and force-set flags: they show the last value written, every put sends its value, and the probe writes each one once so that the value shown is true: - boost and polarity off, iD key ScrollControl, talkback source None - S/PDIF: the MkI's measured power-on mode If a probe write fails, the card still registers and the kernel log names the control. Until a put succeeds, the control reads its probe value, which the device may not hold. The probe write replaces any value the device kept. On mains power the device keeps its values across a replug, so the controls return to the probe values until alsactl restore runs. Signed-off-by: Will Porter --- sound/usb/mixer_audient.c | 316 ++++++++++++++++++++++++++++++++++++++ sound/usb/mixer_audient.h | 1 + sound/usb/mixer_maps.c | 2 + sound/usb/mixer_quirks.c | 1 + 4 files changed, 320 insertions(+) diff --git a/sound/usb/mixer_audient.c b/sound/usb/mixer_audient.c index 77f48d9a74917..62f87283485d0 100644 --- a/sound/usb/mixer_audient.c +++ b/sound/usb/mixer_audient.c @@ -3,6 +3,10 @@ * Audient driver for ALSA * Copyright (C) 2026 Christian Ruppert * + * Supported models: EVO4 (2708:0006), iD14 MkI (2708:0002). + * The iD14 MkII and other iD models keep the generic driver: their units + * may differ. + * * EVO4 support is based on the work of Ivan Hazucha for audient-evo-py. * https://github.com/vanzaho/audient-evo-py/ */ @@ -10,6 +14,7 @@ #include #include +#include #include #include #include @@ -31,6 +36,25 @@ enum snd_audient_type { SND_AUDIENT_TYPE_MUTE, SND_AUDIENT_TYPE_MUTE_OUT, SND_AUDIENT_TYPE_MIXER, + SND_AUDIENT_TYPE_ID14_MON_VOLUME, + SND_AUDIENT_TYPE_ID14_MON_CUT, + SND_AUDIENT_TYPE_ID14_MON_DIM, + SND_AUDIENT_TYPE_ID14_MON_DIM_LEVEL, + SND_AUDIENT_TYPE_ID14_MON_MONO, + SND_AUDIENT_TYPE_ID14_MON_MONO_MODE, + SND_AUDIENT_TYPE_ID14_MON_POLARITY, + SND_AUDIENT_TYPE_ID14_MON_TALKBACK, + SND_AUDIENT_TYPE_ID14_HP_VOLUME, + SND_AUDIENT_TYPE_ID14_HP_MUTE, + SND_AUDIENT_TYPE_ID14_ROUTE_MAIN_L, + SND_AUDIENT_TYPE_ID14_ROUTE_MAIN_R, + SND_AUDIENT_TYPE_ID14_ROUTE_HP_L, + SND_AUDIENT_TYPE_ID14_ROUTE_HP_R, + SND_AUDIENT_TYPE_ID14_IN_BOOST, + SND_AUDIENT_TYPE_ID14_IN_POLARITY, + SND_AUDIENT_TYPE_ID14_MON_ID_KEY, + SND_AUDIENT_TYPE_ID14_MON_TALKBACK_SRC, + SND_AUDIENT_TYPE_ID14_OPTICAL_MODE, SND_AUDIENT_TYPE_NCTYPES }; @@ -61,6 +85,154 @@ struct snd_audient_enum { }; \ static_assert(ARRAY_SIZE(texts_) == ARRAY_SIZE(name##_values)) +/* + * iD14 MkI units. The monitor controller, output routing, headphone level, + * input options and the mixer sit on extension units and on feature units + * whose descriptors declare no controls; the generic driver cannot find them. + */ +#define ID14_IT_DIGITAL 0x01 /* input terminal: optical and coaxial */ +#define ID14_FU_OUT 0x0a /* before the outputs: CN 3-4 headphones */ +#define ID14_FU_IN 0x0b /* inputs: CN 1-2 Mic, 3-10 Digi */ +#define ID14_FU_MIX 0x0c /* after the mixer: CN 1-2 Main, 3-4 Cue */ +#define ID14_ROUTE 0x33 /* routing XU: CN = destination */ +#define ID14_MON 0x36 /* monitor controller XU */ + +/* Monitor controller selectors */ +#define ID14_MON_MONO 0x00 +#define ID14_MON_MONO_MODE 0x01 +#define ID14_MON_POLARITY 0x03 +#define ID14_MON_CUT 0x04 +#define ID14_MON_DIM 0x05 +#define ID14_MON_DIM_LEVEL 0x06 /* s16, 1/256 dB */ +#define ID14_MON_TALKBACK 0x07 +#define ID14_MON_TALKBACK_SRC 0x08 /* GET always returns 0 */ +#define ID14_MON_ID_KEY 0x10 /* u16: the selector the iD key toggles */ +#define ID14_MON_VOLUME 0x12 /* s16, 1/256 dB; the knob also sets it */ + +#define ID14_IN_BOOST 0x0b /* s16: 0x0a00 = +10 dB, 0 = off */ +#define ID14_IN_POLARITY 0x0d +#define ID14_IT_OPTICAL_MODE 0x00 /* u32: 0 ADAT, 1 S/PDIF */ + +#define ID14_ROUTE_SOURCE 0x06 /* u8: source of the destination */ + +/* + * iD14 volumes: s16 in 1/256 dB, -128 ... 0 dB, in the 1 dB steps of the + * front panel knob. Control value 0 is -128 dB, 128 is 0 dB. -128 dB is not + * a mute: on the headphones the level stops falling at a small residual. + */ +static const DECLARE_TLV_DB_SCALE(snd_audient_tlv_id14_vol, -12800, 100, 0); + +/* Mono mode: one-speaker sum (Left, Right) or phantom centre */ +static const char *const snd_audient_id14_mono_mode_texts[] = { + "Left", "Centre", "Right", +}; +SND_AUDIENT_ENUM(snd_audient_id14_mono_mode, + snd_audient_id14_mono_mode_texts, 1, 0, 2); + +/* + * Output routing. Main Mix is 0x14/0x15 on the main outputs and 0x18/0x19 + * on the headphones; DAW Thru on destination n plays DAW n + 1. DAW Thru + * bypasses the monitor controller (speaker volume, cut and dim), so the + * main outputs play the USB stream at full scale. The headphone volume and + * mute still act on every headphone source. + */ +static const char *const snd_audient_id14_route_main_texts[] = { + "Main Mix", "Cue Mix", "DAW Thru (full scale)", +}; +static const char *const snd_audient_id14_route_hp_texts[] = { + "Main Mix", "Cue Mix", "DAW Thru", +}; +SND_AUDIENT_ENUM(snd_audient_id14_route_main_l, + snd_audient_id14_route_main_texts, 0x14, 0x10, 0x00); +SND_AUDIENT_ENUM(snd_audient_id14_route_main_r, + snd_audient_id14_route_main_texts, 0x15, 0x11, 0x01); +SND_AUDIENT_ENUM(snd_audient_id14_route_hp_l, + snd_audient_id14_route_hp_texts, 0x18, 0x10, 0x02); +SND_AUDIENT_ENUM(snd_audient_id14_route_hp_r, + snd_audient_id14_route_hp_texts, 0x19, 0x11, 0x03); + +/* + * iD key function: the value is the monitor controller selector the key + * toggles. ScrollControl (0xffff) toggles nothing: the knob then scrolls + * through the HID interface. + */ +static const char *const snd_audient_id14_id_key_texts[] = { + "ScrollControl", "Mono", "Mono + Polarity", "Dim", "Talkback", +}; +SND_AUDIENT_ENUM(snd_audient_id14_id_key, snd_audient_id14_id_key_texts, + 0xffff, ID14_MON_MONO, ID14_MON_POLARITY, ID14_MON_DIM, + ID14_MON_TALKBACK); + +/* Talkback source: the routing source number of the input; none = 0xff */ +static const char *const snd_audient_id14_talkback_texts[] = { + "None", "Mic 1", "Mic 2", "Digi 1", "Digi 2", "Digi 3", "Digi 4", + "Digi 5", "Digi 6", "Digi 7", "Digi 8", +}; +SND_AUDIENT_ENUM(snd_audient_id14_talkback, snd_audient_id14_talkback_texts, + 0xff, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13); + +static const char *const snd_audient_id14_optical_texts[] = { + "ADAT", "S/PDIF", +}; +SND_AUDIENT_ENUM(snd_audient_id14_optical, snd_audient_id14_optical_texts, + 0, 1); + +/* + * Write-only: GET stalls or does not report writes. Show the last value + * written, write the init value at probe, and send every put. + */ +#define ID14_WO (SND_AUDIENT_CTYPE_FLAGS_CACHE \ + | SND_AUDIENT_CTYPE_FLAGS_GET_BROKEN \ + | SND_AUDIENT_CTYPE_FLAGS_INIT_HW) + +#define ID14_BOOL(unit_, sel_) \ + { \ + .type = SNDRV_CTL_ELEM_TYPE_BOOLEAN, \ + .len = 1, \ + .min.integer = 0, \ + .max.integer = 1, \ + .unit = (unit_), \ + .sel = (sel_), \ + } + +/* 1 = cut or mute: shown as a switch that is off */ +#define ID14_BOOL_INV(unit_, sel_) \ + { \ + .type = SNDRV_CTL_ELEM_TYPE_BOOLEAN, \ + .len = 1, \ + .min.integer = 1, \ + .max.integer = 0, \ + .unit = (unit_), \ + .sel = (sel_), \ + } + +#define ID14_VOLUME(unit_, sel_) \ + { \ + .type = SNDRV_CTL_ELEM_TYPE_INTEGER, \ + .flags = SND_AUDIENT_CTYPE_FLAGS_SIGNED, \ + .len = 2, \ + .min.integer = -128 * 256, \ + .max.integer = 0, \ + .res = 256, \ + .tlv = snd_audient_tlv_id14_vol, \ + .unit = (unit_), \ + .sel = (sel_), \ + } + +/* + * A readable enum. It has no cache entry, so a get always reads the device + * and never uses init. Write-only enums set .init and .flags without this + * macro. + */ +#define ID14_ENUM(unit_, sel_, len_, enum_) \ + { \ + .type = SNDRV_CTL_ELEM_TYPE_ENUMERATED, \ + .len = (len_), \ + .enumeration = &(enum_), \ + .unit = (unit_), \ + .sel = (sel_), \ + } + static const struct snd_audient_ctrl_type { snd_ctl_elem_type_t type; unsigned long flags; @@ -122,6 +294,88 @@ static const struct snd_audient_ctrl_type { .sel = 0x01, .tlv = snd_audient_tlv_mixer, }, + [SND_AUDIENT_TYPE_ID14_MON_VOLUME] = + ID14_VOLUME(ID14_MON, ID14_MON_VOLUME), + [SND_AUDIENT_TYPE_ID14_MON_CUT] = + ID14_BOOL_INV(ID14_MON, ID14_MON_CUT), + [SND_AUDIENT_TYPE_ID14_MON_DIM] = + ID14_BOOL(ID14_MON, ID14_MON_DIM), + [SND_AUDIENT_TYPE_ID14_MON_DIM_LEVEL] = + ID14_VOLUME(ID14_MON, ID14_MON_DIM_LEVEL), + [SND_AUDIENT_TYPE_ID14_MON_MONO] = + ID14_BOOL(ID14_MON, ID14_MON_MONO), + [SND_AUDIENT_TYPE_ID14_MON_MONO_MODE] = + ID14_ENUM(ID14_MON, ID14_MON_MONO_MODE, 1, + snd_audient_id14_mono_mode), + [SND_AUDIENT_TYPE_ID14_MON_POLARITY] = + ID14_BOOL(ID14_MON, ID14_MON_POLARITY), + [SND_AUDIENT_TYPE_ID14_MON_TALKBACK] = + ID14_BOOL(ID14_MON, ID14_MON_TALKBACK), + [SND_AUDIENT_TYPE_ID14_HP_VOLUME] = + ID14_VOLUME(ID14_FU_OUT, UAC_FU_VOLUME), + [SND_AUDIENT_TYPE_ID14_HP_MUTE] = + ID14_BOOL_INV(ID14_FU_OUT, UAC_FU_MUTE), + [SND_AUDIENT_TYPE_ID14_ROUTE_MAIN_L] = + ID14_ENUM(ID14_ROUTE, ID14_ROUTE_SOURCE, 1, + snd_audient_id14_route_main_l), + [SND_AUDIENT_TYPE_ID14_ROUTE_MAIN_R] = + ID14_ENUM(ID14_ROUTE, ID14_ROUTE_SOURCE, 1, + snd_audient_id14_route_main_r), + [SND_AUDIENT_TYPE_ID14_ROUTE_HP_L] = + ID14_ENUM(ID14_ROUTE, ID14_ROUTE_SOURCE, 1, + snd_audient_id14_route_hp_l), + [SND_AUDIENT_TYPE_ID14_ROUTE_HP_R] = + ID14_ENUM(ID14_ROUTE, ID14_ROUTE_SOURCE, 1, + snd_audient_id14_route_hp_r), + /* the documented boost is a fixed +10 dB */ + [SND_AUDIENT_TYPE_ID14_IN_BOOST] = { + .type = SNDRV_CTL_ELEM_TYPE_BOOLEAN, + .flags = ID14_WO, + .len = 2, + .min.integer = 0, + .max.integer = 10 * 256, + .init = 0, + .unit = ID14_FU_IN, + .sel = ID14_IN_BOOST, + }, + [SND_AUDIENT_TYPE_ID14_IN_POLARITY] = { + .type = SNDRV_CTL_ELEM_TYPE_BOOLEAN, + .flags = ID14_WO, + .len = 1, + .min.integer = 0, + .max.integer = 1, + .init = 0, + .unit = ID14_FU_IN, + .sel = ID14_IN_POLARITY, + }, + [SND_AUDIENT_TYPE_ID14_MON_ID_KEY] = { + .type = SNDRV_CTL_ELEM_TYPE_ENUMERATED, + .flags = ID14_WO, + .len = 2, + .init = 0xffff, /* ScrollControl */ + .enumeration = &snd_audient_id14_id_key, + .unit = ID14_MON, + .sel = ID14_MON_ID_KEY, + }, + [SND_AUDIENT_TYPE_ID14_MON_TALKBACK_SRC] = { + .type = SNDRV_CTL_ELEM_TYPE_ENUMERATED, + .flags = ID14_WO, + .len = 1, + .init = 0xff, /* None */ + .enumeration = &snd_audient_id14_talkback, + .unit = ID14_MON, + .sel = ID14_MON_TALKBACK_SRC, + }, + /* the power-on mode is S/PDIF */ + [SND_AUDIENT_TYPE_ID14_OPTICAL_MODE] = { + .type = SNDRV_CTL_ELEM_TYPE_ENUMERATED, + .flags = ID14_WO, + .len = 4, + .init = 1, /* S/PDIF */ + .enumeration = &snd_audient_id14_optical, + .unit = ID14_IT_DIGITAL, + .sel = ID14_IT_OPTICAL_MODE, + }, }; @@ -182,6 +436,62 @@ static const char *const snd_audient_evo4_matrix[] = { NULL }; +#define ID14_CTRL(name_, type_, offs_, chans_) \ + { \ + .name = (name_), \ + .type = SND_AUDIENT_TYPE_ID14_##type_, \ + .channels = (chans_), \ + .hwchannels = (chans_), \ + .val_offs = (offs_), \ + } + +static const struct snd_audient_ctrl snd_audient_id14_mk1_controls[] = { + ID14_CTRL("Monitor Speaker Playback Volume", MON_VOLUME, 0, 1), + ID14_CTRL("Monitor Speaker Playback Switch", MON_CUT, 0, 1), + ID14_CTRL("Monitor Dim Playback Switch", MON_DIM, 0, 1), + ID14_CTRL("Monitor Dim Level Playback Volume", MON_DIM_LEVEL, 0, 1), + ID14_CTRL("Monitor Mono Playback Switch", MON_MONO, 0, 1), + ID14_CTRL("Monitor Mono Mode Playback Enum", MON_MONO_MODE, 0, 1), + ID14_CTRL("Monitor Polarity Invert Playback Switch", MON_POLARITY, 0, 1), + ID14_CTRL("Monitor Headphone Playback Volume", HP_VOLUME, 3, 2), + ID14_CTRL("Monitor Headphone Playback Switch", HP_MUTE, 3, 2), + ID14_CTRL("Talkback Playback Switch", MON_TALKBACK, 0, 1), + ID14_CTRL("Main Out L Source Playback Enum", ROUTE_MAIN_L, 0, 1), + ID14_CTRL("Main Out R Source Playback Enum", ROUTE_MAIN_R, 1, 1), + ID14_CTRL("Headphone L Source Playback Enum", ROUTE_HP_L, 2, 1), + ID14_CTRL("Headphone R Source Playback Enum", ROUTE_HP_R, 3, 1), + ID14_CTRL("Mic 1 Boost Capture Switch", IN_BOOST, 1, 1), + ID14_CTRL("Mic 2 Boost Capture Switch", IN_BOOST, 2, 1), + ID14_CTRL("Mic 1 Polarity Invert Capture Switch", IN_POLARITY, 1, 1), + ID14_CTRL("Mic 2 Polarity Invert Capture Switch", IN_POLARITY, 2, 1), + /* Digi 3-8 refuse polarity (CN 5-10 stall) */ + ID14_CTRL("Digi 1 Polarity Invert Capture Switch", IN_POLARITY, 3, 1), + ID14_CTRL("Digi 2 Polarity Invert Capture Switch", IN_POLARITY, 4, 1), + ID14_CTRL("iD Key Function Playback Enum", MON_ID_KEY, 0, 1), + ID14_CTRL("Talkback Source Capture Enum", MON_TALKBACK_SRC, 0, 1), + ID14_CTRL("Digital In Mode Capture Enum", OPTICAL_MODE, 0, 1), + { 0 }, /* sentinel */ +}; + +/* + * iD14 MkI mixer: unit 60, 14 inputs x 4 outputs, CN = input * 4 + output + * (outputs Main L, Main R, Cue L, Cue R). Each input has a Main and a Cue + * pair, so with 2 channels per element, element n starts at CN 2 * n. + */ +#define ID14_MIX(in) "Mix Main " in " Playback Volume", \ + "Mix Cue " in " Playback Volume" + +static const char *const snd_audient_id14_mk1_matrix[] = { + ID14_MIX("Mic 1"), ID14_MIX("Mic 2"), + ID14_MIX("Digi 1"), ID14_MIX("Digi 2"), + ID14_MIX("Digi 3"), ID14_MIX("Digi 4"), + ID14_MIX("Digi 5"), ID14_MIX("Digi 6"), + ID14_MIX("Digi 7"), ID14_MIX("Digi 8"), + ID14_MIX("DAW 1"), ID14_MIX("DAW 2"), + ID14_MIX("DAW 3"), ID14_MIX("DAW 4"), + NULL +}; + static const struct audient_devinfo { u32 usb_id; const struct snd_audient_ctrl *controls; @@ -194,6 +504,12 @@ static const struct audient_devinfo { .matrix_names = snd_audient_evo4_matrix, .matrix_channels = 2, }, + { + .usb_id = USB_ID(USB_AUDIENT_VID, USB_ID14_MK1_PID), + .controls = snd_audient_id14_mk1_controls, + .matrix_names = snd_audient_id14_mk1_matrix, + .matrix_channels = 2, + }, { 0 } /* sentinel */ }; diff --git a/sound/usb/mixer_audient.h b/sound/usb/mixer_audient.h index db4f31e02b5e1..5d705ffe2cfa1 100644 --- a/sound/usb/mixer_audient.h +++ b/sound/usb/mixer_audient.h @@ -6,6 +6,7 @@ #define USB_AUDIENT_VID (0x2708) #define USB_EVO4_PID (0x0006) +#define USB_ID14_MK1_PID (0x0002) int snd_audient_controls_create(struct usb_mixer_interface *mixer); diff --git a/sound/usb/mixer_maps.c b/sound/usb/mixer_maps.c index 31f8d02534373..b88244b12a98a 100644 --- a/sound/usb/mixer_maps.c +++ b/sound/usb/mixer_maps.c @@ -542,7 +542,9 @@ static const struct usbmix_name_map audient_id14_map[] = { /* Audient iD14 MkI: model-specific control map. */ static const struct usbmix_name_map audient_id14_mk1_map[] = { + { 11, NULL }, /* FU, see mixer_audient.c */ { 12, "Monitor Mix Playback" }, /* FU, partial coverage */ + { 60, NULL }, /* MU, see mixer_audient.c */ {} }; diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index c250ebea5af51..c68aa6f17e454 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c @@ -4781,6 +4781,7 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) break; case USB_ID(USB_AUDIENT_VID, USB_EVO4_PID): /* Audient EVO 4 */ + case USB_ID(USB_AUDIENT_VID, USB_ID14_MK1_PID): /* Audient iD14 MkI */ err = snd_audient_controls_create(mixer); break; -- 2.47.3