diff --git a/.alsa-lib.metadata b/.alsa-lib.metadata index feeb5e3..6ee4083 100644 --- a/.alsa-lib.metadata +++ b/.alsa-lib.metadata @@ -1 +1 @@ -b96002ef24b4155e5d86c081869d8d7b4b496fde SOURCES/alsa-lib-1.1.6.tar.bz2 +018523741f0b78ad5aa928202c11e6694a8c10c2 SOURCES/alsa-lib-1.1.8.tar.bz2 diff --git a/.gitignore b/.gitignore index 745582a..8e86abe 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/alsa-lib-1.1.6.tar.bz2 +SOURCES/alsa-lib-1.1.8.tar.bz2 diff --git a/SOURCES/alsa-lib-1.1.6-post.patch b/SOURCES/alsa-lib-1.1.6-post.patch deleted file mode 100644 index cd02f49..0000000 --- a/SOURCES/alsa-lib-1.1.6-post.patch +++ /dev/null @@ -1,2778 +0,0 @@ -From 93e03bdc2a3dcd5d12516f5de78e14d88a32ff2c Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 4 Apr 2018 09:58:12 +0200 -Subject: [PATCH 01/26] alsa.conf: change the location for add-on configs to - /etc/alsa/conf.d - -The add-on configuration files should be placed to a volatile place. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/alsa.conf | 8 +------- - 1 file changed, 1 insertion(+), 7 deletions(-) - -diff --git a/src/conf/alsa.conf b/src/conf/alsa.conf -index f22918fb..bb00ff40 100644 ---- a/src/conf/alsa.conf -+++ b/src/conf/alsa.conf -@@ -8,13 +8,7 @@ - { - func load - files [ -- { -- @func concat -- strings [ -- { @func datadir } -- "/alsa.conf.d/" -- ] -- } -+ "/etc/alsa/conf.d" - "/etc/asound.conf" - "~/.asoundrc" - ] --- -2.13.6 - - -From 78505dccd23546cc77e5221cb21c01325bc0138d Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 4 Apr 2018 10:02:49 +0200 -Subject: [PATCH 02/26] conf: remove alsa.conf.d from the datadir - -Signed-off-by: Jaroslav Kysela ---- - src/conf/Makefile.am | 2 +- - src/conf/alsa.conf.d/Makefile.am | 8 -------- - src/conf/alsa.conf.d/README | 2 -- - 3 files changed, 1 insertion(+), 11 deletions(-) - delete mode 100644 src/conf/alsa.conf.d/Makefile.am - delete mode 100644 src/conf/alsa.conf.d/README - -diff --git a/src/conf/Makefile.am b/src/conf/Makefile.am -index ef2ea9c1..2b46f95c 100644 ---- a/src/conf/Makefile.am -+++ b/src/conf/Makefile.am -@@ -1,4 +1,4 @@ --SUBDIRS=cards pcm alsa.conf.d -+SUBDIRS=cards pcm - - if BUILD_UCM - SUBDIRS += ucm -diff --git a/src/conf/alsa.conf.d/Makefile.am b/src/conf/alsa.conf.d/Makefile.am -deleted file mode 100644 -index c91661e9..00000000 ---- a/src/conf/alsa.conf.d/Makefile.am -+++ /dev/null -@@ -1,8 +0,0 @@ --alsaconfigdir = @ALSA_CONFIG_DIR@ --alsadir = $(alsaconfigdir)/alsa.conf.d --cfg_files = README -- --alsa_DATA = $(cfg_files) -- --EXTRA_DIST = \ -- $(cfg_files) -diff --git a/src/conf/alsa.conf.d/README b/src/conf/alsa.conf.d/README -deleted file mode 100644 -index 99978848..00000000 ---- a/src/conf/alsa.conf.d/README -+++ /dev/null -@@ -1,2 +0,0 @@ --You can place files named *.conf in this folder and they will be processed --when initialising alsa-lib. --- -2.13.6 - - -From 17bc74d3a25f0d4b1ca25d2d92fcad9c2a9d7f79 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 10 Apr 2018 08:57:07 +0200 -Subject: [PATCH 03/26] configure: remove src/conf/alsa.conf.d/Makefile - -Signed-off-by: Jaroslav Kysela ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index cce195ae..5bc1994f 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -713,7 +713,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \ - src/rawmidi/Makefile src/timer/Makefile \ - src/hwdep/Makefile src/seq/Makefile src/ucm/Makefile \ - src/alisp/Makefile src/topology/Makefile \ -- src/conf/Makefile src/conf/alsa.conf.d/Makefile \ -+ src/conf/Makefile \ - src/conf/cards/Makefile \ - src/conf/pcm/Makefile \ - src/conf/ucm/Makefile \ --- -2.13.6 - - -From 3778a30bb0095c7d3275735718f33058e3c198d5 Mon Sep 17 00:00:00 2001 -From: Kirill Marinushkin -Date: Mon, 16 Apr 2018 20:26:38 +0200 -Subject: [PATCH 04/26] ASoC: topology: Fix bclk and fsync inversion in - set_link_hw_format() - -The values of bclk and fsync are inverted WRT the codec. But the existing -solution already works for Broadwell, see the alsa-lib config: - -`alsa-lib/src/conf/topology/broadwell/broadwell.conf` - -This commit provides the backwards-compatible solution to fix this misuse. -This commit goes in pair with the corresponding patch for linux. - -Signed-off-by: Kirill Marinushkin -Reviewed-by: Pierre-Louis Bossart -Tested-by: Pan Xiuli -Tested-by: Pierre-Louis Bossart -Cc: Jaroslav Kysela -Cc: Takashi Iwai -Cc: Mark Brown -Cc: Liam Girdwood -Cc: linux-kernel@vger.kernel.org -Cc: alsa-devel@alsa-project.org -Signed-off-by: Takashi Iwai ---- - include/sound/asoc.h | 16 ++++++++++++++-- - include/topology.h | 4 ++-- - src/conf/topology/broadwell/broadwell.conf | 4 ++-- - src/topology/pcm.c | 30 ++++++++++++++++++++++++++---- - 4 files changed, 44 insertions(+), 10 deletions(-) - -diff --git a/include/sound/asoc.h b/include/sound/asoc.h -index 0f5d9f9a..89b00703 100644 ---- a/include/sound/asoc.h -+++ b/include/sound/asoc.h -@@ -156,6 +156,18 @@ - #define SND_SOC_TPLG_LNK_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2) - #define SND_SOC_TPLG_LNK_FLGBIT_VOICE_WAKEUP (1 << 3) - -+/* DAI topology BCLK parameter -+ * For the backwards capability, by default codec is bclk master -+ */ -+#define SND_SOC_TPLG_BCLK_CM 0 /* codec is bclk master */ -+#define SND_SOC_TPLG_BCLK_CS 1 /* codec is bclk slave */ -+ -+/* DAI topology FSYNC parameter -+ * For the backwards capability, by default codec is fsync master -+ */ -+#define SND_SOC_TPLG_FSYNC_CM 0 /* codec is fsync master */ -+#define SND_SOC_TPLG_FSYNC_CS 1 /* codec is fsync slave */ -+ - /* - * Block Header. - * This header precedes all object and object arrays below. -@@ -311,8 +323,8 @@ struct snd_soc_tplg_hw_config { - __u8 clock_gated; /* 1 if clock can be gated to save power */ - __u8 invert_bclk; /* 1 for inverted BCLK, 0 for normal */ - __u8 invert_fsync; /* 1 for inverted frame clock, 0 for normal */ -- __u8 bclk_master; /* 1 for master of BCLK, 0 for slave */ -- __u8 fsync_master; /* 1 for master of FSYNC, 0 for slave */ -+ __u8 bclk_master; /* SND_SOC_TPLG_BCLK_ value */ -+ __u8 fsync_master; /* SND_SOC_TPLG_FSYNC_ value */ - __u8 mclk_direction; /* 0 for input, 1 for output */ - __le16 reserved; /* for 32bit alignment */ - __le32 mclk_rate; /* MCLK or SYSCLK freqency in Hz */ -diff --git a/include/topology.h b/include/topology.h -index 8779da4d..5d7b46df 100644 ---- a/include/topology.h -+++ b/include/topology.h -@@ -1000,8 +1000,8 @@ struct snd_tplg_hw_config_template { - unsigned char clock_gated; /* 1 if clock can be gated to save power */ - unsigned char invert_bclk; /* 1 for inverted BCLK, 0 for normal */ - unsigned char invert_fsync; /* 1 for inverted frame clock, 0 for normal */ -- unsigned char bclk_master; /* 1 for master of BCLK, 0 for slave */ -- unsigned char fsync_master; /* 1 for master of FSYNC, 0 for slave */ -+ unsigned char bclk_master; /* SND_SOC_TPLG_BCLK_ value */ -+ unsigned char fsync_master; /* SND_SOC_TPLG_FSYNC_ value */ - unsigned char mclk_direction; /* 0 for input, 1 for output */ - unsigned short reserved; /* for 32bit alignment */ - unsigned int mclk_rate; /* MCLK or SYSCLK freqency in Hz */ -diff --git a/src/conf/topology/broadwell/broadwell.conf b/src/conf/topology/broadwell/broadwell.conf -index b8405d93..09fc4daa 100644 ---- a/src/conf/topology/broadwell/broadwell.conf -+++ b/src/conf/topology/broadwell/broadwell.conf -@@ -393,8 +393,8 @@ SectionGraph."dsp" { - SectionHWConfig."CodecHWConfig" { - id "1" - format "I2S" # physical audio format. -- bclk "master" # Platform is master of bit clock -- fsync "master" # platform is master of fsync -+ bclk "codec_slave" # platform is master of bit clock (codec is slave) -+ fsync "codec_slave" # platform is master of fsync (codec is slave) - } - - SectionLink."Codec" { -diff --git a/src/topology/pcm.c b/src/topology/pcm.c -index bb47b9af..d0395182 100644 ---- a/src/topology/pcm.c -+++ b/src/topology/pcm.c -@@ -1141,8 +1141,19 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg, - if (snd_config_get_string(n, &val) < 0) - return -EINVAL; - -- if (!strcmp(val, "master")) -- hw_cfg->bclk_master = true; -+ if (!strcmp(val, "master")) { -+ /* For backwards capability, -+ * "master" == "codec is slave" -+ */ -+ SNDERR("warning: deprecated bclk value '%s'\n", -+ val); -+ -+ hw_cfg->bclk_master = SND_SOC_TPLG_BCLK_CS; -+ } else if (!strcmp(val, "codec_slave")) { -+ hw_cfg->bclk_master = SND_SOC_TPLG_BCLK_CS; -+ } else if (!strcmp(val, "codec_master")) { -+ hw_cfg->bclk_master = SND_SOC_TPLG_BCLK_CM; -+ } - continue; - } - -@@ -1167,8 +1178,19 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg, - if (snd_config_get_string(n, &val) < 0) - return -EINVAL; - -- if (!strcmp(val, "master")) -- hw_cfg->fsync_master = true; -+ if (!strcmp(val, "master")) { -+ /* For backwards capability, -+ * "master" == "codec is slave" -+ */ -+ SNDERR("warning: deprecated fsync value '%s'\n", -+ val); -+ -+ hw_cfg->fsync_master = SND_SOC_TPLG_FSYNC_CS; -+ } else if (!strcmp(val, "codec_slave")) { -+ hw_cfg->fsync_master = SND_SOC_TPLG_FSYNC_CS; -+ } else if (!strcmp(val, "codec_master")) { -+ hw_cfg->fsync_master = SND_SOC_TPLG_FSYNC_CM; -+ } - continue; - } - --- -2.13.6 - - -From bdb709ab2a091743980c9154950c01f0c540476b Mon Sep 17 00:00:00 2001 -From: Kirill Marinushkin -Date: Mon, 16 Apr 2018 20:26:39 +0200 -Subject: [PATCH 05/26] ASoC: topology: Add missing clock gating parameter when - parsing hw_configs - -Clock gating parameter is a part of `dai_fmt`. It is supported by -`alsa-lib` when creating a topology binary file, but ignored by kernel -when loading this topology file. - -After applying this commit, the clock gating parameter is not ignored any -more. This solution is backwards compatible. The existing behaviour is -not broken, because by default the parameter value is 0 and is ignored. - -snd_soc_tplg_hw_config.clock_gated = 0 => no effect -snd_soc_tplg_hw_config.clock_gated = 1 => SND_SOC_DAIFMT_GATED -snd_soc_tplg_hw_config.clock_gated = 2 => SND_SOC_DAIFMT_CONT - -For example, the following config, based on -alsa-lib/src/conf/topology/broadwell/broadwell.conf, is now supported: - -~~~~ -SectionHWConfig."CodecHWConfig" { - id "1" - format "I2S" # physical audio format. - pm_gate_clocks "true" # clock can be gated -} - -SectionLink."Codec" { - - # used for binding to the physical link - id "0" - - hw_configs [ - "CodecHWConfig" - ] - - default_hw_conf_id "1" -} -~~~~ - -Signed-off-by: Kirill Marinushkin -Reviewed-by: Pierre-Louis Bossart -Cc: Jaroslav Kysela -Cc: Takashi Iwai -Cc: Mark Brown -Cc: Pan Xiuli -Cc: Liam Girdwood -Cc: linux-kernel@vger.kernel.org -Cc: alsa-devel@alsa-project.org -Signed-off-by: Takashi Iwai ---- - include/sound/asoc.h | 7 ++++++- - include/topology.h | 2 +- - src/topology/pcm.c | 6 +++++- - 3 files changed, 12 insertions(+), 3 deletions(-) - -diff --git a/include/sound/asoc.h b/include/sound/asoc.h -index 89b00703..297e837c 100644 ---- a/include/sound/asoc.h -+++ b/include/sound/asoc.h -@@ -135,6 +135,11 @@ - #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_CHANNELS (1 << 1) - #define SND_SOC_TPLG_DAI_FLGBIT_SYMMETRIC_SAMPLEBITS (1 << 2) - -+/* DAI clock gating */ -+#define SND_SOC_TPLG_DAI_CLK_GATE_UNDEFINED 0 -+#define SND_SOC_TPLG_DAI_CLK_GATE_GATED 1 -+#define SND_SOC_TPLG_DAI_CLK_GATE_CONT 2 -+ - /* DAI physical PCM data formats. - * Add new formats to the end of the list. - */ -@@ -320,7 +325,7 @@ struct snd_soc_tplg_hw_config { - __le32 size; /* in bytes of this structure */ - __le32 id; /* unique ID - - used to match */ - __le32 fmt; /* SND_SOC_DAI_FORMAT_ format value */ -- __u8 clock_gated; /* 1 if clock can be gated to save power */ -+ __u8 clock_gated; /* SND_SOC_TPLG_DAI_CLK_GATE_ value */ - __u8 invert_bclk; /* 1 for inverted BCLK, 0 for normal */ - __u8 invert_fsync; /* 1 for inverted frame clock, 0 for normal */ - __u8 bclk_master; /* SND_SOC_TPLG_BCLK_ value */ -diff --git a/include/topology.h b/include/topology.h -index 5d7b46df..3793115c 100644 ---- a/include/topology.h -+++ b/include/topology.h -@@ -997,7 +997,7 @@ struct snd_tplg_pcm_template { - struct snd_tplg_hw_config_template { - int id; /* unique ID - - used to match */ - unsigned int fmt; /* SND_SOC_DAI_FORMAT_ format value */ -- unsigned char clock_gated; /* 1 if clock can be gated to save power */ -+ unsigned char clock_gated; /* SND_SOC_TPLG_DAI_CLK_GATE_ value */ - unsigned char invert_bclk; /* 1 for inverted BCLK, 0 for normal */ - unsigned char invert_fsync; /* 1 for inverted frame clock, 0 for normal */ - unsigned char bclk_master; /* SND_SOC_TPLG_BCLK_ value */ -diff --git a/src/topology/pcm.c b/src/topology/pcm.c -index d0395182..b53f6b03 100644 ---- a/src/topology/pcm.c -+++ b/src/topology/pcm.c -@@ -1233,7 +1233,11 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg, - return -EINVAL; - - if (!strcmp(val, "true")) -- hw_cfg->clock_gated = true; -+ hw_cfg->clock_gated = -+ SND_SOC_TPLG_DAI_CLK_GATE_GATED; -+ else -+ hw_cfg->clock_gated = -+ SND_SOC_TPLG_DAI_CLK_GATE_CONT; - continue; - } - --- -2.13.6 - - -From 7cf73b56e4505ad194f5789293494a6ebaa1feff Mon Sep 17 00:00:00 2001 -From: Kirill Marinushkin -Date: Mon, 16 Apr 2018 20:26:40 +0200 -Subject: [PATCH 06/26] ASoC: topology: Add definitions for mclk_direction - values - -Current comment makes not clear the direction of mclk. Previously, similar -description caused a misunderstanding for bclk_master and fsync_master. - -This commit solves the potential confusion the same way it is solved for -bclk_master and fsync_master. - -Signed-off-by: Kirill Marinushkin -Acked-by: Pierre-Louis Bossart -Cc: Jaroslav Kysela -Cc: Takashi Iwai -Cc: Mark Brown -Cc: Pan Xiuli -Cc: Liam Girdwood -Cc: alsa-devel@alsa-project.org -Signed-off-by: Takashi Iwai ---- - include/sound/asoc.h | 6 +++++- - include/topology.h | 2 +- - src/topology/pcm.c | 15 +++++++++++++-- - 3 files changed, 19 insertions(+), 4 deletions(-) - -diff --git a/include/sound/asoc.h b/include/sound/asoc.h -index 297e837c..bb8aec78 100644 ---- a/include/sound/asoc.h -+++ b/include/sound/asoc.h -@@ -140,6 +140,10 @@ - #define SND_SOC_TPLG_DAI_CLK_GATE_GATED 1 - #define SND_SOC_TPLG_DAI_CLK_GATE_CONT 2 - -+/* DAI mclk_direction */ -+#define SND_SOC_TPLG_MCLK_CO 0 /* for codec, mclk is output */ -+#define SND_SOC_TPLG_MCLK_CI 1 /* for codec, mclk is input */ -+ - /* DAI physical PCM data formats. - * Add new formats to the end of the list. - */ -@@ -330,7 +334,7 @@ struct snd_soc_tplg_hw_config { - __u8 invert_fsync; /* 1 for inverted frame clock, 0 for normal */ - __u8 bclk_master; /* SND_SOC_TPLG_BCLK_ value */ - __u8 fsync_master; /* SND_SOC_TPLG_FSYNC_ value */ -- __u8 mclk_direction; /* 0 for input, 1 for output */ -+ __u8 mclk_direction; /* SND_SOC_TPLG_MCLK_ value */ - __le16 reserved; /* for 32bit alignment */ - __le32 mclk_rate; /* MCLK or SYSCLK freqency in Hz */ - __le32 bclk_rate; /* BCLK freqency in Hz */ -diff --git a/include/topology.h b/include/topology.h -index 3793115c..27da7308 100644 ---- a/include/topology.h -+++ b/include/topology.h -@@ -1002,7 +1002,7 @@ struct snd_tplg_hw_config_template { - unsigned char invert_fsync; /* 1 for inverted frame clock, 0 for normal */ - unsigned char bclk_master; /* SND_SOC_TPLG_BCLK_ value */ - unsigned char fsync_master; /* SND_SOC_TPLG_FSYNC_ value */ -- unsigned char mclk_direction; /* 0 for input, 1 for output */ -+ unsigned char mclk_direction; /* SND_SOC_TPLG_MCLK_ value */ - unsigned short reserved; /* for 32bit alignment */ - unsigned int mclk_rate; /* MCLK or SYSCLK freqency in Hz */ - unsigned int bclk_rate; /* BCLK freqency in Hz */ -diff --git a/src/topology/pcm.c b/src/topology/pcm.c -index b53f6b03..2ce1651b 100644 ---- a/src/topology/pcm.c -+++ b/src/topology/pcm.c -@@ -1223,8 +1223,19 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg, - if (snd_config_get_string(n, &val) < 0) - return -EINVAL; - -- if (!strcmp(val, "master")) -- hw_cfg->mclk_direction = true; -+ if (!strcmp(val, "master")) { -+ /* For backwards capability, -+ * "master" == "for codec, mclk is input" -+ */ -+ SNDERR("warning: deprecated mclk value '%s'\n", -+ val); -+ -+ hw_cfg->mclk_direction = SND_SOC_TPLG_MCLK_CI; -+ } else if (!strcmp(val, "codec_mclk_in")) { -+ hw_cfg->mclk_direction = SND_SOC_TPLG_MCLK_CI; -+ } else if (!strcmp(val, "codec_mclk_out")) { -+ hw_cfg->mclk_direction = SND_SOC_TPLG_MCLK_CO; -+ } - continue; - } - --- -2.13.6 - - -From 4493f6a560a315970f5b068126120526a04ae6a2 Mon Sep 17 00:00:00 2001 -From: Kirill Marinushkin -Date: Mon, 16 Apr 2018 20:26:41 +0200 -Subject: [PATCH 07/26] ASoC: topology: Add alias conf parameter names for - hw_configs - -Currently, some parameter names in conf differ from field names in struct. -These look like typos. - -This commit suggests to add aliases for such parameters, so that the names -in conf are similar to names in struct. This solution is backwards -compatible. - -If the difference between conf names and struct names is done on purpose - -this commit can be dropped. - -Signed-off-by: Kirill Marinushkin -Acked-by: Pierre-Louis Bossart -Cc: Jaroslav Kysela -Cc: Takashi Iwai -Cc: Mark Brown -Cc: Pan Xiuli -Cc: Liam Girdwood -Cc: alsa-devel@alsa-project.org -Signed-off-by: Takashi Iwai ---- - src/topology/pcm.c | 30 ++++++++++++++++++++---------- - 1 file changed, 20 insertions(+), 10 deletions(-) - -diff --git a/src/topology/pcm.c b/src/topology/pcm.c -index 2ce1651b..8ebfafd8 100644 ---- a/src/topology/pcm.c -+++ b/src/topology/pcm.c -@@ -1126,7 +1126,8 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg, - continue; - } - -- if (strcmp(id, "format") == 0) { -+ if (strcmp(id, "format") == 0 || -+ strcmp(id, "fmt") == 0) { - if (snd_config_get_string(n, &val) < 0) - return -EINVAL; - -@@ -1137,7 +1138,8 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg, - continue; - } - -- if (strcmp(id, "bclk") == 0) { -+ if (strcmp(id, "bclk") == 0 || -+ strcmp(id, "bclk_master") == 0) { - if (snd_config_get_string(n, &val) < 0) - return -EINVAL; - -@@ -1157,7 +1159,8 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg, - continue; - } - -- if (strcmp(id, "bclk_freq") == 0) { -+ if (strcmp(id, "bclk_freq") == 0 || -+ strcmp(id, "bclk_rate") == 0) { - if (snd_config_get_string(n, &val) < 0) - return -EINVAL; - -@@ -1165,7 +1168,8 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg, - continue; - } - -- if (strcmp(id, "bclk_invert") == 0) { -+ if (strcmp(id, "bclk_invert") == 0 || -+ strcmp(id, "invert_bclk") == 0) { - if (snd_config_get_string(n, &val) < 0) - return -EINVAL; - -@@ -1174,7 +1178,8 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg, - continue; - } - -- if (strcmp(id, "fsync") == 0) { -+ if (strcmp(id, "fsync") == 0 || -+ strcmp(id, "fsync_master") == 0) { - if (snd_config_get_string(n, &val) < 0) - return -EINVAL; - -@@ -1194,7 +1199,8 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg, - continue; - } - -- if (strcmp(id, "fsync_invert") == 0) { -+ if (strcmp(id, "fsync_invert") == 0 || -+ strcmp(id, "invert_fsync") == 0) { - if (snd_config_get_string(n, &val) < 0) - return -EINVAL; - -@@ -1203,7 +1209,8 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg, - continue; - } - -- if (strcmp(id, "fsync_freq") == 0) { -+ if (strcmp(id, "fsync_freq") == 0 || -+ strcmp(id, "fsync_rate") == 0) { - if (snd_config_get_string(n, &val) < 0) - return -EINVAL; - -@@ -1211,7 +1218,8 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg, - continue; - } - -- if (strcmp(id, "mclk_freq") == 0) { -+ if (strcmp(id, "mclk_freq") == 0 || -+ strcmp(id, "mclk_rate") == 0) { - if (snd_config_get_string(n, &val) < 0) - return -EINVAL; - -@@ -1219,7 +1227,8 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg, - continue; - } - -- if (strcmp(id, "mclk") == 0) { -+ if (strcmp(id, "mclk") == 0 || -+ strcmp(id, "mclk_direction") == 0) { - if (snd_config_get_string(n, &val) < 0) - return -EINVAL; - -@@ -1239,7 +1248,8 @@ int tplg_parse_hw_config(snd_tplg_t *tplg, snd_config_t *cfg, - continue; - } - -- if (strcmp(id, "pm_gate_clocks") == 0) { -+ if (strcmp(id, "pm_gate_clocks") == 0 || -+ strcmp(id, "clock_gated") == 0) { - if (snd_config_get_string(n, &val) < 0) - return -EINVAL; - --- -2.13.6 - - -From 23a20cda111232b5d21dde12d10e19e4ecb71cea Mon Sep 17 00:00:00 2001 -From: Ricard Wanderlof -Date: Wed, 18 Apr 2018 17:03:09 +0200 -Subject: [PATCH 08/26] pcm: softvol: Allow up to 90 dB of gain - -The gain algorithm used in softvol can handle gain factors of up to -32767 which is slightly more than 90 dB, so allow a max_dB of 90 dB. -This doesn't affect existing asound.conf files, but does allow a -max_dB of up to 90 dB when needed. - -Tested using Audacity that there is no undue distorsion or other -artefacts when 90 dB of gain is applied to a suitable signal (i.e. -a signal quiet enough not be clipped whan applying 90 dB of gain). - -Signed-off-by: Ricard Wanderlof -Signed-off-by: Takashi Iwai ---- - src/pcm/pcm_softvol.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/src/pcm/pcm_softvol.c b/src/pcm/pcm_softvol.c -index 8bb4a397..0eaeacef 100644 ---- a/src/pcm/pcm_softvol.c -+++ b/src/pcm/pcm_softvol.c -@@ -59,7 +59,11 @@ typedef struct { - #define PRESET_RESOLUTION 256 - #define PRESET_MIN_DB -51.0 - #define ZERO_DB 0.0 --#define MAX_DB_UPPER_LIMIT 50 -+/* -+ * The gain algorithm as it stands supports gain factors up to 32767, which -+ * is a fraction more than 90 dB, so set 90 dB as the maximum possible gain. -+ */ -+#define MAX_DB_UPPER_LIMIT 90 - - static const unsigned int preset_dB_value[PRESET_RESOLUTION] = { - 0x00b8, 0x00bd, 0x00c1, 0x00c5, 0x00ca, 0x00cf, 0x00d4, 0x00d9, --- -2.13.6 - - -From 181f8e251bc05832f9c9401544e680ea0572a2e3 Mon Sep 17 00:00:00 2001 -From: Hui Wang -Date: Wed, 2 May 2018 14:08:05 +0800 -Subject: [PATCH 09/26] ucm: adding the folder of card_long_name when finding - verb conf file - -The board configuration file and verb conf file are allowed to be -in the folder named of card_long_name, so when finding the verb conf -file, we need to check if it is in the folder of card_long_name or -card_name. - -Signed-off-by: Hui Wang -Signed-off-by: Jaroslav Kysela ---- - src/ucm/parser.c | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/src/ucm/parser.c b/src/ucm/parser.c -index 2d76152f..219edb96 100644 ---- a/src/ucm/parser.c -+++ b/src/ucm/parser.c -@@ -1056,6 +1056,7 @@ static int parse_verb_file(snd_use_case_mgr_t *uc_mgr, - char filename[MAX_FILE]; - char *env = getenv(ALSA_CONFIG_UCM_VAR); - int err; -+ char *folder_name; - - /* allocate verb */ - verb = calloc(1, sizeof(struct use_case_verb)); -@@ -1082,12 +1083,17 @@ static int parse_verb_file(snd_use_case_mgr_t *uc_mgr, - } - - /* open Verb file for reading */ -+ if (!strncmp(uc_mgr->conf_file_name, uc_mgr->card_long_name, MAX_CARD_LONG_NAME)) -+ folder_name = uc_mgr->card_long_name; -+ else -+ folder_name = uc_mgr->card_name; -+ - if (env) - snprintf(filename, sizeof(filename), "%s/%s/%s", -- env, uc_mgr->card_name, file); -+ env, folder_name, file); - else - snprintf(filename, sizeof(filename), "%s/ucm/%s/%s", -- snd_config_topdir(), uc_mgr->card_name, file); -+ snd_config_topdir(), folder_name, file); - filename[sizeof(filename)-1] = '\0'; - - err = uc_mgr_config_load(filename, &cfg); --- -2.13.6 - - -From 81db276f8c2235adc83e9698b0174265f6482655 Mon Sep 17 00:00:00 2001 -From: Hui Wang -Date: Wed, 2 May 2018 14:08:06 +0800 -Subject: [PATCH 10/26] conf/ucm: increase the input volume for LineIn - -Otherwise, the boost value is 0, and the sound captured from that -LineIn jack is too weak for users. - -Signed-off-by: Hui Wang -Signed-off-by: Jaroslav Kysela ---- - src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf b/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf -index 50967896..ece780da 100644 ---- a/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf -+++ b/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf -@@ -99,6 +99,7 @@ SectionDevice."LineIn" { - EnableSequence [ - cdev "hw:PCH" - cset "name='Input Source' Line" -+ cset "name='Line Boost Volume' 3" - ] - } - --- -2.13.6 - - -From f7c38c29d1be8bab9dd4f406aea3b0e9151c1c06 Mon Sep 17 00:00:00 2001 -From: Pierre-Louis Bossart -Date: Sat, 28 Apr 2018 21:51:56 +0200 -Subject: [PATCH 11/26] conf/ucm: chtrt5645: Cleanup and playback fixes - -Apply cleanup and playback fixes changes from: -https://github.com/plbossart/UCM.git - -Cc: Pierre-Louis Bossart -Signed-off-by: Pierre-Louis Bossart -[hdegoede@redhat.com: Modify commit msg and paths for merging into alsa-lib] -Signed-off-by: Hans de Goede -Signed-off-by: Takashi Iwai ---- - src/conf/ucm/chtrt5645/HiFi.conf | 157 ++++++++++++++++++++++++++++++++------- - 1 file changed, 129 insertions(+), 28 deletions(-) - -diff --git a/src/conf/ucm/chtrt5645/HiFi.conf b/src/conf/ucm/chtrt5645/HiFi.conf -index 0c2c83cc..f63392d4 100644 ---- a/src/conf/ucm/chtrt5645/HiFi.conf -+++ b/src/conf/ucm/chtrt5645/HiFi.conf -@@ -11,51 +11,146 @@ SectionVerb { - EnableSequence [ - cdev "hw:chtrt5645" - -- # Enable audio output path -- cset "name='codec_out1 mix 0 pcm0_in Switch' on" -- cset "name='media0_out mix 0 media1_in Switch' on" -+ # media mixer settings -+ # compress -+ cset "name='media0_in Gain 0 Switch' on" -+ cset "name='media0_in Gain 0 Volume' 0" - -- cset "name='media1_in Gain 0 Ramp Delay' 50" -+ # normal - cset "name='media1_in Gain 0 Switch' on" -- cset "name='media1_in Gain 0 Volume' 80% 80%" -+ cset "name='media1_in Gain 0 Volume' 0" -+ # swm loopback -+ cset "name='media2_in Gain 0 Switch' off" -+ cset "name='media2_in Gain 0 Volume' 0%" -+ # deep buffer -+ cset "name='media3_in Gain 0 Switch' on" -+ cset "name='media3_in Gain 0 Volume' 0" -+ -+ cset "name='media0_out mix 0 media0_in Switch' on" -+ cset "name='media0_out mix 0 media1_in Switch' on" -+ cset "name='media0_out mix 0 media2_in Switch' off" -+ cset "name='media0_out mix 0 media3_in Switch' on" -+ -+ cset "name='media1_out mix 0 media0_in Switch' off" -+ cset "name='media1_out mix 0 media1_in Switch' off" -+ cset "name='media1_out mix 0 media2_in Switch' off" -+ cset "name='media1_out mix 0 media3_in Switch' off" - -- cset "name='pcm0_in Gain 0 Ramp Delay' 50" - cset "name='pcm0_in Gain 0 Switch' on" -- cset "name='pcm0_in Gain 0 Volume' 80% 80%" -+ cset "name='pcm0_in Gain 0 Volume' 0" -+ -+ cset "name='pcm1_in Gain 0 Switch' off" -+ cset "name='pcm1_in Gain 0 Volume' 0%" -+ -+ # codec0_out settings (used if ssp2 is connected to aif1) -+ cset "name='codec_out0 mix 0 codec_in0 Switch' off" -+ cset "name='codec_out0 mix 0 codec_in1 Switch' off" -+ cset "name='codec_out0 mix 0 media_loop1_in Switch' off" -+ cset "name='codec_out0 mix 0 media_loop2_in Switch' off" -+ cset "name='codec_out0 mix 0 pcm0_in Switch' on" -+ cset "name='codec_out0 mix 0 pcm1_in Switch' off" -+ cset "name='codec_out0 mix 0 sprot_loop_in Switch' off" -+ cset "name='codec_out0 Gain 0 Switch' on" -+ cset "name='codec_out0 Gain 0 Volume' 0" -+ -+ # modem_out settings (used if ssp0 is connected to aif2) -+ cset "name='modem_out mix 0 codec_in0 Switch' off" -+ cset "name='modem_out mix 0 codec_in1 Switch' off" -+ cset "name='modem_out mix 0 media_loop1_in Switch' off" -+ cset "name='modem_out mix 0 media_loop2_in Switch' off" -+ cset "name='modem_out mix 0 pcm0_in Switch' on" -+ cset "name='modem_out mix 0 pcm1_in Switch' off" -+ cset "name='modem_out mix 0 sprot_loop_in Switch' off" -+ cset "name='modem_out Gain 0 Switch' on" -+ cset "name='modem_out Gain 0 Volume' 0" -+ -+ # input settings -+ # pcm1_out settings -+ -+ # input used when SSP2 is connected -+ cset "name='codec_in0 Gain 0 Switch' on" -+ cset "name='codec_in0 Gain 0 Volume' 0" - -- cset "name='codec_out1 Gain 0 Ramp Delay' 50" -- cset "name='codec_out1 Gain 0 Switch' on" -- cset "name='codec_out1 Gain 0 Volume' 70% 70%" -+ # input used when SSP0 is connected -+ cset "name='modem_in Gain 0 Switch' on" -+ cset "name='modem_in Gain 0 Volume' 0" - -- # Enable audio input path -- cset "name='pcm1_out mix 0 media_loop2_in Switch' on" -- cset "name='media_loop2_out mix 0 codec_in0 Switch' on" -+ cset "name='pcm1_out mix 0 codec_in0 Switch' on" -+ cset "name='pcm1_out mix 0 modem_in Switch' on" -+ cset "name='pcm1_out mix 0 codec_in1 Switch' off" -+ cset "name='pcm1_out mix 0 media_loop1_in Switch' off" -+ cset "name='pcm1_out mix 0 media_loop2_in Switch' off" -+ cset "name='pcm1_out mix 0 pcm0_in Switch' off" -+ cset "name='pcm1_out mix 0 pcm1_in Switch' off" -+ cset "name='pcm1_out mix 0 sprot_loop_in Switch' off" - -- cset "name='codec_in0 Gain 0 Ramp Delay' 50" -- cset "name='codec_in0 Gain 0 Switch' on" -- cset "name='codec_in0 Gain 0 Volume' 80% 80%" -+ cset "name='pcm1_out Gain 0 Switch' on" -+ cset "name='pcm1_out Gain 0 Volume' 0" - -- cset "name='media_loop2_out Gain 0 Ramp Delay' 50" -- cset "name='media_loop2_out Gain 0 Switch' on" -- cset "name='media_loop2_out Gain 0 Volume' 80% 80%" -+ # disable codec_out1 -+ cset "name='codec_out1 mix 0 codec_in0 Switch' off" -+ cset "name='codec_out1 mix 0 codec_in1 Switch' off" -+ cset "name='codec_out1 mix 0 media_loop1_in Switch' off" -+ cset "name='codec_out1 mix 0 media_loop2_in Switch' off" -+ cset "name='codec_out1 mix 0 pcm0_in Switch' off" -+ cset "name='codec_out1 mix 0 pcm1_in Switch' off" -+ cset "name='codec_out1 mix 0 sprot_loop_in Switch' off" -+ cset "name='codec_out1 Gain 0 Switch' off" -+ cset "name='codec_out1 Gain 0 Volume' 0%" - -- cset "name='pcm1_out Gain 0 Ramp Delay' 50" -- cset "name='pcm1_out Gain 0 Switch' on" -- cset "name='pcm1_out Gain 0 Volume' 80% 80%" -+ # disable codec_in1 -+ cset "name='codec_in1 Gain 0 Switch' off" -+ cset "name='codec_in1 Gain 0 Volume' 0%" -+ -+ # disable all loops -+ cset "name='media_loop1_out mix 0 codec_in0 Switch' off" -+ cset "name='media_loop1_out mix 0 codec_in1 Switch' off" -+ cset "name='media_loop1_out mix 0 media_loop1_in Switch' off" -+ cset "name='media_loop1_out mix 0 media_loop2_in Switch' off" -+ cset "name='media_loop1_out mix 0 pcm0_in Switch' off" -+ cset "name='media_loop1_out mix 0 pcm1_in Switch' off" -+ cset "name='media_loop1_out mix 0 sprot_loop_in Switch' off" -+ -+ cset "name='media_loop2_out mix 0 codec_in0 Switch' off" -+ cset "name='media_loop2_out mix 0 codec_in1 Switch' off" -+ cset "name='media_loop2_out mix 0 media_loop1_in Switch' off" -+ cset "name='media_loop2_out mix 0 media_loop2_in Switch' off" -+ cset "name='media_loop2_out mix 0 pcm0_in Switch' off" -+ cset "name='media_loop2_out mix 0 pcm1_in Switch' off" -+ cset "name='media_loop2_out mix 0 sprot_loop_in Switch' off" -+ -+ cset "name='sprot_loop_out mix 0 codec_in0 Switch' off" -+ cset "name='sprot_loop_out mix 0 codec_in1 Switch' off" -+ cset "name='sprot_loop_out mix 0 media_loop1_in Switch' off" -+ cset "name='sprot_loop_out mix 0 media_loop2_in Switch' off" -+ cset "name='sprot_loop_out mix 0 pcm0_in Switch' off" -+ cset "name='sprot_loop_out mix 0 pcm1_in Switch' off" -+ cset "name='sprot_loop_out mix 0 sprot_loop_in Switch' off" - - # Output Configuration -- cset "name='DAC L2 Mux' 'IF1 DAC'" -- cset "name='DAC R2 Mux' 'IF1 DAC'" -+ cset "name='DAC1 L Mux' IF1 DAC" -+ cset "name='DAC1 R Mux' IF1 DAC" -+ cset "name='DAC1 MIXL DAC1 Switch' 1" -+ cset "name='DAC1 MIXR DAC1 Switch' 1" -+ cset "name='Stereo DAC MIXL DAC L1 Switch' 1" -+ cset "name='Stereo DAC MIXR DAC R1 Switch' 1" -+ -+ cset "name='DAC L2 Mux' IF2 DAC" -+ cset "name='DAC R2 Mux' IF2 DAC" - cset "name='Mono DAC MIXL DAC L2 Switch' on" - cset "name='Mono DAC MIXR DAC R2 Switch' on" - cset "name='DAC2 Playback Switch' on" - -+ cset "name='HPOVOL MIXL DAC1 Switch' on" -+ cset "name='HPOVOL MIXR DAC1 Switch' on" - cset "name='HPOVOL MIXL DAC2 Switch' on" - cset "name='HPOVOL MIXR DAC2 Switch' on" - cset "name='HPO MIX HPVOL Switch' on" - cset "name='HPOVOL L Switch' on" - cset "name='HPOVOL R Switch' on" - -+ cset "name='SPK MIXL DAC L1 Switch' on" -+ cset "name='SPK MIXR DAC R1 Switch' on" - cset "name='SPK MIXL DAC L2 Switch' on" - cset "name='SPK MIXR DAC R2 Switch' on" - cset "name='SPOL MIX SPKVOL L Switch' on" -@@ -105,15 +200,18 @@ SectionDevice."Speaker" { - } - - ConflictingDevice [ -- "Headphone" -+ "Headphones" - ] - - EnableSequence [ - cdev "hw:chtrt5645" - -+ cset "name='Headphone Switch' off" -+ cset "name='Headphone Channel Switch' off" -+ - cset "name='Ext Spk Switch' on" - cset "name='Speaker Channel Switch' on" -- cset "name='Speaker Playback Volume' 39" -+ cset "name='Speaker Playback Volume' 31" - ] - - DisableSequence [ -@@ -124,7 +222,7 @@ SectionDevice."Speaker" { - ] - } - --SectionDevice."Headphone".0 { -+SectionDevice."Headphones" { - Comment "Headphones" - - Value { -@@ -140,9 +238,12 @@ SectionDevice."Headphone".0 { - EnableSequence [ - cdev "hw:chtrt5645" - -+ cset "name='Ext Spk Switch' off" -+ cset "name='Speaker Channel Switch' off" -+ - cset "name='Headphone Switch' on" - cset "name='Headphone Channel Switch' on" -- cset "name='Headphone Playback Volume' 39" -+ cset "name='Headphone Playback Volume' 31" - ] - - DisableSequence [ --- -2.13.6 - - -From 4c0d983d7b4402e7275455ac43f39049b45037ea Mon Sep 17 00:00:00 2001 -From: Pierre-Louis Bossart -Date: Sat, 28 Apr 2018 21:51:57 +0200 -Subject: [PATCH 12/26] conf/ucm: chtrt5645: Microphone recording fixes - -Apply microphone recording changes from: -https://github.com/plbossart/UCM.git - -Cc: Pierre-Louis Bossart -Signed-off-by: Pierre-Louis Bossart -[hdegoede@redhat.com: Drop non generic DMIC changes] -Signed-off-by: Hans de Goede -Signed-off-by: Takashi Iwai ---- - src/conf/ucm/chtrt5645/HiFi.conf | 50 ++++++++++++++++++++++++++++++++-------- - 1 file changed, 41 insertions(+), 9 deletions(-) - -diff --git a/src/conf/ucm/chtrt5645/HiFi.conf b/src/conf/ucm/chtrt5645/HiFi.conf -index f63392d4..b97a9c00 100644 ---- a/src/conf/ucm/chtrt5645/HiFi.conf -+++ b/src/conf/ucm/chtrt5645/HiFi.conf -@@ -4,8 +4,8 @@ SectionVerb { - TQ "HiFi" - - # ALSA PCM device for HiFi -- PlaybackPCM "hw:chtrt5645,0" -- CapturePCM "hw:chtrt5645,0" -+ PlaybackPCM "hw:chtrt5645" -+ CapturePCM "hw:chtrt5645" - } - - EnableSequence [ -@@ -255,7 +255,7 @@ SectionDevice."Headphones" { - } - - SectionDevice."Mic".0 { -- Comment "Internal Microphone" -+ Comment "Internal Analog Microphones" - - Value { - CaptureChannels "2" -@@ -266,15 +266,33 @@ SectionDevice."Mic".0 { - cdev "hw:chtrt5645" - - cset "name='Int Mic Switch' on" -- cset "name='Sto1 ADC MIXL ADC2 Switch' on" -- cset "name='Sto1 ADC MIXR ADC2 Switch' on" -+ -+ cset "name='Sto1 ADC MIXL ADC1 Switch' on" -+ cset "name='Sto1 ADC MIXR ADC1 Switch' on" -+ cset "name='Sto1 ADC MIXL ADC2 Switch' off" -+ cset "name='Sto1 ADC MIXR ADC2 Switch' off" -+ -+ cset "name='Mono ADC MIXL ADC1 Switch' on" -+ cset "name='Mono ADC MIXR ADC1 Switch' on" -+ cset "name='Mono ADC MIXL ADC2 Switch' off" -+ cset "name='Mono ADC MIXR ADC2 Switch' off" -+ -+ cset "name='RECMIXL BST1 Switch' on" -+ cset "name='RECMIXR BST1 Switch' on" -+ - ] - - DisableSequence [ - cdev "hw:chtrt5645" - -- cset "name='Sto1 ADC MIXL ADC2 Switch' off" -- cset "name='Sto1 ADC MIXR ADC2 Switch' off" -+ cset "name='Sto1 ADC MIXL ADC1 Switch' off" -+ cset "name='Sto1 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='Int Mic Switch' off" - ] - } -@@ -292,19 +310,33 @@ SectionDevice."HSMic".0 { - cdev "hw:chtrt5645" - - cset "name='Headset Mic Switch' on" -- cset "name='RECMIXL BST1 Switch' on" -- cset "name='RECMIXR BST1 Switch' on" -+ - cset "name='Sto1 ADC MIXL ADC1 Switch' on" - cset "name='Sto1 ADC MIXR ADC1 Switch' on" -+ cset "name='Sto1 ADC MIXL ADC2 Switch' off" -+ cset "name='Sto1 ADC MIXR ADC2 Switch' off" -+ -+ cset "name='Mono ADC MIXL ADC1 Switch' on" -+ cset "name='Mono ADC MIXR ADC1 Switch' on" -+ cset "name='Mono ADC MIXL ADC2 Switch' off" -+ cset "name='Mono ADC MIXR ADC2 Switch' off" -+ -+ cset "name='RECMIXL BST1 Switch' on" -+ cset "name='RECMIXR BST1 Switch' on" -+ - ] - - DisableSequence [ - cdev "hw:chtrt5645" - - cset "name='Headset Mic Switch' off" -+ - cset "name='RECMIXL BST1 Switch' off" - cset "name='RECMIXR BST1 Switch' off" - cset "name='Sto1 ADC MIXL ADC1 Switch' off" - cset "name='Sto1 ADC MIXR ADC1 Switch' off" -+ cset "name='Mono ADC MIXL ADC1 Switch' on" -+ cset "name='Mono ADC MIXR ADC1 Switch' on" -+ - ] - } --- -2.13.6 - - -From 76bc53e69a12163a86e6746fd3011de6b1652043 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Sat, 28 Apr 2018 21:51:58 +0200 -Subject: [PATCH 13/26] conf/ucm: chtrt5645: Fix recording from internal analog - microphone - -The internal analog mic switch is called 'Int Analog Mic Switch' -(not 'Int Mic Switch') and is connected to BST2 not BST1. - -Also change the analog mic volume levels so that we get better -audio / less noise. - -Signed-off-by: Hans de Goede -Signed-off-by: Takashi Iwai ---- - src/conf/ucm/chtrt5645/HiFi.conf | 38 ++++++++++++++++++++++++-------------- - 1 file changed, 24 insertions(+), 14 deletions(-) - -diff --git a/src/conf/ucm/chtrt5645/HiFi.conf b/src/conf/ucm/chtrt5645/HiFi.conf -index b97a9c00..e81866cf 100644 ---- a/src/conf/ucm/chtrt5645/HiFi.conf -+++ b/src/conf/ucm/chtrt5645/HiFi.conf -@@ -160,15 +160,24 @@ SectionVerb { - - # Input Configuration - cset "name='Stereo1 DMIC Mux' 0" -+ cset "name='Stereo1 ADC1 Mux' 1" - cset "name='Stereo1 ADC2 Mux' 1" - cset "name='ADC Capture Switch' on" -- cset "name='ADC Capture Volume' 31" -- cset "name='ADC Boost Capture Volume' 3" -- cset "name='Mono ADC Capture Volume' 63" -- cset "name='Mono ADC Boost Capture Volume' 2" -- cset "name='IN Capture Volume' 63" -+ # 55/63 -+ cset "name='ADC Capture Volume' 55" -+ # set ADC Boost to 0/3, higher vals cause a lot of white noise -+ cset "name='ADC Boost Capture Volume' 0" -+ # 55/63 -+ cset "name='Mono ADC Capture Volume' 55" -+ # 0/3 -+ cset "name='Mono ADC Boost Capture Volume' 0" -+ # 27/31 -+ cset "name='IN Capture Volume' 27" - cset "name='I2S2 Func Switch' on" -- -+ # 3/12 the headphone mic tends to be quite loud -+ cset "name='IN1 Boost' 3" -+ # 8/8 the internal analog mic tends to be quite soft -+ cset "name='IN2 Boost' 8" - ] - - DisableSequence [ -@@ -243,7 +252,8 @@ SectionDevice."Headphones" { - - cset "name='Headphone Switch' on" - cset "name='Headphone Channel Switch' on" -- cset "name='Headphone Playback Volume' 31" -+ # 25/39 higher values cause crackling on some boards -+ cset "name='Headphone Playback Volume' 25" - ] - - DisableSequence [ -@@ -255,7 +265,7 @@ SectionDevice."Headphones" { - } - - SectionDevice."Mic".0 { -- Comment "Internal Analog Microphones" -+ Comment "Internal Analog Microphone" - - Value { - CaptureChannels "2" -@@ -265,7 +275,7 @@ SectionDevice."Mic".0 { - EnableSequence [ - cdev "hw:chtrt5645" - -- cset "name='Int Mic Switch' on" -+ cset "name='Int Analog Mic Switch' on" - - cset "name='Sto1 ADC MIXL ADC1 Switch' on" - cset "name='Sto1 ADC MIXR ADC1 Switch' on" -@@ -277,8 +287,8 @@ SectionDevice."Mic".0 { - cset "name='Mono ADC MIXL ADC2 Switch' off" - cset "name='Mono ADC MIXR ADC2 Switch' off" - -- cset "name='RECMIXL BST1 Switch' on" -- cset "name='RECMIXR BST1 Switch' on" -+ cset "name='RECMIXL BST2 Switch' on" -+ cset "name='RECMIXR BST2 Switch' on" - - ] - -@@ -290,10 +300,10 @@ SectionDevice."Mic".0 { - 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='RECMIXL BST2 Switch' off" -+ cset "name='RECMIXR BST2 Switch' off" - -- cset "name='Int Mic Switch' off" -+ cset "name='Int Analog Mic Switch' off" - ] - } - --- -2.13.6 - - -From c22a7f423ddef2a1376bc84f2aafc0a167192ab6 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Sat, 28 Apr 2018 21:51:59 +0200 -Subject: [PATCH 14/26] conf/ucm: chtrt5645: At config for the Asus T100HA - -The Asus T100HA uses a digital mic rather then an analog one, add -long-name config specific for the T100HA, which is a copy of the standard -chtrt5645 config with the internal analog mic section replaced with one -for the digital mic found on the Asus T100HA. - -Signed-off-by: Hans de Goede -Signed-off-by: Takashi Iwai ---- - configure.ac | 1 + - .../ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN.conf | 5 + - .../HiFi.conf | 348 +++++++++++++++++++++ - .../Makefile.am | 4 + - src/conf/ucm/Makefile.am | 1 + - 5 files changed, 359 insertions(+) - create mode 100644 src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN.conf - create mode 100644 src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf - create mode 100644 src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/Makefile.am - -diff --git a/configure.ac b/configure.ac -index 5bc1994f..94baf055 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -717,6 +717,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \ - src/conf/cards/Makefile \ - src/conf/pcm/Makefile \ - src/conf/ucm/Makefile \ -+ src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/Makefile \ - src/conf/ucm/broadwell-rt286/Makefile \ - src/conf/ucm/broxton-rt298/Makefile \ - src/conf/ucm/bytcr-rt5651/Makefile \ -diff --git a/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN.conf b/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN.conf -new file mode 100644 -index 00000000..5afe5f0b ---- /dev/null -+++ b/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN.conf -@@ -0,0 +1,5 @@ -+Comment "Intel SoC Audio Device" -+SectionUseCase."HiFi" { -+ File "../ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf" -+ Comment "Default" -+} -diff --git a/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf b/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf -new file mode 100644 -index 00000000..78bf9823 ---- /dev/null -+++ b/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/HiFi.conf -@@ -0,0 +1,348 @@ -+SectionVerb { -+ # ALSA PCM -+ Value { -+ TQ "HiFi" -+ -+ # ALSA PCM device for HiFi -+ PlaybackPCM "hw:chtrt5645" -+ CapturePCM "hw:chtrt5645" -+ } -+ -+ EnableSequence [ -+ cdev "hw:chtrt5645" -+ -+ # media mixer settings -+ # compress -+ cset "name='media0_in Gain 0 Switch' on" -+ cset "name='media0_in Gain 0 Volume' 0" -+ -+ # normal -+ cset "name='media1_in Gain 0 Switch' on" -+ cset "name='media1_in Gain 0 Volume' 0" -+ # swm loopback -+ cset "name='media2_in Gain 0 Switch' off" -+ cset "name='media2_in Gain 0 Volume' 0%" -+ # deep buffer -+ cset "name='media3_in Gain 0 Switch' on" -+ cset "name='media3_in Gain 0 Volume' 0" -+ -+ cset "name='media0_out mix 0 media0_in Switch' on" -+ cset "name='media0_out mix 0 media1_in Switch' on" -+ cset "name='media0_out mix 0 media2_in Switch' off" -+ cset "name='media0_out mix 0 media3_in Switch' on" -+ -+ cset "name='media1_out mix 0 media0_in Switch' off" -+ cset "name='media1_out mix 0 media1_in Switch' off" -+ cset "name='media1_out mix 0 media2_in Switch' off" -+ cset "name='media1_out mix 0 media3_in Switch' off" -+ -+ cset "name='pcm0_in Gain 0 Switch' on" -+ cset "name='pcm0_in Gain 0 Volume' 0" -+ -+ cset "name='pcm1_in Gain 0 Switch' off" -+ cset "name='pcm1_in Gain 0 Volume' 0%" -+ -+ # codec0_out settings (used if ssp2 is connected to aif1) -+ cset "name='codec_out0 mix 0 codec_in0 Switch' off" -+ cset "name='codec_out0 mix 0 codec_in1 Switch' off" -+ cset "name='codec_out0 mix 0 media_loop1_in Switch' off" -+ cset "name='codec_out0 mix 0 media_loop2_in Switch' off" -+ cset "name='codec_out0 mix 0 pcm0_in Switch' on" -+ cset "name='codec_out0 mix 0 pcm1_in Switch' off" -+ cset "name='codec_out0 mix 0 sprot_loop_in Switch' off" -+ cset "name='codec_out0 Gain 0 Switch' on" -+ cset "name='codec_out0 Gain 0 Volume' 0" -+ -+ # modem_out settings (used if ssp0 is connected to aif2) -+ cset "name='modem_out mix 0 codec_in0 Switch' off" -+ cset "name='modem_out mix 0 codec_in1 Switch' off" -+ cset "name='modem_out mix 0 media_loop1_in Switch' off" -+ cset "name='modem_out mix 0 media_loop2_in Switch' off" -+ cset "name='modem_out mix 0 pcm0_in Switch' on" -+ cset "name='modem_out mix 0 pcm1_in Switch' off" -+ cset "name='modem_out mix 0 sprot_loop_in Switch' off" -+ cset "name='modem_out Gain 0 Switch' on" -+ cset "name='modem_out Gain 0 Volume' 0" -+ -+ # input settings -+ # pcm1_out settings -+ -+ # input used when SSP2 is connected -+ cset "name='codec_in0 Gain 0 Switch' on" -+ cset "name='codec_in0 Gain 0 Volume' 0" -+ -+ # input used when SSP0 is connected -+ cset "name='modem_in Gain 0 Switch' on" -+ cset "name='modem_in Gain 0 Volume' 0" -+ -+ cset "name='pcm1_out mix 0 codec_in0 Switch' on" -+ cset "name='pcm1_out mix 0 modem_in Switch' on" -+ cset "name='pcm1_out mix 0 codec_in1 Switch' off" -+ cset "name='pcm1_out mix 0 media_loop1_in Switch' off" -+ cset "name='pcm1_out mix 0 media_loop2_in Switch' off" -+ cset "name='pcm1_out mix 0 pcm0_in Switch' off" -+ cset "name='pcm1_out mix 0 pcm1_in Switch' off" -+ cset "name='pcm1_out mix 0 sprot_loop_in Switch' off" -+ -+ cset "name='pcm1_out Gain 0 Switch' on" -+ cset "name='pcm1_out Gain 0 Volume' 0" -+ -+ # disable codec_out1 -+ cset "name='codec_out1 mix 0 codec_in0 Switch' off" -+ cset "name='codec_out1 mix 0 codec_in1 Switch' off" -+ cset "name='codec_out1 mix 0 media_loop1_in Switch' off" -+ cset "name='codec_out1 mix 0 media_loop2_in Switch' off" -+ cset "name='codec_out1 mix 0 pcm0_in Switch' off" -+ cset "name='codec_out1 mix 0 pcm1_in Switch' off" -+ cset "name='codec_out1 mix 0 sprot_loop_in Switch' off" -+ cset "name='codec_out1 Gain 0 Switch' off" -+ cset "name='codec_out1 Gain 0 Volume' 0%" -+ -+ # disable codec_in1 -+ cset "name='codec_in1 Gain 0 Switch' off" -+ cset "name='codec_in1 Gain 0 Volume' 0%" -+ -+ # disable all loops -+ cset "name='media_loop1_out mix 0 codec_in0 Switch' off" -+ cset "name='media_loop1_out mix 0 codec_in1 Switch' off" -+ cset "name='media_loop1_out mix 0 media_loop1_in Switch' off" -+ cset "name='media_loop1_out mix 0 media_loop2_in Switch' off" -+ cset "name='media_loop1_out mix 0 pcm0_in Switch' off" -+ cset "name='media_loop1_out mix 0 pcm1_in Switch' off" -+ cset "name='media_loop1_out mix 0 sprot_loop_in Switch' off" -+ -+ cset "name='media_loop2_out mix 0 codec_in0 Switch' off" -+ cset "name='media_loop2_out mix 0 codec_in1 Switch' off" -+ cset "name='media_loop2_out mix 0 media_loop1_in Switch' off" -+ cset "name='media_loop2_out mix 0 media_loop2_in Switch' off" -+ cset "name='media_loop2_out mix 0 pcm0_in Switch' off" -+ cset "name='media_loop2_out mix 0 pcm1_in Switch' off" -+ cset "name='media_loop2_out mix 0 sprot_loop_in Switch' off" -+ -+ cset "name='sprot_loop_out mix 0 codec_in0 Switch' off" -+ cset "name='sprot_loop_out mix 0 codec_in1 Switch' off" -+ cset "name='sprot_loop_out mix 0 media_loop1_in Switch' off" -+ cset "name='sprot_loop_out mix 0 media_loop2_in Switch' off" -+ cset "name='sprot_loop_out mix 0 pcm0_in Switch' off" -+ cset "name='sprot_loop_out mix 0 pcm1_in Switch' off" -+ cset "name='sprot_loop_out mix 0 sprot_loop_in Switch' off" -+ -+ # Output Configuration -+ cset "name='DAC1 L Mux' IF1 DAC" -+ cset "name='DAC1 R Mux' IF1 DAC" -+ cset "name='DAC1 MIXL DAC1 Switch' 1" -+ cset "name='DAC1 MIXR DAC1 Switch' 1" -+ cset "name='Stereo DAC MIXL DAC L1 Switch' 1" -+ cset "name='Stereo DAC MIXR DAC R1 Switch' 1" -+ -+ cset "name='DAC L2 Mux' IF2 DAC" -+ cset "name='DAC R2 Mux' IF2 DAC" -+ cset "name='Mono DAC MIXL DAC L2 Switch' on" -+ cset "name='Mono DAC MIXR DAC R2 Switch' on" -+ cset "name='DAC2 Playback Switch' on" -+ -+ cset "name='HPOVOL MIXL DAC1 Switch' on" -+ cset "name='HPOVOL MIXR DAC1 Switch' on" -+ cset "name='HPOVOL MIXL DAC2 Switch' on" -+ cset "name='HPOVOL MIXR DAC2 Switch' on" -+ cset "name='HPO MIX HPVOL Switch' on" -+ cset "name='HPOVOL L Switch' on" -+ cset "name='HPOVOL R Switch' on" -+ -+ cset "name='SPK MIXL DAC L1 Switch' on" -+ cset "name='SPK MIXR DAC R1 Switch' on" -+ cset "name='SPK MIXL DAC L2 Switch' on" -+ cset "name='SPK MIXR DAC R2 Switch' on" -+ cset "name='SPOL MIX SPKVOL L Switch' on" -+ cset "name='SPOR MIX SPKVOL R Switch' on" -+ cset "name='SPKVOL L Switch' on" -+ cset "name='SPKVOL R Switch' on" -+ -+ # Input Configuration -+ cset "name='Stereo1 DMIC Mux' 0" -+ cset "name='Stereo1 ADC1 Mux' 1" -+ cset "name='Stereo1 ADC2 Mux' 1" -+ cset "name='ADC Capture Switch' on" -+ # 55/63 -+ cset "name='ADC Capture Volume' 55" -+ # set ADC Boost to 0/3, higher vals cause a lot of white noise -+ cset "name='ADC Boost Capture Volume' 0" -+ # 55/63 -+ cset "name='Mono ADC Capture Volume' 55" -+ # 0/3 -+ cset "name='Mono ADC Boost Capture Volume' 0" -+ # 27/31 -+ cset "name='IN Capture Volume' 27" -+ cset "name='I2S2 Func Switch' on" -+ # 3/12 the headphone mic tends to be quite loud -+ cset "name='IN1 Boost' 3" -+ # 8/8 the internal analog mic tends to be quite soft -+ cset "name='IN2 Boost' 8" -+ ] -+ -+ DisableSequence [ -+ cdev "hw:chtrt5645" -+ -+ # Disable audio output path -+ cset "name='codec_out1 mix 0 pcm0_in Switch' off" -+ cset "name='media0_out mix 0 media1_in Switch' off" -+ -+ cset "name='media1_in Gain 0 Switch' off" -+ cset "name='pcm0_in Gain 0 Switch' off" -+ cset "name='codec_out1 Gain 0 Switch' off" -+ -+ # Disable audio input path -+ cset "name='pcm1_out mix 0 media_loop2_in Switch' off" -+ cset "name='media_loop2_out mix 0 codec_in0 Switch' off" -+ -+ cset "name='media_loop2_out Gain 0 Switch' off" -+ cset "name='pcm1_out Gain 0 Switch' off" -+ cset "name='codec_in0 Gain 0 Switch' off" -+ ] -+} -+ -+SectionDevice."Speaker" { -+ Comment "Speaker" -+ -+ Value { -+ PlaybackChannels "2" -+ } -+ -+ ConflictingDevice [ -+ "Headphones" -+ ] -+ -+ EnableSequence [ -+ cdev "hw:chtrt5645" -+ -+ cset "name='Headphone Switch' off" -+ cset "name='Headphone Channel Switch' off" -+ -+ cset "name='Ext Spk Switch' on" -+ cset "name='Speaker Channel Switch' on" -+ cset "name='Speaker Playback Volume' 31" -+ ] -+ -+ DisableSequence [ -+ cdev "hw:chtrt5645" -+ -+ cset "name='Ext Spk Switch' off" -+ cset "name='Speaker Channel Switch' off" -+ ] -+} -+ -+SectionDevice."Headphones" { -+ Comment "Headphones" -+ -+ Value { -+ PlaybackChannels "2" -+ JackControl "Headphone Jack" -+ JackHWMute "Speaker" -+ } -+ -+ ConflictingDevice [ -+ "Speaker" -+ ] -+ -+ EnableSequence [ -+ cdev "hw:chtrt5645" -+ -+ cset "name='Ext Spk Switch' off" -+ cset "name='Speaker Channel Switch' off" -+ -+ cset "name='Headphone Switch' on" -+ cset "name='Headphone Channel Switch' on" -+ # 25/39 higher values cause crackling on some boards -+ cset "name='Headphone Playback Volume' 25" -+ ] -+ -+ DisableSequence [ -+ cdev "hw:chtrt5645" -+ -+ cset "name='Headphone Switch' off" -+ cset "name='Headphone Channel Switch' off" -+ ] -+} -+ -+SectionDevice."DMic".0 { -+ Comment "Internal Microphone" -+ -+ Value { -+ CaptureChannels "2" -+ CapturePriority "150" -+ } -+ -+ EnableSequence [ -+ cdev "hw:chtrt5645" -+ -+ cset "name='Int Mic Switch' on" -+ -+ cset "name='Stereo1 DMIC Mux' DMIC1" -+ cset "name='Stereo1 ADC2 Mux' DMIC" -+ cset "name='Mono ADC L2 Mux' DMIC" -+ cset "name='Mono ADC R2 Mux' DMIC" -+ -+ cset "name='Sto1 ADC MIXL ADC1 Switch' off" -+ cset "name='Sto1 ADC MIXR ADC1 Switch' off" -+ cset "name='Sto1 ADC MIXL ADC2 Switch' on" -+ cset "name='Sto1 ADC MIXR ADC2 Switch' on" -+ cset "name='Mono ADC MIXL ADC1 Switch' off" -+ cset "name='Mono ADC MIXR ADC1 Switch' off" -+ cset "name='Mono ADC MIXL ADC2 Switch' on" -+ cset "name='Mono ADC MIXR ADC2 Switch' on" -+ ] -+ -+ DisableSequence [ -+ cdev "hw:chtrt5645" -+ -+ cset "name='Sto1 ADC MIXL ADC2 Switch' off" -+ cset "name='Sto1 ADC MIXR ADC2 Switch' off" -+ cset "name='Mono ADC MIXL ADC2 Switch' off" -+ cset "name='Mono ADC MIXR ADC2 Switch' off" -+ cset "name='Int Mic Switch' off" -+ ] -+} -+ -+SectionDevice."HSMic".0 { -+ Comment "Headset Microphone" -+ -+ Value { -+ CaptureChannels "2" -+ JackControl "Headset Mic Jack" -+ JackHWMute "DMic" -+ } -+ -+ EnableSequence [ -+ cdev "hw:chtrt5645" -+ -+ cset "name='Headset Mic Switch' on" -+ -+ cset "name='Sto1 ADC MIXL ADC1 Switch' on" -+ cset "name='Sto1 ADC MIXR ADC1 Switch' on" -+ cset "name='Sto1 ADC MIXL ADC2 Switch' off" -+ cset "name='Sto1 ADC MIXR ADC2 Switch' off" -+ -+ cset "name='Mono ADC MIXL ADC1 Switch' on" -+ cset "name='Mono ADC MIXR ADC1 Switch' on" -+ cset "name='Mono ADC MIXL ADC2 Switch' off" -+ cset "name='Mono ADC MIXR ADC2 Switch' off" -+ -+ cset "name='RECMIXL BST1 Switch' on" -+ cset "name='RECMIXR BST1 Switch' on" -+ -+ ] -+ -+ DisableSequence [ -+ cdev "hw:chtrt5645" -+ -+ cset "name='Headset Mic Switch' off" -+ -+ cset "name='RECMIXL BST1 Switch' off" -+ cset "name='RECMIXR BST1 Switch' off" -+ cset "name='Sto1 ADC MIXL ADC1 Switch' off" -+ cset "name='Sto1 ADC MIXR ADC1 Switch' off" -+ cset "name='Mono ADC MIXL ADC1 Switch' on" -+ cset "name='Mono ADC MIXR ADC1 Switch' on" -+ -+ ] -+} -diff --git a/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/Makefile.am b/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/Makefile.am -new file mode 100644 -index 00000000..dd8b372a ---- /dev/null -+++ b/src/conf/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN/Makefile.am -@@ -0,0 +1,4 @@ -+alsaconfigdir = @ALSA_CONFIG_DIR@ -+ucmdir = $(alsaconfigdir)/ucm/ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN -+ucm_DATA = ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN.conf HiFi.conf -+EXTRA_DIST = $(ucm_DATA) -diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am -index 3b4f13a8..e496ca89 100644 ---- a/src/conf/ucm/Makefile.am -+++ b/src/conf/ucm/Makefile.am -@@ -1,4 +1,5 @@ - SUBDIRS=\ -+ASUSTeKCOMPUTERINC.-T100HAN-1.0-T100HAN \ - broadwell-rt286 \ - broxton-rt298 \ - bytcr-rt5651 \ --- -2.13.6 - - -From 5a2df9449d0b17e3579bde60ba48244ba24ea604 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Sat, 28 Apr 2018 21:52:00 +0200 -Subject: [PATCH 15/26] conf/ucm: chtrt5645: At config for the Lenovo Ideapad - Miix 320 - -The Lenovo Ideapad Miix 320 uses a digital mic connected to the DMIC2 input -(unlike the Asus T100HA which has it connected to the DMIC1 input), add a -long-name config specific for the Miix 320, which is a copy of the standard -chtrt5645 config with the internal analog mic section replaced with one -for a digital mic connected to the DMIC2 input. - -Signed-off-by: Hans de Goede -Signed-off-by: Takashi Iwai ---- - configure.ac | 1 + - .../HiFi.conf | 350 +++++++++++++++++++++ - ...ENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216.conf | 5 + - .../Makefile.am | 4 + - src/conf/ucm/Makefile.am | 1 + - 5 files changed, 361 insertions(+) - create mode 100644 src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf - create mode 100644 src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216.conf - create mode 100644 src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/Makefile.am - -diff --git a/configure.ac b/configure.ac -index 94baf055..3ee989eb 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -729,6 +729,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \ - src/conf/ucm/gpd-win-pocket-rt5645/Makefile \ - src/conf/ucm/HDAudio-Gigabyte-ALC1220DualCodecs/Makefile \ - src/conf/ucm/HDAudio-Lenovo-DualCodecs/Makefile \ -+ src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/Makefile \ - src/conf/ucm/PandaBoard/Makefile \ - src/conf/ucm/PandaBoardES/Makefile \ - src/conf/ucm/PAZ00/Makefile \ -diff --git a/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf b/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf -new file mode 100644 -index 00000000..8cc9c7f2 ---- /dev/null -+++ b/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf -@@ -0,0 +1,350 @@ -+SectionVerb { -+ # ALSA PCM -+ Value { -+ TQ "HiFi" -+ -+ # ALSA PCM device for HiFi -+ PlaybackPCM "hw:chtrt5645" -+ CapturePCM "hw:chtrt5645" -+ } -+ -+ EnableSequence [ -+ cdev "hw:chtrt5645" -+ -+ # media mixer settings -+ # compress -+ cset "name='media0_in Gain 0 Switch' on" -+ cset "name='media0_in Gain 0 Volume' 0" -+ -+ # normal -+ cset "name='media1_in Gain 0 Switch' on" -+ cset "name='media1_in Gain 0 Volume' 0" -+ # swm loopback -+ cset "name='media2_in Gain 0 Switch' off" -+ cset "name='media2_in Gain 0 Volume' 0%" -+ # deep buffer -+ cset "name='media3_in Gain 0 Switch' on" -+ cset "name='media3_in Gain 0 Volume' 0" -+ -+ cset "name='media0_out mix 0 media0_in Switch' on" -+ cset "name='media0_out mix 0 media1_in Switch' on" -+ cset "name='media0_out mix 0 media2_in Switch' off" -+ cset "name='media0_out mix 0 media3_in Switch' on" -+ -+ cset "name='media1_out mix 0 media0_in Switch' off" -+ cset "name='media1_out mix 0 media1_in Switch' off" -+ cset "name='media1_out mix 0 media2_in Switch' off" -+ cset "name='media1_out mix 0 media3_in Switch' off" -+ -+ cset "name='pcm0_in Gain 0 Switch' on" -+ cset "name='pcm0_in Gain 0 Volume' 0" -+ -+ cset "name='pcm1_in Gain 0 Switch' off" -+ cset "name='pcm1_in Gain 0 Volume' 0%" -+ -+ # codec0_out settings (used if ssp2 is connected to aif1) -+ cset "name='codec_out0 mix 0 codec_in0 Switch' off" -+ cset "name='codec_out0 mix 0 codec_in1 Switch' off" -+ cset "name='codec_out0 mix 0 media_loop1_in Switch' off" -+ cset "name='codec_out0 mix 0 media_loop2_in Switch' off" -+ cset "name='codec_out0 mix 0 pcm0_in Switch' on" -+ cset "name='codec_out0 mix 0 pcm1_in Switch' off" -+ cset "name='codec_out0 mix 0 sprot_loop_in Switch' off" -+ cset "name='codec_out0 Gain 0 Switch' on" -+ cset "name='codec_out0 Gain 0 Volume' 0" -+ -+ # modem_out settings (used if ssp0 is connected to aif2) -+ cset "name='modem_out mix 0 codec_in0 Switch' off" -+ cset "name='modem_out mix 0 codec_in1 Switch' off" -+ cset "name='modem_out mix 0 media_loop1_in Switch' off" -+ cset "name='modem_out mix 0 media_loop2_in Switch' off" -+ cset "name='modem_out mix 0 pcm0_in Switch' on" -+ cset "name='modem_out mix 0 pcm1_in Switch' off" -+ cset "name='modem_out mix 0 sprot_loop_in Switch' off" -+ cset "name='modem_out Gain 0 Switch' on" -+ cset "name='modem_out Gain 0 Volume' 0" -+ -+ # input settings -+ # pcm1_out settings -+ -+ # input used when SSP2 is connected -+ cset "name='codec_in0 Gain 0 Switch' on" -+ cset "name='codec_in0 Gain 0 Volume' 0" -+ -+ # input used when SSP0 is connected -+ cset "name='modem_in Gain 0 Switch' on" -+ cset "name='modem_in Gain 0 Volume' 0" -+ -+ cset "name='pcm1_out mix 0 codec_in0 Switch' on" -+ cset "name='pcm1_out mix 0 modem_in Switch' on" -+ cset "name='pcm1_out mix 0 codec_in1 Switch' off" -+ cset "name='pcm1_out mix 0 media_loop1_in Switch' off" -+ cset "name='pcm1_out mix 0 media_loop2_in Switch' off" -+ cset "name='pcm1_out mix 0 pcm0_in Switch' off" -+ cset "name='pcm1_out mix 0 pcm1_in Switch' off" -+ cset "name='pcm1_out mix 0 sprot_loop_in Switch' off" -+ -+ cset "name='pcm1_out Gain 0 Switch' on" -+ cset "name='pcm1_out Gain 0 Volume' 0" -+ -+ # disable codec_out1 -+ cset "name='codec_out1 mix 0 codec_in0 Switch' off" -+ cset "name='codec_out1 mix 0 codec_in1 Switch' off" -+ cset "name='codec_out1 mix 0 media_loop1_in Switch' off" -+ cset "name='codec_out1 mix 0 media_loop2_in Switch' off" -+ cset "name='codec_out1 mix 0 pcm0_in Switch' off" -+ cset "name='codec_out1 mix 0 pcm1_in Switch' off" -+ cset "name='codec_out1 mix 0 sprot_loop_in Switch' off" -+ cset "name='codec_out1 Gain 0 Switch' off" -+ cset "name='codec_out1 Gain 0 Volume' 0%" -+ -+ # disable codec_in1 -+ cset "name='codec_in1 Gain 0 Switch' off" -+ cset "name='codec_in1 Gain 0 Volume' 0%" -+ -+ # disable all loops -+ cset "name='media_loop1_out mix 0 codec_in0 Switch' off" -+ cset "name='media_loop1_out mix 0 codec_in1 Switch' off" -+ cset "name='media_loop1_out mix 0 media_loop1_in Switch' off" -+ cset "name='media_loop1_out mix 0 media_loop2_in Switch' off" -+ cset "name='media_loop1_out mix 0 pcm0_in Switch' off" -+ cset "name='media_loop1_out mix 0 pcm1_in Switch' off" -+ cset "name='media_loop1_out mix 0 sprot_loop_in Switch' off" -+ -+ cset "name='media_loop2_out mix 0 codec_in0 Switch' off" -+ cset "name='media_loop2_out mix 0 codec_in1 Switch' off" -+ cset "name='media_loop2_out mix 0 media_loop1_in Switch' off" -+ cset "name='media_loop2_out mix 0 media_loop2_in Switch' off" -+ cset "name='media_loop2_out mix 0 pcm0_in Switch' off" -+ cset "name='media_loop2_out mix 0 pcm1_in Switch' off" -+ cset "name='media_loop2_out mix 0 sprot_loop_in Switch' off" -+ -+ cset "name='sprot_loop_out mix 0 codec_in0 Switch' off" -+ cset "name='sprot_loop_out mix 0 codec_in1 Switch' off" -+ cset "name='sprot_loop_out mix 0 media_loop1_in Switch' off" -+ cset "name='sprot_loop_out mix 0 media_loop2_in Switch' off" -+ cset "name='sprot_loop_out mix 0 pcm0_in Switch' off" -+ cset "name='sprot_loop_out mix 0 pcm1_in Switch' off" -+ cset "name='sprot_loop_out mix 0 sprot_loop_in Switch' off" -+ -+ # Output Configuration -+ cset "name='DAC1 L Mux' IF1 DAC" -+ cset "name='DAC1 R Mux' IF1 DAC" -+ cset "name='DAC1 MIXL DAC1 Switch' 1" -+ cset "name='DAC1 MIXR DAC1 Switch' 1" -+ cset "name='Stereo DAC MIXL DAC L1 Switch' 1" -+ cset "name='Stereo DAC MIXR DAC R1 Switch' 1" -+ -+ cset "name='DAC L2 Mux' IF2 DAC" -+ cset "name='DAC R2 Mux' IF2 DAC" -+ cset "name='Mono DAC MIXL DAC L2 Switch' on" -+ cset "name='Mono DAC MIXR DAC R2 Switch' on" -+ cset "name='DAC2 Playback Switch' on" -+ -+ cset "name='HPOVOL MIXL DAC1 Switch' on" -+ cset "name='HPOVOL MIXR DAC1 Switch' on" -+ cset "name='HPOVOL MIXL DAC2 Switch' on" -+ cset "name='HPOVOL MIXR DAC2 Switch' on" -+ cset "name='HPO MIX HPVOL Switch' on" -+ cset "name='HPOVOL L Switch' on" -+ cset "name='HPOVOL R Switch' on" -+ -+ cset "name='SPK MIXL DAC L1 Switch' on" -+ cset "name='SPK MIXR DAC R1 Switch' on" -+ cset "name='SPK MIXL DAC L2 Switch' on" -+ cset "name='SPK MIXR DAC R2 Switch' on" -+ cset "name='SPOL MIX SPKVOL L Switch' on" -+ cset "name='SPOR MIX SPKVOL R Switch' on" -+ cset "name='SPKVOL L Switch' on" -+ cset "name='SPKVOL R Switch' on" -+ -+ # Input Configuration -+ cset "name='Stereo1 DMIC Mux' 0" -+ cset "name='Stereo1 ADC1 Mux' 1" -+ cset "name='Stereo1 ADC2 Mux' 1" -+ cset "name='ADC Capture Switch' on" -+ # 55/63 -+ cset "name='ADC Capture Volume' 55" -+ # set ADC Boost to 0/3, higher vals cause a lot of white noise -+ cset "name='ADC Boost Capture Volume' 0" -+ # 55/63 -+ cset "name='Mono ADC Capture Volume' 55" -+ # 0/3 -+ cset "name='Mono ADC Boost Capture Volume' 0" -+ # 27/31 -+ cset "name='IN Capture Volume' 27" -+ cset "name='I2S2 Func Switch' on" -+ # 3/12 the headphone mic tends to be quite loud -+ cset "name='IN1 Boost' 3" -+ # 8/8 the internal analog mic tends to be quite soft -+ cset "name='IN2 Boost' 8" -+ ] -+ -+ DisableSequence [ -+ cdev "hw:chtrt5645" -+ -+ # Disable audio output path -+ cset "name='codec_out1 mix 0 pcm0_in Switch' off" -+ cset "name='media0_out mix 0 media1_in Switch' off" -+ -+ cset "name='media1_in Gain 0 Switch' off" -+ cset "name='pcm0_in Gain 0 Switch' off" -+ cset "name='codec_out1 Gain 0 Switch' off" -+ -+ # Disable audio input path -+ cset "name='pcm1_out mix 0 media_loop2_in Switch' off" -+ cset "name='media_loop2_out mix 0 codec_in0 Switch' off" -+ -+ cset "name='media_loop2_out Gain 0 Switch' off" -+ cset "name='pcm1_out Gain 0 Switch' off" -+ cset "name='codec_in0 Gain 0 Switch' off" -+ ] -+} -+ -+SectionDevice."Speaker" { -+ Comment "Speaker" -+ -+ Value { -+ PlaybackChannels "2" -+ } -+ -+ ConflictingDevice [ -+ "Headphones" -+ ] -+ -+ EnableSequence [ -+ cdev "hw:chtrt5645" -+ -+ cset "name='Headphone Switch' off" -+ cset "name='Headphone Channel Switch' off" -+ -+ cset "name='Ext Spk Switch' on" -+ cset "name='Speaker Channel Switch' on" -+ cset "name='Speaker Playback Volume' 31" -+ ] -+ -+ DisableSequence [ -+ cdev "hw:chtrt5645" -+ -+ cset "name='Ext Spk Switch' off" -+ cset "name='Speaker Channel Switch' off" -+ ] -+} -+ -+SectionDevice."Headphones" { -+ Comment "Headphones" -+ -+ Value { -+ PlaybackChannels "2" -+ JackControl "Headphone Jack" -+ JackHWMute "Speaker" -+ } -+ -+ ConflictingDevice [ -+ "Speaker" -+ ] -+ -+ EnableSequence [ -+ cdev "hw:chtrt5645" -+ -+ cset "name='Ext Spk Switch' off" -+ cset "name='Speaker Channel Switch' off" -+ -+ cset "name='Headphone Switch' on" -+ cset "name='Headphone Channel Switch' on" -+ # 25/39 higher values cause crackling on some boards -+ cset "name='Headphone Playback Volume' 25" -+ ] -+ -+ DisableSequence [ -+ cdev "hw:chtrt5645" -+ -+ cset "name='Headphone Switch' off" -+ cset "name='Headphone Channel Switch' off" -+ ] -+} -+ -+SectionDevice."DMic".0 { -+ Comment "Internal Microphone" -+ -+ Value { -+ CaptureChannels "2" -+ CapturePriority "150" -+ } -+ -+ EnableSequence [ -+ cdev "hw:chtrt5645" -+ -+ cset "name='Int Mic Switch' on" -+ -+ cset "name='Stereo1 DMIC Mux' DMIC2" -+ cset "name='Stereo1 ADC2 Mux' DMIC" -+ cset "name='Mono DMIC L Mux' DMIC2" -+ cset "name='Mono DMIC R Mux' DMIC2" -+ cset "name='Mono ADC L2 Mux' DMIC" -+ cset "name='Mono ADC R2 Mux' DMIC" -+ -+ cset "name='Sto1 ADC MIXL ADC1 Switch' off" -+ cset "name='Sto1 ADC MIXR ADC1 Switch' off" -+ cset "name='Sto1 ADC MIXL ADC2 Switch' on" -+ cset "name='Sto1 ADC MIXR ADC2 Switch' on" -+ cset "name='Mono ADC MIXL ADC1 Switch' off" -+ cset "name='Mono ADC MIXR ADC1 Switch' off" -+ cset "name='Mono ADC MIXL ADC2 Switch' on" -+ cset "name='Mono ADC MIXR ADC2 Switch' on" -+ ] -+ -+ DisableSequence [ -+ cdev "hw:chtrt5645" -+ -+ cset "name='Sto1 ADC MIXL ADC2 Switch' off" -+ cset "name='Sto1 ADC MIXR ADC2 Switch' off" -+ cset "name='Mono ADC MIXL ADC2 Switch' off" -+ cset "name='Mono ADC MIXR ADC2 Switch' off" -+ cset "name='Int Mic Switch' off" -+ ] -+} -+ -+SectionDevice."HSMic".0 { -+ Comment "Headset Microphone" -+ -+ Value { -+ CaptureChannels "2" -+ JackControl "Headset Mic Jack" -+ JackHWMute "DMic" -+ } -+ -+ EnableSequence [ -+ cdev "hw:chtrt5645" -+ -+ cset "name='Headset Mic Switch' on" -+ -+ cset "name='Sto1 ADC MIXL ADC1 Switch' on" -+ cset "name='Sto1 ADC MIXR ADC1 Switch' on" -+ cset "name='Sto1 ADC MIXL ADC2 Switch' off" -+ cset "name='Sto1 ADC MIXR ADC2 Switch' off" -+ -+ cset "name='Mono ADC MIXL ADC1 Switch' on" -+ cset "name='Mono ADC MIXR ADC1 Switch' on" -+ cset "name='Mono ADC MIXL ADC2 Switch' off" -+ cset "name='Mono ADC MIXR ADC2 Switch' off" -+ -+ cset "name='RECMIXL BST1 Switch' on" -+ cset "name='RECMIXR BST1 Switch' on" -+ -+ ] -+ -+ DisableSequence [ -+ cdev "hw:chtrt5645" -+ -+ cset "name='Headset Mic Switch' off" -+ -+ cset "name='RECMIXL BST1 Switch' off" -+ cset "name='RECMIXR BST1 Switch' off" -+ cset "name='Sto1 ADC MIXL ADC1 Switch' off" -+ cset "name='Sto1 ADC MIXR ADC1 Switch' off" -+ cset "name='Mono ADC MIXL ADC1 Switch' on" -+ cset "name='Mono ADC MIXR ADC1 Switch' on" -+ -+ ] -+} -diff --git a/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216.conf b/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216.conf -new file mode 100644 -index 00000000..50bda000 ---- /dev/null -+++ b/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216.conf -@@ -0,0 +1,5 @@ -+Comment "Intel SoC Audio Device" -+SectionUseCase."HiFi" { -+ File "../LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/HiFi.conf" -+ Comment "Default" -+} -diff --git a/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/Makefile.am b/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/Makefile.am -new file mode 100644 -index 00000000..18963c21 ---- /dev/null -+++ b/src/conf/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216/Makefile.am -@@ -0,0 +1,4 @@ -+alsaconfigdir = @ALSA_CONFIG_DIR@ -+ucmdir = $(alsaconfigdir)/ucm/LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216 -+ucm_DATA = LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216.conf HiFi.conf -+EXTRA_DIST = $(ucm_DATA) -diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am -index e496ca89..02df25f0 100644 ---- a/src/conf/ucm/Makefile.am -+++ b/src/conf/ucm/Makefile.am -@@ -11,6 +11,7 @@ GoogleNyan \ - gpd-win-pocket-rt5645 \ - HDAudio-Gigabyte-ALC1220DualCodecs \ - HDAudio-Lenovo-DualCodecs \ -+LENOVO-80XF-LenovoMIIX320_10ICR-LNVNB161216 \ - PandaBoard \ - PandaBoardES \ - PAZ00 \ --- -2.13.6 - - -From 8ebb40c96970c913719a75deb2fe82ba2e257386 Mon Sep 17 00:00:00 2001 -From: Takashi Iwai -Date: Wed, 2 May 2018 16:23:21 +0200 -Subject: [PATCH 16/26] conf/ucm: Add a UCM profile for Dell WD15 Dock - USB-audio - -USB-audio device on Dell WD15 docking station provides two individual -PCM streams, one for headphone and another for line out. A UCM -profile gives the proper roles for these. - -Signed-off-by: Takashi Iwai ---- - src/conf/ucm/Dell-WD15-Dock/Dell-WD15-Dock.conf | 5 +++++ - src/conf/ucm/Dell-WD15-Dock/HiFi.conf | 26 +++++++++++++++++++++++++ - src/conf/ucm/Dell-WD15-Dock/Makefile.am | 4 ++++ - src/conf/ucm/Makefile.am | 1 + - 4 files changed, 36 insertions(+) - create mode 100644 src/conf/ucm/Dell-WD15-Dock/Dell-WD15-Dock.conf - create mode 100644 src/conf/ucm/Dell-WD15-Dock/HiFi.conf - create mode 100644 src/conf/ucm/Dell-WD15-Dock/Makefile.am - -diff --git a/src/conf/ucm/Dell-WD15-Dock/Dell-WD15-Dock.conf b/src/conf/ucm/Dell-WD15-Dock/Dell-WD15-Dock.conf -new file mode 100644 -index 00000000..f4f0a8d9 ---- /dev/null -+++ b/src/conf/ucm/Dell-WD15-Dock/Dell-WD15-Dock.conf -@@ -0,0 +1,5 @@ -+Comment "USB-audio on Dell WD15 docking station" -+SectionUseCase."HiFi" { -+ File "HiFi.conf" -+ Comment "Default" -+} -diff --git a/src/conf/ucm/Dell-WD15-Dock/HiFi.conf b/src/conf/ucm/Dell-WD15-Dock/HiFi.conf -new file mode 100644 -index 00000000..b07f3440 ---- /dev/null -+++ b/src/conf/ucm/Dell-WD15-Dock/HiFi.conf -@@ -0,0 +1,26 @@ -+SectionDevice."Headphone" { -+ Comment "Headphone" -+ -+ Value { -+ PlaybackChannels "2" -+ PlaybackPCM "hw:WD15Dock,0" -+ } -+} -+ -+SectionDevice."LineOut" { -+ Comment "Line Out" -+ -+ Value { -+ PlaybackChannels "2" -+ PlaybackPCM "hw:WD15Dock,1" -+ } -+} -+ -+SectionDevice."Mic" { -+ Comment "Microphone" -+ -+ Value { -+ CaptureChannels "2" -+ CapturePCM "hw:WD15Dock,0" -+ } -+} -diff --git a/src/conf/ucm/Dell-WD15-Dock/Makefile.am b/src/conf/ucm/Dell-WD15-Dock/Makefile.am -new file mode 100644 -index 00000000..7ab58730 ---- /dev/null -+++ b/src/conf/ucm/Dell-WD15-Dock/Makefile.am -@@ -0,0 +1,4 @@ -+alsaconfigdir = @ALSA_CONFIG_DIR@ -+ucmdir = $(alsaconfigdir)/ucm/Dell-WD15-Dock -+ucm_DATA = Dell-WD15-Dock.conf HiFi.conf -+EXTRA_DIST = $(ucm_DATA) -diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am -index 02df25f0..38fc6b25 100644 ---- a/src/conf/ucm/Makefile.am -+++ b/src/conf/ucm/Makefile.am -@@ -7,6 +7,7 @@ chtrt5645 \ - chtrt5645-mono-speaker-analog-mic \ - DAISY-I2S \ - DB410c \ -+Dell-WD15-Dock \ - GoogleNyan \ - gpd-win-pocket-rt5645 \ - HDAudio-Gigabyte-ALC1220DualCodecs \ --- -2.13.6 - - -From 44f499bb22f3923f966e11a234455e3d06936b8b Mon Sep 17 00:00:00 2001 -From: Takashi Iwai -Date: Thu, 3 May 2018 08:40:20 +0200 -Subject: [PATCH 17/26] configure: Fix forgotten ucm entry - -The previous commit forgot to add to configure.ac. Fix it. - -Signed-off-by: Takashi Iwai ---- - configure.ac | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/configure.ac b/configure.ac -index 3ee989eb..693b5d53 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -725,6 +725,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \ - src/conf/ucm/chtrt5645-mono-speaker-analog-mic/Makefile \ - src/conf/ucm/DAISY-I2S/Makefile \ - src/conf/ucm/DB410c/Makefile \ -+ src/conf/ucm/Dell-WD15-Dock/Makefile \ - src/conf/ucm/GoogleNyan/Makefile \ - src/conf/ucm/gpd-win-pocket-rt5645/Makefile \ - src/conf/ucm/HDAudio-Gigabyte-ALC1220DualCodecs/Makefile \ --- -2.13.6 - - -From 5eb78219f6bc0114cbb6518dae1c9256a63ec23a Mon Sep 17 00:00:00 2001 -From: Takashi Sakamoto -Date: Tue, 15 May 2018 21:36:34 +0900 -Subject: [PATCH 18/26] control: add a series of macro for offset of several - types of TLV - -In development period for Linux v4.18, a series of SNDRV_CTL_TLVO_XXX -macro was introduced to kernel stuffs for position offset of TLV data. - -This commit adds these macros to backport header in this library. - -Signed-off-by: Takashi Sakamoto -Signed-off-by: Takashi Iwai ---- - include/sound/tlv.h | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - -diff --git a/include/sound/tlv.h b/include/sound/tlv.h -index b4df440c..2ea47685 100644 ---- a/include/sound/tlv.h -+++ b/include/sound/tlv.h -@@ -41,6 +41,10 @@ - #define SNDRV_CTL_TLVD_LENGTH(...) \ - ((unsigned int)sizeof((const unsigned int[]) { __VA_ARGS__ })) - -+/* Accessor offsets for TLV data items */ -+#define SNDRV_CTL_TLVO_TYPE 0 -+#define SNDRV_CTL_TLVO_LEN 1 -+ - #define SNDRV_CTL_TLVD_CONTAINER_ITEM(...) \ - SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_CONTAINER, __VA_ARGS__) - #define SNDRV_CTL_TLVD_DECLARE_CONTAINER(name, ...) \ -@@ -60,6 +64,10 @@ - SNDRV_CTL_TLVD_DB_SCALE_ITEM(min, step, mute) \ - } - -+/* Accessor offsets for min, mute and step items in dB scale type TLV */ -+#define SNDRV_CTL_TLVO_DB_SCALE_MIN 2 -+#define SNDRV_CTL_TLVO_DB_SCALE_MUTE_AND_STEP 3 -+ - /* dB scale specified with min/max values instead of step */ - #define SNDRV_CTL_TLVD_DB_MINMAX_ITEM(min_dB, max_dB) \ - SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_DB_MINMAX, (min_dB), (max_dB)) -@@ -74,6 +82,10 @@ - SNDRV_CTL_TLVD_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) \ - } - -+/* Accessor offsets for min, max items in db-minmax types of TLV. */ -+#define SNDRV_CTL_TLVO_DB_MINMAX_MIN 2 -+#define SNDRV_CTL_TLVO_DB_MINMAX_MAX 3 -+ - /* linear volume between min_dB and max_dB (.01dB unit) */ - #define SNDRV_CTL_TLVD_DB_LINEAR_ITEM(min_dB, max_dB) \ - SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_DB_LINEAR, (min_dB), (max_dB)) -@@ -82,6 +94,10 @@ - SNDRV_CTL_TLVD_DB_LINEAR_ITEM(min_dB, max_dB) \ - } - -+/* Accessor offsets for min, max items in db-linear type of TLV. */ -+#define SNDRV_CTL_TLVO_DB_LINEAR_MIN 2 -+#define SNDRV_CTL_TLVO_DB_LINEAR_MAX 3 -+ - /* dB range container: - * Items in dB range container must be ordered by their values and by their - * dB values. This implies that larger values must correspond with larger --- -2.13.6 - - -From f61193c96c52cbd99e22d9cbb94937374ce2cb39 Mon Sep 17 00:00:00 2001 -From: Takashi Sakamoto -Date: Tue, 15 May 2018 21:36:35 +0900 -Subject: [PATCH 19/26] control: use position offset macro of TLV data - -A series of SNDRV_CTL_TLVO_XXX macro was introduced for position offset -of TLV data. This commit applies a code optimization. - -Signed-off-by: Takashi Sakamoto -Signed-off-by: Takashi Iwai ---- - src/control/control.c | 12 ++++---- - src/control/control_hw.c | 6 ++-- - src/control/control_local.h | 1 + - src/control/tlv.c | 72 ++++++++++++++++++++++++--------------------- - 4 files changed, 51 insertions(+), 40 deletions(-) - -diff --git a/src/control/control.c b/src/control/control.c -index 11f7815a..82cd1a05 100644 ---- a/src/control/control.c -+++ b/src/control/control.c -@@ -938,10 +938,10 @@ int snd_ctl_elem_tlv_read(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, - * and compare the returned value after ioctl for checking - * the validity of TLV. - */ -- tlv[0] = -1; -- tlv[1] = 0; -+ tlv[SNDRV_CTL_TLVO_TYPE] = -1; -+ tlv[SNDRV_CTL_TLVO_LEN] = 0; - err = snd_ctl_tlv_do(ctl, 0, id, tlv, tlv_size); -- if (err >= 0 && tlv[0] == (unsigned int)-1) -+ if (err >= 0 && tlv[SNDRV_CTL_TLVO_TYPE] == (unsigned int)-1) - err = -ENXIO; - return err; - } -@@ -967,7 +967,8 @@ int snd_ctl_elem_tlv_write(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, - const unsigned int *tlv) - { - assert(ctl && id && (id->name[0] || id->numid) && tlv); -- return snd_ctl_tlv_do(ctl, 1, id, (unsigned int *)tlv, tlv[1] + 2 * sizeof(unsigned int)); -+ return snd_ctl_tlv_do(ctl, 1, id, (unsigned int *)tlv, -+ tlv[SNDRV_CTL_TLVO_LEN] + 2 * sizeof(unsigned int)); - } - - /** -@@ -991,7 +992,8 @@ int snd_ctl_elem_tlv_command(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, - const unsigned int *tlv) - { - assert(ctl && id && (id->name[0] || id->numid) && tlv); -- return snd_ctl_tlv_do(ctl, -1, id, (unsigned int *)tlv, tlv[1] + 2 * sizeof(unsigned int)); -+ return snd_ctl_tlv_do(ctl, -1, id, (unsigned int *)tlv, -+ tlv[SNDRV_CTL_TLVO_LEN] + 2 * sizeof(unsigned int)); - } - - /** -diff --git a/src/control/control_hw.c b/src/control/control_hw.c -index 4cbd306f..68eca522 100644 ---- a/src/control/control_hw.c -+++ b/src/control/control_hw.c -@@ -240,11 +240,13 @@ static int snd_ctl_hw_elem_tlv(snd_ctl_t *handle, int op_flag, - return -errno; - } - if (op_flag == 0) { -- if (xtlv->tlv[1] + 2 * sizeof(unsigned int) > tlv_size) { -+ unsigned int size; -+ size = xtlv->tlv[SNDRV_CTL_TLVO_LEN] + 2 * sizeof(unsigned int); -+ if (size > tlv_size) { - free(xtlv); - return -EFAULT; - } -- memcpy(tlv, xtlv->tlv, xtlv->tlv[1] + 2 * sizeof(unsigned int)); -+ memcpy(tlv, xtlv->tlv, size); - } - free(xtlv); - return 0; -diff --git a/src/control/control_local.h b/src/control/control_local.h -index 30218c6c..9568968e 100644 ---- a/src/control/control_local.h -+++ b/src/control/control_local.h -@@ -20,6 +20,7 @@ - */ - - #include "local.h" -+#include - - typedef struct _snd_ctl_ops { - int (*close)(snd_ctl_t *handle); -diff --git a/src/control/tlv.c b/src/control/tlv.c -index 467023b3..d6944b52 100644 ---- a/src/control/tlv.c -+++ b/src/control/tlv.c -@@ -65,8 +65,8 @@ int snd_tlv_parse_dB_info(unsigned int *tlv, - int err; - - *db_tlvp = NULL; -- type = tlv[0]; -- size = tlv[1]; -+ type = tlv[SNDRV_CTL_TLVO_TYPE]; -+ size = tlv[SNDRV_CTL_TLVO_LEN]; - tlv_size -= 2 * sizeof(int); - if (size > tlv_size) { - SNDERR("TLV size error"); -@@ -83,7 +83,7 @@ int snd_tlv_parse_dB_info(unsigned int *tlv, - return err; /* error */ - if (err > 0) - return err; /* found */ -- len = int_index(tlv[1]) + 2; -+ len = int_index(tlv[SNDRV_CTL_TLVO_LEN]) + 2; - size -= len * sizeof(int); - tlv += len; - } -@@ -131,10 +131,10 @@ int snd_tlv_get_dB_range(unsigned int *tlv, long rangemin, long rangemax, - { - int err; - -- switch (tlv[0]) { -+ switch (tlv[SNDRV_CTL_TLVO_TYPE]) { - case SND_CTL_TLVT_DB_RANGE: { - unsigned int pos, len; -- len = int_index(tlv[1]); -+ len = int_index(tlv[SNDRV_CTL_TLVO_LEN]); - if (len > MAX_TLV_RANGE_SIZE) - return -EINVAL; - pos = 2; -@@ -167,22 +167,23 @@ int snd_tlv_get_dB_range(unsigned int *tlv, long rangemin, long rangemax, - } - case SND_CTL_TLVT_DB_SCALE: { - int step; -- if (tlv[3] & 0x10000) -+ if (tlv[SNDRV_CTL_TLVO_DB_SCALE_MUTE_AND_STEP] & 0x10000) - *min = SND_CTL_TLV_DB_GAIN_MUTE; - else -- *min = (int)tlv[2]; -- step = (tlv[3] & 0xffff); -- *max = (int)tlv[2] + step * (rangemax - rangemin); -+ *min = (int)tlv[SNDRV_CTL_TLVO_DB_SCALE_MIN]; -+ step = (tlv[SNDRV_CTL_TLVO_DB_SCALE_MUTE_AND_STEP] & 0xffff); -+ *max = (int)tlv[SNDRV_CTL_TLVO_DB_SCALE_MIN] + -+ step * (rangemax - rangemin); - return 0; - } - case SND_CTL_TLVT_DB_MINMAX: - case SND_CTL_TLVT_DB_LINEAR: -- *min = (int)tlv[2]; -- *max = (int)tlv[3]; -+ *min = (int)tlv[SNDRV_CTL_TLVO_DB_LINEAR_MIN]; -+ *max = (int)tlv[SNDRV_CTL_TLVO_DB_LINEAR_MAX]; - return 0; - case SND_CTL_TLVT_DB_MINMAX_MUTE: - *min = SND_CTL_TLV_DB_GAIN_MUTE; -- *max = (int)tlv[3]; -+ *max = (int)tlv[SNDRV_CTL_TLVO_DB_MINMAX_MAX]; - return 0; - } - return -EINVAL; -@@ -200,10 +201,12 @@ int snd_tlv_get_dB_range(unsigned int *tlv, long rangemin, long rangemax, - int snd_tlv_convert_to_dB(unsigned int *tlv, long rangemin, long rangemax, - long volume, long *db_gain) - { -- switch (tlv[0]) { -+ unsigned int type = tlv[SNDRV_CTL_TLVO_TYPE]; -+ -+ switch (type) { - case SND_CTL_TLVT_DB_RANGE: { - unsigned int pos, len; -- len = int_index(tlv[1]); -+ len = int_index(tlv[SNDRV_CTL_TLVO_LEN]); - if (len > MAX_TLV_RANGE_SIZE) - return -EINVAL; - pos = 2; -@@ -220,9 +223,9 @@ int snd_tlv_convert_to_dB(unsigned int *tlv, long rangemin, long rangemax, - } - case SND_CTL_TLVT_DB_SCALE: { - int min, step, mute; -- min = tlv[2]; -- step = (tlv[3] & 0xffff); -- mute = (tlv[3] >> 16) & 1; -+ min = tlv[SNDRV_CTL_TLVO_DB_SCALE_MIN]; -+ step = (tlv[SNDRV_CTL_TLVO_DB_SCALE_MUTE_AND_STEP] & 0xffff); -+ mute = (tlv[SNDRV_CTL_TLVO_DB_SCALE_MUTE_AND_STEP] >> 16) & 1; - if (mute && volume <= rangemin) - *db_gain = SND_CTL_TLV_DB_GAIN_MUTE; - else -@@ -232,10 +235,10 @@ int snd_tlv_convert_to_dB(unsigned int *tlv, long rangemin, long rangemax, - case SND_CTL_TLVT_DB_MINMAX: - case SND_CTL_TLVT_DB_MINMAX_MUTE: { - int mindb, maxdb; -- mindb = tlv[2]; -- maxdb = tlv[3]; -+ mindb = tlv[SNDRV_CTL_TLVO_DB_MINMAX_MIN]; -+ maxdb = tlv[SNDRV_CTL_TLVO_DB_MINMAX_MAX]; - if (volume <= rangemin || rangemax <= rangemin) { -- if (tlv[0] == SND_CTL_TLVT_DB_MINMAX_MUTE) -+ if (type == SND_CTL_TLVT_DB_MINMAX_MUTE) - *db_gain = SND_CTL_TLV_DB_GAIN_MUTE; - else - *db_gain = mindb; -@@ -248,8 +251,8 @@ int snd_tlv_convert_to_dB(unsigned int *tlv, long rangemin, long rangemax, - } - #ifndef HAVE_SOFT_FLOAT - case SND_CTL_TLVT_DB_LINEAR: { -- int mindb = tlv[2]; -- int maxdb = tlv[3]; -+ int mindb = tlv[SNDRV_CTL_TLVO_DB_LINEAR_MIN]; -+ int maxdb = tlv[SNDRV_CTL_TLVO_DB_LINEAR_MAX]; - if (volume <= rangemin || rangemax <= rangemin) - *db_gain = mindb; - else if (volume >= rangemax) -@@ -289,11 +292,13 @@ int snd_tlv_convert_to_dB(unsigned int *tlv, long rangemin, long rangemax, - int snd_tlv_convert_from_dB(unsigned int *tlv, long rangemin, long rangemax, - long db_gain, long *value, int xdir) - { -- switch (tlv[0]) { -+ unsigned int type = tlv[SNDRV_CTL_TLVO_TYPE]; -+ -+ switch (type) { - case SND_CTL_TLVT_DB_RANGE: { - long dbmin, dbmax, prev_submax; - unsigned int pos, len; -- len = int_index(tlv[1]); -+ len = int_index(tlv[SNDRV_CTL_TLVO_LEN]); - if (len < 6 || len > MAX_TLV_RANGE_SIZE) - return -EINVAL; - pos = 2; -@@ -324,13 +329,14 @@ int snd_tlv_convert_from_dB(unsigned int *tlv, long rangemin, long rangemax, - return 0; - } - case SND_CTL_TLVT_DB_SCALE: { -- int min, step, max; -- min = tlv[2]; -- step = (tlv[3] & 0xffff); -+ int min, step, max, mute; -+ min = tlv[SNDRV_CTL_TLVO_DB_SCALE_MIN]; -+ step = tlv[SNDRV_CTL_TLVO_DB_SCALE_MUTE_AND_STEP] & 0xffff; -+ mute = tlv[SNDRV_CTL_TLVO_DB_SCALE_MUTE_AND_STEP] & 0x10000; - max = min + (int)(step * (rangemax - rangemin)); - if (db_gain <= min) - if (db_gain > SND_CTL_TLV_DB_GAIN_MUTE && xdir > 0 && -- (tlv[3] & 0x10000)) -+ mute) - *value = rangemin + 1; - else - *value = rangemin; -@@ -348,11 +354,11 @@ int snd_tlv_convert_from_dB(unsigned int *tlv, long rangemin, long rangemax, - case SND_CTL_TLVT_DB_MINMAX: - case SND_CTL_TLVT_DB_MINMAX_MUTE: { - int min, max; -- min = tlv[2]; -- max = tlv[3]; -+ min = tlv[SNDRV_CTL_TLVO_DB_MINMAX_MIN]; -+ max = tlv[SNDRV_CTL_TLVO_DB_MINMAX_MAX]; - if (db_gain <= min) - if (db_gain > SND_CTL_TLV_DB_GAIN_MUTE && xdir > 0 && -- tlv[0] == SND_CTL_TLVT_DB_MINMAX_MUTE) -+ type == SND_CTL_TLVT_DB_MINMAX_MUTE) - *value = rangemin + 1; - else - *value = rangemin; -@@ -370,8 +376,8 @@ int snd_tlv_convert_from_dB(unsigned int *tlv, long rangemin, long rangemax, - #ifndef HAVE_SOFT_FLOAT - case SND_CTL_TLVT_DB_LINEAR: { - int min, max; -- min = tlv[2]; -- max = tlv[3]; -+ min = tlv[SNDRV_CTL_TLVO_DB_LINEAR_MIN]; -+ max = tlv[SNDRV_CTL_TLVO_DB_LINEAR_MAX]; - if (db_gain <= min) - *value = rangemin; - else if (db_gain >= max) --- -2.13.6 - - -From 33f0888f0da191af49f17916f6548076d7125ea9 Mon Sep 17 00:00:00 2001 -From: Takashi Sakamoto -Date: Tue, 15 May 2018 21:36:36 +0900 -Subject: [PATCH 20/26] hcontrol: use position offset macro of TLV data - -A series of SNDRV_CTL_TLVO_XXX macro was introduced for position offset -of TLV data. This commit applies a code optimization. - -Signed-off-by: Takashi Sakamoto -Signed-off-by: Takashi Iwai ---- - src/control/hcontrol.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/control/hcontrol.c b/src/control/hcontrol.c -index 7e775248..0cac8956 100644 ---- a/src/control/hcontrol.c -+++ b/src/control/hcontrol.c -@@ -870,7 +870,7 @@ int snd_hctl_elem_tlv_write(snd_hctl_elem_t *elem, const unsigned int *tlv) - { - assert(elem); - assert(tlv); -- assert(tlv[1] >= 4); -+ assert(tlv[SNDRV_CTL_TLVO_LEN] >= 4); - return snd_ctl_elem_tlv_write(elem->hctl->ctl, &elem->id, tlv); - } - -@@ -886,7 +886,7 @@ int snd_hctl_elem_tlv_command(snd_hctl_elem_t *elem, const unsigned int *tlv) - { - assert(elem); - assert(tlv); -- assert(tlv[1] >= 4); -+ assert(tlv[SNDRV_CTL_TLVO_LEN] >= 4); - return snd_ctl_elem_tlv_command(elem->hctl->ctl, &elem->id, tlv); - } - --- -2.13.6 - - -From b0b720513ee35ec0a5afada0b240310f2f2e1b30 Mon Sep 17 00:00:00 2001 -From: Takashi Sakamoto -Date: Tue, 15 May 2018 21:36:37 +0900 -Subject: [PATCH 21/26] pcm: hw: use position offset macro of TLV data - -A series of SNDRV_CTL_TLVO_XXX macro was introduced for position offset -of TLV data. This commit applies a code optimization. - -Signed-off-by: Takashi Sakamoto -Signed-off-by: Takashi Iwai ---- - src/pcm/pcm_hw.c | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - -diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c -index 65b198c5..a728b23b 100644 ---- a/src/pcm/pcm_hw.c -+++ b/src/pcm/pcm_hw.c -@@ -1199,6 +1199,7 @@ snd_pcm_query_chmaps_from_hw(int card, int dev, int subdev, - snd_ctl_t *ctl; - snd_ctl_elem_id_t id = {0}; - unsigned int tlv[2048], *start; -+ unsigned int type; - snd_pcm_chmap_query_t **map; - int i, ret, nums; - -@@ -1223,9 +1224,10 @@ snd_pcm_query_chmaps_from_hw(int card, int dev, int subdev, - /* FIXME: the parser below assumes that the TLV only contains - * chmap-related blocks - */ -- if (tlv[0] != SND_CTL_TLVT_CONTAINER) { -- if (!is_chmap_type(tlv[0])) { -- SYSMSG("Invalid TLV type %d\n", tlv[0]); -+ type = tlv[SNDRV_CTL_TLVO_TYPE]; -+ if (type != SND_CTL_TLVT_CONTAINER) { -+ if (!is_chmap_type(type)) { -+ SYSMSG("Invalid TLV type %d\n", type); - return NULL; - } - start = tlv; -@@ -1234,7 +1236,7 @@ snd_pcm_query_chmaps_from_hw(int card, int dev, int subdev, - unsigned int *p; - int size; - start = tlv + 2; -- size = tlv[1]; -+ size = tlv[SNDRV_CTL_TLVO_LEN]; - nums = 0; - for (p = start; size > 0; ) { - if (!is_chmap_type(p[0])) { --- -2.13.6 - - -From 6dc2ed4090bee0e5516839173166c6a35c3d80be Mon Sep 17 00:00:00 2001 -From: Takashi Sakamoto -Date: Tue, 15 May 2018 21:36:38 +0900 -Subject: [PATCH 22/26] pcm: softvol: use position offset macro of TLV data - -A series of SNDRV_CTL_TLVO_XXX macro was introduced for position offset -of TLV data. This commit applies a code optimization. - -Signed-off-by: Takashi Sakamoto -Signed-off-by: Takashi Iwai ---- - src/pcm/pcm_softvol.c | 11 +++++++---- - 1 file changed, 7 insertions(+), 4 deletions(-) - -diff --git a/src/pcm/pcm_softvol.c b/src/pcm/pcm_softvol.c -index 0eaeacef..f08208f8 100644 ---- a/src/pcm/pcm_softvol.c -+++ b/src/pcm/pcm_softvol.c -@@ -31,6 +31,8 @@ - #include "pcm_local.h" - #include "pcm_plugin.h" - -+#include -+ - #ifndef PIC - /* entry for static linking */ - const char *_snd_module_pcm_softvol = ""; -@@ -708,10 +710,11 @@ static void snd_pcm_softvol_dump(snd_pcm_t *pcm, snd_output_t *out) - static int add_tlv_info(snd_pcm_softvol_t *svol, snd_ctl_elem_info_t *cinfo) - { - unsigned int tlv[4]; -- tlv[0] = SND_CTL_TLVT_DB_SCALE; -- tlv[1] = 2 * sizeof(int); -- tlv[2] = (int)(svol->min_dB * 100); -- tlv[3] = (int)((svol->max_dB - svol->min_dB) * 100 / svol->max_val); -+ tlv[SNDRV_CTL_TLVO_TYPE] = SND_CTL_TLVT_DB_SCALE; -+ tlv[SNDRV_CTL_TLVO_LEN] = 2 * sizeof(int); -+ tlv[SNDRV_CTL_TLVO_DB_SCALE_MIN] = (int)(svol->min_dB * 100); -+ tlv[SNDRV_CTL_TLVO_DB_SCALE_MUTE_AND_STEP] = -+ (int)((svol->max_dB - svol->min_dB) * 100 / svol->max_val); - return snd_ctl_elem_tlv_write(svol->ctl, &cinfo->id, tlv); - } - --- -2.13.6 - - -From 275a438d425c3477be21e1929061f0c1605876f2 Mon Sep 17 00:00:00 2001 -From: Takashi Sakamoto -Date: Tue, 15 May 2018 21:36:39 +0900 -Subject: [PATCH 23/26] test: use position offset macro of TLV data - -A series of SNDRV_CTL_TLVO_XXX macro was introduced for position offset -of TLV data. This commit applies a code optimization. - -Signed-off-by: Takashi Sakamoto -Signed-off-by: Takashi Iwai ---- - test/user-ctl-element-set.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/test/user-ctl-element-set.c b/test/user-ctl-element-set.c -index e94152b9..fee130e2 100644 ---- a/test/user-ctl-element-set.c -+++ b/test/user-ctl-element-set.c -@@ -660,7 +660,7 @@ static int check_tlv(struct elem_set_trial *trial) - if (err < 0) - return err; - -- len = tlv[1] + sizeof(unsigned int) * 2; -+ len = tlv[SNDRV_CTL_TLVO_LEN] + sizeof(unsigned int) * 2; - curr = malloc(len); - if (curr == NULL) { - free(tlv); --- -2.13.6 - - -From 9ee3e4338f46f18a5cddc267bbb19c7a222c5801 Mon Sep 17 00:00:00 2001 -From: Takashi Iwai -Date: Tue, 22 May 2018 14:10:59 +0200 -Subject: [PATCH 24/26] conf: USB-audio: Fix for Xonar U7 SPDIF device - -Add the entry for Xonar U7 to make SPDIF working on it. - -Reported-by: Steve Banks -Signed-off-by: Takashi Iwai ---- - src/conf/cards/USB-Audio.conf | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/conf/cards/USB-Audio.conf b/src/conf/cards/USB-Audio.conf -index 2b8f9a29..05779c47 100644 ---- a/src/conf/cards/USB-Audio.conf -+++ b/src/conf/cards/USB-Audio.conf -@@ -38,6 +38,7 @@ USB-Audio.pcm.surround40_type { - USB-Audio.pcm.iec958_device { - # "NoiseBlaster 3000" 42 - "USB Sound Blaster HD" 1 -+ "Xonar U7" 1 - - # The below don't have digital in/out, so prevent them from being opened. - "Andrea PureAudio USB-SA Headset" 999 --- -2.13.6 - - -From 4740dd97bf54d67f0edef80e1b9e86c04c8ed402 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 23 May 2018 10:33:40 +0200 -Subject: [PATCH 25/26] pcm: add missing flags initialization for the fallback - control data - -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm_hw.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c -index a728b23b..59a24200 100644 ---- a/src/pcm/pcm_hw.c -+++ b/src/pcm/pcm_hw.c -@@ -1018,7 +1018,7 @@ static int map_status_and_control_data(snd_pcm_t *pcm, bool force_fallback) - snd_pcm_set_appl_ptr(pcm, &hw->mmap_control->appl_ptr, hw->fd, - SNDRV_PCM_MMAP_OFFSET_CONTROL); - if (hw->mmap_control_fallbacked) { -- unsigned int flags; -+ unsigned int flags = 0; - /* read appl_ptr and avail_min from kernel when device opened - * with SND_PCM_APPEND flag - */ --- -2.13.6 - - -From ad5aea89226f131f27790c98c4638e4596060f81 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 23 May 2018 10:36:17 +0200 -Subject: [PATCH 26/26] pcm ioplug: fix some coverity issues (switch, missing - unlock in snd_pcm_ioplug_drain()) - -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm_ioplug.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/pcm/pcm_ioplug.c b/src/pcm/pcm_ioplug.c -index db64853b..4d44ae22 100644 ---- a/src/pcm/pcm_ioplug.c -+++ b/src/pcm/pcm_ioplug.c -@@ -533,6 +533,7 @@ static int snd_pcm_ioplug_drain(snd_pcm_t *pcm) - case SND_PCM_STATE_OPEN: - case SND_PCM_STATE_DISCONNECTED: - case SND_PCM_STATE_SUSPENDED: -+ snd_pcm_unlock(pcm); - return -EBADFD; - case SND_PCM_STATE_PREPARED: - if (pcm->stream == SND_PCM_STREAM_PLAYBACK) { -@@ -545,6 +546,8 @@ static int snd_pcm_ioplug_drain(snd_pcm_t *pcm) - case SND_PCM_STATE_RUNNING: - io->data->state = SND_PCM_STATE_DRAINING; - break; -+ default: -+ break; - } - - if (io->data->state == SND_PCM_STATE_DRAINING) { --- -2.13.6 - diff --git a/SOURCES/alsa-lib-1.1.8-post.patch b/SOURCES/alsa-lib-1.1.8-post.patch new file mode 100644 index 0000000..d933464 --- /dev/null +++ b/SOURCES/alsa-lib-1.1.8-post.patch @@ -0,0 +1,626 @@ +From 9c1439a76cea33d2cec65a42d499230d2f9a5205 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Wed, 9 Jan 2019 12:02:56 +0100 +Subject: [PATCH 1/7] pcm: Preserve period_event in snd_pcm_hw_sw_params() call + +snd_pcm_hw_sw_params() in pcm_hw.c tries to abuse the reserved bits +for passing period_Event flag. In this hackish way, we clear the +reserved bits at beginning, and restore before returning. However, +the code paths that return earlier don't restore the value, hence when +user calls this function twice, it may pass an unexpected value. + +This patch fixes the failure, restoring the value always before +returning from the function. + +Reported-by: Jamey Sharp +Signed-off-by: Takashi Iwai +--- + src/pcm/pcm_hw.c | 22 +++++++++++++--------- + 1 file changed, 13 insertions(+), 9 deletions(-) + +diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c +index 59a24200..91370a88 100644 +--- a/src/pcm/pcm_hw.c ++++ b/src/pcm/pcm_hw.c +@@ -496,7 +496,7 @@ static int snd_pcm_hw_hw_free(snd_pcm_t *pcm) + static int snd_pcm_hw_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t * params) + { + snd_pcm_hw_t *hw = pcm->private_data; +- int fd = hw->fd, err; ++ int fd = hw->fd, err = 0; + int old_period_event = sw_get_period_event(params); + sw_set_period_event(params, 0); + if ((snd_pcm_tstamp_t) params->tstamp_mode == pcm->tstamp_mode && +@@ -508,22 +508,25 @@ static int snd_pcm_hw_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t * params) + params->silence_size == pcm->silence_size && + old_period_event == hw->period_event) { + hw->mmap_control->avail_min = params->avail_min; +- return issue_avail_min(hw); ++ err = issue_avail_min(hw); ++ goto out; + } + if (params->tstamp_type == SND_PCM_TSTAMP_TYPE_MONOTONIC_RAW && + hw->version < SNDRV_PROTOCOL_VERSION(2, 0, 12)) { + SYSMSG("Kernel doesn't support SND_PCM_TSTAMP_TYPE_MONOTONIC_RAW"); +- return -EINVAL; ++ err = -EINVAL; ++ goto out; + } + if (params->tstamp_type == SND_PCM_TSTAMP_TYPE_MONOTONIC && + hw->version < SNDRV_PROTOCOL_VERSION(2, 0, 5)) { + SYSMSG("Kernel doesn't support SND_PCM_TSTAMP_TYPE_MONOTONIC"); +- return -EINVAL; ++ err = -EINVAL; ++ goto out; + } + if (ioctl(fd, SNDRV_PCM_IOCTL_SW_PARAMS, params) < 0) { + err = -errno; + SYSMSG("SNDRV_PCM_IOCTL_SW_PARAMS failed (%i)", err); +- return err; ++ goto out; + } + if ((snd_pcm_tstamp_type_t) params->tstamp_type != pcm->tstamp_type) { + if (hw->version < SNDRV_PROTOCOL_VERSION(2, 0, 12)) { +@@ -532,20 +535,21 @@ static int snd_pcm_hw_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t * params) + if (ioctl(fd, SNDRV_PCM_IOCTL_TSTAMP, &on) < 0) { + err = -errno; + SNDMSG("TSTAMP failed\n"); +- return err; ++ goto out; + } + } + pcm->tstamp_type = params->tstamp_type; + } +- sw_set_period_event(params, old_period_event); + hw->mmap_control->avail_min = params->avail_min; + if (hw->period_event != old_period_event) { + err = snd_pcm_hw_change_timer(pcm, old_period_event); + if (err < 0) +- return err; ++ goto out; + hw->period_event = old_period_event; + } +- return 0; ++ out: ++ sw_set_period_event(params, old_period_event); ++ return err; + } + + static int snd_pcm_hw_channel_info(snd_pcm_t *pcm, snd_pcm_channel_info_t * info) +-- +2.20.1 + + +From d8013619c942dd996c32337a9ade429bfaf455ee Mon Sep 17 00:00:00 2001 +From: Hui Wang +Date: Tue, 27 Nov 2018 09:36:28 +0800 +Subject: [PATCH 2/7] conf/ucm: Add a UCM profile for Dell WD19 Dock USB-audio + +USB-audio device on Dell WD19 docking station provides two individual +output PCM streams, one for headphone Jack and another for speaker out +Jack. A UCM profile gives the proper roles for these. + +Signed-off-by: Hui Wang +Signed-off-by: Jaroslav Kysela +--- + .../ucm/Dell-WD19-Dock/Dell-WD19-Dock.conf | 5 ++++ + src/conf/ucm/Dell-WD19-Dock/HiFi.conf | 26 +++++++++++++++++++ + src/conf/ucm/Dell-WD19-Dock/Makefile.am | 4 +++ + 3 files changed, 35 insertions(+) + create mode 100644 src/conf/ucm/Dell-WD19-Dock/Dell-WD19-Dock.conf + create mode 100644 src/conf/ucm/Dell-WD19-Dock/HiFi.conf + create mode 100644 src/conf/ucm/Dell-WD19-Dock/Makefile.am + +diff --git a/src/conf/ucm/Dell-WD19-Dock/Dell-WD19-Dock.conf b/src/conf/ucm/Dell-WD19-Dock/Dell-WD19-Dock.conf +new file mode 100644 +index 00000000..465ff550 +--- /dev/null ++++ b/src/conf/ucm/Dell-WD19-Dock/Dell-WD19-Dock.conf +@@ -0,0 +1,5 @@ ++Comment "USB-audio on Dell WD19 docking station" ++SectionUseCase."HiFi" { ++ File "HiFi.conf" ++ Comment "Default" ++} +diff --git a/src/conf/ucm/Dell-WD19-Dock/HiFi.conf b/src/conf/ucm/Dell-WD19-Dock/HiFi.conf +new file mode 100644 +index 00000000..e1427a79 +--- /dev/null ++++ b/src/conf/ucm/Dell-WD19-Dock/HiFi.conf +@@ -0,0 +1,26 @@ ++SectionDevice."Headphone" { ++ Comment "Headphone" ++ ++ Value { ++ PlaybackChannels "2" ++ PlaybackPCM "hw:Dock,0" ++ } ++} ++ ++SectionDevice."Speaker" { ++ Comment "Speaker" ++ ++ Value { ++ PlaybackChannels "2" ++ PlaybackPCM "hw:Dock,1" ++ } ++} ++ ++SectionDevice."Mic" { ++ Comment "Microphone" ++ ++ Value { ++ CaptureChannels "2" ++ CapturePCM "hw:Dock,0" ++ } ++} +diff --git a/src/conf/ucm/Dell-WD19-Dock/Makefile.am b/src/conf/ucm/Dell-WD19-Dock/Makefile.am +new file mode 100644 +index 00000000..6549ae1b +--- /dev/null ++++ b/src/conf/ucm/Dell-WD19-Dock/Makefile.am +@@ -0,0 +1,4 @@ ++alsaconfigdir = @ALSA_CONFIG_DIR@ ++ucmdir = $(alsaconfigdir)/ucm/Dell-WD19-Dock ++ucm_DATA = Dell-WD19-Dock.conf HiFi.conf ++EXTRA_DIST = $(ucm_DATA) +-- +2.20.1 + + +From 0862458c1339eec025330b39d5199481c335673c Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Fri, 25 Jan 2019 12:09:31 +0100 +Subject: [PATCH 3/7] Revert "conf/ucm: Add a UCM profile for Dell WD19 Dock + USB-audio" + +This reverts commit d8013619c942dd996c32337a9ade429bfaf455ee. + +The USB driver defines identical profile as for WD15. + +Signed-off-by: Jaroslav Kysela +--- + .../ucm/Dell-WD19-Dock/Dell-WD19-Dock.conf | 5 ---- + src/conf/ucm/Dell-WD19-Dock/HiFi.conf | 26 ------------------- + src/conf/ucm/Dell-WD19-Dock/Makefile.am | 4 --- + 3 files changed, 35 deletions(-) + delete mode 100644 src/conf/ucm/Dell-WD19-Dock/Dell-WD19-Dock.conf + delete mode 100644 src/conf/ucm/Dell-WD19-Dock/HiFi.conf + delete mode 100644 src/conf/ucm/Dell-WD19-Dock/Makefile.am + +diff --git a/src/conf/ucm/Dell-WD19-Dock/Dell-WD19-Dock.conf b/src/conf/ucm/Dell-WD19-Dock/Dell-WD19-Dock.conf +deleted file mode 100644 +index 465ff550..00000000 +--- a/src/conf/ucm/Dell-WD19-Dock/Dell-WD19-Dock.conf ++++ /dev/null +@@ -1,5 +0,0 @@ +-Comment "USB-audio on Dell WD19 docking station" +-SectionUseCase."HiFi" { +- File "HiFi.conf" +- Comment "Default" +-} +diff --git a/src/conf/ucm/Dell-WD19-Dock/HiFi.conf b/src/conf/ucm/Dell-WD19-Dock/HiFi.conf +deleted file mode 100644 +index e1427a79..00000000 +--- a/src/conf/ucm/Dell-WD19-Dock/HiFi.conf ++++ /dev/null +@@ -1,26 +0,0 @@ +-SectionDevice."Headphone" { +- Comment "Headphone" +- +- Value { +- PlaybackChannels "2" +- PlaybackPCM "hw:Dock,0" +- } +-} +- +-SectionDevice."Speaker" { +- Comment "Speaker" +- +- Value { +- PlaybackChannels "2" +- PlaybackPCM "hw:Dock,1" +- } +-} +- +-SectionDevice."Mic" { +- Comment "Microphone" +- +- Value { +- CaptureChannels "2" +- CapturePCM "hw:Dock,0" +- } +-} +diff --git a/src/conf/ucm/Dell-WD19-Dock/Makefile.am b/src/conf/ucm/Dell-WD19-Dock/Makefile.am +deleted file mode 100644 +index 6549ae1b..00000000 +--- a/src/conf/ucm/Dell-WD19-Dock/Makefile.am ++++ /dev/null +@@ -1,4 +0,0 @@ +-alsaconfigdir = @ALSA_CONFIG_DIR@ +-ucmdir = $(alsaconfigdir)/ucm/Dell-WD19-Dock +-ucm_DATA = Dell-WD19-Dock.conf HiFi.conf +-EXTRA_DIST = $(ucm_DATA) +-- +2.20.1 + + +From 7442c8b9be91ef576871eed5efce9499fcdeab4a Mon Sep 17 00:00:00 2001 +From: Srinivas Kandagatla +Date: Tue, 29 Jan 2019 10:48:28 +0000 +Subject: [PATCH 4/7] ucm: Add ucm files for DB820c board + +DB820c board is based of MSM8996 Qualcomm SoC, which has support for both +Digital and Analog audio. Digital audio is over HDMI and analog is over +WCD9335 codec via SLIMbus. + +Board itself has HDMI port, a 3.5mm audio Jack and an Audio expansion +connector. +This patch adds support for HDMI port and 3.5mm jack. + +Signed-off-by: Srinivas Kandagatla +Signed-off-by: Takashi Iwai +--- + configure.ac | 1 + + src/conf/ucm/DB820c/DB820c.conf | 9 +++ + src/conf/ucm/DB820c/HDMI | 37 +++++++++++ + src/conf/ucm/DB820c/HiFi | 110 ++++++++++++++++++++++++++++++++ + src/conf/ucm/DB820c/Makefile.am | 4 ++ + src/conf/ucm/Makefile.am | 1 + + 6 files changed, 162 insertions(+) + create mode 100644 src/conf/ucm/DB820c/DB820c.conf + create mode 100644 src/conf/ucm/DB820c/HDMI + create mode 100644 src/conf/ucm/DB820c/HiFi + create mode 100644 src/conf/ucm/DB820c/Makefile.am + +diff --git a/configure.ac b/configure.ac +index a0c346ef..e9e1a369 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -747,6 +747,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \ + src/conf/ucm/cube-i1_TF-Defaultstring-CherryTrailCR/Makefile \ + src/conf/ucm/DAISY-I2S/Makefile \ + src/conf/ucm/DB410c/Makefile \ ++ src/conf/ucm/DB820c/Makefile \ + src/conf/ucm/Dell-WD15-Dock/Makefile \ + src/conf/ucm/GoogleNyan/Makefile \ + src/conf/ucm/gpd-win-pocket-rt5645/Makefile \ +diff --git a/src/conf/ucm/DB820c/DB820c.conf b/src/conf/ucm/DB820c/DB820c.conf +new file mode 100644 +index 00000000..58b7ff4e +--- /dev/null ++++ b/src/conf/ucm/DB820c/DB820c.conf +@@ -0,0 +1,9 @@ ++SectionUseCase."HiFi" { ++ File "HiFi" ++ Comment "HiFi quality Music." ++} ++ ++SectionUseCase."HDMI" { ++ File "HDMI" ++ Comment "HDMI output." ++} +diff --git a/src/conf/ucm/DB820c/HDMI b/src/conf/ucm/DB820c/HDMI +new file mode 100644 +index 00000000..39b28692 +--- /dev/null ++++ b/src/conf/ucm/DB820c/HDMI +@@ -0,0 +1,37 @@ ++# Use case configuration for DB820c board. ++# Author: Srinivas Kandagatla ++ ++SectionVerb { ++ EnableSequence [ ++ cdev "hw:0" ++ cset "name='HDMI Mixer MultiMedia1' 1" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:0" ++ cset "name='HDMI Mixer MultiMedia1' 0" ++ ] ++ Value { ++ TQ "HiFi" ++ PlaybackPCM "plughw:0,0" ++ } ++} ++ ++SectionDevice."HDMI-stereo" { ++ #Name "HDMI-stereo" ++ Comment "HDMI Digital Stereo Output" ++ ++ EnableSequence [ ++ cdev "hw:0" ++ cset "name='HDMI Mixer MultiMedia1' 1" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:0" ++ cset "name='HDMI Mixer MultiMedia1' 0" ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ } ++} +diff --git a/src/conf/ucm/DB820c/HiFi b/src/conf/ucm/DB820c/HiFi +new file mode 100644 +index 00000000..4457329f +--- /dev/null ++++ b/src/conf/ucm/DB820c/HiFi +@@ -0,0 +1,110 @@ ++# Use case configuration for DB820c board. ++# Author: Srinivas Kandagatla ++ ++SectionVerb { ++ ++ EnableSequence [ ++ cdev "hw:0" ++ cset "name='SLIM RX0 MUX' ZERO" ++ cset "name='SLIM RX1 MUX' ZERO" ++ cset "name='SLIM RX2 MUX' ZERO" ++ cset "name='SLIM RX3 MUX' ZERO" ++ cset "name='SLIM RX4 MUX' ZERO" ++ cset "name='SLIM RX5 MUX' AIF4_PB" ++ cset "name='SLIM RX6 MUX' AIF4_PB" ++ cset "name='SLIM RX7 MUX' ZERO" ++ cset "name='RX INT1_2 MUX' RX5" ++ cset "name='RX INT2_2 MUX' RX6" ++ ## gain to 0dB ++ cset "name='RX5 Digital Volume' 68" ++ ## gain to 0dB ++ cset "name='RX6 Digital Volume' 68" ++ cset "name='SLIMBUS_6_RX Audio Mixer MultiMedia2' 1" ++ cset "name='MultiMedia3 Mixer SLIMBUS_0_TX' 1" ++ cset "name='RX INT1 DEM MUX' CLSH_DSM_OUT" ++ cset "name='RX INT2 DEM MUX' CLSH_DSM_OUT" ++ cset "name='AIF1_CAP Mixer SLIM TX0' 1" ++ cset "name='SLIM TX0 MUX' DEC0" ++ cset "name='ADC2 Volume' 12" ++ cset "name='ADC MUX0' AMIC" ++ cset "name='AMIC MUX0' ADC2" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:0" ++ cset "name='SLIMBUS_6_RX Audio Mixer MultiMedia2' 0" ++ cset "name='MultiMedia3 Mixer SLIMBUS_0_TX' 0" ++ ] ++ ++ # ALSA PCM ++ Value { ++ # ALSA PCM device for HiFi ++ PlaybackPCM "plughw:0,1" ++ CapturePCM "plughw:0,2" ++ } ++} ++ ++SectionDevice."Headphones" { ++ Comment "Headphones playback" ++ ++ EnableSequence [ ++ cdev "hw:0" ++ cset "name='SLIM RX0 MUX' ZERO" ++ cset "name='SLIM RX1 MUX' ZERO" ++ cset "name='SLIM RX2 MUX' ZERO" ++ cset "name='SLIM RX3 MUX' ZERO" ++ cset "name='SLIM RX4 MUX' ZERO" ++ cset "name='SLIM RX5 MUX' AIF4_PB" ++ cset "name='SLIM RX6 MUX' AIF4_PB" ++ cset "name='SLIM RX7 MUX' ZERO" ++ cset "name='RX INT1_2 MUX' RX5" ++ cset "name='RX INT2_2 MUX' RX6" ++ ## gain to 0dB ++ cset "name='RX5 Digital Volume' 68" ++ ## gain to 0dB ++ cset "name='RX6 Digital Volume' 68" ++ cset "name='SLIMBUS_6_RX Audio Mixer MultiMedia2' 1" ++ cset "name='RX INT1 DEM MUX' CLSH_DSM_OUT" ++ cset "name='RX INT2 DEM MUX' CLSH_DSM_OUT" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:0" ++ cset "name='RX5 Digital Volume' 0" ++ cset "name='RX6 Digital Volume' 0" ++ cset "name='SLIM RX5 MUX' ZERO" ++ cset "name='SLIM RX6 MUX' ZERO" ++ cset "name='SLIMBUS_6_RX Audio Mixer MultiMedia2' 0" ++ ] ++ ++ Value { ++ PlaybackChannels "2" ++ } ++} ++ ++SectionDevice."Handset" { ++ Comment "Headset Microphone" ++ ++ EnableSequence [ ++ cdev "hw:0" ++ cset "name='MultiMedia3 Mixer SLIMBUS_0_TX' 1" ++ cset "name='AIF1_CAP Mixer SLIM TX0' 1" ++ cset "name='SLIM TX0 MUX' DEC0" ++ cset "name='ADC2 Volume' 12" ++ cset "name='ADC MUX0' AMIC" ++ cset "name='AMIC MUX0' ADC2" ++ ] ++ ++ DisableSequence [ ++ cdev "hw:0" ++ cset "name='MultiMedia3 Mixer SLIMBUS_0_TX' 0" ++ cset "name='AIF1_CAP Mixer SLIM TX0' 0" ++ cset "name='AMIC MUX0' ZERO" ++ cset "name='SLIM TX0 MUX' ZERO" ++ cset "name='ADC2 Volume' 0" ++ ] ++ ++ Value { ++ CaptureChannels "1" ++ } ++} +diff --git a/src/conf/ucm/DB820c/Makefile.am b/src/conf/ucm/DB820c/Makefile.am +new file mode 100644 +index 00000000..16e985e5 +--- /dev/null ++++ b/src/conf/ucm/DB820c/Makefile.am +@@ -0,0 +1,4 @@ ++alsaconfigdir = @ALSA_CONFIG_DIR@ ++ucmdir = $(alsaconfigdir)/ucm/DB820c ++ucm_DATA = DB820c.conf HDMI HiFi ++EXTRA_DIST = $(ucm_DATA) +diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am +index ee850ee6..e9f88ed6 100644 +--- a/src/conf/ucm/Makefile.am ++++ b/src/conf/ucm/Makefile.am +@@ -31,6 +31,7 @@ chtrt5650 \ + cube-i1_TF-Defaultstring-CherryTrailCR \ + DAISY-I2S \ + DB410c \ ++DB820c \ + Dell-WD15-Dock \ + GoogleNyan \ + gpd-win-pocket-rt5645 \ +-- +2.20.1 + + +From 4d9374e61d23a5fc219ec172fe9613017f9ae79c Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sun, 3 Feb 2019 12:37:41 +0100 +Subject: [PATCH 5/7] ucm: bytcr/PlatformEnableSeq.conf update some comments + +Commit f91cc3c7d6b7 ("Update chtrt5645 ucm variants to use +bytcr/PlatformEnableSeq.conf component") updated the +following 2 comments: + + # codec0_out settings (used if SSP2 is connected to aif1) + # modem_out settings (used if SSP0 is connected to aif2) + +Specifically it added the " to aif1" resp. " to aif2" part of the comments. + +This is not correct, AIF1 / AIF2 are something which is present on +Realtek codecs only, and either one can be used indepedent of +SSP0 or SSP2 being used (the comments in the chtrt5645 UCM profile +before this change were wrong / outdated). + +Besides there not being any relationship between SSP0 or SSP2 being +used, bytcr/PlatformEnableSeq.conf is also used with other codecs, +e.g. the ESS8316 codec where this is not applicable at all. + +Therefor this commit removes the " to aif?" part of the comments again +to avoid confusing people reading this in the future. + +Cc: Russell Parker +Signed-off-by: Hans de Goede +Signed-off-by: Takashi Iwai +--- + src/conf/ucm/platforms/bytcr/PlatformEnableSeq.conf | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/conf/ucm/platforms/bytcr/PlatformEnableSeq.conf b/src/conf/ucm/platforms/bytcr/PlatformEnableSeq.conf +index 6f5e899c..b5ee2b41 100644 +--- a/src/conf/ucm/platforms/bytcr/PlatformEnableSeq.conf ++++ b/src/conf/ucm/platforms/bytcr/PlatformEnableSeq.conf +@@ -29,7 +29,7 @@ cset "name='pcm0_in Gain 0 Volume' 0" + cset "name='pcm1_in Gain 0 Switch' off" + cset "name='pcm1_in Gain 0 Volume' 0%" + +-# codec0_out settings (used if SSP2 is connected to aif1) ++# codec0_out settings (used if SSP2 is connected) + cset "name='codec_out0 mix 0 codec_in0 Switch' off" + cset "name='codec_out0 mix 0 codec_in1 Switch' off" + cset "name='codec_out0 mix 0 media_loop1_in Switch' off" +@@ -40,7 +40,7 @@ cset "name='codec_out0 mix 0 sprot_loop_in Switch' off" + cset "name='codec_out0 Gain 0 Switch' on" + cset "name='codec_out0 Gain 0 Volume' 0" + +-# modem_out settings (used if SSP0 is connected to aif2) ++# modem_out settings (used if SSP0 is connected) + cset "name='modem_out mix 0 codec_in0 Switch' off" + cset "name='modem_out mix 0 codec_in1 Switch' off" + cset "name='modem_out mix 0 media_loop1_in Switch' off" +-- +2.20.1 + + +From 7cea8c156204ebae7c0dc60801dde5ddfa5bb7d0 Mon Sep 17 00:00:00 2001 +From: Brendan Shanks +Date: Mon, 11 Feb 2019 11:51:26 -0800 +Subject: [PATCH 6/7] pcm: dshare: Fix overflow when slave_hw_ptr rolls over + boundary +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +In snd_pcm_dshare_sync_area() when 'slave_hw_ptr' rolls over +'slave_boundary', the wrong variable is checked ('dshare->slave_hw_ptr' vs +the local 'slave_hw_ptr'). In some cases, this results in 'slave_hw_ptr' +not rolling over correctly. 'slave_size' and 'size' are then much too +large, and the for loop blocks for several minutes copying samples. + +This was likely only triggered on 32-bit systems, since the PCM boundary +is computed based on LONG_MAX and is much larger on 64-bit systems. + +This same change was made to pcm_dmix in commit +6c7f60f7a982fdba828e4530a9d7aa0aa2b704ae ("Fix boundary overlap”) from +June 2005. + +Signed-off-by: Brendan Shanks +Signed-off-by: Takashi Iwai +--- + src/pcm/pcm_dshare.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c +index 2bb735fe..f135b5df 100644 +--- a/src/pcm/pcm_dshare.c ++++ b/src/pcm/pcm_dshare.c +@@ -121,7 +121,7 @@ static void snd_pcm_dshare_sync_area(snd_pcm_t *pcm) + */ + slave_hw_ptr -= slave_hw_ptr % dshare->slave_period_size; + slave_hw_ptr += dshare->slave_buffer_size; +- if (dshare->slave_hw_ptr > dshare->slave_boundary) ++ if (slave_hw_ptr >= dshare->slave_boundary) + slave_hw_ptr -= dshare->slave_boundary; + if (slave_hw_ptr < dshare->slave_appl_ptr) + slave_size = slave_hw_ptr + (dshare->slave_boundary - dshare->slave_appl_ptr); +-- +2.20.1 + + +From deb07a0b208225393efc6347556310f3d8adb54d Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Fri, 1 Mar 2019 12:43:19 +0100 +Subject: [PATCH 7/7] test/latency: use frame bytes correctly in writebuf() + +Reported-by: Alessandro Lapini +Signed-off-by: Jaroslav Kysela +--- + test/latency.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/test/latency.c b/test/latency.c +index e926856b..ddd5a7af 100644 +--- a/test/latency.c ++++ b/test/latency.c +@@ -374,6 +374,7 @@ long readbuf(snd_pcm_t *handle, char *buf, long len, size_t *frames, size_t *max + long writebuf(snd_pcm_t *handle, char *buf, long len, size_t *frames) + { + long r; ++ int frame_bytes = (snd_pcm_format_width(format) / 8) * channels; + + while (len > 0) { + r = snd_pcm_writei(handle, buf, len); +@@ -383,7 +384,7 @@ long writebuf(snd_pcm_t *handle, char *buf, long len, size_t *frames) + if (r < 0) + return r; + // showstat(handle, 0); +- buf += r * 4; ++ buf += r * frame_bytes; + len -= r; + *frames += r; + } +-- +2.20.1 + diff --git a/SPECS/alsa-lib.spec b/SPECS/alsa-lib.spec index 8f01603..965d667 100644 --- a/SPECS/alsa-lib.spec +++ b/SPECS/alsa-lib.spec @@ -4,8 +4,8 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib -Version: 1.1.6 -Release: 2%{?prever_dot}%{?dist} +Version: 1.1.8 +Release: 1%{?prever_dot}%{?dist} License: LGPLv2+ Group: System Environment/Libraries URL: http://www.alsa-project.org/ @@ -14,7 +14,7 @@ Source: ftp://ftp.alsa-project.org/pub/lib/%{name}-%{version}%{?prever}%{?post Source10: asound.conf Source11: modprobe-dist-alsa.conf Source12: modprobe-dist-oss.conf -Patch0: alsa-lib-1.1.6-post.patch +Patch0: alsa-lib-1.1.8-post.patch Patch1: alsa-lib-1.1.0-config.patch BuildRequires: doxygen @@ -114,6 +114,10 @@ find %{buildroot} -name '*.la' -delete %{_datadir}/aclocal/alsa.m4 %changelog +* Mon Mar 11 2019 Jaroslav Kysela - 1.1.8-1 +- Updated to 1.1.8 +- Resolves: rhbz#1658083 + * Tue May 22 2018 Jaroslav Kysela - 1.1.6-2 - Updated to 1.1.6 - Resolves: rhbz#1578680