From patchwork Sat Aug 26 14:56:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Verwiebe X-Patchwork-Id: 9923547 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 69CC56022E for ; Sat, 26 Aug 2017 15:21:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 582A0285D3 for ; Sat, 26 Aug 2017 15:21:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B441285DC; Sat, 26 Aug 2017 15:21:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3489F285D3 for ; Sat, 26 Aug 2017 15:21:27 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id B5593266CD2; Sat, 26 Aug 2017 16:56:05 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id EBAE4266CE2; Sat, 26 Aug 2017 16:56:04 +0200 (CEST) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.187]) by alsa0.perex.cz (Postfix) with ESMTP id 36D64266998 for ; Sat, 26 Aug 2017 16:56:02 +0200 (CEST) Received: from [192.168.178.21] ([77.188.16.129]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.167]) with ESMTPSA (Nemesis) id 0LzCmv-1dPKbb2Qhl-014PiN for ; Sat, 26 Aug 2017 16:56:02 +0200 To: alsa-devel@alsa-project.org From: Jens Verwiebe Message-ID: Date: Sat, 26 Aug 2017 16:56:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Content-Language: en-US X-Provags-ID: V03:K0:WtVf4dqdm+MLRtajSjwquD8CADEtwmUBEbcnSeXW+CVm1V8QRSW 9Hb7GPqL61XOhxrr1hxcWDaUrqFqRLylmkxCIZHaOPx8Ee460NhTWlDC7I+gxcOBKNIQuaM Zzr0lVWDVfJbb1kCxN+fB+ZgV89QTDdwQUgEEOqxHZkIHn4D1Me/x6x17Zstcn19ylHrvq2 V7ofqxcYihwCCyy+b8L/Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:3nB/PHsHxPI=:eGIk59H4rGpT5dyxrO951R HqKiCmGGb0BbMApVqc9YZd9gY2MKc5ENt052fqB5NlisMvvnipWMxQ0WSUEBKZk3YlGrLRIPu Yseafcb+taFqlW6+uRf6ExVPL3pGkwW+0uv9kI1tPcztUBu5PaSLuU76BpTNpWI4N4DaXT6sD e6Gdh6LS3N6WjI8cPeJHrHeK31a/MzjyZTMIcy88cIAe56RLDgNdq29Gl2zP1GaSO1QcYKYew yvXyJ38OhPXG6gMIlZ/JhJAFyOtCp76Rz4AGBtrvBFIkICDKXqYugaW2/ZzQEgPhnkRWdBjLg dIaqmh+vDR3RdKTLLHoXOuaEsf4IhP1ArSunktSwkfEzZy7EAhWlSx8ywESSKRz6ZSeHFwsYl doh4kWVaDVJ1nF1lZcY9/1G/GLzjj/w05mm8sQ1voMWMa8tmbG16cBWVAm0wYaLy+lbjDRPIf v6cXGAg72ebSLGlUNWpdBueT18GNiVU5tQe6CNE9Q3uusVQx9RcE3rOMnvpL04BWkM3dk41LE YJXTdpqmoat0eoM5OB23MZ/3xKrYSkFH7l0/GSPsr7grYMKgBX8URBv78E8XqKr1oV970vPtg 2x41HX1zLoNC/9wVh+Kej/6U8g622bAH8/TBeibiQVDXtyTHQXhyB6V0hj5wK+XUtemNx4jZH mWXMkdB/hAKs8c6q40zXZiLtmmtgKUANGP05ANcqvV56u/3AdfItyjcUegLT/jfcN+8gFCHuX hufjP1WGh9agaMubbJdeIRzeE/MV82MGuyPDVg8skHRHXw5F/mBshi3Bl3c= Subject: [alsa-devel] Scarlett 6i6 gain switches patch X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Hi folks As an owner of an Focusrite Scarlett 6i6 (gen 1)i was bothered that i could not switch rear inputs 3/4 gain. After investigating the code i found the specs of that interface not used right. I wrote a patch and tested this well so far. Afaik the same could be used also for the 18i18 and 18i20, but i left those untouched for i could not test myself. Pls review and take over in case its accepted. Cheers ... Jens The patch: --- /sound/usb/mixer_scarlett_nv.c 2017-04-08 09:53:53.000000000 +0200 +++ /sound/usb/mixer_scarlett.c 2017-08-26 03:15:15.734930629 +0200 @@ -152,6 +152,7 @@ SCARLETT_OUTPUTS, SCARLETT_SWITCH_IMPEDANCE, SCARLETT_SWITCH_PAD, + SCARLETT_SWITCH_GAIN, }; enum { @@ -202,6 +203,15 @@ } }; +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, @@ -664,8 +674,8 @@ { .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 = { @@ -895,6 +905,15 @@ 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; } }