All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: alsa-devel@alsa-project.org
Cc: Takashi Iwai <tiwai@suse.de>, Hans de Goede <hdegoede@redhat.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Subject: [PATCH 11/14] conf/ucm: bytcr-rt5651: Add mono speaker output profile
Date: Fri, 20 Jul 2018 09:27:38 +0200	[thread overview]
Message-ID: <20180720072741.4632-12-hdegoede@redhat.com> (raw)
In-Reply-To: <20180720072741.4632-1-hdegoede@redhat.com>

Many rt5651 devices only have a single speaker and even though there is
some external mixing done on the PCB, the quality of that mixing is quite
poor and various sounds come out garbled when relying on the on PCB mixing.

Using the codecs builtin mixer to mix left + right to the left output works
much better. This commits adds a new MonoSpeaker.conf output profile which
allows this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 src/conf/ucm/bytcr-rt5651/HiFi.conf           |  2 +-
 src/conf/ucm/rt5651/EnableSeq.conf            |  2 ++
 src/conf/ucm/rt5651/HeadPhones.conf           |  1 +
 src/conf/ucm/rt5651/Makefile.am               |  2 +-
 .../rt5651/{Speaker.conf => MonoSpeaker.conf} | 20 ++++++++++++-------
 src/conf/ucm/rt5651/Speaker.conf              |  1 +
 6 files changed, 19 insertions(+), 9 deletions(-)
 copy src/conf/ucm/rt5651/{Speaker.conf => MonoSpeaker.conf} (52%)

diff --git a/src/conf/ucm/bytcr-rt5651/HiFi.conf b/src/conf/ucm/bytcr-rt5651/HiFi.conf
index 961b2604..8733403c 100644
--- a/src/conf/ucm/bytcr-rt5651/HiFi.conf
+++ b/src/conf/ucm/bytcr-rt5651/HiFi.conf
@@ -21,9 +21,9 @@ SectionVerb {
 }
 
 <rt5651/Speaker.conf>
+<rt5651/MonoSpeaker.conf>
 <rt5651/HeadPhones.conf>
 
-
 <rt5651/IN1-InternalMic.conf>
 <rt5651/IN2-InternalMic.conf>
 <rt5651/IN12-InternalMic.conf>
diff --git a/src/conf/ucm/rt5651/EnableSeq.conf b/src/conf/ucm/rt5651/EnableSeq.conf
index 37bffecb..6fb3c1f2 100644
--- a/src/conf/ucm/rt5651/EnableSeq.conf
+++ b/src/conf/ucm/rt5651/EnableSeq.conf
@@ -11,6 +11,8 @@ cset "name='IF1 ASRC Switch' on"
 cset "name='LOUT L Playback Switch' off"
 cset "name='LOUT R Playback Switch' off"
 cset "name='Stereo DAC MIXL DAC L1 Switch' on"
+cset "name='Stereo DAC MIXL DAC R1 Switch' off"
+cset "name='Stereo DAC MIXR DAC L1 Switch' off"
 cset "name='Stereo DAC MIXR DAC R1 Switch' on"
 cset "name='Stereo1 ADC MIXR ADC1 Switch' on"
 cset "name='Stereo1 ADC MIXR ADC2 Switch' on"
diff --git a/src/conf/ucm/rt5651/HeadPhones.conf b/src/conf/ucm/rt5651/HeadPhones.conf
index b9323a36..eaf5fdfc 100644
--- a/src/conf/ucm/rt5651/HeadPhones.conf
+++ b/src/conf/ucm/rt5651/HeadPhones.conf
@@ -3,6 +3,7 @@ SectionDevice."Headphones" {
 
 	ConflictingDevice [
 		"Speaker"
+		"MonoSpeaker"
 	]
 
 	EnableSequence [
diff --git a/src/conf/ucm/rt5651/Makefile.am b/src/conf/ucm/rt5651/Makefile.am
index abd45ad7..a9600ed6 100644
--- a/src/conf/ucm/rt5651/Makefile.am
+++ b/src/conf/ucm/rt5651/Makefile.am
@@ -2,5 +2,5 @@ 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
+	   Speaker.conf MonoSpeaker.conf
 EXTRA_DIST = $(ucm_DATA)
diff --git a/src/conf/ucm/rt5651/Speaker.conf b/src/conf/ucm/rt5651/MonoSpeaker.conf
similarity index 52%
copy from src/conf/ucm/rt5651/Speaker.conf
copy to src/conf/ucm/rt5651/MonoSpeaker.conf
index 44168cc5..0c3492fb 100644
--- a/src/conf/ucm/rt5651/Speaker.conf
+++ b/src/conf/ucm/rt5651/MonoSpeaker.conf
@@ -1,15 +1,20 @@
-SectionDevice."Speaker" {
-	Comment "Speakers"
+SectionDevice."MonoSpeaker" {
+	Comment "Mono Speaker"
 
 	ConflictingDevice [
+		"Speaker"
 		"Headphones"
 	]
 
 	EnableSequence [
 		cdev "hw:bytcrrt5651"
+
+		# Map left and right input on left
+		cset "name='Stereo DAC MIXR DAC R1 Switch' off"
+		cset "name='Stereo DAC MIXL DAC R1 Switch' on"
+
 		cset "name='Speaker Switch' on"
 		cset "name='LOUT L Playback Switch' on"
-		cset "name='LOUT R Playback Switch' on"
 		# Done after turning the speaker on to keep the bias and clk on
 		cset "name='Headphone Switch' off"
 		cset "name='HPO L Playback Switch' off"
@@ -18,10 +23,11 @@ SectionDevice."Speaker" {
 
 	DisableSequence [
 		cdev "hw:bytcrrt5651"
-		# This is done by the Headphones EnableSequence, so that the
-		# Platform Clock and BIAS do not temporarily get turned off
-		# as that breaks audio-streams which are playing when
-		# switching between Speaker/Headphone
+		# Disabling the  switches is done by the Speaker EnableSeq
+
+		# Undo mono mapping
+		cset "name='Stereo DAC MIXL DAC R1 Switch' off"
+		cset "name='Stereo DAC MIXR DAC R1 Switch' on"
 	]
 
 	Value {
diff --git a/src/conf/ucm/rt5651/Speaker.conf b/src/conf/ucm/rt5651/Speaker.conf
index 44168cc5..c1091523 100644
--- a/src/conf/ucm/rt5651/Speaker.conf
+++ b/src/conf/ucm/rt5651/Speaker.conf
@@ -2,6 +2,7 @@ SectionDevice."Speaker" {
 	Comment "Speakers"
 
 	ConflictingDevice [
+		"MonoSpeaker"
 		"Headphones"
 	]
 
-- 
2.17.1

  parent reply	other threads:[~2018-07-20  7:27 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-20  7:27 [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Hans de Goede
2018-07-20  7:27 ` [PATCH 01/14] conf/ucm: bytcr-rt5645: Use the generic bytcr/PlatformEnableSeq.conf Hans de Goede
2018-07-20  7:27 ` [PATCH 02/14] conf/ucm: bytcr-rt5651: Add support for boards using SSP0 Hans de Goede
2018-07-20  7:27 ` [PATCH 03/14] conf/ucm: bytcr-rt5651: Do not use both DAC1 and HPVOL inputs for HP Hans de Goede
2018-07-20  7:27 ` [PATCH 04/14] conf/ucm: bytcr-rt5651: Configure all volumes at 0dB Hans de Goede
2018-07-20 13:48   ` Pierre-Louis Bossart
2018-08-08  9:02     ` Hans de Goede
2018-07-20  7:27 ` [PATCH 05/14] conf/ucm: bytcr-rt5651: Start with all outputs and inputs disabled Hans de Goede
2018-07-20  7:27 ` [PATCH 06/14] conf/ucm: bytcr-rt5651: Change Speaker/Headphone en/disable sequences to fix switching Hans de Goede
2018-07-20  7:27 ` [PATCH 07/14] conf/ucm: bytcr-rt5651: Use generic SSP enable + disable sequence Hans de Goede
2018-07-20 13:49   ` Pierre-Louis Bossart
2018-08-08  9:03     ` Hans de Goede
2018-07-20  7:27 ` [PATCH 08/14] conf/ucm: bytcr-rt5651: Fix ADC and Mic capture volumes Hans de Goede
2018-07-20  7:27 ` [PATCH 09/14] conf/ucm: bytcr-rt5651: Add support for mic input on various pins Hans de Goede
2018-07-20  7:27 ` [PATCH 10/14] conf/ucm: bytcr-rt5651: Split into 1 .conf file per input / output Hans de Goede
2018-07-20  7:27 ` Hans de Goede [this message]
2018-07-20  7:27 ` [PATCH 12/14] conf/ucm: bytcr-rt5651: Add long-name UCM profiles Hans de Goede
2018-07-20  7:27 ` [PATCH 13/14] conf/ucm: bytcr-rt5651: Add bytcr-rt5651-mono-spk-in2-mic-hp-swapped config Hans de Goede
2018-07-20  7:27 ` [PATCH 14/14] conf/ucm: bytcr-rt5640: Improve human readable input/output names Hans de Goede
2018-07-20 13:51 ` [PATCH 00/14] conf/ucm: bytcr-rt5651: Various improvements + long-name profiles addition Pierre-Louis Bossart
2018-07-22  8:52   ` Takashi Iwai
2018-08-05 16:46     ` Takashi Iwai
2018-08-06  7:41       ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180720072741.4632-12-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.