From patchwork Wed Aug 8 09:05:42 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: 10559681 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6490214E5 for ; Wed, 8 Aug 2018 09:07:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51CE72A9CC for ; Wed, 8 Aug 2018 09:07:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 452FA2A9DD; Wed, 8 Aug 2018 09:07:24 +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 66B9F2A9CC for ; Wed, 8 Aug 2018 09:07:23 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6DFC92678D4; Wed, 8 Aug 2018 11:06:18 +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 26ABA2678E2; Wed, 8 Aug 2018 11:06:00 +0200 (CEST) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by alsa0.perex.cz (Postfix) with ESMTP id 8817F2678D7 for ; Wed, 8 Aug 2018 11:05:56 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D7E66819701A; Wed, 8 Aug 2018 09:05:55 +0000 (UTC) Received: from shalem.localdomain.com (ovpn-117-222.ams2.redhat.com [10.36.117.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2A2E11C718; Wed, 8 Aug 2018 09:05:55 +0000 (UTC) From: Hans de Goede To: alsa-devel@alsa-project.org Date: Wed, 8 Aug 2018 11:05:42 +0200 Message-Id: <20180808090543.15181-12-hdegoede@redhat.com> In-Reply-To: <20180808090543.15181-1-hdegoede@redhat.com> References: <20180808090543.15181-1-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 08 Aug 2018 09:05:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 08 Aug 2018 09:05:55 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.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 v2 12/13] 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. Reviewed-by: Pierre-Louis Bossart 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)