samsung-goyawifi: fix ALSA audio and pulseaudio compatibility (MR 3912)

This commit is contained in:
Adrian Chelaru 2023-02-13 10:56:01 +00:00 committed by Newbyte
parent 615d6f0ebe
commit 7a4b53d2af
No known key found for this signature in database
GPG key ID: 990600ED1DB95E02
6 changed files with 237 additions and 2 deletions

View file

@ -1,13 +1,14 @@
# Reference: <https://postmarketos.org/devicepkg> # Reference: <https://postmarketos.org/devicepkg>
pkgname=device-samsung-goyawifi pkgname=device-samsung-goyawifi
pkgdesc="Samsung Galaxy Tab 3 Lite" pkgdesc="Samsung Galaxy Tab 3 Lite"
pkgver=0.2 pkgver=0.3
pkgrel=0 pkgrel=0
url="https://postmarketos.org" url="https://postmarketos.org"
license="MIT" license="MIT"
arch="armv7" arch="armv7"
options="!check !archcheck" options="!check !archcheck"
depends=" depends="
alsa-ucm-conf
linux-samsung-goyawifi linux-samsung-goyawifi
mkbootimg mkbootimg
postmarketos-base postmarketos-base
@ -20,6 +21,9 @@ source="
dhcp-client.conf dhcp-client.conf
ipv4-workaround.sh ipv4-workaround.sh
etc-lightdm-lightdm.conf etc-lightdm-lightdm.conf
initfs-hook.sh
ucm/HiFi.conf
ucm/emei-dkb-hifi.conf
" "
subpackages=" subpackages="
$pkgname-nonfree-firmware:nonfree_firmware $pkgname-nonfree-firmware:nonfree_firmware
@ -39,6 +43,12 @@ package() {
"$pkgdir"/etc/modprobe.d/goyawifi.conf "$pkgdir"/etc/modprobe.d/goyawifi.conf
install -D -m644 "$srcdir"/sd8xxx.conf \ install -D -m644 "$srcdir"/sd8xxx.conf \
"$pkgdir"/lib/modules-load.d/sd8xxx.conf "$pkgdir"/lib/modules-load.d/sd8xxx.conf
# Alsa UCM configs
install -Dm644 "$srcdir"/emei-dkb-hifi.conf \
"$pkgdir"/usr/share/alsa/ucm2/conf.d/emei-dkb-hifi/emei-dkb-hifi.conf
install -Dm644 "$srcdir"/HiFi.conf \
"$pkgdir"/usr/share/alsa/ucm2/conf.d/emei-dkb-hifi/HiFi.conf
} }
nonfree_firmware() { nonfree_firmware() {
@ -78,4 +88,7 @@ sha512sums="
c1c9b58b5325ad11afc98bf1b20179c725b7627416270fe87558bdc259fbb996628d404aaaef6e8c9ea41c21b015ae767ce1c3054490481c24cc97d0002d69bb dhcp-client.conf c1c9b58b5325ad11afc98bf1b20179c725b7627416270fe87558bdc259fbb996628d404aaaef6e8c9ea41c21b015ae767ce1c3054490481c24cc97d0002d69bb dhcp-client.conf
6d7178d18288f4ca9b8ad70b9fd9a28882c1a724448c9e4866224d6ffb5d1e7580ef402701b59cc67f880c7edcecd24ba37deba461ec1ed51889c5eb6bf2350a ipv4-workaround.sh 6d7178d18288f4ca9b8ad70b9fd9a28882c1a724448c9e4866224d6ffb5d1e7580ef402701b59cc67f880c7edcecd24ba37deba461ec1ed51889c5eb6bf2350a ipv4-workaround.sh
861270c6bc0b2a3e6cd389c21c8c895e62de8cf8bec6fcf23c178f8cbaae855d62b0ee98692671ab4f518d84cb43dd0b2fe46f5a609f65af6a6c06e0fdbb6d0c etc-lightdm-lightdm.conf 861270c6bc0b2a3e6cd389c21c8c895e62de8cf8bec6fcf23c178f8cbaae855d62b0ee98692671ab4f518d84cb43dd0b2fe46f5a609f65af6a6c06e0fdbb6d0c etc-lightdm-lightdm.conf
efcf13b927a984bc99b86ea0fee907a7be555d02bb38cc7e020c53120be8a1cd9c53ec1754b316b6422621fc13768e81fd00b837713178f5024e12664dad47d5 initfs-hook.sh
a947334f0e8a3b46ab7905a7291ea0cb94b4f73303ec1f7307478a5a7a316300907af033eb58035044738701185ef715ff22eb168f2eba281728d2ef039ffac9 HiFi.conf
80d44e328e31eacdaba6a56536ab68bcbda71e20be1fb62e8a13262ad165ce9de0d92c88bae9079b38a02956b8fa5a81e8675a21b5a825587542a786d12817f2 emei-dkb-hifi.conf
" "

View file

@ -0,0 +1,4 @@
#!/bin/sh
# Fix ALSA audio play
echo 1 > /proc/driver/ssp_master

View file

@ -0,0 +1,156 @@
SectionVerb {
EnableSequence [
cset 'name="PM805_CODEC_ADCS_SETTING_1" 0'
cset 'name="PM805_CODEC_ADCS_SETTING_2" 0'
cset 'name="PM805_CODEC_ADCS_SETTING_3" 2'
cset 'name="PM805_CODEC_ADC_GAIN_1" 0'
cset 'name="PM805_CODEC_ADC_GAIN_2" 0'
cset 'name="PM805_CODEC_ADC_SETTING_1" 3'
cset 'name="PM805_CODEC_ADC_SETTING_2" 85'
cset 'name="PM805_CODEC_ADC_SETTING_3" 4'
cset 'name="PM805_CODEC_ADC_SETTING_4" 2'
cset 'name="PM805_CODEC_ANALOG_BLOCK_EN" 45'
cset 'name="PM805_CODEC_ANALOG_BLOCK_STS_1" 31'
cset 'name="PM805_CODEC_ANALOG_BLOCK_STS_2" 1'
cset 'name="PM805_CODEC_AUTO_SEQUENCE_SETTING" 0'
cset 'name="PM805_CODEC_AUTO_SEQUENCE_STS_1" 169'
cset 'name="PM805_CODEC_AUTO_SEQUENCE_STS_2" 0'
cset 'name="PM805_CODEC_CHARGE_PUMP_SETTING_1" 136'
cset 'name="PM805_CODEC_CHARGE_PUMP_SETTING_2" 22'
cset 'name="PM805_CODEC_CHARGE_PUMP_SETTING_3" 22'
cset 'name="PM805_CODEC_CLIP_BITS_1" 0'
cset 'name="PM805_CODEC_CLIP_BITS_2" 0'
cset 'name="PM805_CODEC_CLIP_BITS_3" 0'
cset 'name="PM805_CODEC_CLOCK_SETTING" 0'
cset 'name="PM805_CODEC_DIGITAL_BLOCK_EN_2" 21'
cset 'name="PM805_CODEC_DIGITAL_BLOCK_EN_1" 31'
cset 'name="PM805_CODEC_DMIC_SETTING" 0'
cset 'name="PM805_CODEC_DWA_SETTING" 9'
cset 'name="PM805_CODEC_DWS_SETTING" 0'
cset 'name="PM805_CODEC_EARPHONE_SETTING" 0'
cset 'name="PM805_CODEC_FLL_SPREAD_SPECTRUM_1" 68'
cset 'name="PM805_CODEC_FLL_SPREAD_SPECTRUM_2" 113'
cset 'name="PM805_CODEC_FLL_SPREAD_SPECTRUM_3" 18'
cset 'name="PM805_CODEC_FLL_STS" 0'
cset 'name="PM805_CODEC_HEADPHONE_AMP_SETTING" 64'
cset 'name="PM805_CODEC_HEADPHONE_GAIN_A2A" 0'
cset 'name="PM805_CODEC_HEADPHONE_SETTING" 0'
cset 'name="PM805_CODEC_HEADPHONE_SHORT_STS" 0'
cset 'name="PM805_CODEC_HEAD_EAR_PHONE_SETTING" 8'
cset 'name="PM805_CODEC_ID" 6'
cset 'name="PM805_CODEC_INT_MANAGEMENT" 0'
cset 'name="PM805_CODEC_INT_MASK_1" 195'
cset 'name="PM805_CODEC_INT_MASK_2" 192'
cset 'name="PM805_CODEC_MAIN_POWERUP" 3'
cset 'name="PM805_CODEC_MIC_CONFLICT_STS" 0'
cset 'name="PM805_CODEC_MIC_DETECT_1" 0'
cset 'name="PM805_CODEC_MIC_DETECT_2" 0'
cset 'name="PM805_CODEC_MIC_DETECT_3" 4'
cset 'name="PM805_CODEC_MIC_DETECT_STS" 0'
cset 'name="PM805_CODEC_MIX_EQ_COEFFICIENT_1" 0'
cset 'name="PM805_CODEC_MIX_EQ_COEFFICIENT_2" 1'
cset 'name="PM805_CODEC_MIX_EQ_COEFFICIENT_4" 0'
cset 'name="PM805_CODEC_PAD_ANALOG_SETTING" 16'
cset 'name="PM805_CODEC_PDM_CONTROL_1" 0'
cset 'name="PM805_CODEC_PDM_CONTROL_2" 0'
cset 'name="PM805_CODEC_PDM_CONTROL_3" 0'
cset 'name="PM805_CODEC_PDM_SETTING_1" 193'
cset 'name="PM805_CODEC_PDM_SETTING_2" 65'
cset 'name="PM805_CODEC_PDM_SETTING_3" 0'
cset 'name="PM805_CODEC_POWER_AMP_ENABLE" 0'
cset 'name="PM805_CODEC_RECONSTRUCTION_FILTER_1" 5'
cset 'name="PM805_CODEC_RECONSTRUCTION_FILTER_2" 0'
cset 'name="PM805_CODEC_RECONSTRUCTION_FILTER_3" 0'
cset 'name="PM805_CODEC_REF_GROUP_SETTING_1" 126'
cset 'name="PM805_CODEC_SAI1_SETTING_1" 14'
cset 'name="PM805_CODEC_SAI1_SETTING_2" 73'
cset 'name="PM805_CODEC_SAI1_SETTING_3" 4'
cset 'name="PM805_CODEC_SAI1_SETTING_4" 0'
cset 'name="PM805_CODEC_SAI1_SETTING_5" 0'
cset 'name="PM805_CODEC_SAI2_SETTING_1" 0'
cset 'name="PM805_CODEC_SAI2_SETTING_2" 0'
cset 'name="PM805_CODEC_SAI2_SETTING_3" 0'
cset 'name="PM805_CODEC_SAI2_SETTING_4" 0'
cset 'name="PM805_CODEC_SAI2_SETTING_5" 0'
cset 'name="PM805_CODEC_SDM_VOL_DELAY" 0'
cset 'name="PM805_CODEC_SIDETONE_COEFFICIENT_1" 0'
cset 'name="PM805_CODEC_SIDETONE_COEFFICIENT_2" 0'
cset 'name="PM805_CODEC_SIDETONE_COEFFICIENT_3" 0'
cset 'name="PM805_CODEC_SIDETONE_COEFFICIENT_4" 0'
cset 'name="PM805_CODEC_SIDETONE_SETTING" 0'
cset 'name="PM805_CODEC_SRC_DPLL_LOCK" 0'
cset 'name="PM805_CODEC_SRC_SETTING_1" 0'
cset 'name="PM805_CODEC_SRC_SETTING_2" 18'
cset 'name="PM805_CODEC_SRC_SETTING_3" 0'
cset 'name="PM805_CODEC_VOL_CHANNEL_1_2_SEL" 0'
cset 'name="PM805_CODEC_VOL_CHANNLE_3_4_SEL" 0'
cset 'name="PM805_CODEC_VOL_CTRL_PARAM_SEL" 32'
cset 'name="PM805_CODEC_VOL_SEL_CHANNEL_1" 0'
cset 'name="PM805_CODEC_VOL_SEL_CHANNEL_2" 0'
cset 'name="PM805_CODEC_VOL_SEL_CHANNEL_3" 183'
cset 'name="PM805_CODEC_VOL_SEL_CHANNEL_4" 0'
cset 'name="PM805_CODEC_ZERO_CROSS_AUTOMUTE" 5'
cset 'name="PM822_CLASS_D_1" 243'
cset 'name="PM822_MIS_CLASS_D_1" 194'
cset 'name="PM822_MIS_CLASS_D_2" 112'
]
DisableSequence [
cset 'name="PM805_CODEC_MAIN_POWERUP" 0'
cset 'name="PM805_CODEC_SAI1_SETTING_1" 6'
cset 'name="PM805_CODEC_DIGITAL_BLOCK_EN_2" 0'
cset 'name="PM805_CODEC_DIGITAL_BLOCK_EN_1" 0'
cset 'name="PM805_CODEC_PDM_SETTING_2" 0'
cset 'name="PM805_CODEC_PDM_SETTING_1" 0'
cset 'name="PM805_CODEC_VOL_CTRL_PARAM_SEL" 0'
cset 'name="PM822_MIS_CLASS_D_2" 48'
cset 'name="PM822_MIS_CLASS_D_1" 206'
cset 'name="PM822_CLASS_D_1" 0'
]
}
SectionDevice."Speaker" {
Comment "Internal speaker"
EnableSequence [
cset 'name="PM805_CODEC_MIX_EQ_COEFFICIENT_3" 28'
]
DisableSequence [
cset 'name="PM805_CODEC_MIX_EQ_COEFFICIENT_3" 0'
]
Value {
PlaybackPriority 100
PlaybackPCM "hw:${CardId}"
}
}
SectionDevice."Mic" {
Comment "Internal mic"
EnableSequence [
cset 'name="PM805_CODEC_DWS_SETTING" 1'
cset 'name="PM805_CODEC_ADC_SETTING_2" 86'
cset 'name="PM805_CODEC_ADC_SETTING_4" 3'
cset 'name="PM805_CODEC_SRC_SETTING_2" 0'
]
DisableSequence [
cset 'name="PM805_CODEC_DWS_SETTING" 0'
cset 'name="PM805_CODEC_ADC_SETTING_2" 0'
cset 'name="PM805_CODEC_ADC_SETTING_4" 2'
cset 'name="PM805_CODEC_SRC_SETTING_2" 1'
]
Value {
CapturePriority 100
CapturePCM "hw:${CardId}"
}
}

View file

@ -0,0 +1,6 @@
Syntax 2
SectionUseCase."HiFi" {
File "HiFi.conf"
Comment "Play high quality music"
}

View file

@ -0,0 +1,54 @@
From 98b7abe4eed2a3919f3064049e13a5b2e21aff56 Mon Sep 17 00:00:00 2001
From: Adrian Chelaru <che.adrian@yahoo.com>
Date: Sun, 12 Feb 2023 11:01:28 +0000
Subject: [PATCH] Fix ALSA CTL CODEC EQ_COEFFICIENT_3
---
sound/soc/codecs/88pm805-codec.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/sound/soc/codecs/88pm805-codec.c b/sound/soc/codecs/88pm805-codec.c
index e53b7b86..03f16360 100644
--- a/sound/soc/codecs/88pm805-codec.c
+++ b/sound/soc/codecs/88pm805-codec.c
@@ -169,12 +169,13 @@ static int pm805_bulk_read_reg(struct snd_kcontrol *kcontrol,
int i, count = 0;
struct pm80x_chip *chip = (struct pm80x_chip *)codec->control_data;
- count = (ucontrol->value.integer.value[0] & 0xff);
+ //count = (ucontrol->value.integer.value[0] & 0xff);
+ count = PM805_MIXER_COEFFICIENT_MAX_NUM-1;
- if (count < 1 || count >= PM805_MIXER_COEFFICIENT_MAX_NUM) {
- pr_info("error count %d, must between 1~64\n", count);
- return -EINVAL;
- }
+ //if (count < 1 || count >= PM805_MIXER_COEFFICIENT_MAX_NUM) {
+ // pr_info("error count %d, must between 1~64\n", count);
+ // return -EINVAL;
+ //}
pr_debug("%s: 0x%x, count %d\n", __func__, reg, count);
@@ -199,12 +200,13 @@ static int pm805_bulk_write_reg(struct snd_kcontrol *kcontrol,
int i, count = 0;
struct pm80x_chip *chip = (struct pm80x_chip *)codec->control_data;
- count = (ucontrol->value.integer.value[0] & 0xff);
+ //count = (ucontrol->value.integer.value[0] & 0xff);
+ count = PM805_MIXER_COEFFICIENT_MAX_NUM-1;
- if (count < 1 || count > PM805_MIXER_COEFFICIENT_MAX_NUM) {
- pr_info("error count %d, must between 1~32\n", count);
- return -EINVAL;
- }
+ //if (count < 1 || count > PM805_MIXER_COEFFICIENT_MAX_NUM) {
+ // pr_info("error count %d, must between 1~32\n", count);
+ // return -EINVAL;
+ //}
pr_debug("%s: 0x%x, count %d\n", __func__, reg, count);
--
2.38.3

View file

@ -3,7 +3,7 @@
pkgname=linux-samsung-goyawifi pkgname=linux-samsung-goyawifi
pkgver=3.4.5 pkgver=3.4.5
pkgrel=1 pkgrel=2
pkgdesc="Samsung Galaxy Tab 3 Lite kernel fork" pkgdesc="Samsung Galaxy Tab 3 Lite kernel fork"
arch="armv7" arch="armv7"
_carch="arm" _carch="arm"
@ -39,6 +39,7 @@ source="
0003-Backport-shm-add-memfd-create-syscall.patch 0003-Backport-shm-add-memfd-create-syscall.patch
0004-Backport-asm-generic-add-memfd_create-system-call-to.patch 0004-Backport-asm-generic-add-memfd_create-system-call-to.patch
0005-Backport-ARM-wire-up-memfd_create-syscall.patch 0005-Backport-ARM-wire-up-memfd_create-syscall.patch
0006-Fix-ALSA-CTL-CODEC-EQ_COEFFICIENT_3.patch
" "
builddir="$srcdir/$_repository-$_commit" builddir="$srcdir/$_repository-$_commit"
@ -77,4 +78,5 @@ fb16404be045f4d9c7bf29512321ec2a4cb17111a8c870adff91889f0e6b314265cddb5dd9caa808
560b46dab45b14fa0a9fbdb9ddb2bb597a9914b25bb5591d2e24eb483bcc506ee413ac873eb7543a3112e53b535f5e3b1745409c6dc1a62b2651dda766eb1782 0003-Backport-shm-add-memfd-create-syscall.patch 560b46dab45b14fa0a9fbdb9ddb2bb597a9914b25bb5591d2e24eb483bcc506ee413ac873eb7543a3112e53b535f5e3b1745409c6dc1a62b2651dda766eb1782 0003-Backport-shm-add-memfd-create-syscall.patch
e07d7e0104cd37fa45cfb54bda8f6ebaa0ce8a54fa12e57133f0cb1ccc96c5133a25ba936678228b4ffb21a7c65a546e35004935afbf6e8f008265a687cfb0d3 0004-Backport-asm-generic-add-memfd_create-system-call-to.patch e07d7e0104cd37fa45cfb54bda8f6ebaa0ce8a54fa12e57133f0cb1ccc96c5133a25ba936678228b4ffb21a7c65a546e35004935afbf6e8f008265a687cfb0d3 0004-Backport-asm-generic-add-memfd_create-system-call-to.patch
22822ab84f3179c749eae3d44ea123c72d24399d8af52f603fceb5ca3f323da33eb0b7656a7db4c6b04963d7b118abbc4ae5def07f1db6066bcc5a7403a11dd4 0005-Backport-ARM-wire-up-memfd_create-syscall.patch 22822ab84f3179c749eae3d44ea123c72d24399d8af52f603fceb5ca3f323da33eb0b7656a7db4c6b04963d7b118abbc4ae5def07f1db6066bcc5a7403a11dd4 0005-Backport-ARM-wire-up-memfd_create-syscall.patch
bfaa80417d452db734daf6a3c10dca1c6acf2e6a8102fa59bd8a5af09513521f4b7ec5bd5e00ffb3f76ed864faeb8ba20bd31c10315f69558fee792a21cde0f6 0006-Fix-ALSA-CTL-CODEC-EQ_COEFFICIENT_3.patch
" "