Accepting request 593417 from home:tiwai:branches:multimedia:libs

- Updated to alsa-lib 1.1.6:
  * Change FSF address (Franklin Street)
  * pcm: route: Fix use_getput flag computation for 3 byte formats
  * test: correct emulation for channel-map TLV
  * Change snd_dlopen() function to return the error string
  * configure.ac: build extra mixer modules conditionally
  * configure.ac: do not enable alisp code by default
  * conf/ucm: Rearrange Makefile.am
  * conf/ucm: Add dual HD-audio codecs config for Lenovo
  * conf/ucm: Add Gigabyte mobo UCM profile with dual HD-audio codecs
  * asound.h: add SNDRV_PCM_FORMAT_{S, U}20
  * pcm: add and describe SND_PCM_FORMAT_{S, U}20
  * pcm: linear, route: handle linear formats with 20-bit sample on 4 bytes
  * pcm: plug: add SND_PCM_FORMAT_{S, U}20 to linear_preferred_formats
  * pcm: remove unused macros of COPY_LABELS/COPY_END
  * pcm: remove unused macros of GETU_LABELS/GETU_END
  * pcm: remove unused macros of NORMS_LABELS/NORMS_END
  * pcm: fix wrong comments for some cases of linear interpolation of PCM samples
  * topology: Fix to skip writing of header for compound elements
  * control: Proper reference of internal versioned functions
  * timer: Proper reference of internal versioned symbols
  * core: Proper reference of internal snd_dlopen()
  * conf/ucm: Add chtrt5645-mono-speaker-analog-mic configuration
  * pcm: Return the consistent error code for unexpected PCM states
  * pcm: Fix two bugs in snd_pcm_area_silence()
  * pcm: fix a bug to copy silent samples aligned to 64
  * pcm: another fix for the snd_pcm_area_silence() fast path
  * pcm: ioplug: Use boundary for wrap around
  * pcm: Do not access lock_enabled if thread safe API
  * pcm: ioplug: Provide hw_avail helper function for plugins

OBS-URL: https://build.opensuse.org/request/show/593417
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=230
This commit is contained in:
Tomáš Chvátal 2018-04-04 09:21:43 +00:00 committed by Git OBS Bridge
parent a5d2e9b64b
commit b80b6de5ef
10 changed files with 59 additions and 1509 deletions

View File

@ -1,38 +0,0 @@
From 6f52b3d643fc68bf1b6a2839696385f0b2b3f327 Mon Sep 17 00:00:00 2001
From: "Maciej S. Szmigiero" <mail@maciej.szmigiero.name>
Date: Mon, 20 Nov 2017 13:12:32 +0100
Subject: [PATCH] pcm: route: Fix use_getput flag computation for 3 byte
formats
Commit de63b942acf520 ("pcm: route: Use get/put labels for all 3 byte formats")
wanted to make the route plugin use get / put labels not only for 24-bit
physical width formats but also for 18 and 20-bit ones.
There was, however, a typo in that commit so a check for these widths
didn't really work.
Let's fix it now.
Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_route.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/pcm/pcm_route.c b/src/pcm/pcm_route.c
index 999a2eed3a25..1f485a8e79f9 100644
--- a/src/pcm/pcm_route.c
+++ b/src/pcm/pcm_route.c
@@ -567,8 +567,8 @@ static int snd_pcm_route_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
return err;
/* 3 bytes formats? */
route->params.use_getput =
- (snd_pcm_format_physical_width(src_format) + 7) / 3 == 3 ||
- (snd_pcm_format_physical_width(dst_format) + 7) / 3 == 3;
+ (snd_pcm_format_physical_width(src_format) + 7) / 8 == 3 ||
+ (snd_pcm_format_physical_width(dst_format) + 7) / 8 == 3;
route->params.get_idx = snd_pcm_linear_get_index(src_format, SND_PCM_FORMAT_S32);
route->params.put_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S32, dst_format);
route->params.conv_idx = snd_pcm_linear_convert_index(src_format, dst_format);
--
2.15.1

View File

@ -1,78 +0,0 @@
From 91896be6bc326b5b9c1b5ef52b9dbac243fefa27 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Tue, 5 Dec 2017 14:58:30 +0100
Subject: [PATCH] conf/ucm: Rearrange Makefile.am
Just rearrange and split to multiple lines to make future patches
cleaner. No actual code change.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
configure.ac | 16 ++++++++--------
src/conf/ucm/Makefile.am | 16 +++++++++++++++-
2 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/configure.ac b/configure.ac
index afe4306d2062..c232236dc193 100644
--- a/configure.ac
+++ b/configure.ac
@@ -709,19 +709,20 @@ 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/broadwell-rt286/Makefile \
+ src/conf/ucm/broxton-rt298/Makefile \
+ src/conf/ucm/bytcr-rt5651/Makefile \
+ src/conf/ucm/chtrt5645/Makefile \
src/conf/ucm/DAISY-I2S/Makefile \
+ src/conf/ucm/DB410c/Makefile \
+ src/conf/ucm/GoogleNyan/Makefile \
src/conf/ucm/PandaBoard/Makefile \
src/conf/ucm/PandaBoardES/Makefile \
- src/conf/ucm/SDP4430/Makefile \
- src/conf/ucm/tegraalc5632/Makefile \
src/conf/ucm/PAZ00/Makefile \
- src/conf/ucm/GoogleNyan/Makefile \
- src/conf/ucm/broadwell-rt286/Makefile \
+ src/conf/ucm/SDP4430/Makefile \
src/conf/ucm/skylake-rt286/Makefile \
+ src/conf/ucm/tegraalc5632/Makefile \
src/conf/ucm/VEYRON-I2S/Makefile \
- src/conf/ucm/chtrt5645/Makefile \
- src/conf/ucm/DB410c/Makefile \
- src/conf/ucm/bytcr-rt5651/Makefile \
src/conf/topology/Makefile \
src/conf/topology/broadwell/Makefile \
modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile \
@@ -729,7 +730,6 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
src/conf/topology/bxtrt298/Makefile \
alsalisp/Makefile aserver/Makefile \
test/Makefile test/lsb/Makefile \
- src/conf/ucm/broxton-rt298/Makefile \
utils/Makefile utils/alsa-lib.spec utils/alsa.pc)
dnl Create asoundlib.h dynamically according to configure options
diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am
index 2bd4ebe761ae..060d025f1bb5 100644
--- a/src/conf/ucm/Makefile.am
+++ b/src/conf/ucm/Makefile.am
@@ -1 +1,15 @@
-SUBDIRS=DAISY-I2S PandaBoard PandaBoardES SDP4430 tegraalc5632 PAZ00 GoogleNyan broadwell-rt286 skylake-rt286 VEYRON-I2S chtrt5645 DB410c broxton-rt298 bytcr-rt5651
+SUBDIRS=\
+broadwell-rt286 \
+broxton-rt298 \
+bytcr-rt5651 \
+chtrt5645 \
+DAISY-I2S \
+DB410c \
+GoogleNyan \
+PandaBoard \
+PandaBoardES \
+PAZ00 \
+SDP4430 \
+skylake-rt286 \
+tegraalc5632 \
+VEYRON-I2S
--
2.15.1

View File

@ -1,225 +0,0 @@
From b7e56af82a600262b7f641c5920a914b3303fd56 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Tue, 5 Dec 2017 14:53:11 +0100
Subject: [PATCH] conf/ucm: Add dual HD-audio codecs config for Lenovo
Some recent Lenovo laptops have dual codecs and we need to switch them
accordingly. The kernel side already contains a fix and gives the
unique longname string for identifying the board, and here we hook up
the corresponding UCM profile.
The profile was corrected and tested by Hui Wang on Lenovo p520.
Tested-by: Kailang <kailang@realtek.com>
Tested-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
configure.ac | 1 +
.../HDAudio-Lenovo-DualCodecs.conf | 5 +
src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf | 145 +++++++++++++++++++++
src/conf/ucm/HDAudio-Lenovo-DualCodecs/Makefile.am | 4 +
src/conf/ucm/Makefile.am | 1 +
5 files changed, 156 insertions(+)
create mode 100644 src/conf/ucm/HDAudio-Lenovo-DualCodecs/HDAudio-Lenovo-DualCodecs.conf
create mode 100644 src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf
create mode 100644 src/conf/ucm/HDAudio-Lenovo-DualCodecs/Makefile.am
diff --git a/configure.ac b/configure.ac
index c232236dc193..8d95a8b17f0c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -716,6 +716,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
src/conf/ucm/DAISY-I2S/Makefile \
src/conf/ucm/DB410c/Makefile \
src/conf/ucm/GoogleNyan/Makefile \
+ src/conf/ucm/HDAudio-Lenovo-DualCodecs/Makefile \
src/conf/ucm/PandaBoard/Makefile \
src/conf/ucm/PandaBoardES/Makefile \
src/conf/ucm/PAZ00/Makefile \
diff --git a/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HDAudio-Lenovo-DualCodecs.conf b/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HDAudio-Lenovo-DualCodecs.conf
new file mode 100644
index 000000000000..98fdd8cceb7b
--- /dev/null
+++ b/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HDAudio-Lenovo-DualCodecs.conf
@@ -0,0 +1,5 @@
+Comment "Lenovo laptop with dual HD-audio codecs"
+SectionUseCase."HiFi" {
+ File "HiFi.conf"
+ Comment "Default"
+}
diff --git a/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf b/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf
new file mode 100644
index 000000000000..509678964f3f
--- /dev/null
+++ b/src/conf/ucm/HDAudio-Lenovo-DualCodecs/HiFi.conf
@@ -0,0 +1,145 @@
+SectionVerb {
+ Value {
+ TQ "HiFi"
+ }
+
+ EnableSequence [
+ cdev "hw:PCH"
+ cset "name='Front Playback Volume' 100%"
+ cset "name='Front Playback Switch' on"
+ cset "name='Rear-Panel Capture Volume' 100%"
+ cset "name='Rear-Panel Capture Switch' on"
+ ]
+
+ DisableSequence [
+ cdev "hw:PCH"
+ cset "name='Front Playback Volume' 0"
+ cset "name='Front Playback Switch' off"
+ cset "name='Rear-Panel Capture Volume' 0"
+ cset "name='Rear-Panel Capture Switch' off"
+ ]
+}
+
+SectionDevice."Speaker" {
+ Comment "Speaker"
+
+ Value {
+ PlaybackChannels "2"
+ PlaybackPCM "hw:PCH,4"
+ }
+
+ ConflictingDevice [
+ "Headphone"
+ ]
+
+ EnableSequence [
+ cdev "hw:PCH"
+ cset "name='Speaker Playback Switch' on"
+ cset "name='Speaker Playback Volume' 100%"
+ ]
+
+ DisableSequence [
+ cdev "hw:PCH"
+ cset "name='Speaker Playback Volume' 0"
+ cset "name='Speaker Playback Switch' off"
+ ]
+}
+
+SectionDevice."LineOut" {
+ Comment "Line Out"
+
+ Value {
+ PlaybackChannels "2"
+ PlaybackPCM "hw:PCH,0"
+ JackControl "Line Out Jack"
+ JackHWMute "Speaker"
+ }
+}
+
+SectionDevice."Headphone" {
+ Comment "Headphone"
+
+ Value {
+ PlaybackChannels "2"
+ PlaybackPCM "hw:PCH,4"
+ JackControl "Front Headphone Jack"
+ JackHWMute "Speaker"
+ }
+
+ ConflictingDevice [
+ "Speaker"
+ ]
+
+ EnableSequence [
+ cdev "hw:PCH"
+ cset "name='Headphone Playback Switch' on"
+ cset "name='Headphone Playback Volume' 100%"
+ ]
+
+ DisableSequence [
+ cdev "hw:PCH"
+ cset "name='Headphone Playback Volume' 0"
+ cset "name='Headphone Playback Switch' off"
+ ]
+}
+
+SectionDevice."LineIn" {
+ Comment "Rear Line In"
+
+ Value {
+ CaptureChannels "2"
+ CapturePCM "hw:PCH,0"
+ JackControl "Line Jack"
+ }
+
+ ConflictingDevice [
+ "RearMic"
+ ]
+
+ EnableSequence [
+ cdev "hw:PCH"
+ cset "name='Input Source' Line"
+ ]
+}
+
+SectionDevice."RearMic" {
+ Comment "Rear Microphone"
+
+ Value {
+ CaptureChannels "2"
+ CapturePCM "hw:PCH,0"
+ # CapturePriority "150"
+ JackHWMute "LineIn"
+ }
+
+ ConflictingDevice [
+ "LineIn"
+ ]
+
+ EnableSequence [
+ cdev "hw:PCH"
+ cset "name='Input Source' Rear Mic"
+ ]
+}
+
+SectionDevice."FrontMic" {
+ Comment "Front Microphone"
+
+ Value {
+ CaptureChannels "2"
+ CapturePCM "hw:PCH,4"
+ JackControl "Front Mic Jack"
+ }
+
+ EnableSequence [
+ cdev "hw:PCH"
+ cset "name='Front-Panel Capture Volume' 100%"
+ cset "name='Front-Panel Capture Switch' on"
+ ]
+
+ DisableSequence [
+ cdev "hw:PCH"
+ cset "name='Front-Panel Capture Volume' 0"
+ cset "name='Front-Panel Capture Switch' off"
+ ]
+}
diff --git a/src/conf/ucm/HDAudio-Lenovo-DualCodecs/Makefile.am b/src/conf/ucm/HDAudio-Lenovo-DualCodecs/Makefile.am
new file mode 100644
index 000000000000..da285415c145
--- /dev/null
+++ b/src/conf/ucm/HDAudio-Lenovo-DualCodecs/Makefile.am
@@ -0,0 +1,4 @@
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/HDAudio-Lenovo-DualCodecs
+ucm_DATA = HDAudio-Lenovo-DualCodecs.conf HiFi.conf
+EXTRA_DIST = $(ucm_DATA)
diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am
index 060d025f1bb5..1d81beeb4ddf 100644
--- a/src/conf/ucm/Makefile.am
+++ b/src/conf/ucm/Makefile.am
@@ -6,6 +6,7 @@ chtrt5645 \
DAISY-I2S \
DB410c \
GoogleNyan \
+HDAudio-Lenovo-DualCodecs \
PandaBoard \
PandaBoardES \
PAZ00 \
--
2.15.1

View File

@ -1,221 +0,0 @@
From d1e08d2db3517e8430ffa570f23b53987ba78cc3 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Tue, 5 Dec 2017 15:08:01 +0100
Subject: [PATCH] conf/ucm: Add Gigabyte mobo UCM profile with dual HD-audio
codecs
Like the previous Lenovo laptops, some Gigabyte mobos have dual
HD-audio codecs and need to switch dynamically via UCM profile.
Reuse the same profile as Lenovo dual codecs, so far.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
configure.ac | 1 +
.../HDAudio-Gigabyte-ALC1220DualCodecs.conf | 5 +
.../HDAudio-Gigabyte-ALC1220DualCodecs/HiFi.conf | 145 +++++++++++++++++++++
.../HDAudio-Gigabyte-ALC1220DualCodecs/Makefile.am | 4 +
src/conf/ucm/Makefile.am | 1 +
5 files changed, 156 insertions(+)
create mode 100644 src/conf/ucm/HDAudio-Gigabyte-ALC1220DualCodecs/HDAudio-Gigabyte-ALC1220DualCodecs.conf
create mode 100644 src/conf/ucm/HDAudio-Gigabyte-ALC1220DualCodecs/HiFi.conf
create mode 100644 src/conf/ucm/HDAudio-Gigabyte-ALC1220DualCodecs/Makefile.am
diff --git a/configure.ac b/configure.ac
index 8d95a8b17f0c..47c50fcf89b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -716,6 +716,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
src/conf/ucm/DAISY-I2S/Makefile \
src/conf/ucm/DB410c/Makefile \
src/conf/ucm/GoogleNyan/Makefile \
+ src/conf/ucm/HDAudio-Gigabyte-ALC1220DualCodecs/Makefile \
src/conf/ucm/HDAudio-Lenovo-DualCodecs/Makefile \
src/conf/ucm/PandaBoard/Makefile \
src/conf/ucm/PandaBoardES/Makefile \
diff --git a/src/conf/ucm/HDAudio-Gigabyte-ALC1220DualCodecs/HDAudio-Gigabyte-ALC1220DualCodecs.conf b/src/conf/ucm/HDAudio-Gigabyte-ALC1220DualCodecs/HDAudio-Gigabyte-ALC1220DualCodecs.conf
new file mode 100644
index 000000000000..492eebf01aa9
--- /dev/null
+++ b/src/conf/ucm/HDAudio-Gigabyte-ALC1220DualCodecs/HDAudio-Gigabyte-ALC1220DualCodecs.conf
@@ -0,0 +1,5 @@
+Comment "Gigabyte mobo with dual HD-audio codecs"
+SectionUseCase."HiFi" {
+ File "HiFi.conf"
+ Comment "Default"
+}
diff --git a/src/conf/ucm/HDAudio-Gigabyte-ALC1220DualCodecs/HiFi.conf b/src/conf/ucm/HDAudio-Gigabyte-ALC1220DualCodecs/HiFi.conf
new file mode 100644
index 000000000000..509678964f3f
--- /dev/null
+++ b/src/conf/ucm/HDAudio-Gigabyte-ALC1220DualCodecs/HiFi.conf
@@ -0,0 +1,145 @@
+SectionVerb {
+ Value {
+ TQ "HiFi"
+ }
+
+ EnableSequence [
+ cdev "hw:PCH"
+ cset "name='Front Playback Volume' 100%"
+ cset "name='Front Playback Switch' on"
+ cset "name='Rear-Panel Capture Volume' 100%"
+ cset "name='Rear-Panel Capture Switch' on"
+ ]
+
+ DisableSequence [
+ cdev "hw:PCH"
+ cset "name='Front Playback Volume' 0"
+ cset "name='Front Playback Switch' off"
+ cset "name='Rear-Panel Capture Volume' 0"
+ cset "name='Rear-Panel Capture Switch' off"
+ ]
+}
+
+SectionDevice."Speaker" {
+ Comment "Speaker"
+
+ Value {
+ PlaybackChannels "2"
+ PlaybackPCM "hw:PCH,4"
+ }
+
+ ConflictingDevice [
+ "Headphone"
+ ]
+
+ EnableSequence [
+ cdev "hw:PCH"
+ cset "name='Speaker Playback Switch' on"
+ cset "name='Speaker Playback Volume' 100%"
+ ]
+
+ DisableSequence [
+ cdev "hw:PCH"
+ cset "name='Speaker Playback Volume' 0"
+ cset "name='Speaker Playback Switch' off"
+ ]
+}
+
+SectionDevice."LineOut" {
+ Comment "Line Out"
+
+ Value {
+ PlaybackChannels "2"
+ PlaybackPCM "hw:PCH,0"
+ JackControl "Line Out Jack"
+ JackHWMute "Speaker"
+ }
+}
+
+SectionDevice."Headphone" {
+ Comment "Headphone"
+
+ Value {
+ PlaybackChannels "2"
+ PlaybackPCM "hw:PCH,4"
+ JackControl "Front Headphone Jack"
+ JackHWMute "Speaker"
+ }
+
+ ConflictingDevice [
+ "Speaker"
+ ]
+
+ EnableSequence [
+ cdev "hw:PCH"
+ cset "name='Headphone Playback Switch' on"
+ cset "name='Headphone Playback Volume' 100%"
+ ]
+
+ DisableSequence [
+ cdev "hw:PCH"
+ cset "name='Headphone Playback Volume' 0"
+ cset "name='Headphone Playback Switch' off"
+ ]
+}
+
+SectionDevice."LineIn" {
+ Comment "Rear Line In"
+
+ Value {
+ CaptureChannels "2"
+ CapturePCM "hw:PCH,0"
+ JackControl "Line Jack"
+ }
+
+ ConflictingDevice [
+ "RearMic"
+ ]
+
+ EnableSequence [
+ cdev "hw:PCH"
+ cset "name='Input Source' Line"
+ ]
+}
+
+SectionDevice."RearMic" {
+ Comment "Rear Microphone"
+
+ Value {
+ CaptureChannels "2"
+ CapturePCM "hw:PCH,0"
+ # CapturePriority "150"
+ JackHWMute "LineIn"
+ }
+
+ ConflictingDevice [
+ "LineIn"
+ ]
+
+ EnableSequence [
+ cdev "hw:PCH"
+ cset "name='Input Source' Rear Mic"
+ ]
+}
+
+SectionDevice."FrontMic" {
+ Comment "Front Microphone"
+
+ Value {
+ CaptureChannels "2"
+ CapturePCM "hw:PCH,4"
+ JackControl "Front Mic Jack"
+ }
+
+ EnableSequence [
+ cdev "hw:PCH"
+ cset "name='Front-Panel Capture Volume' 100%"
+ cset "name='Front-Panel Capture Switch' on"
+ ]
+
+ DisableSequence [
+ cdev "hw:PCH"
+ cset "name='Front-Panel Capture Volume' 0"
+ cset "name='Front-Panel Capture Switch' off"
+ ]
+}
diff --git a/src/conf/ucm/HDAudio-Gigabyte-ALC1220DualCodecs/Makefile.am b/src/conf/ucm/HDAudio-Gigabyte-ALC1220DualCodecs/Makefile.am
new file mode 100644
index 000000000000..728fd19b9251
--- /dev/null
+++ b/src/conf/ucm/HDAudio-Gigabyte-ALC1220DualCodecs/Makefile.am
@@ -0,0 +1,4 @@
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/HDAudio-Gigabyte-ALC1220DualCodecs
+ucm_DATA = HDAudio-Gigabyte-ALC1220DualCodecs.conf HiFi.conf
+EXTRA_DIST = $(ucm_DATA)
diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am
index 1d81beeb4ddf..954e32b8f0c8 100644
--- a/src/conf/ucm/Makefile.am
+++ b/src/conf/ucm/Makefile.am
@@ -6,6 +6,7 @@ chtrt5645 \
DAISY-I2S \
DB410c \
GoogleNyan \
+HDAudio-Gigabyte-ALC1220DualCodecs \
HDAudio-Lenovo-DualCodecs \
PandaBoard \
PandaBoardES \
--
2.15.1

View File

@ -1,512 +0,0 @@
From 60ed28999a272e1a3d737a9eeee0719b98efd447 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Sat, 6 Jan 2018 23:03:20 +0100
Subject: [PATCH] conf/ucm: Add chtrt5645-mono-speaker-analog-mic configuration
Add a configuration for Cherry Trail boards which use a rt5645 codec
connected to a mono speaker and with an analog mic on IN2N + IN2P.
The chtrt5645-mono-speaker-analog-mic/HiFi.conf for this is based on the
latest version from https://github.com/plbossart/UCM/tree/master/chtrt5645
with all the unused input options removed and some changes made to make
the analog mic work.
This commit also adds 2 ucm dirs with the longname of 2 boards known to use
this setup, which simply contain a symlink to the generic
chtrt5645-mono-speaker-analog-mic entry.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
configure.ac | 3 +
src/conf/ucm/Makefile.am | 3 +
.../Makefile.am | 4 +
...TECLAST-X80Pro-Defaultstring-CherryTrailCR.conf | 1 +
.../chtrt5645-mono-speaker-analog-mic/HiFi.conf | 361 +++++++++++++++++++++
.../chtrt5645-mono-speaker-analog-mic/Makefile.am | 4 +
.../chtrt5645-mono-speaker-analog-mic.conf | 5 +
src/conf/ucm/gpd-win-pocket-rt5645/Makefile.am | 4 +
.../gpd-win-pocket-rt5645.conf | 1 +
9 files changed, 386 insertions(+)
create mode 100644 src/conf/ucm/TECLAST-X80Pro-Defaultstring-CherryTrailCR/Makefile.am
create mode 120000 src/conf/ucm/TECLAST-X80Pro-Defaultstring-CherryTrailCR/TECLAST-X80Pro-Defaultstring-CherryTrailCR.conf
create mode 100644 src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf
create mode 100644 src/conf/ucm/chtrt5645-mono-speaker-analog-mic/Makefile.am
create mode 100644 src/conf/ucm/chtrt5645-mono-speaker-analog-mic/chtrt5645-mono-speaker-analog-mic.conf
create mode 100644 src/conf/ucm/gpd-win-pocket-rt5645/Makefile.am
create mode 120000 src/conf/ucm/gpd-win-pocket-rt5645/gpd-win-pocket-rt5645.conf
diff --git a/configure.ac b/configure.ac
index 47c50fcf89b4..2c51ce75555a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -713,9 +713,11 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
src/conf/ucm/broxton-rt298/Makefile \
src/conf/ucm/bytcr-rt5651/Makefile \
src/conf/ucm/chtrt5645/Makefile \
+ src/conf/ucm/chtrt5645-mono-speaker-analog-mic/Makefile \
src/conf/ucm/DAISY-I2S/Makefile \
src/conf/ucm/DB410c/Makefile \
src/conf/ucm/GoogleNyan/Makefile \
+ 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/PandaBoard/Makefile \
@@ -723,6 +725,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
src/conf/ucm/PAZ00/Makefile \
src/conf/ucm/SDP4430/Makefile \
src/conf/ucm/skylake-rt286/Makefile \
+ src/conf/ucm/TECLAST-X80Pro-Defaultstring-CherryTrailCR/Makefile \
src/conf/ucm/tegraalc5632/Makefile \
src/conf/ucm/VEYRON-I2S/Makefile \
src/conf/topology/Makefile \
diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am
index 954e32b8f0c8..3b4f13a880e6 100644
--- a/src/conf/ucm/Makefile.am
+++ b/src/conf/ucm/Makefile.am
@@ -3,9 +3,11 @@ broadwell-rt286 \
broxton-rt298 \
bytcr-rt5651 \
chtrt5645 \
+chtrt5645-mono-speaker-analog-mic \
DAISY-I2S \
DB410c \
GoogleNyan \
+gpd-win-pocket-rt5645 \
HDAudio-Gigabyte-ALC1220DualCodecs \
HDAudio-Lenovo-DualCodecs \
PandaBoard \
@@ -13,5 +15,6 @@ PandaBoardES \
PAZ00 \
SDP4430 \
skylake-rt286 \
+TECLAST-X80Pro-Defaultstring-CherryTrailCR \
tegraalc5632 \
VEYRON-I2S
diff --git a/src/conf/ucm/TECLAST-X80Pro-Defaultstring-CherryTrailCR/Makefile.am b/src/conf/ucm/TECLAST-X80Pro-Defaultstring-CherryTrailCR/Makefile.am
new file mode 100644
index 000000000000..f56a817c73e0
--- /dev/null
+++ b/src/conf/ucm/TECLAST-X80Pro-Defaultstring-CherryTrailCR/Makefile.am
@@ -0,0 +1,4 @@
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/TECLAST-X80Pro-Defaultstring-CherryTrailCR
+ucm_DATA = TECLAST-X80Pro-Defaultstring-CherryTrailCR.conf
+EXTRA_DIST = $(ucm_DATA)
diff --git a/src/conf/ucm/TECLAST-X80Pro-Defaultstring-CherryTrailCR/TECLAST-X80Pro-Defaultstring-CherryTrailCR.conf b/src/conf/ucm/TECLAST-X80Pro-Defaultstring-CherryTrailCR/TECLAST-X80Pro-Defaultstring-CherryTrailCR.conf
new file mode 120000
index 000000000000..1b1d47540b73
--- /dev/null
+++ b/src/conf/ucm/TECLAST-X80Pro-Defaultstring-CherryTrailCR/TECLAST-X80Pro-Defaultstring-CherryTrailCR.conf
@@ -0,0 +1 @@
+../chtrt5645-mono-speaker-analog-mic/chtrt5645-mono-speaker-analog-mic.conf
\ No newline at end of file
diff --git a/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf b/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf
new file mode 100644
index 000000000000..7a0cd51c0790
--- /dev/null
+++ b/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/HiFi.conf
@@ -0,0 +1,361 @@
+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"
+
+ # Monospeaker: Mix right to left
+ cset "name='Stereo DAC MIXL DAC R1 Switch' 1"
+ cset "name='Stereo DAC MIXR DAC R1 Switch' 0"
+
+ 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"
+
+ # Undo monospeaker mixing
+ cset "name='Stereo DAC MIXL DAC R1 Switch' 0"
+ cset "name='Stereo DAC MIXR DAC R1 Switch' 1"
+
+ 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."Mic".0 {
+ Comment "Internal Analog Microphone"
+
+ Value {
+ CaptureChannels "2"
+ CapturePriority "150"
+ }
+
+ EnableSequence [
+ cdev "hw:chtrt5645"
+
+ cset "name='Int Analog 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 BST2 Switch' on"
+ cset "name='RECMIXR BST2 Switch' on"
+
+ ]
+
+ DisableSequence [
+ cdev "hw:chtrt5645"
+
+ 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 BST2 Switch' off"
+ cset "name='RECMIXR BST2 Switch' off"
+
+ cset "name='Int Analog Mic Switch' off"
+ ]
+}
+
+
+SectionDevice."HSMic".0 {
+ Comment "Headset Microphone"
+
+ Value {
+ CaptureChannels "2"
+ JackControl "Headset Mic Jack"
+ JackHWMute "Mic"
+ }
+
+ 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/chtrt5645-mono-speaker-analog-mic/Makefile.am b/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/Makefile.am
new file mode 100644
index 000000000000..4c4d7cf4df85
--- /dev/null
+++ b/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/Makefile.am
@@ -0,0 +1,4 @@
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/chtrt5645-mono-speaker-analog-mic
+ucm_DATA = chtrt5645-mono-speaker-analog-mic.conf HiFi.conf
+EXTRA_DIST = $(ucm_DATA)
diff --git a/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/chtrt5645-mono-speaker-analog-mic.conf b/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/chtrt5645-mono-speaker-analog-mic.conf
new file mode 100644
index 000000000000..b1a5206e24b1
--- /dev/null
+++ b/src/conf/ucm/chtrt5645-mono-speaker-analog-mic/chtrt5645-mono-speaker-analog-mic.conf
@@ -0,0 +1,5 @@
+Comment "Intel SoC Audio Device"
+SectionUseCase."HiFi" {
+ File "../chtrt5645-mono-speaker-analog-mic/HiFi.conf"
+ Comment "Default"
+}
diff --git a/src/conf/ucm/gpd-win-pocket-rt5645/Makefile.am b/src/conf/ucm/gpd-win-pocket-rt5645/Makefile.am
new file mode 100644
index 000000000000..62440926057b
--- /dev/null
+++ b/src/conf/ucm/gpd-win-pocket-rt5645/Makefile.am
@@ -0,0 +1,4 @@
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/gpd-win-pocket-rt5645
+ucm_DATA = gpd-win-pocket-rt5645.conf
+EXTRA_DIST = $(ucm_DATA)
diff --git a/src/conf/ucm/gpd-win-pocket-rt5645/gpd-win-pocket-rt5645.conf b/src/conf/ucm/gpd-win-pocket-rt5645/gpd-win-pocket-rt5645.conf
new file mode 120000
index 000000000000..1b1d47540b73
--- /dev/null
+++ b/src/conf/ucm/gpd-win-pocket-rt5645/gpd-win-pocket-rt5645.conf
@@ -0,0 +1 @@
+../chtrt5645-mono-speaker-analog-mic/chtrt5645-mono-speaker-analog-mic.conf
\ No newline at end of file
--
2.15.1

View File

@ -1,417 +0,0 @@
From 6e555781259281e31f8b5dc518a317511d67bbd8 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Wed, 17 Jan 2018 15:57:20 +0100
Subject: [PATCH] pcm: Return the consistent error code for unexpected PCM
states
Some PCM functions have the sanity check of the expected PCM states,
and most of them return -EBADFD if the current state doesn't match.
This is bad for some programs like aplay that expect the function
returning a proper code corresponding to the state, e.g. -ESTRPIPE for
the suspend.
This patch is an attempt to address such inconsistencies. The sanity
checker bad_pcm_state() now returns the error code instead of bool, so
that the caller can pass the returned code as is. And it calls a new
helper, pcm_state_to_error(), for obtaining the error code to certain
known PCM error state.
While we're at it, use the new pcm_state_to_error() for simplifying
the existing code to retrieve the error code, too.
Tested-by: Mirza Krak <mirza.krak@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm.c | 170 +++++++++++++++++++++++++++++++++-------------------------
1 file changed, 98 insertions(+), 72 deletions(-)
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index e9ebf383c31b..69d7d66500ea 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -657,6 +657,21 @@ playback devices.
#include "pcm_local.h"
#ifndef DOC_HIDDEN
+/* return specific error codes for known bad PCM states */
+static int pcm_state_to_error(snd_pcm_state_t state)
+{
+ switch (state) {
+ case SND_PCM_STATE_XRUN:
+ return -EPIPE;
+ case SND_PCM_STATE_SUSPENDED:
+ return -ESTRPIPE;
+ case SND_PCM_STATE_DISCONNECTED:
+ return -ENODEV;
+ default:
+ return 0;
+ }
+}
+
#define P_STATE(x) (1U << SND_PCM_STATE_ ## x)
#define P_STATE_RUNNABLE (P_STATE(PREPARED) | \
P_STATE(RUNNING) | \
@@ -667,9 +682,18 @@ playback devices.
/* check whether the PCM is in the unexpected state */
static int bad_pcm_state(snd_pcm_t *pcm, unsigned int supported_states)
{
+ snd_pcm_state_t state;
+ int err;
+
if (pcm->own_state_check)
return 0; /* don't care, the plugin checks by itself */
- return !(supported_states & (1U << snd_pcm_state(pcm)));
+ state = snd_pcm_state(pcm);
+ if (supported_states & (1U << state))
+ return 0; /* OK */
+ err = pcm_state_to_error(state);
+ if (err < 0)
+ return err;
+ return -EBADFD;
}
#endif
@@ -1143,8 +1167,9 @@ int snd_pcm_prepare(snd_pcm_t *pcm)
SNDMSG("PCM not set up");
return -EIO;
}
- if (bad_pcm_state(pcm, ~P_STATE(DISCONNECTED)))
- return -EBADFD;
+ err = bad_pcm_state(pcm, ~P_STATE(DISCONNECTED));
+ if (err < 0)
+ return err;
snd_pcm_lock(pcm);
err = pcm->fast_ops->prepare(pcm->fast_op_arg);
snd_pcm_unlock(pcm);
@@ -1191,8 +1216,9 @@ int snd_pcm_start(snd_pcm_t *pcm)
SNDMSG("PCM not set up");
return -EIO;
}
- if (bad_pcm_state(pcm, P_STATE(PREPARED)))
- return -EBADFD;
+ err = bad_pcm_state(pcm, P_STATE(PREPARED));
+ if (err < 0)
+ return err;
snd_pcm_lock(pcm);
err = __snd_pcm_start(pcm);
snd_pcm_unlock(pcm);
@@ -1221,9 +1247,10 @@ int snd_pcm_drop(snd_pcm_t *pcm)
SNDMSG("PCM not set up");
return -EIO;
}
- if (bad_pcm_state(pcm, P_STATE_RUNNABLE | P_STATE(SETUP) |
- P_STATE(SUSPENDED)))
- return -EBADFD;
+ err = bad_pcm_state(pcm, P_STATE_RUNNABLE | P_STATE(SETUP) |
+ P_STATE(SUSPENDED));
+ if (err < 0)
+ return err;
snd_pcm_lock(pcm);
err = pcm->fast_ops->drop(pcm->fast_op_arg);
snd_pcm_unlock(pcm);
@@ -1247,13 +1274,16 @@ int snd_pcm_drop(snd_pcm_t *pcm)
*/
int snd_pcm_drain(snd_pcm_t *pcm)
{
+ int err;
+
assert(pcm);
if (CHECK_SANITY(! pcm->setup)) {
SNDMSG("PCM not set up");
return -EIO;
}
- if (bad_pcm_state(pcm, P_STATE_RUNNABLE))
- return -EBADFD;
+ err = bad_pcm_state(pcm, P_STATE_RUNNABLE);
+ if (err < 0)
+ return err;
/* lock handled in the callback */
return pcm->fast_ops->drain(pcm->fast_op_arg);
}
@@ -1279,8 +1309,9 @@ int snd_pcm_pause(snd_pcm_t *pcm, int enable)
SNDMSG("PCM not set up");
return -EIO;
}
- if (bad_pcm_state(pcm, P_STATE_RUNNABLE))
- return -EBADFD;
+ err = bad_pcm_state(pcm, P_STATE_RUNNABLE);
+ if (err < 0)
+ return err;
snd_pcm_lock(pcm);
err = pcm->fast_ops->pause(pcm->fast_op_arg, enable);
snd_pcm_unlock(pcm);
@@ -1301,14 +1332,16 @@ int snd_pcm_pause(snd_pcm_t *pcm, int enable)
snd_pcm_sframes_t snd_pcm_rewindable(snd_pcm_t *pcm)
{
snd_pcm_sframes_t result;
+ int err;
assert(pcm);
if (CHECK_SANITY(! pcm->setup)) {
SNDMSG("PCM not set up");
return -EIO;
}
- if (bad_pcm_state(pcm, P_STATE_RUNNABLE))
- return -EBADFD;
+ err = bad_pcm_state(pcm, P_STATE_RUNNABLE);
+ if (err < 0)
+ return err;
snd_pcm_lock(pcm);
result = pcm->fast_ops->rewindable(pcm->fast_op_arg);
snd_pcm_unlock(pcm);
@@ -1327,6 +1360,7 @@ snd_pcm_sframes_t snd_pcm_rewindable(snd_pcm_t *pcm)
snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
{
snd_pcm_sframes_t result;
+ int err;
assert(pcm);
if (CHECK_SANITY(! pcm->setup)) {
@@ -1335,8 +1369,9 @@ snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
}
if (frames == 0)
return 0;
- if (bad_pcm_state(pcm, P_STATE_RUNNABLE))
- return -EBADFD;
+ err = bad_pcm_state(pcm, P_STATE_RUNNABLE);
+ if (err < 0)
+ return err;
snd_pcm_lock(pcm);
result = pcm->fast_ops->rewind(pcm->fast_op_arg, frames);
snd_pcm_unlock(pcm);
@@ -1357,14 +1392,16 @@ snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
snd_pcm_sframes_t snd_pcm_forwardable(snd_pcm_t *pcm)
{
snd_pcm_sframes_t result;
+ int err;
assert(pcm);
if (CHECK_SANITY(! pcm->setup)) {
SNDMSG("PCM not set up");
return -EIO;
}
- if (bad_pcm_state(pcm, P_STATE_RUNNABLE))
- return -EBADFD;
+ err = bad_pcm_state(pcm, P_STATE_RUNNABLE);
+ if (err < 0)
+ return err;
snd_pcm_lock(pcm);
result = pcm->fast_ops->forwardable(pcm->fast_op_arg);
snd_pcm_unlock(pcm);
@@ -1387,6 +1424,7 @@ snd_pcm_sframes_t snd_pcm_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
#endif
{
snd_pcm_sframes_t result;
+ int err;
assert(pcm);
if (CHECK_SANITY(! pcm->setup)) {
@@ -1395,8 +1433,9 @@ snd_pcm_sframes_t snd_pcm_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
}
if (frames == 0)
return 0;
- if (bad_pcm_state(pcm, P_STATE_RUNNABLE))
- return -EBADFD;
+ err = bad_pcm_state(pcm, P_STATE_RUNNABLE);
+ if (err < 0)
+ return err;
snd_pcm_lock(pcm);
result = pcm->fast_ops->forward(pcm->fast_op_arg, frames);
snd_pcm_unlock(pcm);
@@ -1425,6 +1464,8 @@ use_default_symbol_version(__snd_pcm_forward, snd_pcm_forward, ALSA_0.9.0rc8);
*/
snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size)
{
+ int err;
+
assert(pcm);
assert(size == 0 || buffer);
if (CHECK_SANITY(! pcm->setup)) {
@@ -1435,8 +1476,9 @@ snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_ufr
SNDMSG("invalid access type %s", snd_pcm_access_name(pcm->access));
return -EINVAL;
}
- if (bad_pcm_state(pcm, P_STATE_RUNNABLE))
- return -EBADFD;
+ err = bad_pcm_state(pcm, P_STATE_RUNNABLE);
+ if (err < 0)
+ return err;
return _snd_pcm_writei(pcm, buffer, size);
}
@@ -1461,6 +1503,8 @@ snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_ufr
*/
snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size)
{
+ int err;
+
assert(pcm);
assert(size == 0 || bufs);
if (CHECK_SANITY(! pcm->setup)) {
@@ -1471,8 +1515,9 @@ snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t
SNDMSG("invalid access type %s", snd_pcm_access_name(pcm->access));
return -EINVAL;
}
- if (bad_pcm_state(pcm, P_STATE_RUNNABLE))
- return -EBADFD;
+ err = bad_pcm_state(pcm, P_STATE_RUNNABLE);
+ if (err < 0)
+ return err;
return _snd_pcm_writen(pcm, bufs, size);
}
@@ -1497,6 +1542,8 @@ snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t
*/
snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size)
{
+ int err;
+
assert(pcm);
assert(size == 0 || buffer);
if (CHECK_SANITY(! pcm->setup)) {
@@ -1507,8 +1554,9 @@ snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t
SNDMSG("invalid access type %s", snd_pcm_access_name(pcm->access));
return -EINVAL;
}
- if (bad_pcm_state(pcm, P_STATE_RUNNABLE))
- return -EBADFD;
+ err = bad_pcm_state(pcm, P_STATE_RUNNABLE);
+ if (err < 0)
+ return err;
return _snd_pcm_readi(pcm, buffer, size);
}
@@ -1533,6 +1581,8 @@ snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t
*/
snd_pcm_sframes_t snd_pcm_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size)
{
+ int err;
+
assert(pcm);
assert(size == 0 || bufs);
if (CHECK_SANITY(! pcm->setup)) {
@@ -1543,8 +1593,9 @@ snd_pcm_sframes_t snd_pcm_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t s
SNDMSG("invalid access type %s", snd_pcm_access_name(pcm->access));
return -EINVAL;
}
- if (bad_pcm_state(pcm, P_STATE_RUNNABLE))
- return -EBADFD;
+ err = bad_pcm_state(pcm, P_STATE_RUNNABLE);
+ if (err < 0)
+ return err;
return _snd_pcm_readn(pcm, bufs, size);
}
@@ -2695,18 +2746,12 @@ int snd_pcm_wait(snd_pcm_t *pcm, int timeout)
/* locked version */
int __snd_pcm_wait_in_lock(snd_pcm_t *pcm, int timeout)
{
+ int err;
+
if (!snd_pcm_may_wait_for_avail_min(pcm, snd_pcm_mmap_avail(pcm))) {
/* check more precisely */
- switch (__snd_pcm_state(pcm)) {
- case SND_PCM_STATE_XRUN:
- return -EPIPE;
- case SND_PCM_STATE_SUSPENDED:
- return -ESTRPIPE;
- case SND_PCM_STATE_DISCONNECTED:
- return -ENODEV;
- default:
- return 1;
- }
+ err = pcm_state_to_error(__snd_pcm_state(pcm));
+ return err < 0 ? err : 1;
}
return snd_pcm_wait_nocheck(pcm, timeout);
}
@@ -2753,16 +2798,8 @@ int snd_pcm_wait_nocheck(snd_pcm_t *pcm, int timeout)
return err;
if (revents & (POLLERR | POLLNVAL)) {
/* check more precisely */
- switch (__snd_pcm_state(pcm)) {
- case SND_PCM_STATE_XRUN:
- return -EPIPE;
- case SND_PCM_STATE_SUSPENDED:
- return -ESTRPIPE;
- case SND_PCM_STATE_DISCONNECTED:
- return -ENODEV;
- default:
- return -EIO;
- }
+ err = pcm_state_to_error(__snd_pcm_state(pcm));
+ return err < 0 ? err : -EIO;
}
} while (!(revents & (POLLIN | POLLOUT)));
#if 0 /* very useful code to test poll related problems */
@@ -7010,8 +7047,9 @@ int snd_pcm_mmap_begin(snd_pcm_t *pcm,
{
int err;
- if (bad_pcm_state(pcm, P_STATE_RUNNABLE))
- return -EBADFD;
+ err = bad_pcm_state(pcm, P_STATE_RUNNABLE);
+ if (err < 0)
+ return err;
snd_pcm_lock(pcm);
err = __snd_pcm_mmap_begin(pcm, areas, offset, frames);
snd_pcm_unlock(pcm);
@@ -7106,9 +7144,11 @@ snd_pcm_sframes_t snd_pcm_mmap_commit(snd_pcm_t *pcm,
snd_pcm_uframes_t frames)
{
snd_pcm_sframes_t result;
+ int err;
- if (bad_pcm_state(pcm, P_STATE_RUNNABLE))
- return -EBADFD;
+ err = bad_pcm_state(pcm, P_STATE_RUNNABLE);
+ if (err < 0)
+ return err;
snd_pcm_lock(pcm);
result = __snd_pcm_mmap_commit(pcm, offset, frames);
snd_pcm_unlock(pcm);
@@ -7204,17 +7244,10 @@ snd_pcm_sframes_t snd_pcm_read_areas(snd_pcm_t *pcm, const snd_pcm_channel_area_
case SND_PCM_STATE_DRAINING:
case SND_PCM_STATE_PAUSED:
break;
- case SND_PCM_STATE_XRUN:
- err = -EPIPE;
- goto _end;
- case SND_PCM_STATE_SUSPENDED:
- err = -ESTRPIPE;
- goto _end;
- case SND_PCM_STATE_DISCONNECTED:
- err = -ENODEV;
- goto _end;
default:
- err = -EBADFD;
+ err = pcm_state_to_error(state);
+ if (!err)
+ err = -EBADFD;
goto _end;
}
avail = __snd_pcm_avail_update(pcm);
@@ -7280,17 +7313,10 @@ snd_pcm_sframes_t snd_pcm_write_areas(snd_pcm_t *pcm, const snd_pcm_channel_area
if (err < 0)
goto _end;
break;
- case SND_PCM_STATE_XRUN:
- err = -EPIPE;
- goto _end;
- case SND_PCM_STATE_SUSPENDED:
- err = -ESTRPIPE;
- goto _end;
- case SND_PCM_STATE_DISCONNECTED:
- err = -ENODEV;
- goto _end;
default:
- err = -EBADFD;
+ err = pcm_state_to_error(state);
+ if (!err)
+ err = -EBADFD;
goto _end;
}
avail = __snd_pcm_avail_update(pcm);
--
2.15.1

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f4f68ad3c6da36b0b5241ac3c798a7a71e0e97d51f972e9f723b3f20a9650ae6
size 979225

3
alsa-lib-1.1.6.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5f2cd274b272cae0d0d111e8a9e363f08783329157e8dd68b3de0c096de6d724
size 989316

View File

@ -1,3 +1,55 @@
-------------------------------------------------------------------
Wed Apr 4 08:28:28 CEST 2018 - tiwai@suse.de
- Updated to alsa-lib 1.1.6:
* Change FSF address (Franklin Street)
* pcm: route: Fix use_getput flag computation for 3 byte formats
* test: correct emulation for channel-map TLV
* Change snd_dlopen() function to return the error string
* configure.ac: build extra mixer modules conditionally
* configure.ac: do not enable alisp code by default
* conf/ucm: Rearrange Makefile.am
* conf/ucm: Add dual HD-audio codecs config for Lenovo
* conf/ucm: Add Gigabyte mobo UCM profile with dual HD-audio codecs
* asound.h: add SNDRV_PCM_FORMAT_{S, U}20
* pcm: add and describe SND_PCM_FORMAT_{S, U}20
* pcm: linear, route: handle linear formats with 20-bit sample on 4 bytes
* pcm: plug: add SND_PCM_FORMAT_{S, U}20 to linear_preferred_formats
* pcm: remove unused macros of COPY_LABELS/COPY_END
* pcm: remove unused macros of GETU_LABELS/GETU_END
* pcm: remove unused macros of NORMS_LABELS/NORMS_END
* pcm: fix wrong comments for some cases of linear interpolation of PCM samples
* topology: Fix to skip writing of header for compound elements
* control: Proper reference of internal versioned functions
* timer: Proper reference of internal versioned symbols
* core: Proper reference of internal snd_dlopen()
* conf/ucm: Add chtrt5645-mono-speaker-analog-mic configuration
* pcm: Return the consistent error code for unexpected PCM states
* pcm: Fix two bugs in snd_pcm_area_silence()
* pcm: fix a bug to copy silent samples aligned to 64
* pcm: another fix for the snd_pcm_area_silence() fast path
* pcm: ioplug: Use boundary for wrap around
* pcm: Do not access lock_enabled if thread safe API
* pcm: ioplug: Provide hw_avail helper function for plugins
* pcm: Provide areas_copy function which handles buffer wrap around
* pcm: ioplug: update prepare and draining state correctly
* topology: Fix parsing config with multiple hw_configs
* pcm: hw: Keep control data from kernel when SND_PCM_APPEND
* control ext: fix the default .rawmidi_next_device callback
* modules: smixer_python - add support for python3
* a set of fixes to reduce gcc warnings
* pcm: Skip avail_min check during draining
* pcm: ioplug: Implement proper drain behavior
* conf: USB-Audio: Add second S/PDIF device on Phiree U2SX
- Remove obsoleted patches:
0001-pcm-route-Fix-use_getput-flag-computation-for-3-byte.patch
0002-conf-ucm-Rearrange-Makefile.am.patch
0003-conf-ucm-Add-dual-HD-audio-codecs-config-for-Lenovo.patch
0004-conf-ucm-Add-Gigabyte-mobo-UCM-profile-with-dual-HD-.patch
0005-conf-ucm-Add-chtrt5645-mono-speaker-analog-mic-confi.patch
0006-pcm-Return-the-consistent-error-code-for-unexpected-.patch
- Use %license file tag
-------------------------------------------------------------------
Wed Feb 28 22:33:05 CET 2018 - tiwai@suse.de

View File

@ -21,12 +21,12 @@
%define _fillupdir /var/adm/fillup-templates
%endif
%define package_version 1.1.5
%define package_version 1.1.6
%if 0%{?suse_version} < 1200
%define _udevrulesdir /lib/udev/rules.d/
%endif
Name: alsa
Version: 1.1.5
Version: 1.1.6
Release: 0
Summary: Advanced Linux Sound Architecture
License: LGPL-2.1-or-later
@ -50,12 +50,6 @@ Source34: alsa-init.sh
Source40: 50-alsa.conf
Source41: install-snd-module
# upstream fixes
Patch1: 0001-pcm-route-Fix-use_getput-flag-computation-for-3-byte.patch
Patch2: 0002-conf-ucm-Rearrange-Makefile.am.patch
Patch3: 0003-conf-ucm-Add-dual-HD-audio-codecs-config-for-Lenovo.patch
Patch4: 0004-conf-ucm-Add-Gigabyte-mobo-UCM-profile-with-dual-HD-.patch
Patch5: 0005-conf-ucm-Add-chtrt5645-mono-speaker-analog-mic-confi.patch
Patch6: 0006-pcm-Return-the-consistent-error-code-for-unexpected-.patch
# rest suse fixes
Source101: chtcx2072x.conf
Source102: chtcx2072x-HiFi.conf
@ -123,12 +117,6 @@ Architecture.
%prep
%setup -q -n alsa-lib-%{package_version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%build
export AUTOMAKE_JOBS="%{?_smp_mflags}"
@ -224,7 +212,7 @@ install -m 644 $RPM_SOURCE_DIR/sysconfig.joystick %{buildroot}%{_fillupdir}
mkdir -p %{buildroot}%{_docdir}/%{name}
cp $RPM_SOURCE_DIR/README* %{buildroot}%{_docdir}/%{name}
mkdir -p %{buildroot}%{_docdir}/%{name}/alsa-lib
cp COPYING ChangeLog INSTALL TODO MEMORY-LEAK %{buildroot}%{_docdir}/%{name}/alsa-lib
cp ChangeLog INSTALL TODO MEMORY-LEAK %{buildroot}%{_docdir}/%{name}/alsa-lib
cp doc/asoundrc.txt %{buildroot}%{_docdir}/%{name}/alsa-lib
%post
@ -253,6 +241,7 @@ exit 0
%files
%defattr(-, root, root)
%doc %{_docdir}/%{name}
%license COPYING
%if 0%{?suse_version} <= 1310
%{_initddir}/*
%endif