Compare commits

...
12 changed files with 1309 additions and 18 deletions

No files matched your search

+13 -3
View File
@@ -4,26 +4,28 @@
pkgname=device-shift-axolotl
pkgdesc="SHIFT6mq"
pkgver=5
pkgver=9999
pkgrel=1
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="
alsa-ucm-conf
linux-postmarketos-qcom-sdm845
make-dynpart-mappings
mkbootimg
postmarketos-base
postmarketos-update-kernel
soc-qcom-sdm845
soc-qcom-sdm845-ucm
soc-qcom-sdm845-qbootctl
"
makedepends="devicepkg-dev"
source="
deviceinfo
phoc.ini
q6voiced.conf
shift-axolotl.pa
"
subpackages="
$pkgname-nonfree-firmware:nonfree_firmware
@@ -41,7 +43,7 @@ package() {
nonfree_firmware() {
pkgdesc="Modem, GPU and WiFi Firmware, also needed for osk-sdl"
depends="firmware-shift-sdm845 firmware-shift-sdm845-initramfs soc-qcom-sdm845-nonfree-firmware"
mkdir "$subpkgdir"
install -Dm644 q6voiced.conf "$subpkgdir"/etc/conf.d/q6voiced
}
phosh() {
@@ -50,7 +52,15 @@ phosh() {
"$subpkgdir"/etc/phosh/phoc.ini
}
pulseaudio() {
install_if="$pkgname pulseaudio"
install -Dm644 "$srcdir"/shift-axolotl.pa \
"$subpkgdir"/etc/pulse/default.pa.d/shift-axolotl.pa
}
sha512sums="
6a075c5ea73bc2700cc5cb0325599e19b1380358f95938367150082253ab909140e2a02a496343a94b0b98b9e21a862953a0db4a023f5ceda9b7cef98250210f deviceinfo
65f74d29ab318b23f7ac8923a3661f2c4130049273a8c6be234ed2c8e00810b6a1254b54cf0932e42850a6d48f821dcd038900fbb836feeddfab2759afffae38 phoc.ini
2a3cbdad5aa91181d24a4e56e63986af6accf887c64fa4d1b6ddad1926e29050243c4b1e2fd892d38ca7c16e24dff8545a16552e5749ae31b6d01bf428468e51 q6voiced.conf
989931743ca194584d5cbc92951a0348f132d8fcf5a479f17066d3e856b65d95630e7046928ff874d0f900f26bc7a9185f7d47be4a902b4a8ad157feb8e70b99 shift-axolotl.pa
"
@@ -0,0 +1,2 @@
q6voice_card=0
q6voice_device=12
@@ -0,0 +1,5 @@
unload-module module-suspend-on-idle
# allows the full range of dB
unload-module module-udev-detect
load-module module-udev-detect ignore_dB=true
@@ -0,0 +1,296 @@
From 911a3e52a4a4f726b9ad8920654499fd154a2770 Mon Sep 17 00:00:00 2001
From: Dylan Van Assche <me@dylanvanassche.be>
Date: Fri, 17 Jun 2022 15:59:22 +0200
Subject: [PATCH 1/3] Revert "ASoC: codecs: wcd934x: Use .prepare and .shutdown
instead of .trigger"
This reverts commit 6b8fe9663ebf682c68fa9548f699672b4c88f89e.
This commit is a hack to make q6voice working, but breaks headphones and
earpiece on the WCD934x codec driver. Reverting it makes them working
again.
Signed-off-by: Dylan Van Assche <me@dylanvanassche.be>
---
sound/soc/codecs/wcd934x.c | 41 +++++++++++++++++++-------------------
1 file changed, 20 insertions(+), 21 deletions(-)
diff --git a/sound/soc/codecs/wcd934x.c b/sound/soc/codecs/wcd934x.c
index c07b89910066..f56907d0942d 100644
--- a/sound/soc/codecs/wcd934x.c
+++ b/sound/soc/codecs/wcd934x.c
@@ -1891,7 +1891,7 @@ static int wcd934x_hw_free(struct snd_pcm_substream *substream,
return 0;
}
-static int wcd934x_prepare(struct snd_pcm_substream *substream,
+static int wcd934x_trigger(struct snd_pcm_substream *substream, int cmd,
struct snd_soc_dai *dai)
{
struct wcd_slim_codec_dai_data *dai_data;
@@ -1901,26 +1901,26 @@ static int wcd934x_prepare(struct snd_pcm_substream *substream,
wcd = snd_soc_component_get_drvdata(dai->component);
dai_data = &wcd->dai[dai->id];
- cfg = &dai_data->sconfig;
-
- slim_stream_prepare(dai_data->sruntime, cfg);
- slim_stream_enable(dai_data->sruntime);
- return 0;
-}
-
-static void wcd934x_shutdown(struct snd_pcm_substream *substream,
- struct snd_soc_dai *dai)
-{
- struct wcd_slim_codec_dai_data *dai_data;
- struct wcd934x_codec *wcd;
-
- wcd = snd_soc_component_get_drvdata(dai->component);
-
- dai_data = &wcd->dai[dai->id];
+ switch (cmd) {
+ case SNDRV_PCM_TRIGGER_START:
+ case SNDRV_PCM_TRIGGER_RESUME:
+ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
+ cfg = &dai_data->sconfig;
+ slim_stream_prepare(dai_data->sruntime, cfg);
+ slim_stream_enable(dai_data->sruntime);
+ break;
+ case SNDRV_PCM_TRIGGER_STOP:
+ case SNDRV_PCM_TRIGGER_SUSPEND:
+ case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
+ slim_stream_unprepare(dai_data->sruntime);
+ slim_stream_disable(dai_data->sruntime);
+ break;
+ default:
+ break;
+ }
- slim_stream_unprepare(dai_data->sruntime);
- slim_stream_disable(dai_data->sruntime);
+ return 0;
}
static int wcd934x_set_channel_map(struct snd_soc_dai *dai,
@@ -2008,10 +2008,9 @@ static int wcd934x_get_channel_map(struct snd_soc_dai *dai,
}
static const struct snd_soc_dai_ops wcd934x_dai_ops = {
- .prepare = wcd934x_prepare,
- .shutdown = wcd934x_shutdown,
.hw_params = wcd934x_hw_params,
.hw_free = wcd934x_hw_free,
+ .trigger = wcd934x_trigger,
.set_channel_map = wcd934x_set_channel_map,
.get_channel_map = wcd934x_get_channel_map,
};
--
GitLab
From 19f1e97359338e5d7c30d544c12245650263c43d Mon Sep 17 00:00:00 2001
From: Dylan Van Assche <me@dylanvanassche.be>
Date: Sat, 18 Jun 2022 20:38:15 +0200
Subject: [PATCH 2/3] arch: arm64: qcom: sdm845-shift-axolotl: improve audio
routing
Audio on the SHIFT6mq needs to handle 3 microphones (internal bottom,
internal back, and headset through jack) together with 3 speakers
(earpiece, main speaker, and headset through jack). This requires
multiple DAIs to route everything without conflicting with each other.
This patch enables multiple MultiMedias for allowing capture and
playback and routes them the WCD9340 codec properly so each microphone
and speaker output has it own DAI link.
Signed-off-by: Dylan Van Assche <me@dylanvanassche.be>
---
.../boot/dts/qcom/sdm845-shift-axolotl.dts | 94 ++++++++++++++++++-
1 file changed, 89 insertions(+), 5 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
index f160c66906f7..29b3cb90b6b1 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
@@ -634,6 +634,18 @@ dai@1 {
dai@2 {
reg = <2>;
};
+
+ dai@3 {
+ reg = <3>;
+ };
+
+ dai@4 {
+ reg = <4>;
+ };
+
+ dai@5 {
+ reg = <5>;
+ };
};
/*
@@ -693,7 +705,13 @@ &sound {
audio-routing = "RX_BIAS", "MCLK",
"AMIC1", "MIC BIAS1",
"AMIC2", "MIC BIAS2",
- "AMIC3", "MIC BIAS3";
+ "AMIC3", "MIC BIAS3",
+ "MM_DL1", "MultiMedia1 Playback",
+ "MM_DL3", "MultiMedia3 Playback",
+ "MM_DL5", "MultiMedia5 Playback",
+ "MultiMedia2 Capture", "MM_UL2",
+ "MultiMedia4 Capture", "MM_UL4",
+ "MultiMedia6 Capture", "MM_UL6";
mm1-dai-link {
link-name = "MultiMedia1";
@@ -716,6 +734,27 @@ cpu {
};
};
+ mm4-dai-link {
+ link-name = "MultiMedia4";
+ cpu {
+ sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA4>;
+ };
+ };
+
+ mm5-dai-link {
+ link-name = "MultiMedia5";
+ cpu {
+ sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA5>;
+ };
+ };
+
+ mm6-dai-link {
+ link-name = "MultiMedia6";
+ cpu {
+ sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA6>;
+ };
+ };
+
speaker-dai-link {
link-name = "Speaker Playback";
codec {
@@ -731,10 +770,25 @@ platform {
};
};
+ slimcap-wcd-dai-link {
+ link-name = "SLIM WCD Capture 1";
+ codec {
+ sound-dai = <&wcd9340 1>; /* AIF1_CAP */
+ };
+
+ cpu {
+ sound-dai = <&q6afedai SLIMBUS_1_TX>;
+ };
+
+ platform {
+ sound-dai = <&q6routing>;
+ };
+ };
+
slim-dai-link {
- link-name = "SLIM Playback";
+ link-name = "SLIM WCD Playback 1";
codec {
- sound-dai = <&wcd9340 0>;
+ sound-dai = <&wcd9340 0>; /* AIF1_PB */
};
cpu {
@@ -747,9 +801,9 @@ platform {
};
slimcap-dai-link {
- link-name = "SLIM Capture";
+ link-name = "SLIM WCD Capture 2";
codec {
- sound-dai = <&wcd9340 1>;
+ sound-dai = <&wcd9340 3>; /* AIF2_CAP */
};
cpu {
@@ -761,6 +815,36 @@ platform {
};
};
+ slim-wcd-dai-link {
+ link-name = "SLIM WCD Playback 2";
+ codec {
+ sound-dai = <&wcd9340 2>; /* AIF2_PB */
+ };
+
+ cpu {
+ sound-dai = <&q6afedai SLIMBUS_1_RX>;
+ };
+
+ platform {
+ sound-dai = <&q6routing>;
+ };
+ };
+
+ slimcap2-wcd-dai-link {
+ link-name = "SLIM WCD Capture 3";
+ codec {
+ sound-dai = <&wcd9340 5>; /* AIF3_CAP */
+ };
+
+ cpu {
+ sound-dai = <&q6afedai SLIMBUS_2_TX>;
+ };
+
+ platform {
+ sound-dai = <&q6routing>;
+ };
+ };
+
voicemmode1-dai-link {
link-name = "VoiceMMode1";
cpu {
--
GitLab
From 9f40791a4dca96283386b5c958b9c7b1e98cf46b Mon Sep 17 00:00:00 2001
From: Dylan Van Assche <me@dylanvanassche.be>
Date: Sat, 2 Jul 2022 11:00:41 +0200
Subject: [PATCH 3/3] sound: soc: codecs: wcd-mbhc-v2: expose ALSA control for
jack
Jack detection is currently fully functional via the input
interface together with the multimedia buttons, but is not exposed
as an ALSA control. Therefore, ALSA clients such as PulseAudio
do not pick up the jack detection events as they only support
one of the possible interface (ALSA control or input interface,
but not both). Expose the jack events as a new ALSA control
as well to provide ALSA clients both interfaces.
Signed-off-by: Dylan Van Assche <me@dylanvanassche.be>
---
sound/soc/codecs/wcd-mbhc-v2.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/sound/soc/codecs/wcd-mbhc-v2.c b/sound/soc/codecs/wcd-mbhc-v2.c
index c53c2ef33e1a..2f38d67875f5 100644
--- a/sound/soc/codecs/wcd-mbhc-v2.c
+++ b/sound/soc/codecs/wcd-mbhc-v2.c
@@ -725,6 +725,11 @@ static int wcd_mbhc_initialise(struct wcd_mbhc *mbhc)
mutex_lock(&mbhc->lock);
+ /* expose ALSA control for jack detection */
+ ret = snd_jack_add_new_kctl (mbhc->jack->jack, "Headset Jack", WCD_MBHC_JACK_MASK);
+ if (ret)
+ dev_warn(component->dev, "failed creating Headset Jack kctl with err: %d\n", ret);
+
/* enable HS detection */
if (mbhc->mbhc_cb->hph_pull_up_control_v2)
mbhc->mbhc_cb->hph_pull_up_control_v2(component,
--
GitLab
@@ -6,7 +6,7 @@
_flavor="postmarketos-qcom-sdm845"
pkgname=linux-$_flavor
pkgver=5.19.7
pkgrel=0
pkgrel=1
pkgdesc="Mainline Kernel fork for SDM845 devices"
arch="aarch64"
_carch="arm64"
@@ -28,6 +28,7 @@ _tag="sdm845-5.19.7"
source="
linux-$_tag.tar.gz::https://gitlab.com/sdm845-mainline/linux/-/archive/$_tag/linux-$_tag.tar.gz
$_config
31.patch
"
builddir="$srcdir/linux-$_tag"
@@ -63,4 +64,5 @@ package() {
sha512sums="
efd6acd08d29490490fa81be57a302fffc04f14e060d0b7ed61371408c3a81749444f16349d2f803d491a2d4720c54bb34828d762c4e9d76dfb8b3084a8e8634 linux-sdm845-5.19.7.tar.gz
357c34d9853a95dd77e8f0b8265f7fdc8ac6c64cd9e15c4b86d37e88dc10bb69b8ca612f45304c8b6e956e41ff8dd3028171471af950a1af67f4eda22c9df03f config-postmarketos-qcom-sdm845.aarch64
0f92ab717c4c0ae2f2d020255ec8c09c77f13dac036acd59a943fdaba38976a30728371f9904fcbecfdea37fa83ac843f412f2d7a8d6ce8ca5b2841f38622043 31.patch
"
+5 -8
View File
@@ -1,7 +1,7 @@
# Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=postmarketos-base-ui
pkgver=4
pkgrel=3
pkgver=5
pkgrel=0
pkgdesc="Meta package for minimal postmarketOS UI base"
url="https://postmarketos.org"
arch="noarch"
@@ -41,8 +41,7 @@ _source644="
etc/conf.d/tinydm
etc/conf.d/wpa_supplicant
etc/elogind/logind.conf
etc/pulse/daemon.conf.d/90-postmarketos.conf
etc/pulse/postmarketos.pa
etc/pulse/default.pa.d/postmarketos.pa
etc/skel/.profile
etc/sleep-inhibitor.conf
etc/X11/Xwrapper.config
@@ -105,8 +104,7 @@ tinydm() {
pulseaudio() {
install_if="$pkgname=$pkgver-r$pkgrel pulseaudio"
provides="postmarketos-base-pulseaudio=$pkgver-r$pkgrel"
amove etc/pulse/postmarketos.pa
amove etc/pulse/daemon.conf.d/90-postmarketos.conf
amove etc/pulse/default.pa.d/postmarketos.pa
}
_obexd() {
@@ -127,8 +125,7 @@ e5d049db1d82c510bab9246208b51b8ec2711d008d67792fc10d4c0b65ed4dece7b5ae3c3dd28a85
44e4283c6f77de83915977dd3bc2d8e2d96b3ed6cc68d3cc156304359ae649b5a8b0bac843e517ec6faa2066dd43ba85e313899b1eda04862f864fb9eb508aa0 rootfs-etc-conf.d-tinydm
fe0651904c1f40ffa67d83daca190af199f63247e53642a59a1e1147cd06776fcf20b7b2fcc5373783d50b8bd6ce8d1354c8e5f4d582d319727b9ceefd1e8e16 rootfs-etc-conf.d-wpa_supplicant
8d2c54fe3ca62c62f8337fb6be28479d0e02ea63f32abae81907f2768631e65c9e17485f8bc0854a013377f729b06dd1873e2b75f86f657ece866d00aecbbdb4 rootfs-etc-elogind-logind.conf
4afe8c5b70f4ca85f9348eb0df12e3152b76203a1a138daa5777f22b751ea431d3ee4113189d8606078f87a99c230b184bc73d53222e6e00581e46224bf5d39f rootfs-etc-pulse-daemon.conf.d-90-postmarketos.conf
315598b67889b1f25f82b8269ed36af4fcee018a4edf2926ba966ab08e0a42e36676896d0a5636001b1eb7f16211dcf518123230049556dec9d03006e003a584 rootfs-etc-pulse-postmarketos.pa
6c516635a61fbaa93102f02301a75070a91de837456b07a50e24a9e0ee5dac785087d4a8f78906807719ebf6f0124127383441cccf00475d9a91d3dbaf9d4d81 rootfs-etc-pulse-default.pa.d-postmarketos.pa
90b30cbea660ef6cd4c0461b6935de0cd63a84a1a40edb24348a83044c97935b974bd8bafda9cd558e92d3eb69e22c5ccf55483b80f839e24f0eb57ae2df6fe3 rootfs-etc-skel-.profile
6b9c7bb73213187eb9ca8a94109b2b816f50c1158c90fec2e92b373864280d67741589e5bfbab8810945f031d2f4b535aad78a72e46e52ea50be5b85324da381 rootfs-etc-sleep-inhibitor.conf
cac604e25c46e695dd30bd5a10cfd2d69595fcc3bc290096ac94b76b10834d591ea6576afb79c46b5da492a1dbf8660cf87b6110cd39937e15237bc74fa7a5c6 rootfs-etc-X11-Xwrapper.config
@@ -1 +0,0 @@
default-script-file = /etc/pulse/postmarketos.pa
@@ -1,5 +1,3 @@
.include /etc/pulse/default.pa
# duck volume of audio streams when notification or accessibility sounds are played
load-module module-role-ducking trigger_roles=event,a11y ducking_roles=no_role,music,video,game global=true
+35
View File
@@ -0,0 +1,35 @@
From 5dfa30d0076f2be159d878f36da2a550dd8cfdd7 Mon Sep 17 00:00:00 2001
From: Dylan Van Assche <me@dylanvanassche.be>
Date: Fri, 8 Jul 2022 16:03:12 +0200
Subject: [PATCH] q6voiced: use pcm_start instead of pcm_prepare
Some drivers do their init and deinit in prepare and shutdown
callbacks. For these drivers this daemon worked already.
However, the proper way is to use the trigger callback according
to the ALSA documentation in the kernel [1].
Therefore, use pcm_start to trigger prepare, shutdown, and trigger callbacks.
[1] https://www.kernel.org/doc/html/latest/sound/kernel-api/alsa-driver-api.html#c.snd_compr_ops
---
q6voiced.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/q6voiced.c b/q6voiced.c
index c8d6e13..e2bc383 100644
--- a/q6voiced.c
+++ b/q6voiced.c
@@ -29,9 +29,9 @@ static void q6voiced_open(struct q6voiced *v)
*/
v->tx = pcm_open(v->card, v->device, PCM_IN, &pcm_config_voice_call);
v->rx = pcm_open(v->card, v->device, PCM_OUT, &pcm_config_voice_call);
- if (!pcm_is_ready(v->tx) || pcm_prepare(v->tx))
+ if (!pcm_is_ready(v->tx) || pcm_start(v->tx))
perror("Failed to open tx");
- if (!pcm_is_ready(v->rx) || pcm_prepare(v->rx))
+ if (!pcm_is_ready(v->rx) || pcm_start(v->rx))
perror("Failed to open rx");
printf("PCM devices were opened.\n");
--
GitLab
+7 -3
View File
@@ -2,7 +2,7 @@
pkgname=q6voiced
pkgver=0_git20210408
_commit="a75518e1ddf44971b1181e12c328dd250b62962a"
pkgrel=0
pkgrel=1
pkgdesc="Enable q6voice audio when call is performed with oFono/ModemManager"
url="https://github.com/msm8916-mainline/linux"
arch="all"
@@ -11,6 +11,7 @@ makedepends="tinyalsa-dev dbus-dev"
subpackages="$pkgname-openrc"
source="https://gitlab.com/postmarketOS/q6voiced/-/archive/$_commit/q6voiced-$_commit.tar.gz
q6voiced.initd
3.patch
"
options="!check" # no tests
builddir="$srcdir/q6voiced-$_commit"
@@ -25,5 +26,8 @@ package() {
install -Dm755 "$srcdir"/q6voiced.initd "$pkgdir"/etc/init.d/q6voiced
}
sha512sums="1d60d65235b152f368fd64a1b294080623542cb86fcf2f6e12e3ff7ca275a119669313c764f3dd4f07b4f57622ba618d4394f376352e88100e58df57ec1b3a3d q6voiced-a75518e1ddf44971b1181e12c328dd250b62962a.tar.gz
02e5b338f2b1ed2bbcb1f8cc29d57a5915bf5fc03bc946906b545d2c31bd16302399508bbe8000ec660eee54bb1a6407689a4f85631be727ebd963e1964a54b9 q6voiced.initd"
sha512sums="
1d60d65235b152f368fd64a1b294080623542cb86fcf2f6e12e3ff7ca275a119669313c764f3dd4f07b4f57622ba618d4394f376352e88100e58df57ec1b3a3d q6voiced-a75518e1ddf44971b1181e12c328dd250b62962a.tar.gz
02e5b338f2b1ed2bbcb1f8cc29d57a5915bf5fc03bc946906b545d2c31bd16302399508bbe8000ec660eee54bb1a6407689a4f85631be727ebd963e1964a54b9 q6voiced.initd
cc542d38117dda2f466bab8d91f20772a4e682976c3c9f22e0051f5be4a41de4ef254115d406dd9636ed109418c0633b134a0132e8517f01becde034d7a36d20 3.patch
"
+23
View File
@@ -0,0 +1,23 @@
# forked from Alpine
pkgname=alsa-ucm-conf
pkgver=1.2.7.2
pkgrel=1
pkgdesc="ALSA Use Case Manager configuration"
url="https://alsa-project.org"
arch="noarch"
license="BSD-3-Clause"
source="
https://alsa-project.org/files/pub/lib/alsa-ucm-conf-$pkgver.tar.bz2
shift6mq.patch
"
options="!check" # no tests
package() {
mkdir -p "$pkgdir"/usr/share/alsa
cp -r ucm2 "$pkgdir"/usr/share/alsa
}
sha512sums="
b6866f1ca6a3f4d69d7923bc1107a64b49944a3a8756f129f39034e5390e08db1c295669e54dfe1437ca934cc11abf407f60fc8319f5cba3f021966e8654c2db alsa-ucm-conf-1.2.7.2.tar.bz2
3bb491eb773b31d98df97a20052007f5493e7ad51e104c7be3f48c713dd547b5018fabb65a0b841eeaf2d3eaf50a9ed810e75c3066e0fed902aa0d992206ece8 shift6mq.patch
"
+920
View File
@@ -0,0 +1,920 @@
From f5eb576b3bb9f25a84ccf7a49d2ebf8029ee9925 Mon Sep 17 00:00:00 2001
From: Dylan Van Assche <me@dylanvanassche.be>
Date: Mon, 16 May 2022 16:42:34 +0200
Subject: [PATCH 1/9] ucm2: SHIFT: axolotl: add ALSA UCM config
ALSA UCM config to enable the following output devices on SHIFT 6mq:
- Speaker
- Earpiece (breaks currently on switching)
- Headphones
- Microphone bottom
- Microphone back
- Headphones microphone
Both use cases are supported: HiFi for playing music and VoiceCall to
make phone calls. No audio works yet in voice calls, probably due to a
kernel change.
---
ucm2/SHIFT/axolotl/HiFi.conf | 141 ++++++++++++++++++
ucm2/SHIFT/axolotl/axolotl.conf | 10 ++
ucm2/codecs/wcd934x/DefaultDisableSeq.conf | 5 +-
ucm2/codecs/wcd934x/DefaultEnableSeq.conf | 23 ++-
ucm2/codecs/wcd934x/HeadphoneDisableSeq.conf | 15 +-
ucm2/codecs/wcd934x/HeadphoneEnableSeq.conf | 15 +-
.../wcd934x/HeadphoneMicDisableSeq.conf | 5 +-
.../codecs/wcd934x/HeadphoneMicEnableSeq.conf | 8 +-
ucm2/codecs/wcd934x/SpeakerDisableSeq.conf | 7 +-
ucm2/codecs/wcd934x/SpeakerEnableSeq.conf | 5 +-
ucm2/codecs/wcd934x/init.conf | 22 +++
ucm2/conf.d/sdm845/SHIFT6mq.conf | 1 +
12 files changed, 221 insertions(+), 36 deletions(-)
create mode 100644 ucm2/SHIFT/axolotl/HiFi.conf
create mode 100644 ucm2/SHIFT/axolotl/axolotl.conf
create mode 100644 ucm2/codecs/wcd934x/init.conf
create mode 120000 ucm2/conf.d/sdm845/SHIFT6mq.conf
diff --git a/ucm2/SHIFT/axolotl/HiFi.conf b/ucm2/SHIFT/axolotl/HiFi.conf
new file mode 100644
index 0000000..846f941
--- /dev/null
+++ b/ucm2/SHIFT/axolotl/HiFi.conf
@@ -0,0 +1,141 @@
+# Use case configuration for SHIFT 6mq (axolotl).
+# Author: Dylan Van Assche <me@dylanvanassche.be>
+
+# OUTPUT DEVICES
+# - Internal speaker: MultiMedia1, device 0 on card 0, TFA driver, QUAT_MI2S
+# - Internal earpiece: MultiMedia3, device 1 on card 0, WCD934x driver, SLIMBUS, RX2 + RX3
+# - Jack headphones: MultiMedia5, device 1 on card 0, WCD934x driver, SLIMBUS, RX0
+# INPUT DEVICES
+# - Headphone microphone: MultiMedia2, device 1 on card 0, SLIMBUS, ADC2
+# - Internal microphone bottom: MultiMedia4, device 1 on card 0, SLIMBUS, ADC1
+# - Internal microphone back: MultiMedia6, device 1 on card 0, SLIMBUS, ADC3
+
+SectionVerb {
+
+ EnableSequence [
+ cset "name='QUAT_MI2S_RX Audio Mixer MultiMedia1' 1"
+ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia3' 1"
+ cset "name='SLIMBUS_1_RX Audio Mixer MultiMedia5' 1"
+ cset "name='MultiMedia2 Mixer SLIMBUS_0_TX' 1"
+ cset "name='MultiMedia4 Mixer SLIMBUS_1_TX' 1"
+ cset "name='MultiMedia6 Mixer SLIMBUS_2_TX' 1"
+ ]
+
+ Include.wcde.File "/codecs/wcd934x/DefaultEnableSeq.conf"
+
+ Include.wcdd {
+ File "/codecs/wcd934x/DefaultDisableSeq.conf"
+ Before.DisableSequence "0"
+ }
+
+ DisableSequence [
+ cset "name='QUAT_MI2S_RX Audio Mixer MultiMedia1' 0"
+ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia3' 0"
+ cset "name='SLIMBUS_1_RX Audio Mixer MultiMedia5' 0"
+ cset "name='MultiMedia2 Mixer SLIMBUS_0_TX' 0"
+ cset "name='MultiMedia4 Mixer SLIMBUS_1_TX' 0"
+ cset "name='MultiMedia6 Mixer SLIMBUS_2_TX' 0"
+ ]
+
+ Value {
+ TQ "HiFi"
+ }
+}
+
+SectionDevice."Speaker" {
+ Comment "Speaker playback"
+
+ Value {
+ PlaybackPriority 300
+ PlaybackPCM "hw:${CardId},0"
+ }
+}
+
+SectionDevice."Earpiece" {
+ Comment "Earpiece playback"
+
+ EnableSequence [
+ cset "name='RX INT0_1 MIX1 INP0' RX0"
+ cset "name='RX INT0 DEM MUX' CLSH_DSM_OUT"
+ ]
+
+ DisableSequence [
+ cset "name='RX INT0_1 MIX1 INP0' ZERO"
+ cset "name='RX INT0 DEM MUX' NORMAL_DSM_OUT"
+ ]
+
+ Value {
+ PlaybackPriority 100
+ PlaybackPCM "hw:${CardId},2"
+ }
+}
+
+SectionDevice."Headphones" {
+ Comment "Headphones playback"
+
+ Include.wcdhpe.File "/codecs/wcd934x/HeadphoneEnableSeq.conf"
+ Include.wcdhpd.File "/codecs/wcd934x/HeadphoneDisableSeq.conf"
+
+ Value {
+ PlaybackPriority 200
+ PlaybackPCM "hw:${CardId},4"
+ PlaybackMixer "default:${CardId}"
+ PlaybackMixerElem "HP Digital"
+ }
+}
+
+SectionDevice."Mic1" {
+ Comment "Mic headphones"
+
+ Include.wcdmice.File "/codecs/wcd934x/HeadphoneMicEnableSeq.conf"
+ Include.wcdmicd.File "/codecs/wcd934x/HeadphoneMicDisableSeq.conf"
+
+ DisableSequence [
+ cset "name='AMIC MUX0' ZERO"
+ ]
+
+ Value {
+ CapturePriority 200
+ CapturePCM "hw:${CardId},1"
+ CaptureMixerElem "ADC2"
+ }
+}
+
+SectionDevice."Mic2" {
+ Comment "Mic bottom"
+
+ EnableSequence [
+ cset "name='AMIC MUX6' ADC1"
+ cset "name='ADC MUX6' AMIC"
+ ]
+
+ DisableSequence [
+ cset "name='AMIC MUX6' ZERO"
+ ]
+
+ Value {
+ CapturePriority 300
+ CapturePCM "hw:${CardId},3"
+ CaptureMixerElem "ADC1"
+ }
+}
+
+SectionDevice."Mic3" {
+ Comment "Mic back"
+
+ EnableSequence [
+ cset "name='AMIC MUX7' ADC3"
+ cset "name='ADC MUX7' AMIC"
+ ]
+
+ DisableSequence [
+ cset "name='AMIC MUX7' ZERO"
+ ]
+
+ Value {
+ CapturePriority 100
+ CapturePCM "hw:${CardId},5"
+ CaptureMixerElem "ADC3"
+ }
+}
+
diff --git a/ucm2/SHIFT/axolotl/axolotl.conf b/ucm2/SHIFT/axolotl/axolotl.conf
new file mode 100644
index 0000000..ba8c21d
--- /dev/null
+++ b/ucm2/SHIFT/axolotl/axolotl.conf
@@ -0,0 +1,10 @@
+Syntax 3
+
+SectionUseCase."HiFi" {
+ File "/SHIFT/axolotl/HiFi.conf"
+ Comment "HiFi quality Music."
+}
+
+Include.card-init.File "/lib/card-init.conf"
+Include.ctl-remap.File "/lib/ctl-remap.conf"
+Include.codec-init.File "/codecs/wcd934x/init.conf"
diff --git a/ucm2/codecs/wcd934x/DefaultDisableSeq.conf b/ucm2/codecs/wcd934x/DefaultDisableSeq.conf
index 9df1664..2f77108 100644
--- a/ucm2/codecs/wcd934x/DefaultDisableSeq.conf
+++ b/ucm2/codecs/wcd934x/DefaultDisableSeq.conf
@@ -1,7 +1,8 @@
DisableSequence [
- cset "name='RX INT7_1 MIX1 INP0' ZERO"
- cset "name='RX INT8_1 MIX1 INP0' ZERO"
cset "name='RX INT1_2 MUX' ZERO"
cset "name='RX INT2_2 MUX' ZERO"
cset "name='CDC_IF TX0 MUX' ZERO"
+ cset "name='CDC_IF TX1 MUX' ZERO"
+ cset "name='CDC_IF TX2 MUX' ZERO"
]
+
diff --git a/ucm2/codecs/wcd934x/DefaultEnableSeq.conf b/ucm2/codecs/wcd934x/DefaultEnableSeq.conf
index 4b6f3e7..a61ccf4 100644
--- a/ucm2/codecs/wcd934x/DefaultEnableSeq.conf
+++ b/ucm2/codecs/wcd934x/DefaultEnableSeq.conf
@@ -1,16 +1,15 @@
EnableSequence [
- cset "name='SLIM RX1 MUX' AIF1_PB"
- cset "name='SLIM RX2 MUX' AIF1_PB"
- cset "name='SLIM RX6 MUX' ZERO"
- cset "name='SLIM RX7 MUX' ZERO"
- cset "name='SLIM RX3 MUX' ZERO"
- cset "name='SLIM RX4 MUX' ZERO"
- cset "name='SLIM RX5 MUX' ZERO"
- cset "name='AIF1_CAP Mixer SLIM TX0' 1"
+ cset "name='SLIM RX0 MUX' AIF1_PB"
+ cset "name='SLIM RX2 MUX' AIF2_PB"
+ cset "name='SLIM RX3 MUX' AIF2_PB"
- cset "name='RX INT7_1 MIX1 INP0' RX1"
- cset "name='RX INT8_1 MIX1 INP0' RX2"
- cset "name='RX INT1_2 MUX' RX1"
- cset "name='RX INT2_2 MUX' RX2"
+ cset "name='AIF1_CAP Mixer SLIM TX0' 1"
cset "name='CDC_IF TX0 MUX' DEC0"
+
+ cset "name='AIF2_CAP Mixer SLIM TX6' 1"
+ cset "name='CDC_IF TX6 MUX' DEC6"
+
+ cset "name='AIF3_CAP Mixer SLIM TX7' 1"
+ cset "name='CDC_IF TX7 MUX' DEC7"
]
+
diff --git a/ucm2/codecs/wcd934x/HeadphoneDisableSeq.conf b/ucm2/codecs/wcd934x/HeadphoneDisableSeq.conf
index 0206e87..3003ac0 100644
--- a/ucm2/codecs/wcd934x/HeadphoneDisableSeq.conf
+++ b/ucm2/codecs/wcd934x/HeadphoneDisableSeq.conf
@@ -1,6 +1,9 @@
-cset "name='COMP1 Switch' 0"
-cset "name='COMP2 Switch' 0"
-cset "name='RX1 Digital Volume' 0"
-cset "name='RX2 Digital Volume' 0"
-cset "name='RX INT1 DEM MUX' ZERO"
-cset "name='RX INT2 DEM MUX' ZERO"
+DisableSequence [
+ cset "name='COMP1 Switch' 0"
+ cset "name='COMP2 Switch' 0"
+ cset "name='RX INT1_1 MIX1 INP0' ZERO"
+ cset "name='RX INT2_1 MIX1 INP0' ZERO"
+ cset "name='RX INT1 DEM MUX' NORMAL_DSM_OUT"
+ cset "name='RX INT2 DEM MUX' NORMAL_DSM_OUT"
+]
+
diff --git a/ucm2/codecs/wcd934x/HeadphoneEnableSeq.conf b/ucm2/codecs/wcd934x/HeadphoneEnableSeq.conf
index 5ce7950..7ae2807 100644
--- a/ucm2/codecs/wcd934x/HeadphoneEnableSeq.conf
+++ b/ucm2/codecs/wcd934x/HeadphoneEnableSeq.conf
@@ -1,6 +1,9 @@
-cset "name='COMP1 Switch' 1"
-cset "name='COMP2 Switch' 1"
-cset "name='RX INT1 DEM MUX' CLSH_DSM_OUT"
-cset "name='RX INT2 DEM MUX' CLSH_DSM_OUT"
-cset "name='RX1 Digital Volume' 68"
-cset "name='RX2 Digital Volume' 68"
+EnableSequence [
+ cset "name='COMP1 Switch' 1"
+ cset "name='COMP2 Switch' 1"
+ cset "name='RX INT1_1 MIX1 INP0' RX2"
+ cset "name='RX INT2_1 MIX1 INP0' RX3"
+ cset "name='RX INT1 DEM MUX' CLSH_DSM_OUT"
+ cset "name='RX INT2 DEM MUX' CLSH_DSM_OUT"
+]
+
diff --git a/ucm2/codecs/wcd934x/HeadphoneMicDisableSeq.conf b/ucm2/codecs/wcd934x/HeadphoneMicDisableSeq.conf
index 5558446..591bf7e 100644
--- a/ucm2/codecs/wcd934x/HeadphoneMicDisableSeq.conf
+++ b/ucm2/codecs/wcd934x/HeadphoneMicDisableSeq.conf
@@ -1,2 +1,3 @@
-cset "name='AMIC MUX0' ZERO"
-cset "name='ADC2 Volume' 0"
+DisableSequence [
+ cset "name='AMIC MUX0' ZERO"
+]
diff --git a/ucm2/codecs/wcd934x/HeadphoneMicEnableSeq.conf b/ucm2/codecs/wcd934x/HeadphoneMicEnableSeq.conf
index ad43830..8eecdce 100644
--- a/ucm2/codecs/wcd934x/HeadphoneMicEnableSeq.conf
+++ b/ucm2/codecs/wcd934x/HeadphoneMicEnableSeq.conf
@@ -1,3 +1,5 @@
-cset "name='AMIC MUX0' ADC2"
-cset "name='ADC2 Volume' 12"
-cset "name='ADC MUX0' AMIC"
+EnableSequence [
+ cset "name='AMIC MUX0' ADC2"
+ cset "name='ADC MUX0' AMIC"
+]
+
diff --git a/ucm2/codecs/wcd934x/SpeakerDisableSeq.conf b/ucm2/codecs/wcd934x/SpeakerDisableSeq.conf
index 92f9dea..5e3ffce 100644
--- a/ucm2/codecs/wcd934x/SpeakerDisableSeq.conf
+++ b/ucm2/codecs/wcd934x/SpeakerDisableSeq.conf
@@ -1,6 +1,7 @@
DisableSequence [
- cset "name='RX7 Digital Volume' 0"
- cset "name='RX8 Digital Volume' 0"
cset "name='COMP7 Switch' 0"
cset "name='COMP8 Switch' 0"
-]
\ No newline at end of file
+ cset "name='RX INT7_1 MIX1 INP0' ZERO"
+ cset "name='RX INT8_1 MIX1 INP0' ZERO"
+]
+
diff --git a/ucm2/codecs/wcd934x/SpeakerEnableSeq.conf b/ucm2/codecs/wcd934x/SpeakerEnableSeq.conf
index 2d8d01a..25802fa 100644
--- a/ucm2/codecs/wcd934x/SpeakerEnableSeq.conf
+++ b/ucm2/codecs/wcd934x/SpeakerEnableSeq.conf
@@ -1,6 +1,7 @@
EnableSequence [
cset "name='COMP7 Switch' 1"
cset "name='COMP8 Switch' 1"
- cset "name='RX7 Digital Volume' 80"
- cset "name='RX8 Digital Volume' 80"
+ cset "name='RX INT7_1 MIX1 INP0' RX0"
+ cset "name='RX INT8_1 MIX1 INP0' RX1"
]
+
diff --git a/ucm2/codecs/wcd934x/init.conf b/ucm2/codecs/wcd934x/init.conf
new file mode 100644
index 0000000..94ed7d3
--- /dev/null
+++ b/ucm2/codecs/wcd934x/init.conf
@@ -0,0 +1,22 @@
+# WCD934X specific volume control settings
+
+BootSequence [
+ cset "name='RX0 Digital Volume' 80"
+ cset "name='RX1 Digital Volume' 80"
+ cset "name='RX2 Digital Volume' 80"
+ cset "name='ADC1 Volume' 12"
+ cset "name='ADC2 Volume' 12"
+ cset "name='ADC3 Volume' 12"
+]
+
+LibraryConfig.remap.Config {
+
+ ctl.default.map {
+ # Merge two mono controls into one stereo
+ "name='HP Digital Volume'" {
+ "name='RX1 Digital Volume'".vindex.0 0
+ "name='RX2 Digital Volume'".vindex.1 0
+ }
+ }
+}
+
diff --git a/ucm2/conf.d/sdm845/SHIFT6mq.conf b/ucm2/conf.d/sdm845/SHIFT6mq.conf
new file mode 120000
index 0000000..80c7254
--- /dev/null
+++ b/ucm2/conf.d/sdm845/SHIFT6mq.conf
@@ -0,0 +1 @@
+../../SHIFT/axolotl/axolotl.conf
\ No newline at end of file
--
2.37.1
From 909689b4295071f133bd3027838619afdbb32d8a Mon Sep 17 00:00:00 2001
From: Dylan Van Assche <me@dylanvanassche.be>
Date: Sat, 2 Jul 2022 19:07:42 +0200
Subject: [PATCH 2/9] ucm2: SHIFT: axolotl: add headphone jack detection
Add JackControl keyword to enable/disable the headphones on demand
---
ucm2/SHIFT/axolotl/HiFi.conf | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ucm2/SHIFT/axolotl/HiFi.conf b/ucm2/SHIFT/axolotl/HiFi.conf
index 846f941..1900cb2 100644
--- a/ucm2/SHIFT/axolotl/HiFi.conf
+++ b/ucm2/SHIFT/axolotl/HiFi.conf
@@ -81,6 +81,7 @@ SectionDevice."Headphones" {
PlaybackPCM "hw:${CardId},4"
PlaybackMixer "default:${CardId}"
PlaybackMixerElem "HP Digital"
+ JackControl "Headset Jack"
}
}
@@ -98,6 +99,7 @@ SectionDevice."Mic1" {
CapturePriority 200
CapturePCM "hw:${CardId},1"
CaptureMixerElem "ADC2"
+ JackControl "Headset Jack"
}
}
--
2.37.1
From 8305ccf0a131c729c204774037d3c9c913967988 Mon Sep 17 00:00:00 2001
From: Dylan Van Assche <me@dylanvanassche.be>
Date: Sun, 3 Jul 2022 16:28:10 +0200
Subject: [PATCH 3/9] ucm2: SHIFT: axolotl: always pick bottom mic as default
Back microphone is available but with a lower priority.
Bottom microphone has the highest priority
and needs to be the last microhpone as well in the UCM config
to be parsed correctly
---
ucm2/SHIFT/axolotl/HiFi.conf | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/ucm2/SHIFT/axolotl/HiFi.conf b/ucm2/SHIFT/axolotl/HiFi.conf
index 1900cb2..8073beb 100644
--- a/ucm2/SHIFT/axolotl/HiFi.conf
+++ b/ucm2/SHIFT/axolotl/HiFi.conf
@@ -104,40 +104,40 @@ SectionDevice."Mic1" {
}
SectionDevice."Mic2" {
- Comment "Mic bottom"
+ Comment "Mic back"
EnableSequence [
- cset "name='AMIC MUX6' ADC1"
- cset "name='ADC MUX6' AMIC"
+ cset "name='AMIC MUX7' ADC3"
+ cset "name='ADC MUX7' AMIC"
]
DisableSequence [
- cset "name='AMIC MUX6' ZERO"
+ cset "name='AMIC MUX7' ZERO"
]
Value {
- CapturePriority 300
- CapturePCM "hw:${CardId},3"
- CaptureMixerElem "ADC1"
+ CapturePriority 100
+ CapturePCM "hw:${CardId},5"
+ CaptureMixerElem "ADC3"
}
}
SectionDevice."Mic3" {
- Comment "Mic back"
+ Comment "Mic bottom"
EnableSequence [
- cset "name='AMIC MUX7' ADC3"
- cset "name='ADC MUX7' AMIC"
+ cset "name='AMIC MUX6' ADC1"
+ cset "name='ADC MUX6' AMIC"
]
DisableSequence [
- cset "name='AMIC MUX7' ZERO"
+ cset "name='AMIC MUX6' ZERO"
]
Value {
- CapturePriority 100
- CapturePCM "hw:${CardId},5"
- CaptureMixerElem "ADC3"
+ CapturePriority 300
+ CapturePCM "hw:${CardId},3"
+ CaptureMixerElem "ADC1"
}
}
--
2.37.1
From 7fe1e8ca243adcaf0a59400f22cce17e3f1fd5b3 Mon Sep 17 00:00:00 2001
From: Dylan Van Assche <me@dylanvanassche.be>
Date: Sun, 3 Jul 2022 20:36:13 +0200
Subject: [PATCH 4/9] ucm2: SHIFT: axolotl: use HW volume control
Needs ignore_dB=true in PulseAudio config: load-module module-udev-detect ignore_dB=true since dB scale information is invalid
---
ucm2/SHIFT/axolotl/HiFi.conf | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/ucm2/SHIFT/axolotl/HiFi.conf b/ucm2/SHIFT/axolotl/HiFi.conf
index 8073beb..60e7e9b 100644
--- a/ucm2/SHIFT/axolotl/HiFi.conf
+++ b/ucm2/SHIFT/axolotl/HiFi.conf
@@ -67,6 +67,7 @@ SectionDevice."Earpiece" {
Value {
PlaybackPriority 100
PlaybackPCM "hw:${CardId},2"
+ PlaybackVolume "EAR PA Volume"
}
}
@@ -82,6 +83,7 @@ SectionDevice."Headphones" {
PlaybackMixer "default:${CardId}"
PlaybackMixerElem "HP Digital"
JackControl "Headset Jack"
+ PlaybackVolume "HP Digital Volume"
}
}
@@ -100,6 +102,7 @@ SectionDevice."Mic1" {
CapturePCM "hw:${CardId},1"
CaptureMixerElem "ADC2"
JackControl "Headset Jack"
+ CaptureVolume "ADC2 Volume"
}
}
@@ -119,6 +122,7 @@ SectionDevice."Mic2" {
CapturePriority 100
CapturePCM "hw:${CardId},5"
CaptureMixerElem "ADC3"
+ CaptureVolume "ADC3 Volume"
}
}
@@ -138,6 +142,6 @@ SectionDevice."Mic3" {
CapturePriority 300
CapturePCM "hw:${CardId},3"
CaptureMixerElem "ADC1"
+ CaptureVolume "ADC1 Volume"
}
}
-
--
2.37.1
From b98304045e5aed4662e9cf464966260d386e2f82 Mon Sep 17 00:00:00 2001
From: Dylan Van Assche <me@dylanvanassche.be>
Date: Mon, 4 Jul 2022 16:08:46 +0200
Subject: [PATCH 5/9] ucm2: SHIFT: axolotl: use bottom mic for voice calls
q6voice driver expects mic for voice calls to be on SLIMBUS_0_TX
---
ucm2/SHIFT/axolotl/HiFi.conf | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ucm2/SHIFT/axolotl/HiFi.conf b/ucm2/SHIFT/axolotl/HiFi.conf
index 60e7e9b..4fd3447 100644
--- a/ucm2/SHIFT/axolotl/HiFi.conf
+++ b/ucm2/SHIFT/axolotl/HiFi.conf
@@ -99,7 +99,7 @@ SectionDevice."Mic1" {
Value {
CapturePriority 200
- CapturePCM "hw:${CardId},1"
+ CapturePCM "hw:${CardId},3"
CaptureMixerElem "ADC2"
JackControl "Headset Jack"
CaptureVolume "ADC2 Volume"
@@ -140,7 +140,7 @@ SectionDevice."Mic3" {
Value {
CapturePriority 300
- CapturePCM "hw:${CardId},3"
+ CapturePCM "hw:${CardId},1"
CaptureMixerElem "ADC1"
CaptureVolume "ADC1 Volume"
}
--
2.37.1
From 38be6b2992b5b487f5a43601f298ef864715cb83 Mon Sep 17 00:00:00 2001
From: Dylan Van Assche <me@dylanvanassche.be>
Date: Wed, 6 Jul 2022 18:34:59 +0200
Subject: [PATCH 6/9] ucm2: SHIFT: axolotl: LibraryConfig is not supported in
syntax v3
Maybe in higher versions of the ALSA UCM syntax, but upgrading breaks other things, let's keep it for now
---
ucm2/SHIFT/axolotl/HiFi.conf | 1 -
ucm2/SHIFT/axolotl/axolotl.conf | 1 -
ucm2/codecs/wcd934x/init.conf | 12 ------------
3 files changed, 14 deletions(-)
diff --git a/ucm2/SHIFT/axolotl/HiFi.conf b/ucm2/SHIFT/axolotl/HiFi.conf
index 4fd3447..0fd86c7 100644
--- a/ucm2/SHIFT/axolotl/HiFi.conf
+++ b/ucm2/SHIFT/axolotl/HiFi.conf
@@ -83,7 +83,6 @@ SectionDevice."Headphones" {
PlaybackMixer "default:${CardId}"
PlaybackMixerElem "HP Digital"
JackControl "Headset Jack"
- PlaybackVolume "HP Digital Volume"
}
}
diff --git a/ucm2/SHIFT/axolotl/axolotl.conf b/ucm2/SHIFT/axolotl/axolotl.conf
index ba8c21d..e54878b 100644
--- a/ucm2/SHIFT/axolotl/axolotl.conf
+++ b/ucm2/SHIFT/axolotl/axolotl.conf
@@ -6,5 +6,4 @@ SectionUseCase."HiFi" {
}
Include.card-init.File "/lib/card-init.conf"
-Include.ctl-remap.File "/lib/ctl-remap.conf"
Include.codec-init.File "/codecs/wcd934x/init.conf"
diff --git a/ucm2/codecs/wcd934x/init.conf b/ucm2/codecs/wcd934x/init.conf
index 94ed7d3..d24a086 100644
--- a/ucm2/codecs/wcd934x/init.conf
+++ b/ucm2/codecs/wcd934x/init.conf
@@ -8,15 +8,3 @@ BootSequence [
cset "name='ADC2 Volume' 12"
cset "name='ADC3 Volume' 12"
]
-
-LibraryConfig.remap.Config {
-
- ctl.default.map {
- # Merge two mono controls into one stereo
- "name='HP Digital Volume'" {
- "name='RX1 Digital Volume'".vindex.0 0
- "name='RX2 Digital Volume'".vindex.1 0
- }
- }
-}
-
--
2.37.1
From a6109c61022b89d76fb3f22771777296bc3a0dcf Mon Sep 17 00:00:00 2001
From: Dylan Van Assche <me@dylanvanassche.be>
Date: Wed, 6 Jul 2022 18:45:34 +0200
Subject: [PATCH 7/9] ucm2: SHIFT: axolotl: improve headset support
Set headset priority to highest so it automatically switches to it when plugged in and drop earpiece in HiFi
---
ucm2/SHIFT/axolotl/HiFi.conf | 31 +++++--------------------------
1 file changed, 5 insertions(+), 26 deletions(-)
diff --git a/ucm2/SHIFT/axolotl/HiFi.conf b/ucm2/SHIFT/axolotl/HiFi.conf
index 0fd86c7..fa06fdd 100644
--- a/ucm2/SHIFT/axolotl/HiFi.conf
+++ b/ucm2/SHIFT/axolotl/HiFi.conf
@@ -14,7 +14,6 @@ SectionVerb {
EnableSequence [
cset "name='QUAT_MI2S_RX Audio Mixer MultiMedia1' 1"
- cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia3' 1"
cset "name='SLIMBUS_1_RX Audio Mixer MultiMedia5' 1"
cset "name='MultiMedia2 Mixer SLIMBUS_0_TX' 1"
cset "name='MultiMedia4 Mixer SLIMBUS_1_TX' 1"
@@ -30,7 +29,6 @@ SectionVerb {
DisableSequence [
cset "name='QUAT_MI2S_RX Audio Mixer MultiMedia1' 0"
- cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia3' 0"
cset "name='SLIMBUS_1_RX Audio Mixer MultiMedia5' 0"
cset "name='MultiMedia2 Mixer SLIMBUS_0_TX' 0"
cset "name='MultiMedia4 Mixer SLIMBUS_1_TX' 0"
@@ -46,31 +44,11 @@ SectionDevice."Speaker" {
Comment "Speaker playback"
Value {
- PlaybackPriority 300
+ PlaybackPriority 200
PlaybackPCM "hw:${CardId},0"
}
}
-SectionDevice."Earpiece" {
- Comment "Earpiece playback"
-
- EnableSequence [
- cset "name='RX INT0_1 MIX1 INP0' RX0"
- cset "name='RX INT0 DEM MUX' CLSH_DSM_OUT"
- ]
-
- DisableSequence [
- cset "name='RX INT0_1 MIX1 INP0' ZERO"
- cset "name='RX INT0 DEM MUX' NORMAL_DSM_OUT"
- ]
-
- Value {
- PlaybackPriority 100
- PlaybackPCM "hw:${CardId},2"
- PlaybackVolume "EAR PA Volume"
- }
-}
-
SectionDevice."Headphones" {
Comment "Headphones playback"
@@ -78,7 +56,7 @@ SectionDevice."Headphones" {
Include.wcdhpd.File "/codecs/wcd934x/HeadphoneDisableSeq.conf"
Value {
- PlaybackPriority 200
+ PlaybackPriority 300
PlaybackPCM "hw:${CardId},4"
PlaybackMixer "default:${CardId}"
PlaybackMixerElem "HP Digital"
@@ -97,7 +75,7 @@ SectionDevice."Mic1" {
]
Value {
- CapturePriority 200
+ CapturePriority 300
CapturePCM "hw:${CardId},3"
CaptureMixerElem "ADC2"
JackControl "Headset Jack"
@@ -138,9 +116,10 @@ SectionDevice."Mic3" {
]
Value {
- CapturePriority 300
+ CapturePriority 200
CapturePCM "hw:${CardId},1"
CaptureMixerElem "ADC1"
CaptureVolume "ADC1 Volume"
}
}
+
--
2.37.1
From 0606ac876df1213ac22d072d7d619f772618bd78 Mon Sep 17 00:00:00 2001
From: Dylan Van Assche <me@dylanvanassche.be>
Date: Thu, 7 Jul 2022 19:54:05 +0200
Subject: [PATCH 8/9] ucm2: SHIFT: axolotl: use better names
Use consistent device names for a nicer look in overlay UI for audio
---
ucm2/SHIFT/axolotl/HiFi.conf | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/ucm2/SHIFT/axolotl/HiFi.conf b/ucm2/SHIFT/axolotl/HiFi.conf
index fa06fdd..44cdacc 100644
--- a/ucm2/SHIFT/axolotl/HiFi.conf
+++ b/ucm2/SHIFT/axolotl/HiFi.conf
@@ -41,7 +41,7 @@ SectionVerb {
}
SectionDevice."Speaker" {
- Comment "Speaker playback"
+ Comment "Speaker"
Value {
PlaybackPriority 200
@@ -50,7 +50,7 @@ SectionDevice."Speaker" {
}
SectionDevice."Headphones" {
- Comment "Headphones playback"
+ Comment "Headset"
Include.wcdhpe.File "/codecs/wcd934x/HeadphoneEnableSeq.conf"
Include.wcdhpd.File "/codecs/wcd934x/HeadphoneDisableSeq.conf"
@@ -65,7 +65,7 @@ SectionDevice."Headphones" {
}
SectionDevice."Mic1" {
- Comment "Mic headphones"
+ Comment "Headset microphone"
Include.wcdmice.File "/codecs/wcd934x/HeadphoneMicEnableSeq.conf"
Include.wcdmicd.File "/codecs/wcd934x/HeadphoneMicDisableSeq.conf"
@@ -84,7 +84,7 @@ SectionDevice."Mic1" {
}
SectionDevice."Mic2" {
- Comment "Mic back"
+ Comment "Microphone back"
EnableSequence [
cset "name='AMIC MUX7' ADC3"
@@ -104,7 +104,7 @@ SectionDevice."Mic2" {
}
SectionDevice."Mic3" {
- Comment "Mic bottom"
+ Comment "Microphone bottom"
EnableSequence [
cset "name='AMIC MUX6' ADC1"
--
2.37.1
From c3ac12d627f937a8289fb6dba827a9a3ce436e3e Mon Sep 17 00:00:00 2001
From: Dylan Van Assche <me@dylanvanassche.be>
Date: Thu, 7 Jul 2022 19:54:36 +0200
Subject: [PATCH 9/9] ucm2: SHIFT: axolotl: add Voice Call use case
Enable voice calls on SHIFT 6mq
---
ucm2/SHIFT/axolotl/VoiceCall.conf | 82 +++++++++++++++++++++++++++++++
ucm2/SHIFT/axolotl/axolotl.conf | 6 +++
2 files changed, 88 insertions(+)
create mode 100644 ucm2/SHIFT/axolotl/VoiceCall.conf
diff --git a/ucm2/SHIFT/axolotl/VoiceCall.conf b/ucm2/SHIFT/axolotl/VoiceCall.conf
new file mode 100644
index 0000000..8c5b03d
--- /dev/null
+++ b/ucm2/SHIFT/axolotl/VoiceCall.conf
@@ -0,0 +1,82 @@
+# Use case configuration for SHIFT 6mq (axolotl).
+# Author: Dylan Van Assche <me@dylanvanassche.be>
+
+# OUTPUT DEVICES
+# - Internal speaker: MultiMedia1, device 0 on card 0, TFA driver, QUAT_MI2S
+# - Internal earpiece: MultiMedia3, device 1 on card 0, WCD934x driver, SLIMBUS, RX2 + RX3
+# - Jack headphones: MultiMedia5, device 1 on card 0, WCD934x driver, SLIMBUS, RX0
+# INPUT DEVICES
+# - Headphone microphone: MultiMedia2, device 1 on card 0, SLIMBUS, ADC2
+# - Internal microphone bottom: MultiMedia4, device 1 on card 0, SLIMBUS, ADC1
+# - Internal microphone back: MultiMedia6, device 1 on card 0, SLIMBUS, ADC3
+
+SectionVerb {
+
+ EnableSequence [
+ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia3' 1"
+ cset "name='SLIMBUS_0_RX Voice Mixer VoiceMMode1' 1"
+ cset "name='MultiMedia2 Mixer SLIMBUS_0_TX' 1"
+ cset "name='VoiceMMode1 Capture Mixer SLIMBUS_0_TX' 1"
+ ]
+
+ Include.wcde.File "/codecs/wcd934x/DefaultEnableSeq.conf"
+
+ Include.wcdd {
+ File "/codecs/wcd934x/DefaultDisableSeq.conf"
+ Before.DisableSequence "0"
+ }
+
+ DisableSequence [
+ cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia3' 0"
+ cset "name='SLIMBUS_0_RX Voice Mixer VoiceMMode1' 0"
+ cset "name='MultiMedia2 Mixer SLIMBUS_0_TX' 1"
+ cset "name='VoiceMMode1 Capture Mixer SLIMBUS_0_TX' 0"
+ ]
+
+ Value {
+ TQ "Voice"
+ }
+}
+
+SectionDevice."Earpiece" {
+ Comment "Earpiece"
+
+ EnableSequence [
+ cset "name='RX INT0_1 MIX1 INP0' RX0"
+ cset "name='RX INT0 DEM MUX' CLSH_DSM_OUT"
+ ]
+
+ DisableSequence [
+ cset "name='RX INT0_1 MIX1 INP0' ZERO"
+ cset "name='RX INT0 DEM MUX' NORMAL_DSM_OUT"
+ ]
+
+ Value {
+ PlaybackPriority 100
+ PlaybackPCM "hw:${CardId},2"
+ PlaybackVolume "EAR PA Volume"
+ }
+
+}
+
+SectionDevice."Mic" {
+ # Bottom microphone is used for calls
+ Comment "Microphone"
+
+ EnableSequence [
+ cset "name='AMIC MUX6' ADC1"
+ cset "name='ADC MUX6' AMIC"
+ ]
+
+ DisableSequence [
+ cset "name='AMIC MUX6' ZERO"
+ ]
+
+ Value {
+ CapturePriority 200
+ CapturePCM "hw:${CardId},1"
+ CaptureMixerElem "ADC1"
+ CaptureVolume "ADC1 Volume"
+ }
+}
+
diff --git a/ucm2/SHIFT/axolotl/axolotl.conf b/ucm2/SHIFT/axolotl/axolotl.conf
index e54878b..e8d21f6 100644
--- a/ucm2/SHIFT/axolotl/axolotl.conf
+++ b/ucm2/SHIFT/axolotl/axolotl.conf
@@ -5,5 +5,11 @@ SectionUseCase."HiFi" {
Comment "HiFi quality Music."
}
+SectionUseCase."Voice Call" {
+ File "/SHIFT/axolotl/VoiceCall.conf"
+ Comment "Make a phone call."
+}
+
Include.card-init.File "/lib/card-init.conf"
Include.codec-init.File "/codecs/wcd934x/init.conf"
+
--
2.37.1