From patchwork Sun Nov 24 12:35:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Verwiebe X-Patchwork-Id: 11259157 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AAD3A14E5 for ; Sun, 24 Nov 2019 12:36:45 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8CDA52075E for ; Sun, 24 Nov 2019 12:36:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="NCCqTeXN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CDA52075E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=jensverwiebe.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 31D7B1853; Sun, 24 Nov 2019 13:35:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 31D7B1853 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1574599002; bh=WnN4kD5KnGI8nNm9JsMEuH46r+Apg9DuU2qTbftMJ6k=; h=To:From:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=NCCqTeXNIJCzrYqM/GkukSB7T+soLFHlCKkcr3LTLEq1Y4lv7j/xPdug27g6N+sT6 MiIfDpLLInB0GdC3Gv9Q2EKmTGYg1vqGDsBtO2Plm1PyDk5/X6ar4tmPpxxssiotH/ INUt6MC9IHrnSG5l5HEclZ09qUB2qrY7JW+iiIAU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 80E16F80159; Sun, 24 Nov 2019 13:35:51 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id DA6D1F801ED; Sun, 24 Nov 2019 13:35:49 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=HTML_MESSAGE,SPF_HELO_NONE, SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 058ECF800E5 for ; Sun, 24 Nov 2019 13:35:46 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 058ECF800E5 Received: from [192.168.178.21] ([95.116.187.128]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MMnnm-1iIICb0OWa-00IkoZ for ; Sun, 24 Nov 2019 13:35:45 +0100 To: alsa-devel@alsa-project.org From: Jens Verwiebe Message-ID: <384d65cd-5e87-91eb-9fc3-e57226f534c6@jensverwiebe.de> Date: Sun, 24 Nov 2019 13:35:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 Content-Language: de-DE X-Provags-ID: V03:K1:RCtG0SlfYyHOWQIRJe+6jZfgebpXe3Ky4GAJYzb5Imy64q45uu7 nt3e7wCPrULlhPOr6JhxGsr9Gtov+wGlTZs4KTFbB1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KfpPTdJ3sPK9EeruePUsdDPQUgwRI= X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [alsa-devel] [RESEND PATCH] ALSA: usb-audio: Fix Focusrite Scarlett 6i6 gen1 - input handling X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The Scarlett 6i6 has no padding on rear inputs 3/4 but a gainstage. This patch introduces this functionality as to be seen in the mac or windows scarlett control. The correct address could already be found in the dump info, but was never used. Without this patch inputs 3/4 are quite unusable else. The diff is attached as a textfile as i found this preseverves formatting best. Diffed and testcompiled against todays kernel master. Cheers ... Jens Changelog: The Scarlett 6i6 has no padding on rear inputs 3/4 but a gainstage (Lo/Hi). Adding this functionality according to macOS/Win drivers. Signed-off-by: Jens Verwiebe diff --git a/sound/usb/mixer_scarlett.c b/sound/usb/mixer_scarlett.c index 83715fd8dfd6..9d10cbf1b5ed 100644 --- a/sound/usb/mixer_scarlett.c +++ b/sound/usb/mixer_scarlett.c @@ -142,6 +142,7 @@ enum { SCARLETT_OUTPUTS, SCARLETT_SWITCH_IMPEDANCE, SCARLETT_SWITCH_PAD, + SCARLETT_SWITCH_GAIN, }; enum { @@ -192,6 +193,15 @@ static const struct scarlett_mixer_elem_enum_info opt_pad = { } }; +static const struct scarlett_mixer_elem_enum_info opt_gain = { + .start = 0, + .len = 2, + .offsets = {}, + .names = (char const * const []){ + "Lo", "Hi" + } +}; + static const struct scarlett_mixer_elem_enum_info opt_impedance = { .start = 0, .len = 2, @@ -652,8 +662,8 @@ static struct scarlett_device_info s6i6_info = { { .num = 1, .type = SCARLETT_SWITCH_PAD, .name = NULL}, { .num = 2, .type = SCARLETT_SWITCH_IMPEDANCE, .name = NULL}, { .num = 2, .type = SCARLETT_SWITCH_PAD, .name = NULL}, - { .num = 3, .type = SCARLETT_SWITCH_PAD, .name = NULL}, - { .num = 4, .type = SCARLETT_SWITCH_PAD, .name = NULL}, + { .num = 3, .type = SCARLETT_SWITCH_GAIN, .name = NULL}, + { .num = 4, .type = SCARLETT_SWITCH_GAIN, .name = NULL}, }, .matrix_mux_init = { @@ -883,6 +893,15 @@ static int scarlett_controls_create_generic(struct usb_mixer_interface *mixer, if (err < 0) return err; break; + case SCARLETT_SWITCH_GAIN: + sprintf(mx, "Input %d Gain Switch", ctl->num); + err = add_new_ctl(mixer, &usb_scarlett_ctl_enum, + scarlett_ctl_enum_resume, 0x01, + 0x08, ctl->num, USB_MIXER_S16, 1, mx, + &opt_gain, &elem); + if (err < 0) + return err; + break; } }