samsung-p4note: enable audio (MR 4868)

add alsa-utils package and the corresponding ucm configuration to enable
audio on the p4note
This commit is contained in:
Martin Jücker 2024-02-28 00:58:03 +01:00 committed by Viciouss
parent 5ad554d68e
commit d1655e9fd6
No known key found for this signature in database
GPG key ID: CAB5A5DBC11B967B
3 changed files with 277 additions and 3 deletions

View file

@ -1,8 +1,8 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-samsung-p4note
pkgdesc="Samsung Galaxy Note 10.1"
pkgver=1.3
pkgrel=3
pkgver=1.4
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
@ -10,12 +10,16 @@ options="!check !archcheck"
depends="
linux-postmarketos-exynos4
mkbootimg
alsa-ucm-conf
postmarketos-base
postmarketos-update-kernel
"
makedepends="devicepkg-dev"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
source="deviceinfo"
source="
deviceinfo
audio/HiFi.conf
audio/p4note.conf"
build() {
devicepkg_build $startdir $pkgname
@ -23,6 +27,11 @@ build() {
package() {
devicepkg_package $startdir $pkgname
install -Dm644 "$srcdir"/HiFi.conf \
-t "$pkgdir"/usr/share/alsa/ucm2/conf.d/p4note
install -Dm644 "$srcdir"/p4note.conf \
-t "$pkgdir"/usr/share/alsa/ucm2/conf.d/p4note
}
nonfree_firmware() {
@ -37,4 +46,6 @@ nonfree_firmware() {
sha512sums="
b473bd6e9bf1ba3d75f4cfd55bf4acff2edba338a87f4367bfb3aa7be2a0b31ee07012ba506d00faf811ba71f6859f1c771e77ec034fc9e7f3811c739b2068cc deviceinfo
40c2d13a8e59749a646e4070a444098609f62679f19a975da3f53b1a0fc4ac4c417dd86ec271a339e6a19c1737b384b759661d8f9a167c7eedc4a3ffbaffd77f HiFi.conf
2c5011f7d5f25362e6249624796a6d9d36d858169538ab9c4ab1a79f37ece95f425a92b14849a65fd9281c5567753158871c6bf20a772f8dca6b2d6813ea2f03 p4note.conf
"

View file

@ -0,0 +1,163 @@
#
# Based on OFW N8010XXUDNE4_N8010OXADNE4_HOME @ /etc/tinyucm.conf in the system.img
#
SectionVerb {
EnableSequence [
# Default all outputs off
cset "name='HP Switch' 0"
cset "name='SPK Switch' 0"
cset "name='RCV Switch' 0"
cset "name='LINE Switch' 0"
cset "name='HDMI Switch' 0"
# Default all inputs off
cset "name='Main Mic Switch' 0"
cset "name='Sub Mic Switch' 0"
cset "name='Headset Mic Switch' 0"
]
DisableSequence [
]
Value {
TQ HiFi
}
}
SectionDevice."Speaker" {
Comment "Speaker"
EnableSequence [
cset "name='SPK Switch' 1"
cset "name='Speaker Boost Volume' 6"
cset "name='AIF1DAC1 EQ Switch' 1"
]
DisableSequence [
cset "name='SPK Switch' 0"
cset "name='Speaker Boost Volume' 0"
cset "name='AIF1DAC1 EQ Switch' 0"
]
Value {
PlaybackVolume "Speaker Volume"
PlaybackSwitch "SPK Switch"
PlaybackPriority 100
PlaybackPCM "hw:${CardId}"
}
}
SectionDevice."Headphones" {
Comment "Headphones"
EnableSequence [
cset "name='HP Switch' 1"
]
DisableSequence [
cset "name='HP Switch' 0"
]
Value {
PlaybackVolume "Headphone Volume"
PlaybackSwitch "HP Switch"
PlaybackPriority 150
PlaybackPCM "hw:${CardId}"
}
}
SectionDevice."HeadsetMic" {
Comment "Headset Microphone"
EnableSequence [
cset "name='Headset Mic Switch' 1"
cset "name='AIF1ADCL Source' Right"
cset "name='AIF1ADCR Source' Right"
cset "name='MIXINR IN1R Switch' 1"
cset "name='AIF2DAC2L Mixer Left Sidetone Switch' 0"
cset "name='AIF2DAC2L Mixer Right Sidetone Switch' 1"
cset "name='AIF2DAC2R Mixer Left Sidetone Switch' 0"
cset "name='AIF2DAC2R Mixer Right Sidetone Switch' 1"
cset "name='Sub Mic Switch' 1"
]
DisableSequence [
cset "name='Headset Mic Switch' 0"
cset "name='Sub Mic Switch' 0"
cset "name='MIXINR IN1R Switch' 0"
]
Value {
CaptureVolume "IN2L Volume"
CapturePriority 150
CapturePCM "hw:${CardId}"
}
}
SectionDevice."InternalMic" {
Comment "Microphone"
EnableSequence [
cset "name='Main Mic Switch' 1"
cset "name='AIF1ADCL Source' Left"
cset "name='AIF1ADCR Source' Left"
cset "name='MIXINL IN1L Switch' 1"
cset "name='AIF2DAC2L Mixer Left Sidetone Switch' 1"
cset "name='AIF2DAC2L Mixer Right Sidetone Switch' 0"
cset "name='AIF2DAC2R Mixer Left Sidetone Switch' 1"
cset "name='AIF2DAC2R Mixer Right Sidetone Switch' 0"
]
DisableSequence [
cset "name='Main Mic Switch' 0"
cset "name='MIXINL IN1L Switch' 0"
cset "name='AIF1ADC1L DRC Switch' 0"
cset "name='AIF1ADC1 HPF Switch' 0"
]
Value {
CaptureVolume "IN1L Volume"
CapturePriority 100
CapturePCM "hw:${CardId}"
}
}
## currently not supported by kernel drivers ##
#SectionDevice."AUX Digital Out" {
# Comment "HDMI Audio"
#
# EnableSequence [
# cset "name='LINEOUT1N Switch' 1",
# cset "name='LINEOUT1P Switch' 1",
# cset "name='HDMI Switch' 1",
# ]
#
# DisableSequence [
# cset "name='LINEOUT1N Switch' 0",
# cset "name='LINEOUT1P Switch' 0",
# cset "name='HDMI Switch' 0",
# ]
#}
#SectionDevice."Analogue Dock Out" {
# Comment "Dock Headset"
#
# EnableSequence [
# cset "name='LINEOUT2N Switch' 1",
# cset "name='LINEOUT2P Switch' 1",
# cset "name='AIF1DACL Source' Right",
# cset "name='AIF1DACR Source' Left",
# cset "name='LINE Switch' 1",
# cset "name='LineoutSwitch Mode' 1",
# ]
#
# DisableSequence [
# cset "name='LineoutSwitch Mode' 0",
# cset "name='LINEOUT2N Switch' 0",
# cset "name='LINEOUT2P Switch' 0",
# cset "name='LINE Switch' 0",
# ]
#}

View file

@ -0,0 +1,100 @@
Syntax 2
SectionUseCase."HiFi" {
File "HiFi.conf"
Comment "Hi-Fi audio"
}
BootSequence [
# general
cset "name='IN1L ZC Switch' 0"
cset "name='IN1R ZC Switch' 0"
cset "name='IN2L ZC Switch' 0"
cset "name='IN2R ZC Switch' 0"
cset "name='Output ZC Switch' 0"
cset "name='Speaker ZC Switch' 0"
cset "name='Headphone ZC Switch' 0"
# AIF1->DAC1
cset "name='DAC1L Mixer AIF1.1 Switch' 1"
cset "name='DAC1R Mixer AIF1.1 Switch' 1"
cset "name='DAC1 Switch' 1"
# ADC->AIF2
cset "name='AIF2ADCL Source' Left"
cset "name='AIF2ADCR Source' Right"
cset "name='AIF2DAC2L Mixer Left Sidetone Switch' 1"
cset "name='AIF2DAC2L Mixer Right Sidetone Switch' 0"
cset "name='AIF2DAC2R Mixer Left Sidetone Switch' 0"
cset "name='AIF2DAC2R Mixer Right Sidetone Switch' 1"
cset "name='DAC2 Left Sidetone Volume' 12"
cset "name='DAC2 Right Sidetone Volume' 12"
cset "name='DAC2 Switch' 1"
# DAC1->HP
cset "name='Left Headphone Mux' DAC"
cset "name='Right Headphone Mux' DAC"
# DAC1->SPKL/R->SPKL/R Boost->SPK
cset "name='SPKL DAC1 Switch' 1"
cset "name='SPKR DAC1 Switch' 1"
cset "name='SPKL Boost SPKL Switch' 1"
cset "name='SPKL Boost SPKR Switch' 0"
cset "name='SPKR Boost SPKL Switch' 0"
cset "name='SPKR Boost SPKR Switch' 1"
cset "name='Speaker Mixer Volume' 3"
# DAC->Output mixer->Earpiece
cset "name='Left Output Mixer DAC Switch' 1"
cset "name='Right Output Mixer DAC Switch' 1"
cset "name='Earpiece Mixer Left Output Switch' 1"
cset "name='Earpiece Mixer Right Output Switch' 1"
cset "name='Earpiece Switch' 1"
# LINEOUT
cset "name='LINEOUT2N Mixer Left Output Switch' 1"
cset "name='LINEOUT2P Mixer Right Output Switch' 1"
cset "name='LINEOUT1N Mixer Right Output Switch' 1"
cset "name='LINEOUT1P Mixer Left Output Switch' 1"
# Main Mic->IN1LP/N->Input Mixer with +30dB at mixer
cset "name='IN1L PGA IN1LP Switch' 1"
cset "name='IN1L PGA IN1LN Switch' 1"
cset "name='MIXINL IN1L Volume' 1"
cset "name='IN1L Switch' 1"
# Sub Mic->IN1RP/N->Input Mixer with +30dB at mixer
cset "name='IN1R PGA IN1RP Switch' 1"
cset "name='IN1R PGA IN1RN Switch' 1"
cset "name='MIXINR IN1R Volume' 1"
cset "name='IN1R Switch' 1"
# Ear Mic->IN2LP/N->Input Mixer with +30dB at mixer
cset "name='IN2L PGA IN2LP Switch' 1"
cset "name='IN2L PGA IN2LN Switch' 1"
cset "name='MIXINL IN2L Volume' 1"
cset "name='IN2L Switch' 1"
# Input mixer->ADC->AIF1
cset "name='AIF1ADC1L Mixer ADC/DMIC Switch' 1"
cset "name='AIF1ADC1R Mixer ADC/DMIC Switch' 1"
cset "name='ADCL Mux' ADC"
# HPF on to take out some bounce
cset "name='Sidetone HPF Switch' 0"
# Work around core issue
cset "name='ADCL Mux' DMIC"
cset "name='ADCL Mux' ADC"
cset "name='ADCR Mux' DMIC"
cset "name='ADCR Mux' ADC"
# AIF2ADCDAT to AIF3ADC mux
cset "name='AIF3ADC Mux' 1"
cset "name='AIF1DAC1 EQ1 Volume' 9"
cset "name='AIF1DAC1 EQ2 Volume' 7"
cset "name='AIF1DAC1 EQ3 Volume' 10"
cset "name='AIF1DAC1 EQ4 Volume' 13"
cset "name='AIF1DAC1 EQ5 Volume' 12"
]