From patchwork Fri Feb 26 15:40:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 387688 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3DDBC433E0 for ; Fri, 26 Feb 2021 15:42:27 +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 044D764EC4 for ; Fri, 26 Feb 2021 15:42:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 044D764EC4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com 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 6789A166D; Fri, 26 Feb 2021 16:41:35 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6789A166D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1614354145; bh=HA3P4xrS0JfNmmEZ39L+clx5ppNcAH9l8RmdOgvCWAA=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Pdd6sSc2ow7g8eTfBgGAaSpUh+IzJO45Oz+Rsr594vuXt6fCYLNCoq7MawYtkEFv9 RVO9ASP9VGTIik7K3autVabbljsc3sUT+fJG2a5ufDYTGJoUNpnC3XJ8w7Ns0X4XaF 6wM/HdZMHelU3h0epSmO2qRnF6Tt7D4aJvp+ZTKY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5B04EF80234; Fri, 26 Feb 2021 16:40:47 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 65D61F80276; Fri, 26 Feb 2021 16:40:43 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 6318BF80154 for ; Fri, 26 Feb 2021 16:40:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6318BF80154 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OGsqKA0s" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614354033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jxY8B4qTKDcHaRcAhEwhGpo5FXKEPrhaW4WxzNJwna0=; b=OGsqKA0sNXEQJtNduAUdMtS0epBmLMTM3ZyY4+cBE5ukbpgqkhi8mbLoh8MCNYc0CSLu+1 Nk5zPknl/BF/+3bd7jh15oGgxM/df3s89/tg7L3FuCPIjrpr/TDPytf8WzAfgS4BYLBMc1 TmXf5WRPsOjN7TKJmt+jjpmqvyBMkwU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-274-3_xm-V4APPiHrOjske4BQA-1; Fri, 26 Feb 2021 10:40:31 -0500 X-MC-Unique: 3_xm-V4APPiHrOjske4BQA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1AD5680402E; Fri, 26 Feb 2021 15:40:30 +0000 (UTC) Received: from x1.localdomain (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id E2935131D8; Fri, 26 Feb 2021 15:40:28 +0000 (UTC) From: Hans de Goede To: Jaroslav Kysela Subject: [PATCH alsa-ucm-conf 1/8] codecs/rt5640: Cleanup: unify Stereo / Mono ADC handling Date: Fri, 26 Feb 2021 16:40:18 +0100 Message-Id: <20210226154025.84828-2-hdegoede@redhat.com> In-Reply-To: <20210226154025.84828-1-hdegoede@redhat.com> References: <20210226154025.84828-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hdegoede@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: Hans de Goede , alsa-devel@alsa-project.org, Pierre-Louis Bossart , Bard Liao 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" Cleanup: no functional changes intended. The rt5640 codec is sometimes used with AIF1 connected to the SoC and sometimes with AIF2 connected to the SoC. The rt5640 UCM configuration deals with this by accepting input from and sending output to both AIFs, relying on the kernels DAPM framework to disable parts of the graph which are connected to the unconnected AIF. On the output side we solve this by enabling both the IF1_DAC and IF2_DAC data inputs to the digital 'Stereo DAC MIX' mixer. On the input side handling this is somewhat more complicated, the "Digital Mixer Path" leading to the IF1_ADC and IF2_ADC outputs are entirely separate paths. To solve this we enable the active input (DMIC or ADC) in both the Stereo ADC (connected to IF1_ADC) and the Mono ADC (IF2_ADC) paths. So far we've not been entirely consistent in our handling of the Stereo ADC vs Mono ADC paths, this commit cleans this up: 1. Set the 'Mono ADC Capture Switch' to on once from EnableSeq.conf, like we do for the 'ADC Capture Switch' instead of toggling it on/off from the individual input Enable/Disable sequences. 2. Group all the 'Mono ADC ...' mixer cset calls together with their stereo ADC counterparts. 3. Explicitly select DMIC L/R 1 for the Mono ADC L/R 2 Mux input, instead of relying on this being the default. Signed-off-by: Hans de Goede --- ucm2/codecs/rt5640/DigitalMics.conf | 2 -- ucm2/codecs/rt5640/EnableSeq.conf | 10 +++++++--- ucm2/codecs/rt5640/HeadsetMic.conf | 10 ++-------- ucm2/codecs/rt5640/IN1-InternalMic.conf | 11 ++--------- ucm2/codecs/rt5640/IN3-InternalMic.conf | 11 ++--------- 5 files changed, 13 insertions(+), 31 deletions(-) diff --git a/ucm2/codecs/rt5640/DigitalMics.conf b/ucm2/codecs/rt5640/DigitalMics.conf index fdd412f..157c544 100644 --- a/ucm2/codecs/rt5640/DigitalMics.conf +++ b/ucm2/codecs/rt5640/DigitalMics.conf @@ -8,7 +8,6 @@ SectionDevice."Mic" { EnableSequence [ cset "name='Mono ADC MIXL ADC2 Switch' on" cset "name='Mono ADC MIXR ADC2 Switch' on" - cset "name='Mono ADC Capture Switch' on" cset "name='Stereo ADC MIXL ADC2 Switch' on" cset "name='Stereo ADC MIXR ADC2 Switch' on" cset "name='Internal Mic Switch' on" @@ -18,7 +17,6 @@ SectionDevice."Mic" { DisableSequence [ cset "name='Mono ADC MIXL ADC2 Switch' off" cset "name='Mono ADC MIXR ADC2 Switch' off" - cset "name='Mono ADC Capture Switch' off" cset "name='Stereo ADC MIXL ADC2 Switch' off" cset "name='Stereo ADC MIXR ADC2 Switch' off" cset "name='Internal Mic Switch' off" diff --git a/ucm2/codecs/rt5640/EnableSeq.conf b/ucm2/codecs/rt5640/EnableSeq.conf index 145a23b..4754df7 100644 --- a/ucm2/codecs/rt5640/EnableSeq.conf +++ b/ucm2/codecs/rt5640/EnableSeq.conf @@ -30,8 +30,13 @@ EnableSequence [ # Input Configuration cset "name='Stereo ADC1 Mux' ADC" cset "name='Stereo ADC2 Mux' DMIC1" - cset "name='Mono ADC L1 Mux' 1" - cset "name='Mono ADC R1 Mux' 1" + cset "name='ADC Capture Switch' on" + + cset "name='Mono ADC L1 Mux' ADCL" + cset "name='Mono ADC R1 Mux' ADCR" + cset "name='Mono ADC L2 Mux' DMIC L1" + cset "name='Mono ADC R2 Mux' DMIC R1" + cset "name='Mono ADC Capture Switch' on" # 47=0dB, 0.375 dB/step, set it to 6 dB to help with soft mics cset "name='ADC Capture Volume' 63" @@ -45,5 +50,4 @@ EnableSequence [ cset "name='Internal Mic Switch' off" cset "name='Headset Mic Switch' off" - cset "name='ADC Capture Switch' on" ] diff --git a/ucm2/codecs/rt5640/HeadsetMic.conf b/ucm2/codecs/rt5640/HeadsetMic.conf index f88b611..829e4e6 100644 --- a/ucm2/codecs/rt5640/HeadsetMic.conf +++ b/ucm2/codecs/rt5640/HeadsetMic.conf @@ -21,26 +21,20 @@ SectionDevice."Headset" { cset "name='Stereo ADC MIXL ADC1 Switch' on" cset "name='Stereo ADC MIXR ADC1 Switch' on" - cset "name='Mono ADC MIXL ADC1 Switch' on" cset "name='Mono ADC MIXR ADC1 Switch' on" - - cset "name='Mono ADC Capture Switch' on" ] DisableSequence [ cset "name='Stereo ADC MIXL ADC1 Switch' off" cset "name='Stereo ADC MIXR ADC1 Switch' off" + cset "name='Mono ADC MIXL ADC1 Switch' off" + cset "name='Mono ADC MIXR ADC1 Switch' off" cset "name='RECMIXL BST2 Switch' off" cset "name='RECMIXR BST2 Switch' off" cset "name='Headset Mic Switch' off" - - cset "name='Mono ADC MIXL ADC1 Switch' off" - cset "name='Mono ADC MIXR ADC1 Switch' off" - - cset "name='Mono ADC Capture Switch' off" ] Value { diff --git a/ucm2/codecs/rt5640/IN1-InternalMic.conf b/ucm2/codecs/rt5640/IN1-InternalMic.conf index ebb5b6d..260df90 100644 --- a/ucm2/codecs/rt5640/IN1-InternalMic.conf +++ b/ucm2/codecs/rt5640/IN1-InternalMic.conf @@ -15,27 +15,20 @@ SectionDevice."Mic" { cset "name='Stereo ADC MIXL ADC1 Switch' on" cset "name='Stereo ADC MIXR ADC1 Switch' on" - cset "name='Mono ADC MIXL ADC1 Switch' on" cset "name='Mono ADC MIXR ADC1 Switch' on" - - cset "name='Mono ADC Capture Switch' on" ] DisableSequence [ cset "name='Stereo ADC MIXL ADC1 Switch' off" cset "name='Stereo ADC MIXR ADC1 Switch' off" + cset "name='Mono ADC MIXL ADC1 Switch' off" + cset "name='Mono ADC MIXR ADC1 Switch' off" cset "name='RECMIXL BST1 Switch' off" cset "name='RECMIXR BST1 Switch' off" cset "name='Internal Mic Switch' off" - - cset "name='Mono ADC MIXL ADC1 Switch' off" - cset "name='Mono ADC MIXR ADC1 Switch' off" - - cset "name='Mono ADC Capture Switch' off" - ] Value { diff --git a/ucm2/codecs/rt5640/IN3-InternalMic.conf b/ucm2/codecs/rt5640/IN3-InternalMic.conf index 172d909..ebd2b9c 100644 --- a/ucm2/codecs/rt5640/IN3-InternalMic.conf +++ b/ucm2/codecs/rt5640/IN3-InternalMic.conf @@ -15,27 +15,20 @@ SectionDevice."Mic" { cset "name='Stereo ADC MIXL ADC1 Switch' on" cset "name='Stereo ADC MIXR ADC1 Switch' on" - cset "name='Mono ADC MIXL ADC1 Switch' on" cset "name='Mono ADC MIXR ADC1 Switch' on" - - cset "name='Mono ADC Capture Switch' on" - ] DisableSequence [ cset "name='Stereo ADC MIXL ADC1 Switch' off" cset "name='Stereo ADC MIXR ADC1 Switch' off" + cset "name='Mono ADC MIXL ADC1 Switch' off" + cset "name='Mono ADC MIXR ADC1 Switch' off" cset "name='RECMIXL BST3 Switch' off" cset "name='RECMIXR BST3 Switch' off" cset "name='Internal Mic Switch' off" - - cset "name='Mono ADC MIXL ADC1 Switch' off" - cset "name='Mono ADC MIXR ADC1 Switch' off" - - cset "name='Mono ADC Capture Switch' off" ] Value { From patchwork Fri Feb 26 15:40:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 387687 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12056C433E0 for ; Fri, 26 Feb 2021 15:43:19 +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 A82DE64E4D for ; Fri, 26 Feb 2021 15:43:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A82DE64E4D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com 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 1B90D168C; Fri, 26 Feb 2021 16:42:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1B90D168C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1614354196; bh=t4GRXwpz+QsM5RIrjqipLQFfVIBgOxJgg3lCGEgsv3c=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=k73Ezb5lzz2rXCbuBBSf6ncHUONBBlND0YUh3gsnhILcMf/EV/d9xUD+urP4m/0Dz DKH/CpRz1a03JbGRrvMnBbmqkk9YXA3sAONuLrqUsg6WQCWeUqZqWGeNBmGkWKoVqH mp9VYrnPkAmAD5hCmoBijxpvVxhyI0lob2KfrzvI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 160A2F8032B; Fri, 26 Feb 2021 16:40:54 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 455A4F802E2; Fri, 26 Feb 2021 16:40:48 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id CA882F8016C for ; Fri, 26 Feb 2021 16:40:35 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CA882F8016C Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="VnRO9IaS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614354034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=461RKBm0rY9dqbC2WJLQm2UBN2yOxdhctKYoP7EIdUM=; b=VnRO9IaSwk50x4YkatB0ZhuDVMSDGBlZcuoDUaNa80yMwx4OARY50R2qe8s0u7H3n3pmJb W1jyUUNPO2+tVlXlZWrdcDvVVu9FHg6EXqGeesRGovaZt2aRGrTkMcnw8V2owCUIXLKA58 g6iZK2e8Xv4vhTUnYBpLrbFc+JY8JyI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-247-gzld9M5yMv2BqroHNaxE6Q-1; Fri, 26 Feb 2021 10:40:32 -0500 X-MC-Unique: gzld9M5yMv2BqroHNaxE6Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 731626D4E3; Fri, 26 Feb 2021 15:40:31 +0000 (UTC) Received: from x1.localdomain (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 618251050E; Fri, 26 Feb 2021 15:40:30 +0000 (UTC) From: Hans de Goede To: Jaroslav Kysela Subject: [PATCH alsa-ucm-conf 2/8] codecs/rt5640: Cleanup: Initially disable all inputs and outputs Date: Fri, 26 Feb 2021 16:40:19 +0100 Message-Id: <20210226154025.84828-3-hdegoede@redhat.com> In-Reply-To: <20210226154025.84828-1-hdegoede@redhat.com> References: <20210226154025.84828-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hdegoede@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: Hans de Goede , alsa-devel@alsa-project.org, Pierre-Louis Bossart , Bard Liao 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" Cleanup: no functional changes intended. Disable all inputs and outputs from the main EnableSequence. This allows removing some weirdness from the individual input/output EnableSequences where they were turning controls for other inputs/outputs then themselves off. Signed-off-by: Hans de Goede --- ucm2/codecs/rt5640/EnableSeq.conf | 21 +++++++++++++++++++++ ucm2/codecs/rt5640/HeadPhones.conf | 1 - ucm2/codecs/rt5640/IN1-InternalMic.conf | 2 -- ucm2/codecs/rt5640/IN3-InternalMic.conf | 2 -- ucm2/codecs/rt5640/MonoSpeaker.conf | 1 - ucm2/codecs/rt5640/Speaker.conf | 1 - 6 files changed, 21 insertions(+), 7 deletions(-) diff --git a/ucm2/codecs/rt5640/EnableSeq.conf b/ucm2/codecs/rt5640/EnableSeq.conf index 4754df7..5dc7092 100644 --- a/ucm2/codecs/rt5640/EnableSeq.conf +++ b/ucm2/codecs/rt5640/EnableSeq.conf @@ -48,6 +48,27 @@ EnableSequence [ cset "name='IN2 Boost' 1" cset "name='IN3 Boost' 8" + # Start with all controls which are used by the individual + # input/output Enable/DisableSequences off + + cset "name='RECMIXL BST1 Switch' off" + cset "name='RECMIXR BST1 Switch' off" + cset "name='RECMIXL BST2 Switch' off" + cset "name='RECMIXR BST2 Switch' off" + cset "name='RECMIXL BST3 Switch' off" + cset "name='RECMIXR BST3 Switch' off" + + cset "name='Stereo ADC MIXL ADC1 Switch' off" + cset "name='Stereo ADC MIXR ADC1 Switch' off" + cset "name='Stereo ADC MIXL ADC2 Switch' off" + cset "name='Stereo ADC MIXR ADC2 Switch' off" + cset "name='Mono ADC MIXL ADC1 Switch' off" + cset "name='Mono ADC MIXR ADC1 Switch' off" + cset "name='Mono ADC MIXL ADC2 Switch' off" + cset "name='Mono ADC MIXR ADC2 Switch' off" + + cset "name='Speaker Switch' off" + cset "name='Headphone Switch' off" cset "name='Internal Mic Switch' off" cset "name='Headset Mic Switch' off" ] diff --git a/ucm2/codecs/rt5640/HeadPhones.conf b/ucm2/codecs/rt5640/HeadPhones.conf index a9e4d20..1f4316d 100644 --- a/ucm2/codecs/rt5640/HeadPhones.conf +++ b/ucm2/codecs/rt5640/HeadPhones.conf @@ -17,7 +17,6 @@ SectionDevice."Headphones" { cset "name='HPO MIX HPVOL Switch' on" cset "name='Headphone Switch' on" cset "name='HP Channel Switch' on" - cset "name='Speaker Switch' off" cset "name='HP L Playback Switch' on" cset "name='HP R Playback Switch' on" cset "name='HP Playback Volume' 29" diff --git a/ucm2/codecs/rt5640/IN1-InternalMic.conf b/ucm2/codecs/rt5640/IN1-InternalMic.conf index 260df90..d7c419e 100644 --- a/ucm2/codecs/rt5640/IN1-InternalMic.conf +++ b/ucm2/codecs/rt5640/IN1-InternalMic.conf @@ -10,8 +10,6 @@ SectionDevice."Mic" { cset "name='RECMIXL BST1 Switch' on" cset "name='RECMIXR BST1 Switch' on" - cset "name='RECMIXL BST3 Switch' off" - cset "name='RECMIXR BST3 Switch' off" cset "name='Stereo ADC MIXL ADC1 Switch' on" cset "name='Stereo ADC MIXR ADC1 Switch' on" diff --git a/ucm2/codecs/rt5640/IN3-InternalMic.conf b/ucm2/codecs/rt5640/IN3-InternalMic.conf index ebd2b9c..3e330e6 100644 --- a/ucm2/codecs/rt5640/IN3-InternalMic.conf +++ b/ucm2/codecs/rt5640/IN3-InternalMic.conf @@ -8,8 +8,6 @@ SectionDevice."Mic" { EnableSequence [ cset "name='Internal Mic Switch' on" - cset "name='RECMIXL BST1 Switch' off" - cset "name='RECMIXR BST1 Switch' off" cset "name='RECMIXL BST3 Switch' on" cset "name='RECMIXR BST3 Switch' on" diff --git a/ucm2/codecs/rt5640/MonoSpeaker.conf b/ucm2/codecs/rt5640/MonoSpeaker.conf index 23cf34c..5035c8d 100644 --- a/ucm2/codecs/rt5640/MonoSpeaker.conf +++ b/ucm2/codecs/rt5640/MonoSpeaker.conf @@ -14,7 +14,6 @@ SectionDevice."Speaker" { cset "name='SPOL MIX SPKVOL R Switch' on" cset "name='Speaker Switch' on" cset "name='Speaker Channel Switch' on" - cset "name='Headphone Switch' off" cset "name='Speaker L Playback Switch' on" cset "name='Speaker R Playback Switch' on" cset "name='Speaker Playback Volume' 35" diff --git a/ucm2/codecs/rt5640/Speaker.conf b/ucm2/codecs/rt5640/Speaker.conf index 422cfdf..fd74994 100644 --- a/ucm2/codecs/rt5640/Speaker.conf +++ b/ucm2/codecs/rt5640/Speaker.conf @@ -14,7 +14,6 @@ SectionDevice."Speaker" { cset "name='SPOL MIX SPKVOL R Switch' off" cset "name='Speaker Switch' on" cset "name='Speaker Channel Switch' on" - cset "name='Headphone Switch' off" cset "name='Speaker L Playback Switch' on" cset "name='Speaker R Playback Switch' on" cset "name='Speaker Playback Volume' 35" From patchwork Fri Feb 26 15:40:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 388179 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB6B9C433E0 for ; Fri, 26 Feb 2021 15:42:32 +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 DCB6764EF0 for ; Fri, 26 Feb 2021 15:42:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DCB6764EF0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com 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 D150E167F; Fri, 26 Feb 2021 16:41:39 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D150E167F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1614354149; bh=TaKn+fr8LZrQI2znIDQkwH0pTdNa+gGuPIm3hOKrm+w=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=bVDRhby9PBSSc6LHN50izGnc2wz9bx0XEsFCQA8VcObrC/oYuyX3j50VL6CoBrjBt nbcID/EnvIhZSAp9KHsW/2jLfL6I6ADhnKLJ/DAcW0Je+0FCjhK77YP2tN8eqQqfMm 3vLZN4lJF1xMNdIpv8jy2tdAGWdLdP5IroQVLWMU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C5966F8016C; Fri, 26 Feb 2021 16:40:49 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 11C32F802D2; Fri, 26 Feb 2021 16:40:45 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C9093F80161 for ; Fri, 26 Feb 2021 16:40:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C9093F80161 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="GwH8sQOZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614354035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=d0VBWxWJNsaIisKDtr+Dd11Z7wHg8abuGX0PO11D6Yk=; b=GwH8sQOZXyierQ7CoPQfeMpO+/0g74qBgXn34wmxtZfQCE1H2dtcvYrz/Qsz9wxlOpTdBS zOJ/MYOQ3lTB6iaOI/qmAk6yA12IagV5Au6Hg33siZvlE7ofqRPxRvs7I01kv8C36qC57M nmeA14SQm5PTDYX6rz+17uXgzBx9ju8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-117-VmSzH3f0MBisb9-YPnpGpA-1; Fri, 26 Feb 2021 10:40:34 -0500 X-MC-Unique: VmSzH3f0MBisb9-YPnpGpA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CD4626D4E0; Fri, 26 Feb 2021 15:40:32 +0000 (UTC) Received: from x1.localdomain (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id B88381050E; Fri, 26 Feb 2021 15:40:31 +0000 (UTC) From: Hans de Goede To: Jaroslav Kysela Subject: [PATCH alsa-ucm-conf 3/8] codecs/rt5640: Cleanup: Move 'SPK MIX' setup to main EnableSequene Date: Fri, 26 Feb 2021 16:40:20 +0100 Message-Id: <20210226154025.84828-4-hdegoede@redhat.com> In-Reply-To: <20210226154025.84828-1-hdegoede@redhat.com> References: <20210226154025.84828-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hdegoede@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: Hans de Goede , alsa-devel@alsa-project.org, Pierre-Louis Bossart , Bard Liao 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" Cleanup: no functional changes intended. Do the 'SPK MIXL' / 'SPK MIXR' setup only once from the main EnableSequene, like we do for the 'OUT MIXL' / 'OUT MIXR' setup used by the headphones already. Signed-off-by: Hans de Goede --- ucm2/codecs/rt5640/EnableSeq.conf | 6 ++++-- ucm2/codecs/rt5640/MonoSpeaker.conf | 2 -- ucm2/codecs/rt5640/Speaker.conf | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ucm2/codecs/rt5640/EnableSeq.conf b/ucm2/codecs/rt5640/EnableSeq.conf index 5dc7092..4a355a5 100644 --- a/ucm2/codecs/rt5640/EnableSeq.conf +++ b/ucm2/codecs/rt5640/EnableSeq.conf @@ -6,8 +6,10 @@ EnableSequence [ cset "name='Stereo DAC MIXR DAC R1 Switch' on" cset "name='Stereo DAC MIXL DAC L2 Switch' on" cset "name='Stereo DAC MIXR DAC R2 Switch' on" - cset "name='OUT MIXL DAC L1 Switch' on" - cset "name='OUT MIXR DAC R1 Switch' on" + cset "name='OUT MIXL DAC L1 Switch' on" + cset "name='OUT MIXR DAC R1 Switch' on" + cset "name='SPK MIXL DAC L1 Switch' on" + cset "name='SPK MIXR DAC R1 Switch' on" # uncomment for loopback mic->speakers # cset "name='SPOL MIX BST1 Switch' on" diff --git a/ucm2/codecs/rt5640/MonoSpeaker.conf b/ucm2/codecs/rt5640/MonoSpeaker.conf index 5035c8d..654edc3 100644 --- a/ucm2/codecs/rt5640/MonoSpeaker.conf +++ b/ucm2/codecs/rt5640/MonoSpeaker.conf @@ -6,8 +6,6 @@ SectionDevice."Speaker" { ] EnableSequence [ - cset "name='SPK MIXL DAC L1 Switch' on" - cset "name='SPK MIXR DAC R1 Switch' on" cset "name='SPOL MIX SPKVOL L Switch' on" # for mono speaker we apply left on right # cset "name='SPOR MIX SPKVOL R Switch' on" diff --git a/ucm2/codecs/rt5640/Speaker.conf b/ucm2/codecs/rt5640/Speaker.conf index fd74994..3264cc3 100644 --- a/ucm2/codecs/rt5640/Speaker.conf +++ b/ucm2/codecs/rt5640/Speaker.conf @@ -6,8 +6,6 @@ SectionDevice."Speaker" { ] EnableSequence [ - cset "name='SPK MIXL DAC L1 Switch' on" - cset "name='SPK MIXR DAC R1 Switch' on" cset "name='SPOL MIX SPKVOL L Switch' on" cset "name='SPOR MIX SPKVOL R Switch' on" # undo MonoSpeaker mixing of right channel to left speaker From patchwork Fri Feb 26 15:40:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 388178 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83777C433DB for ; Fri, 26 Feb 2021 15:43:31 +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 3112064EF0 for ; Fri, 26 Feb 2021 15:43:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3112064EF0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com 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 93ED71679; Fri, 26 Feb 2021 16:42:38 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 93ED71679 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1614354208; bh=mLMZkkMl2Bzfh4IVGtjwkAGHpxCWtgNzpg3OrBejrjY=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=rzdy0uC+W+0X6G3GJGKRIv+PjHnlPzR5/bGX3mFgZCRmPr31AKXYyC0B9M74gSjX7 vPLZWDpHv0WD3sg8NzUvXQu1CO0tL87pQZsENtTxWaqRrC6IyaqMLewIIPmqPHFx7x lV4hna9Jl0AlQgzeEYeTrR/aFsoiwy0eXNhr8fgE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3E2A0F80424; Fri, 26 Feb 2021 16:40:57 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4A16CF802E0; Fri, 26 Feb 2021 16:40:48 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E2825F8022D for ; Fri, 26 Feb 2021 16:40:40 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E2825F8022D Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="XuSgq4bt" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614354039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Xd0cfAOXRgCMojRzB8m8hWwaqiVPwUv6bqCEhkbVMI4=; b=XuSgq4btlPrmC/haGrfnlHg4GbEEAuUUwT+/ArjvckxxKNM8GRXh5BEHiLX3tBLDhpx50V 9o8tU0JZmO7peN+MzVDEfSmsk//1zev1+9pYd0XsK6ket6RzaTc9n8GwmNWxhmsJ0mrLcf gJboZ4XymAw5wTa/H5OEofjCE8vBWP4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-336-_HkG8eZJNGKZ99YZkerU8w-1; Fri, 26 Feb 2021 10:40:35 -0500 X-MC-Unique: _HkG8eZJNGKZ99YZkerU8w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 30BCB804045; Fri, 26 Feb 2021 15:40:34 +0000 (UTC) Received: from x1.localdomain (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E63D131D8; Fri, 26 Feb 2021 15:40:32 +0000 (UTC) From: Hans de Goede To: Jaroslav Kysela Subject: [PATCH alsa-ucm-conf 4/8] codecs/rt5640: Drop bogus 'DIG MIXL DAC L2 Switch' setting Date: Fri, 26 Feb 2021 16:40:21 +0100 Message-Id: <20210226154025.84828-5-hdegoede@redhat.com> In-Reply-To: <20210226154025.84828-1-hdegoede@redhat.com> References: <20210226154025.84828-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hdegoede@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: Hans de Goede , alsa-devel@alsa-project.org, Pierre-Louis Bossart , Bard Liao 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 'DIG MIXL DAC L2 Switch' path is only used for Digital Mixer Path loopback, which we don't use. Drop it. Signed-off-by: Hans de Goede --- ucm2/codecs/rt5640/EnableSeq.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/ucm2/codecs/rt5640/EnableSeq.conf b/ucm2/codecs/rt5640/EnableSeq.conf index 4a355a5..223cceb 100644 --- a/ucm2/codecs/rt5640/EnableSeq.conf +++ b/ucm2/codecs/rt5640/EnableSeq.conf @@ -27,7 +27,6 @@ EnableSequence [ #cset "name='DAI select' 1" cset "name='DAC2 Playback Switch' on" - cset "name='DIG MIXL DAC L2 Switch' on" # Input Configuration cset "name='Stereo ADC1 Mux' ADC" From patchwork Fri Feb 26 15:40:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 388177 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2F95C433DB for ; Fri, 26 Feb 2021 15:44:12 +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 03C9364EED for ; Fri, 26 Feb 2021 15:44:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 03C9364EED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com 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 719571681; Fri, 26 Feb 2021 16:43:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 719571681 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1614354250; bh=8su8N7kpnGqd7uYSGLCq8VFE5LjnQc92sQr14EqIN1Y=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=DuBHObuH9UHMEDdfSu2kxAnPLtS0Iud2faVpevQdd0Jb+yW/F1dmzKheXqTPXutym DVq+dl5WNBy1k2i0lAn4VB53il5PklP733z/7Uj+MBa+qspLYXbtbIUY9uiJS7ooJ9 wt0RaEkWD0sZBtGClUHPfIUFt5wP4iwUQmPk/uPk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 66C62F804AA; Fri, 26 Feb 2021 16:40:58 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E1027F802E2; Fri, 26 Feb 2021 16:40:50 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D5A6DF80154 for ; Fri, 26 Feb 2021 16:40:42 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D5A6DF80154 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Xhlktajk" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614354041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=A2dNc7YHrTVAhjNJuNub3LKHAh9CuFHIIOp3bJT789c=; b=Xhlktajkl5VtNLrb+FFS2gUpvzzbxQaR+SF1XqERPZH+vf+IzTCihdPkJsWtzWrVdf1ERg M4pJ0AFHJr/S5A5MMmdthfr/5sANdI9QHnhfim0Os5ALNUeJC3UN1lufrIQQGsGjCnGTVQ C8P8X5i90DZiiHzB4aYMaJefXY3WcJs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-296-AvM0JCAkNeaiHGiKSQYBug-1; Fri, 26 Feb 2021 10:40:36 -0500 X-MC-Unique: AvM0JCAkNeaiHGiKSQYBug-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8A10480402E; Fri, 26 Feb 2021 15:40:35 +0000 (UTC) Received: from x1.localdomain (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 75CF21050E; Fri, 26 Feb 2021 15:40:34 +0000 (UTC) From: Hans de Goede To: Jaroslav Kysela Subject: [PATCH alsa-ucm-conf 5/8] codecs/rt5640: Unify capture volume for AIF1 and AIF2 recording paths Date: Fri, 26 Feb 2021 16:40:22 +0100 Message-Id: <20210226154025.84828-6-hdegoede@redhat.com> In-Reply-To: <20210226154025.84828-1-hdegoede@redhat.com> References: <20210226154025.84828-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hdegoede@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: Hans de Goede , alsa-devel@alsa-project.org, Pierre-Louis Bossart , Bard Liao 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 rt5640 codec is sometimes used with AIF1 connected to the SoC and sometimes with AIF2 connected to the SoC. The rt5640 UCM configuration deals with this by accepting input from and sending output to both AIFs, relying on the kernels DAPM framework to disable parts of the graph which are connected to the unconnected AIF. Before this commit codecs/rt5640/EnableSeq.conf was adding a +9dB (digital) boost to recording going through the 'ADC' path to AIF1, while not touching the 'Mono ADC' path to AIF2. This was causing recordings on devices using AIF2 to be somewhat soft. This commit unifies the record volume control settings for both paths by only using the '[Mono ]ADC Capture Volume' control, which is present in both paths and setting it to +9dB on both paths. Signed-off-by: Hans de Goede --- ucm2/codecs/rt5640/EnableSeq.conf | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ucm2/codecs/rt5640/EnableSeq.conf b/ucm2/codecs/rt5640/EnableSeq.conf index 223cceb..8b30153 100644 --- a/ucm2/codecs/rt5640/EnableSeq.conf +++ b/ucm2/codecs/rt5640/EnableSeq.conf @@ -39,10 +39,14 @@ EnableSequence [ cset "name='Mono ADC R2 Mux' DMIC R1" cset "name='Mono ADC Capture Switch' on" - # 47=0dB, 0.375 dB/step, set it to 6 dB to help with soft mics - cset "name='ADC Capture Volume' 63" - # Set ADC Boost Gain to 3dB higher vals result in too much noise - cset "name='ADC Boost Gain' 1" + # 47=0dB, 0.375 dB/step, set it to 9 dB to help with soft mics + cset "name='ADC Capture Volume' 71" + cset "name='Mono ADC Capture Volume' 71" + + # The second 'Mono ADC' path does not have a 'Boost Gain', + # set this to 0dB so that the volume of the AIF1 and AIF2 paths is equal. + cset "name='ADC Boost Gain' 0" + # Set IN1/IN3 internal mic boost to 8 (max) # Set IN2 headset-mic boost to 1, headset mics are quite loud cset "name='IN1 Boost' 8" From patchwork Fri Feb 26 15:40:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 388176 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7657C433E0 for ; Fri, 26 Feb 2021 15:45:00 +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 016F464EC4 for ; Fri, 26 Feb 2021 15:44:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 016F464EC4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com 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 56257169B; Fri, 26 Feb 2021 16:44:08 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 56257169B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1614354298; bh=AoCj2MfxvD/4rvE5UVuBwiQrDDmChsm6kaRt9+H2suI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ipkG6yM629YQshwN5OwCqn7cdF6pP55zcxioQelS0EqtgKWYYiTS9dTkT+0NXhZTs r5IgctA6pbWZeRFt3e4ZeLbGyqxHmHU3mj8vVj/WK511N2mqJh5lNe4t96h2C3UqhQ BMmEJbIr43lKOy9JqYDh20O2oKlxMygATywLkdvg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8E699F804CF; Fri, 26 Feb 2021 16:40:59 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B9AF9F802DF; Fri, 26 Feb 2021 16:40:49 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 86B18F8012C for ; Fri, 26 Feb 2021 16:40:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 86B18F8012C Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="AcaAHJs0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614354040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GptrVlL/IvCa/3+g0IoS03y5KFkwAmZrLf7JXRBN3xQ=; b=AcaAHJs0BNhrOmXQ23TirjPCe5V+6pUM1D2ifivJiSHEs+v24D9RVQyUdIbtvpHeK3dSvD wf/atyVtGNfaNLQjBFQAqR4uYF2irO2ZKQi/Ka0TseczcX8eIce4kbsI5NpyRSMMDZKuf5 KAAESPSD44F4z1IvuAB98kn//UU6HoQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-418-2QDUu_olO-u-XR7hQiwKSg-1; Fri, 26 Feb 2021 10:40:38 -0500 X-MC-Unique: 2QDUu_olO-u-XR7hQiwKSg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 126DB804043; Fri, 26 Feb 2021 15:40:37 +0000 (UTC) Received: from x1.localdomain (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF64A1050E; Fri, 26 Feb 2021 15:40:35 +0000 (UTC) From: Hans de Goede To: Jaroslav Kysela Subject: [PATCH alsa-ucm-conf 6/8] codecs/rt5640: Add hardware volume-control support Date: Fri, 26 Feb 2021 16:40:23 +0100 Message-Id: <20210226154025.84828-7-hdegoede@redhat.com> In-Reply-To: <20210226154025.84828-1-hdegoede@redhat.com> References: <20210226154025.84828-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hdegoede@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: Hans de Goede , alsa-devel@alsa-project.org, Pierre-Louis Bossart , Bard Liao 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" Add hardware volume-control support for the rt5640 codec. Note this commit does not add support for the (digital) master ADC/DAC Volume / Mute controls. There are 2 of each, and which one should be used depends on which AIF is being used. Signed-off-by: Hans de Goede --- ucm2/codecs/rt5640/HeadPhones.conf | 2 ++ ucm2/codecs/rt5640/HeadsetMic.conf | 2 ++ ucm2/codecs/rt5640/IN1-InternalMic.conf | 2 ++ ucm2/codecs/rt5640/IN3-InternalMic.conf | 2 ++ ucm2/codecs/rt5640/MonoSpeaker.conf | 2 ++ ucm2/codecs/rt5640/Speaker.conf | 2 ++ 6 files changed, 12 insertions(+) diff --git a/ucm2/codecs/rt5640/HeadPhones.conf b/ucm2/codecs/rt5640/HeadPhones.conf index 1f4316d..5535111 100644 --- a/ucm2/codecs/rt5640/HeadPhones.conf +++ b/ucm2/codecs/rt5640/HeadPhones.conf @@ -35,5 +35,7 @@ SectionDevice."Headphones" { PlaybackPriority 300 PlaybackPCM "hw:${CardId}" JackControl "Headphone Jack" + PlaybackMixerElem "HP" + PlaybackVolume "HP Playback Volume" } } diff --git a/ucm2/codecs/rt5640/HeadsetMic.conf b/ucm2/codecs/rt5640/HeadsetMic.conf index 829e4e6..8479672 100644 --- a/ucm2/codecs/rt5640/HeadsetMic.conf +++ b/ucm2/codecs/rt5640/HeadsetMic.conf @@ -41,5 +41,7 @@ SectionDevice."Headset" { CapturePriority 200 CapturePCM "hw:${CardId}" JackControl "Headset Mic Jack" + CaptureMixerElem "IN2 Boost" + CaptureVolume "IN2 Boost" } } diff --git a/ucm2/codecs/rt5640/IN1-InternalMic.conf b/ucm2/codecs/rt5640/IN1-InternalMic.conf index d7c419e..a317388 100644 --- a/ucm2/codecs/rt5640/IN1-InternalMic.conf +++ b/ucm2/codecs/rt5640/IN1-InternalMic.conf @@ -32,5 +32,7 @@ SectionDevice."Mic" { Value { CapturePriority 100 CapturePCM "hw:${CardId}" + CaptureMixerElem "IN1 Boost" + CaptureVolume "IN1 Boost" } } diff --git a/ucm2/codecs/rt5640/IN3-InternalMic.conf b/ucm2/codecs/rt5640/IN3-InternalMic.conf index 3e330e6..ef4eaba 100644 --- a/ucm2/codecs/rt5640/IN3-InternalMic.conf +++ b/ucm2/codecs/rt5640/IN3-InternalMic.conf @@ -32,5 +32,7 @@ SectionDevice."Mic" { Value { CapturePriority 100 CapturePCM "hw:${CardId}" + CaptureMixerElem "IN3 Boost" + CaptureVolume "IN3 Boost" } } diff --git a/ucm2/codecs/rt5640/MonoSpeaker.conf b/ucm2/codecs/rt5640/MonoSpeaker.conf index 654edc3..3cbeafd 100644 --- a/ucm2/codecs/rt5640/MonoSpeaker.conf +++ b/ucm2/codecs/rt5640/MonoSpeaker.conf @@ -29,5 +29,7 @@ SectionDevice."Speaker" { Value { PlaybackPriority 100 PlaybackPCM "hw:${CardId}" + PlaybackMixerElem "Speaker" + PlaybackVolume "Speaker Playback Volume" } } diff --git a/ucm2/codecs/rt5640/Speaker.conf b/ucm2/codecs/rt5640/Speaker.conf index 3264cc3..0924f9c 100644 --- a/ucm2/codecs/rt5640/Speaker.conf +++ b/ucm2/codecs/rt5640/Speaker.conf @@ -29,5 +29,7 @@ SectionDevice."Speaker" { Value { PlaybackPriority 100 PlaybackPCM "hw:${CardId}" + PlaybackMixerElem "Speaker" + PlaybackVolume "Speaker Playback Volume" } } From patchwork Fri Feb 26 15:40:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 387686 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06BA8C433DB for ; Fri, 26 Feb 2021 15:43:59 +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 50EDD64EC4 for ; Fri, 26 Feb 2021 15:43:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 50EDD64EC4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com 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 B04C11696; Fri, 26 Feb 2021 16:43:06 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B04C11696 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1614354236; bh=101NkQMZCph4NpKsuUmbGeSzLdg7VzpeaZxNVPTH8CA=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=UxQ7pDdJ/GzQeTEYnZIMuUNlbwGdRCahGQRq8jnAER1tlq4DbsIMO6p9diiK4lGjh 0HmPOmghayjgThqVIWteGZHosDTb020hqpt2QNJDGPak3GPxnZiz/3/m/rL/00peNW UBgHSoUtJNdhtNfF32TDdj970Cxo55xfUOU04Gl8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D0519F80431; Fri, 26 Feb 2021 16:40:57 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 889C4F802E2; Fri, 26 Feb 2021 16:40:50 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 6A0AAF8028D for ; Fri, 26 Feb 2021 16:40:42 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6A0AAF8028D Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OFikQoHv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614354041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XK6uQjUKJi6Hk5n+Ju9baSQ/pNmY+koCgGJ6phSdOlc=; b=OFikQoHvQ16qqVytXg6JTTzMQylvEpjcpd9HKSxzOUGjGx0acRJdrUw5Y9eYa/PCoshjhX BpXYJpqB1UZh7hPGrn/Hb8QiutOcoqfgefutqKgQcJd/dDrYD4PMTUuIvx8ht6LOn1wRfs WHYZ4kp3WlUdJJ5Pr8Y1YNXS/wnu4XI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-557-ZKbW8K8FPFSdImB3_ptsKA-1; Fri, 26 Feb 2021 10:40:39 -0500 X-MC-Unique: ZKbW8K8FPFSdImB3_ptsKA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 689C21868405; Fri, 26 Feb 2021 15:40:38 +0000 (UTC) Received: from x1.localdomain (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 56EAE1050E; Fri, 26 Feb 2021 15:40:37 +0000 (UTC) From: Hans de Goede To: Jaroslav Kysela Subject: [PATCH alsa-ucm-conf 7/8] codecs/rt5640: Use the new "aif:%d" part of the components string Date: Fri, 26 Feb 2021 16:40:24 +0100 Message-Id: <20210226154025.84828-8-hdegoede@redhat.com> In-Reply-To: <20210226154025.84828-1-hdegoede@redhat.com> References: <20210226154025.84828-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hdegoede@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: Hans de Goede , alsa-devel@alsa-project.org, Pierre-Louis Bossart , Bard Liao 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" Newer kernels add "aif:1" or "aif:2" to the components string to let us know which AIF is being used. Use this to mute the ADC/DAC master controls on the other AIF. Muting these is necessary to make mute LED control work properly, because the snd_ctl_led will only turn on the mute LED if both DAC Volume Switches are disabled. Signed-off-by: Hans de Goede --- ucm2/bytcr-rt5640/HiFi.conf | 46 +++++++++++++++++++ ucm2/codecs/rt5640/EnableSeq-AIF-unknown.conf | 7 +++ ucm2/codecs/rt5640/EnableSeq-AIF1.conf | 7 +++ ucm2/codecs/rt5640/EnableSeq-AIF2.conf | 7 +++ ucm2/codecs/rt5640/EnableSeq.conf | 4 -- 5 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 ucm2/codecs/rt5640/EnableSeq-AIF-unknown.conf create mode 100644 ucm2/codecs/rt5640/EnableSeq-AIF1.conf create mode 100644 ucm2/codecs/rt5640/EnableSeq-AIF2.conf diff --git a/ucm2/bytcr-rt5640/HiFi.conf b/ucm2/bytcr-rt5640/HiFi.conf index a5c05ba..39a9a2b 100644 --- a/ucm2/bytcr-rt5640/HiFi.conf +++ b/ucm2/bytcr-rt5640/HiFi.conf @@ -1,8 +1,54 @@ # Use case Configuration for bytcr-rt5640 +Define.HaveAif "" +Define.HaveAif1 "" +Define.HaveAif2 "" + +If.DefineAif1 { + Condition { + Type String + Haystack "${CardComponents}" + Needle "aif:1" + } + True { + Define.HaveAif "yes" + Define.HaveAif1 "yes" + } +} + +If.DefineAif2 { + Condition { + Type String + Haystack "${CardComponents}" + Needle "aif:2" + } + True { + Define.HaveAif "yes" + Define.HaveAif2 "yes" + } +} + SectionVerb { Include.e.File "/codecs/rt5640/EnableSeq.conf" + If.Aif1 { + Condition { Type String Empty "${var:HaveAif1}" } + Before.EnableSequence "0" + False.Include.aif1.File "/codecs/rt5640/EnableSeq-AIF1.conf" + } + + If.Aif2 { + Condition { Type String Empty "${var:HaveAif2}" } + Before.EnableSequence "0" + False.Include.aif1.File "/codecs/rt5640/EnableSeq-AIF2.conf" + } + + If.AifUnknown { + Condition { Type String Empty "${var:HaveAif}" } + Before.EnableSequence "0" + True.Include.aif-unknown.File "/codecs/rt5640/EnableSeq-AIF-unknown.conf" + } + If.Controls { Condition { Type ControlExists diff --git a/ucm2/codecs/rt5640/EnableSeq-AIF-unknown.conf b/ucm2/codecs/rt5640/EnableSeq-AIF-unknown.conf new file mode 100644 index 0000000..3160d5c --- /dev/null +++ b/ucm2/codecs/rt5640/EnableSeq-AIF-unknown.conf @@ -0,0 +1,7 @@ +EnableSequence [ + # When the AIF is unknown enable audio from/to both AIFs + # Note kernels which do not advertise the AIF do not have a 'DAC1 Playback Switch' + cset "name='DAC2 Playback Switch' on" + cset "name='ADC Capture Switch' on" + cset "name='Mono ADC Capture Switch' on" +] diff --git a/ucm2/codecs/rt5640/EnableSeq-AIF1.conf b/ucm2/codecs/rt5640/EnableSeq-AIF1.conf new file mode 100644 index 0000000..b31fb7b --- /dev/null +++ b/ucm2/codecs/rt5640/EnableSeq-AIF1.conf @@ -0,0 +1,7 @@ +EnableSequence [ + cset "name='DAC1 Playback Switch' on" + cset "name='ADC Capture Switch' on" + # When AIF1 is used, mute the AIF2 ADC/DAC master control + cset "name='DAC2 Playback Switch' off" + cset "name='Mono ADC Capture Switch' off" +] diff --git a/ucm2/codecs/rt5640/EnableSeq-AIF2.conf b/ucm2/codecs/rt5640/EnableSeq-AIF2.conf new file mode 100644 index 0000000..a1d4d68 --- /dev/null +++ b/ucm2/codecs/rt5640/EnableSeq-AIF2.conf @@ -0,0 +1,7 @@ +EnableSequence [ + cset "name='DAC2 Playback Switch' on" + cset "name='Mono ADC Capture Switch' on" + # When AIF2 is used, mute the AIF1 ADC/DAC master control + cset "name='DAC1 Playback Switch' off" + cset "name='ADC Capture Switch' off" +] diff --git a/ucm2/codecs/rt5640/EnableSeq.conf b/ucm2/codecs/rt5640/EnableSeq.conf index 8b30153..572d1a2 100644 --- a/ucm2/codecs/rt5640/EnableSeq.conf +++ b/ucm2/codecs/rt5640/EnableSeq.conf @@ -26,18 +26,14 @@ EnableSequence [ #cset "name='SDI select' 1" #cset "name='DAI select' 1" - cset "name='DAC2 Playback Switch' on" - # Input Configuration cset "name='Stereo ADC1 Mux' ADC" cset "name='Stereo ADC2 Mux' DMIC1" - cset "name='ADC Capture Switch' on" cset "name='Mono ADC L1 Mux' ADCL" cset "name='Mono ADC R1 Mux' ADCR" cset "name='Mono ADC L2 Mux' DMIC L1" cset "name='Mono ADC R2 Mux' DMIC R1" - cset "name='Mono ADC Capture Switch' on" # 47=0dB, 0.375 dB/step, set it to 9 dB to help with soft mics cset "name='ADC Capture Volume' 71" From patchwork Fri Feb 26 15:40:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 387685 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C928EC433E0 for ; Fri, 26 Feb 2021 15:44:48 +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 CC3E164EF0 for ; Fri, 26 Feb 2021 15:44:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC3E164EF0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com 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 1CE2883D; Fri, 26 Feb 2021 16:43:56 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1CE2883D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1614354286; bh=B4SerikZIYIDN9DH7hGg9RfkCUEIzaDTN8ksanp2m+E=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Szb8rv8RgJh1r5BMWvICDxKVdqmIBslK5Kads03Pj9M64teh4qQcIVW2K0vzMy7ff gTjxHPu0+6c3qeVMT3rMsxSr9hIAev+LQdlcOL71ZT2ya7736KSV6LvaICOvcOnAX/ m9VqrnL99tmce2ukMaq3b4VFD+AcTuKjbCdV7Iig= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id F11E0F804AF; Fri, 26 Feb 2021 16:40:58 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CDE1FF8032C; Fri, 26 Feb 2021 16:40:51 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A10D9F802A9 for ; Fri, 26 Feb 2021 16:40:43 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A10D9F802A9 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Z6Zu/x3y" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614354042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hAhBm5qYE5wgDoNiAgOSUE+Cs3ybfhvyiXwU3Ge5IRk=; b=Z6Zu/x3y2ibmNJJHJ/5pS49+uopAwcO1Ag0CKFPPgzlJtKls6ySgJd7N/vLjBpIzM0P0xP IpOTwmjrzokWnT2YLqaa7L04iLT/huTvXGwq6qTTgHPK+/cOklvFOsY7AX/ZXT/9bR5S8S Tafc70QfwQPMIkNCE0uk1/xP8YgA6xw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-579-kh2lT7j1MGeQyHNterDaWA-1; Fri, 26 Feb 2021 10:40:41 -0500 X-MC-Unique: kh2lT7j1MGeQyHNterDaWA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C1B3A100A614; Fri, 26 Feb 2021 15:40:39 +0000 (UTC) Received: from x1.localdomain (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id ADEC8163D5; Fri, 26 Feb 2021 15:40:38 +0000 (UTC) From: Hans de Goede To: Jaroslav Kysela Subject: [PATCH alsa-ucm-conf 8/8] codecs/rt5640: Specify Playback/CaptureMasterElem for HW volume-control Date: Fri, 26 Feb 2021 16:40:25 +0100 Message-Id: <20210226154025.84828-9-hdegoede@redhat.com> In-Reply-To: <20210226154025.84828-1-hdegoede@redhat.com> References: <20210226154025.84828-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hdegoede@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: Hans de Goede , alsa-devel@alsa-project.org, Pierre-Louis Bossart , Bard Liao 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" Specify the correct Playback/CaptureMasterElem for HW volume-control, based on which AIF is being used. On older kernels, where there is no "aif:%d" string in the components string, no Playback/CaptureMasterElem is specified. In DigitalMics.conf the master mixer is used as regular CaptureMixerElem instead of as CaptureMasterElem since the DMICs don't have any analog volume control. Signed-off-by: Hans de Goede --- ucm2/codecs/rt5640/DigitalMics.conf | 16 ++++++++++++++++ ucm2/codecs/rt5640/HeadPhones.conf | 12 ++++++++++++ ucm2/codecs/rt5640/HeadsetMic.conf | 12 ++++++++++++ ucm2/codecs/rt5640/IN1-InternalMic.conf | 12 ++++++++++++ ucm2/codecs/rt5640/IN3-InternalMic.conf | 12 ++++++++++++ ucm2/codecs/rt5640/MonoSpeaker.conf | 12 ++++++++++++ ucm2/codecs/rt5640/Speaker.conf | 12 ++++++++++++ 7 files changed, 88 insertions(+) diff --git a/ucm2/codecs/rt5640/DigitalMics.conf b/ucm2/codecs/rt5640/DigitalMics.conf index 157c544..032d954 100644 --- a/ucm2/codecs/rt5640/DigitalMics.conf +++ b/ucm2/codecs/rt5640/DigitalMics.conf @@ -26,5 +26,21 @@ SectionDevice."Mic" { Value { CapturePriority 100 CapturePCM "hw:${CardId}" + If.DmicAif1 { + Condition { Type String Empty "${var:HaveAif1}" } + False { + CaptureMixerElem "ADC" + CaptureVolume "ADC Capture Volume" + CaptureSwitch "ADC Capture Switch" + } + } + If.DmicAif2 { + Condition { Type String Empty "${var:HaveAif2}" } + False { + CaptureMixerElem "Mono ADC" + CaptureVolume "Mono ADC Capture Volume" + CaptureSwitch "Mono ADC Capture Switch" + } + } } } diff --git a/ucm2/codecs/rt5640/HeadPhones.conf b/ucm2/codecs/rt5640/HeadPhones.conf index 5535111..4fbe95d 100644 --- a/ucm2/codecs/rt5640/HeadPhones.conf +++ b/ucm2/codecs/rt5640/HeadPhones.conf @@ -37,5 +37,17 @@ SectionDevice."Headphones" { JackControl "Headphone Jack" PlaybackMixerElem "HP" PlaybackVolume "HP Playback Volume" + If.HpAif1 { + Condition { Type String Empty "${var:HaveAif1}" } + False { + PlaybackMasterElem "DAC1" + } + } + If.HpAif2 { + Condition { Type String Empty "${var:HaveAif2}" } + False { + PlaybackMasterElem "DAC2" + } + } } } diff --git a/ucm2/codecs/rt5640/HeadsetMic.conf b/ucm2/codecs/rt5640/HeadsetMic.conf index 8479672..b49dad4 100644 --- a/ucm2/codecs/rt5640/HeadsetMic.conf +++ b/ucm2/codecs/rt5640/HeadsetMic.conf @@ -43,5 +43,17 @@ SectionDevice."Headset" { JackControl "Headset Mic Jack" CaptureMixerElem "IN2 Boost" CaptureVolume "IN2 Boost" + If.HSmicAif1 { + Condition { Type String Empty "${var:HaveAif1}" } + False { + CaptureMasterElem "ADC" + } + } + If.HSmicAif2 { + Condition { Type String Empty "${var:HaveAif2}" } + False { + CaptureMasterElem "Mono ADC" + } + } } } diff --git a/ucm2/codecs/rt5640/IN1-InternalMic.conf b/ucm2/codecs/rt5640/IN1-InternalMic.conf index a317388..d670484 100644 --- a/ucm2/codecs/rt5640/IN1-InternalMic.conf +++ b/ucm2/codecs/rt5640/IN1-InternalMic.conf @@ -34,5 +34,17 @@ SectionDevice."Mic" { CapturePCM "hw:${CardId}" CaptureMixerElem "IN1 Boost" CaptureVolume "IN1 Boost" + If.In1Aif1 { + Condition { Type String Empty "${var:HaveAif1}" } + False { + CaptureMasterElem "ADC" + } + } + If.In1Aif2 { + Condition { Type String Empty "${var:HaveAif2}" } + False { + CaptureMasterElem "Mono ADC" + } + } } } diff --git a/ucm2/codecs/rt5640/IN3-InternalMic.conf b/ucm2/codecs/rt5640/IN3-InternalMic.conf index ef4eaba..345db1e 100644 --- a/ucm2/codecs/rt5640/IN3-InternalMic.conf +++ b/ucm2/codecs/rt5640/IN3-InternalMic.conf @@ -34,5 +34,17 @@ SectionDevice."Mic" { CapturePCM "hw:${CardId}" CaptureMixerElem "IN3 Boost" CaptureVolume "IN3 Boost" + If.In3Aif1 { + Condition { Type String Empty "${var:HaveAif1}" } + False { + CaptureMasterElem "ADC" + } + } + If.In3Aif2 { + Condition { Type String Empty "${var:HaveAif2}" } + False { + CaptureMasterElem "Mono ADC" + } + } } } diff --git a/ucm2/codecs/rt5640/MonoSpeaker.conf b/ucm2/codecs/rt5640/MonoSpeaker.conf index 3cbeafd..addaddd 100644 --- a/ucm2/codecs/rt5640/MonoSpeaker.conf +++ b/ucm2/codecs/rt5640/MonoSpeaker.conf @@ -31,5 +31,17 @@ SectionDevice."Speaker" { PlaybackPCM "hw:${CardId}" PlaybackMixerElem "Speaker" PlaybackVolume "Speaker Playback Volume" + If.MonoSpkAif1 { + Condition { Type String Empty "${var:HaveAif1}" } + False { + PlaybackMasterElem "DAC1" + } + } + If.MonoSpkAif2 { + Condition { Type String Empty "${var:HaveAif2}" } + False { + PlaybackMasterElem "DAC2" + } + } } } diff --git a/ucm2/codecs/rt5640/Speaker.conf b/ucm2/codecs/rt5640/Speaker.conf index 0924f9c..e7ff673 100644 --- a/ucm2/codecs/rt5640/Speaker.conf +++ b/ucm2/codecs/rt5640/Speaker.conf @@ -31,5 +31,17 @@ SectionDevice."Speaker" { PlaybackPCM "hw:${CardId}" PlaybackMixerElem "Speaker" PlaybackVolume "Speaker Playback Volume" + If.SpkAif1 { + Condition { Type String Empty "${var:HaveAif1}" } + False { + PlaybackMasterElem "DAC1" + } + } + If.SpkAif2 { + Condition { Type String Empty "${var:HaveAif2}" } + False { + PlaybackMasterElem "DAC2" + } + } } }