From patchwork Fri Jul 20 07:27:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 10536093 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 6F11260547 for ; Fri, 20 Jul 2018 07:38:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57EC129167 for ; Fri, 20 Jul 2018 07:38:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 446AC29190; Fri, 20 Jul 2018 07:38:48 +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=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham 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 5AD88293EC for ; Fri, 20 Jul 2018 07:38:46 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id EABED26779F; Fri, 20 Jul 2018 09:28:13 +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 D008C26776A; Fri, 20 Jul 2018 09:28:00 +0200 (CEST) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by alsa0.perex.cz (Postfix) with ESMTP id 4799E26777F for ; Fri, 20 Jul 2018 09:27:57 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 023F077890; Fri, 20 Jul 2018 07:27:57 +0000 (UTC) Received: from shalem.localdomain.com (ovpn-117-82.ams2.redhat.com [10.36.117.82]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4788E2156897; Fri, 20 Jul 2018 07:27:56 +0000 (UTC) From: Hans de Goede To: alsa-devel@alsa-project.org Date: Fri, 20 Jul 2018 09:27:40 +0200 Message-Id: <20180720072741.4632-14-hdegoede@redhat.com> In-Reply-To: <20180720072741.4632-1-hdegoede@redhat.com> References: <20180720072741.4632-1-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 20 Jul 2018 07:27:57 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 20 Jul 2018 07:27:57 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'hdegoede@redhat.com' RCPT:'' Cc: Takashi Iwai , Hans de Goede , Pierre-Louis Bossart Subject: [alsa-devel] [PATCH 13/14] conf/ucm: bytcr-rt5651: Add bytcr-rt5651-mono-spk-in2-mic-hp-swapped config 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Add a longname profile for devices with a mono speaker, the Internal Mic hooked up to IN2 and the left and right channels of their headphones output swapped. Signed-off-by: Hans de Goede --- configure.ac | 1 + src/conf/ucm/Makefile.am | 1 + .../HiFi.conf | 27 ++++++++++++ .../Makefile.am | 4 ++ ...cr-rt5651-mono-spk-in2-mic-hp-swapped.conf | 10 +++++ src/conf/ucm/rt5651/HeadPhones-swapped.conf | 42 +++++++++++++++++++ src/conf/ucm/rt5651/Makefile.am | 6 +-- 7 files changed, 88 insertions(+), 3 deletions(-) create mode 100644 src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/HiFi.conf create mode 100644 src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/Makefile.am create mode 100644 src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/bytcr-rt5651-mono-spk-in2-mic-hp-swapped.conf create mode 100644 src/conf/ucm/rt5651/HeadPhones-swapped.conf diff --git a/configure.ac b/configure.ac index 9fb7218c..97d61abd 100644 --- a/configure.ac +++ b/configure.ac @@ -731,6 +731,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \ src/conf/ucm/bytcr-rt5651/Makefile \ src/conf/ucm/bytcr-rt5651-mono-spk-in1-mic/Makefile \ src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic/Makefile \ + src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/Makefile \ src/conf/ucm/bytcr-rt5651-stereo-spk-in1-mic/Makefile \ src/conf/ucm/bytcr-rt5651-stereo-spk-in2-mic/Makefile \ src/conf/ucm/bytcr-rt5651-stereo-spk-in12-mic/Makefile \ diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am index 1246e7ae..7cdc6176 100644 --- a/src/conf/ucm/Makefile.am +++ b/src/conf/ucm/Makefile.am @@ -13,6 +13,7 @@ bytcr-rt5640-stereo-spk-in3-mic \ bytcr-rt5651 \ bytcr-rt5651-mono-spk-in1-mic \ bytcr-rt5651-mono-spk-in2-mic \ +bytcr-rt5651-mono-spk-in2-mic-hp-swapped \ bytcr-rt5651-stereo-spk-in1-mic \ bytcr-rt5651-stereo-spk-in2-mic \ bytcr-rt5651-stereo-spk-in12-mic \ diff --git a/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/HiFi.conf b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/HiFi.conf new file mode 100644 index 00000000..777ed783 --- /dev/null +++ b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/HiFi.conf @@ -0,0 +1,27 @@ +# Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651 + + + +SectionVerb { + EnableSequence [ + cdev "hw:bytcrrt5651" + + + ] + + DisableSequence [ + cdev "hw:bytcrrt5651" + + ] + + Value { + PlaybackPCM "hw:bytcrrt5651" + CapturePCM "hw:bytcrrt5651" + } +} + + + + + + diff --git a/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/Makefile.am b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/Makefile.am new file mode 100644 index 00000000..862d38b9 --- /dev/null +++ b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/Makefile.am @@ -0,0 +1,4 @@ +alsaconfigdir = @ALSA_CONFIG_DIR@ +ucmdir = $(alsaconfigdir)/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped +ucm_DATA = bytcr-rt5651-mono-spk-in2-mic-hp-swapped.conf HiFi.conf +EXTRA_DIST = $(ucm_DATA) diff --git a/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/bytcr-rt5651-mono-spk-in2-mic-hp-swapped.conf b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/bytcr-rt5651-mono-spk-in2-mic-hp-swapped.conf new file mode 100644 index 00000000..916fbc19 --- /dev/null +++ b/src/conf/ucm/bytcr-rt5651-mono-spk-in2-mic-hp-swapped/bytcr-rt5651-mono-spk-in2-mic-hp-swapped.conf @@ -0,0 +1,10 @@ +# Adapted from https://github.com/plbossart/UCM/tree/master/bytcr-rt5651 + +SectionUseCase."HiFi" { + File "../bytcr-rt5651-mono-spk-in2-mic-hp-swapped/HiFi.conf" + Comment "Play HiFi quality Music" +} + +SectionDefaults [ + cdev "hw:bytcrrt5651" +] diff --git a/src/conf/ucm/rt5651/HeadPhones-swapped.conf b/src/conf/ucm/rt5651/HeadPhones-swapped.conf new file mode 100644 index 00000000..e79b40a7 --- /dev/null +++ b/src/conf/ucm/rt5651/HeadPhones-swapped.conf @@ -0,0 +1,42 @@ +SectionDevice."Headphones" { + Comment "Headphones" + + ConflictingDevice [ + "Speaker" + "MonoSpeaker" + ] + + EnableSequence [ + cdev "hw:bytcrrt5651" + + # Swap left and right + cset "name='Stereo DAC MIXL DAC R1 Switch' on" + cset "name='Stereo DAC MIXL DAC L1 Switch' off" + cset "name='Stereo DAC MIXR DAC L1 Switch' on" + cset "name='Stereo DAC MIXR DAC R1 Switch' off" + + cset "name='Headphone Switch' on" + cset "name='HPO L Playback Switch' on" + cset "name='HPO R Playback Switch' on" + # Done after turning the HP on to keep the bias and clk on + cset "name='Speaker Switch' off" + cset "name='LOUT L Playback Switch' off" + cset "name='LOUT R Playback Switch' off" + ] + + DisableSequence [ + cdev "hw:bytcrrt5651" + # Disabling the HP switches is done by the Speaker EnableSeq + + # Unswap left and right + cset "name='Stereo DAC MIXL DAC L1 Switch' on" + cset "name='Stereo DAC MIXL DAC R1 Switch' off" + cset "name='Stereo DAC MIXR DAC R1 Switch' on" + cset "name='Stereo DAC MIXR DAC L1 Switch' off" + ] + + Value { + PlaybackChannels "2" + JackControl "Headphone Jack" + } +} diff --git a/src/conf/ucm/rt5651/Makefile.am b/src/conf/ucm/rt5651/Makefile.am index a9600ed6..acc8ea49 100644 --- a/src/conf/ucm/rt5651/Makefile.am +++ b/src/conf/ucm/rt5651/Makefile.am @@ -1,6 +1,6 @@ alsaconfigdir = @ALSA_CONFIG_DIR@ ucmdir = $(alsaconfigdir)/ucm/rt5651 -ucm_DATA = EnableSeq.conf HeadPhones.conf IN1-InternalMic.conf \ - IN2-InternalMic.conf IN12-InternalMic.conf IN3-HeadsetMic.conf \ - Speaker.conf MonoSpeaker.conf +ucm_DATA = EnableSeq.conf HeadPhones.conf HeadPhones-swapped.conf \ + IN1-InternalMic.conf IN2-InternalMic.conf IN12-InternalMic.conf \ + IN3-HeadsetMic.conf Speaker.conf MonoSpeaker.conf EXTRA_DIST = $(ucm_DATA)