xiaomi-vince: move audio resources under alsa subpkg (MR 2716)
[ci:skip-build] already built successfully in CI
This commit is contained in:
parent
0b7ea96f35
commit
9f334cb0a3
4 changed files with 210 additions and 184 deletions
|
@ -2,15 +2,17 @@
|
|||
# Reference: <https://postmarketos.org/devicepkg>
|
||||
pkgname=device-xiaomi-vince
|
||||
pkgdesc="Xiaomi Redmi Note 5 Plus"
|
||||
pkgver=1
|
||||
pkgrel=1
|
||||
pkgver=2
|
||||
pkgrel=0
|
||||
url="https://postmarketos.org"
|
||||
license="MIT"
|
||||
arch="aarch64"
|
||||
options="!check !archcheck"
|
||||
depends="postmarketos-base linux-xiaomi-vince mkbootimg mesa-dri-swrast msm-fb-refresher"
|
||||
makedepends="devicepkg-dev"
|
||||
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
|
||||
subpackages="$pkgname-nonfree-firmware:nonfree_firmware
|
||||
$pkgname-alsa
|
||||
"
|
||||
|
||||
source="deviceinfo
|
||||
fb.modes
|
||||
|
@ -20,8 +22,8 @@ source="deviceinfo
|
|||
misc/charging.sh
|
||||
misc/discharging.sh
|
||||
misc/vince-audioctl.sh
|
||||
ucm/msm8953-snd-card-mtp/HiFi.conf
|
||||
ucm/msm8953-snd-card-mtp/msm8953-snd-card-mtp.conf
|
||||
ucm2/msm8953-snd-car/HiFi.conf
|
||||
ucm2/msm8953-snd-car/msm8953-snd-card-mtp.conf
|
||||
"
|
||||
|
||||
build() {
|
||||
|
@ -30,13 +32,18 @@ build() {
|
|||
|
||||
package() {
|
||||
devicepkg_package $startdir $pkgname
|
||||
install -Dm644 "$srcdir"/fb.modes "$pkgdir"/etc/fb.modes
|
||||
install -Dm644 "$srcdir"/pointercal "$pkgdir"/etc/pointercal
|
||||
install -Dm644 "$srcdir"/fb.modes \
|
||||
"$pkgdir"/etc/fb.modes
|
||||
install -Dm644 "$srcdir"/pointercal \
|
||||
"$pkgdir"/etc/pointercal
|
||||
install -Dm644 "$srcdir"/100-charging.rules \
|
||||
"$pkgdir"/etc/udev/rules.d/100-charging.rules
|
||||
install -Dm755 "$srcdir"/charging.sh "$pkgdir"/usr/lib/device-xiaomi-vince/charging.sh
|
||||
install -Dm755 "$srcdir"/discharging.sh "$pkgdir"/usr/lib/device-xiaomi-vince/discharging.sh
|
||||
install -Dm755 "$srcdir"/vince-audioctl.sh "$pkgdir"/usr/lib/device-xiaomi-vince/vince-audioctl.sh
|
||||
install -Dm755 "$srcdir"/charging.sh \
|
||||
"$pkgdir"/usr/lib/device-xiaomi-vince/charging.sh
|
||||
install -Dm755 "$srcdir"/discharging.sh \
|
||||
"$pkgdir"/usr/lib/device-xiaomi-vince/discharging.sh
|
||||
install -Dm755 "$srcdir"/vince-audioctl.sh \
|
||||
"$pkgdir"/usr/lib/device-xiaomi-vince/vince-audioctl.sh
|
||||
|
||||
# Disable v4l udev rules (video4linux), because without the camera
|
||||
# firmware blobs this makes udev helper hang (#1033)
|
||||
|
@ -46,18 +53,22 @@ package() {
|
|||
|
||||
nonfree_firmware() {
|
||||
pkgdesc="Wi-Fi, ADSP Firmware"
|
||||
depends="firmware-xiaomi-vince wcnss-wlan adsp-audio pulseaudio pulseaudio-alsa alsa-plugins-pulse alsa-utils"
|
||||
depends="firmware-xiaomi-vince wcnss-wlan"
|
||||
install="$pkgname-nonfree-firmware.post-install"
|
||||
mkdir "$subpkgdir"
|
||||
}
|
||||
|
||||
alsa() {
|
||||
pkgdesc="Audio configuration files"
|
||||
depends="adsp-audio alsa-plugins-pulse alsa-ucm-conf alsa-utils pulseaudio pulseaudio-alsa triggerhappy"
|
||||
mkdir "$subpkgdir"
|
||||
# Install triggerhappy evdev rules for vince
|
||||
install -Dm755 "$srcdir"/buttons.conf "$pkgdir"/etc/triggerhappy/triggers.d/buttons.conf
|
||||
|
||||
# Install UCM files for vince
|
||||
install -Dm644 "$srcdir"/HiFi.conf \
|
||||
"$subpkgdir"/usr/share/alsa/ucm2/msm8953-snd-card-mtp/HiFi.conf
|
||||
install -Dm644 "$srcdir"/msm8953-snd-card-mtp.conf \
|
||||
"$subpkgdir"/usr/share/alsa/ucm2/msm8953-snd-card-mtp/msm8953-snd-card-mtp.conf
|
||||
install -Dm755 "$srcdir"/buttons.conf -t \
|
||||
"$subpkgdir"/etc/triggerhappy/triggers.d
|
||||
install -Dm644 "$srcdir"/msm8953-snd-card-mtp.conf -t \
|
||||
"$subpkgdir"/usr/share/alsa/ucm2/msm8953-snd-car
|
||||
install -Dm644 "$srcdir"/HiFi.conf -t \
|
||||
"$subpkgdir"/usr/share/alsa/ucm/msm8953-snd-car
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
|
@ -69,6 +80,6 @@ b6951e2f8d2e21aa58f15b600a67289900d645b9dcff9992d0864dea383528539fc8b0140bff6af4
|
|||
89195cfaa131eef1a34c882685ed53eb0e80d1520cf9924e775875bde1de883448f3d182775f8323b261afaf0f6a5e73aa31142f2e72acc3ac584a64de6e72a3 charging.sh
|
||||
947fb09b7dce638d28afb367ce193437092bca956647486d67438a3fbb695c9354bc1174a68a5993644c3c619f9826cb8a84b8b9f49b513a484089a965b665c5 discharging.sh
|
||||
24762c3f4b0d1e9a035495c05e53852a68d46699e1f41915bd6d68af3d2a22dad075c77209533d92a81693aa45c86018ce825a8b7e7a8c163b59d826d9e204d1 vince-audioctl.sh
|
||||
8b0ec10746d98d905041ec18bcc0bfae1961bed574a280ca903a5a5ec71de14df0429c5b49ce25835555c076565d8c35285d7a3b7152e21aa4d1b97659e012eb HiFi.conf
|
||||
f7dfd0c863f4c0d3746533bd3d0885b88ac73fb3b158522da5b57b636a4048d0c68a143f76e6750bb1404893c4803a86928671d4b60e93d253fe4b62d7a2f5f6 msm8953-snd-card-mtp.conf
|
||||
a72522650df9ff6bda188aeca71b9e2dacf810e1efaa10d8c32eb65e445ffb69e49410f531bc110abab270126140baa047ca847c9ed7a84f231c9c678263fc0e HiFi.conf
|
||||
4d034b7f38831a84d489c25d39b9363f86d701e336163be79f5313eaf3f527a83866e1a0e23c7aabbea706c0fe4dda64dfb8b04353c72ec84ac9a07cf3dae55d msm8953-snd-card-mtp.conf
|
||||
"
|
||||
|
|
|
@ -1,157 +0,0 @@
|
|||
SectionVerb {
|
||||
EnableSequence[
|
||||
cdev "hw:msm8953sndcardm"
|
||||
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 1"
|
||||
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 1"
|
||||
]
|
||||
DisableSequence[
|
||||
cdev "hw:msm8953sndcardm"
|
||||
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 0"
|
||||
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 0"
|
||||
]
|
||||
Value {
|
||||
TQ "HiFi"
|
||||
PlaybackPCM "hw:msm8953sndcardm,0"
|
||||
CapturePCM "hw:msm8953sndcardm,0"
|
||||
}
|
||||
}
|
||||
|
||||
SectionDevice."Headphones" {
|
||||
Comment "Headset"
|
||||
ConflictingDevice[]
|
||||
EnableSequence[
|
||||
cdev "hw:msm8953sndcardm"
|
||||
cset "name='MI2S_RX Channels' Two"
|
||||
cset "name='RX1 MIX1 INP1' RX1"
|
||||
cset "name='RX2 MIX1 INP1' RX2"
|
||||
cset "name='RX HPH Mode' HD2"
|
||||
cset "name='RDAC2 MUX' RX2"
|
||||
cset "name='HPHL' Switch"
|
||||
cset "name='HPHR' Switch"
|
||||
# cset "name='Ext Spk Switch' On"
|
||||
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 1"
|
||||
]
|
||||
DisableSequence[
|
||||
cdev "hw:msm8953sndcardm"
|
||||
cset "name='MI2S_RX Channels' One"
|
||||
cset "name='RX1 MIX1 INP1' ZERO"
|
||||
cset "name='RX2 MIX1 INP1' ZERO"
|
||||
cset "name='RX HPH Mode' NORMAL"
|
||||
cset "name='RDAC2 MUX' ZERO"
|
||||
cset "name='HPHL' ZERO"
|
||||
cset "name='HPHR' ZERO"
|
||||
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 0"
|
||||
]
|
||||
Value {
|
||||
PlaybackChannels "2"
|
||||
PlaybackPriority 200
|
||||
}
|
||||
}
|
||||
|
||||
SectionDevice."Handset" {
|
||||
Comment "Handset earpiece"
|
||||
ConflictingDevice[
|
||||
"Headphones"
|
||||
]
|
||||
EnableSequence[
|
||||
cdev "hw:msm8953sndcardm"
|
||||
cset "name='RX1 MIX1 INP1' RX1"
|
||||
cset "name='RDAC2 MUX' RX1"
|
||||
cset "name='RX1 Digital Volume' 88"
|
||||
cset "name='EAR PA Gain' POS_6_DB"
|
||||
cset "name='EAR_S' Switch"
|
||||
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 1"
|
||||
]
|
||||
DisableSequence[
|
||||
cdev "hw:msm8953sndcardm"
|
||||
cset "name='RX1 MIX1 INP1' ZERO"
|
||||
cset "name='RDAC2 MUX' ZERO"
|
||||
cset "name='RX1 Digital Volume' 84"
|
||||
cset "name='EAR PA Gain' POS_6_DB"
|
||||
cset "name='EAR_S' ZERO"
|
||||
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 0"
|
||||
]
|
||||
Value {
|
||||
PlaybackChannels "2"
|
||||
PlaybackPriority 100
|
||||
}
|
||||
}
|
||||
|
||||
SectionDevice."HandsetMic" {
|
||||
Comment "Handset microphone"
|
||||
ConflictingDevice[
|
||||
"SpeakerMic"
|
||||
"HeadsetMic"
|
||||
]
|
||||
EnableSequence[
|
||||
cdev "hw:msm8953sndcardm"
|
||||
cset "name='ADC1 Volume' 6"
|
||||
cset "name='DEC1 MUX' ADC1"
|
||||
cset "name='ADC1_INP1 Switch' 1"
|
||||
cset "name='IIR1 INP1 MUX' DEC1"
|
||||
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 1"
|
||||
]
|
||||
DisableSequence[
|
||||
cdev "hw:msm8953sndcardm"
|
||||
cset "name='ADC1 Volume' 4"
|
||||
cset "name='DEC1 MUX' ZERO"
|
||||
cset "name='ADC1_INP1 Switch' 0"
|
||||
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 0"
|
||||
]
|
||||
Value {
|
||||
CaptureChannels "2"
|
||||
}
|
||||
}
|
||||
|
||||
SectionDevice."SpeakerMic" {
|
||||
Comment "Handset microphone for speaker-mode"
|
||||
ConflictingDevice[
|
||||
"Handset"
|
||||
"HandsetMic"
|
||||
"HeadsetMic"
|
||||
]
|
||||
EnableSequence[
|
||||
cdev "hw:msm8953sndcardm"
|
||||
cset "name='ADC1 Volume' 6"
|
||||
cset "name='DEC1 MUX' ADC1"
|
||||
cset "name='ADC1_INP1 Switch' 1"
|
||||
cset "name='IIR1 INP1 MUX' DEC1"
|
||||
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 1"
|
||||
]
|
||||
DisableSequence[
|
||||
cdev "hw:msm8953sndcardm"
|
||||
cset "name='ADC1 Volume' 4"
|
||||
cset "name='DEC1 MUX' ZERO"
|
||||
cset "name='ADC1_INP1 Switch' 0"
|
||||
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 0"
|
||||
]
|
||||
Value {
|
||||
CaptureChannels "2"
|
||||
}
|
||||
}
|
||||
|
||||
SectionDevice."HeadsetMic" {
|
||||
Comment "Headset microphone"
|
||||
ConflictingDevice[
|
||||
"HandsetMic"
|
||||
"SpeakerMic"
|
||||
]
|
||||
EnableSequence[
|
||||
cdev "hw:msm8953sndcardm"
|
||||
cset "name='ADC2 Volume' 6"
|
||||
cset "name='DEC1 MUX' ADC2"
|
||||
cset "name='ADC2 MUX' INP2"
|
||||
cset "name='IIR1 INP1 MUX' DEC1"
|
||||
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 1"
|
||||
]
|
||||
DisableSequence[
|
||||
cdev "hw:msm8953sndcardm"
|
||||
cset "name='ADC2 Volume' 4"
|
||||
cset "name='DEC1 MUX' ZERO"
|
||||
cset "name='ADC2 MUX' ZERO"
|
||||
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 0"
|
||||
]
|
||||
Value {
|
||||
CaptureChannels "2"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,171 @@
|
|||
# Use case configuration for Xiaomi Redmi Note 5 / Plus
|
||||
# All analog outputs/inputs connected to internal PM8953 codec,
|
||||
|
||||
Define {
|
||||
WcdPlaybackPCM "hw:${CardId}"
|
||||
WcdCapturePCM "hw:${CardId}"
|
||||
}
|
||||
|
||||
SectionVerb {
|
||||
EnableSequence[
|
||||
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 1"
|
||||
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 1"
|
||||
]
|
||||
DisableSequence[
|
||||
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 0"
|
||||
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 0"
|
||||
]
|
||||
Value {
|
||||
TQ "HiFi"
|
||||
PlaybackPCM "${var:WcdPlaybackPCM}"
|
||||
CapturePCM "${var:WcdCapturePCM}"
|
||||
}
|
||||
}
|
||||
|
||||
SectionDevice."Headphones" {
|
||||
Comment "Headphones playback"
|
||||
EnableSequence[
|
||||
cdev "${var:WcdPlaybackPCM}"
|
||||
cset "name='MI2S_RX Channels' Two"
|
||||
cset "name='RX1 MIX1 INP1' RX1"
|
||||
cset "name='RX2 MIX1 INP1' RX2"
|
||||
cset "name='RX HPH Mode' HD2"
|
||||
cset "name='RDAC2 MUX' RX2"
|
||||
cset "name='HPHL' Switch"
|
||||
cset "name='HPHR' Switch"
|
||||
# cset "name='Ext Spk Switch' On"
|
||||
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 1"
|
||||
]
|
||||
DisableSequence[
|
||||
cdev "${var:WcdPlaybackPCM}"
|
||||
cset "name='MI2S_RX Channels' One"
|
||||
cset "name='RX1 MIX1 INP1' ZERO"
|
||||
cset "name='RX2 MIX1 INP1' ZERO"
|
||||
cset "name='RX HPH Mode' NORMAL"
|
||||
cset "name='RDAC2 MUX' ZERO"
|
||||
cset "name='HPHL' ZERO"
|
||||
cset "name='HPHR' ZERO"
|
||||
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 0"
|
||||
]
|
||||
Value {
|
||||
PlaybackPCM "${var:WcdPlaybackPCM}"
|
||||
PlaybackChannels 2
|
||||
PlaybackPriority 100
|
||||
JackControl "Headphone Jack"
|
||||
}
|
||||
}
|
||||
|
||||
SectionDevice."Handset" {
|
||||
Comment "Handset earpiece"
|
||||
ConflictingDevice[
|
||||
"Headphones"
|
||||
]
|
||||
EnableSequence[
|
||||
cdev "${var:WcdPlaybackPCM}"
|
||||
cset "name='RX1 MIX1 INP1' RX1"
|
||||
cset "name='RDAC2 MUX' RX1"
|
||||
cset "name='RX1 Digital Volume' 88"
|
||||
cset "name='EAR PA Gain' POS_6_DB"
|
||||
cset "name='EAR_S' Switch"
|
||||
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 1"
|
||||
]
|
||||
DisableSequence[
|
||||
cdev "${var:WcdPlaybackPCM}"
|
||||
cset "name='RX1 MIX1 INP1' ZERO"
|
||||
cset "name='RDAC2 MUX' ZERO"
|
||||
## cset "name='RX1 Digital Volume' 84"
|
||||
cset "name='EAR PA Gain' POS_6_DB"
|
||||
cset "name='EAR_S' ZERO"
|
||||
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 0"
|
||||
]
|
||||
Value {
|
||||
PlaybackPCM "${var:WcdPlaybackPCM}"
|
||||
PlaybackChannels 2
|
||||
PlaybackPriority 100
|
||||
}
|
||||
}
|
||||
|
||||
SectionDevice."HandsetMic" {
|
||||
Comment "Handset microphone"
|
||||
ConflictingDevice[
|
||||
"SpeakerMic"
|
||||
"HeadsetMic"
|
||||
]
|
||||
EnableSequence[
|
||||
cdev "${var:WcdCapturePCM}"
|
||||
cset "name='ADC1 Volume' 6"
|
||||
cset "name='DEC1 MUX' ADC1"
|
||||
cset "name='ADC1_INP1 Switch' 1"
|
||||
cset "name='IIR1 INP1 MUX' DEC1"
|
||||
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 1"
|
||||
]
|
||||
DisableSequence[
|
||||
cdev "${var:WcdCapturePCM}"
|
||||
cset "name='ADC1 Volume' 4"
|
||||
cset "name='DEC1 MUX' ZERO"
|
||||
cset "name='ADC1_INP1 Switch' 0"
|
||||
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 0"
|
||||
]
|
||||
Value {
|
||||
CapturePCM "${var:WcdCapturePCM}"
|
||||
CaptureChannels 2
|
||||
CapturePriority 300
|
||||
}
|
||||
}
|
||||
|
||||
SectionDevice."SpeakerMic" {
|
||||
Comment "Handset microphone for speaker-mode"
|
||||
ConflictingDevice[
|
||||
"Handset"
|
||||
"HandsetMic"
|
||||
"HeadsetMic"
|
||||
]
|
||||
EnableSequence[
|
||||
cdev "${var:WcdCapturePCM}"
|
||||
cset "name='ADC1 Volume' 6"
|
||||
cset "name='DEC1 MUX' ADC1"
|
||||
cset "name='ADC1_INP1 Switch' 1"
|
||||
cset "name='IIR1 INP1 MUX' DEC1"
|
||||
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 1"
|
||||
]
|
||||
DisableSequence[
|
||||
cdev "${var:WcdCapturePCM}"
|
||||
cset "name='ADC1 Volume' 4"
|
||||
cset "name='DEC1 MUX' ZERO"
|
||||
cset "name='ADC1_INP1 Switch' 0"
|
||||
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 0"
|
||||
]
|
||||
Value {
|
||||
CapturePCM "${var:WcdCapturePCM}"
|
||||
CaptureChannels "2"
|
||||
}
|
||||
}
|
||||
|
||||
SectionDevice."HeadsetMic" {
|
||||
Comment "Headset microphone"
|
||||
ConflictingDevice[
|
||||
"HandsetMic"
|
||||
"SpeakerMic"
|
||||
]
|
||||
EnableSequence[
|
||||
cdev "${var:WcdCapturePCM}"
|
||||
cset "name='ADC2 Volume' 6"
|
||||
cset "name='DEC1 MUX' ADC2"
|
||||
cset "name='ADC2 MUX' INP2"
|
||||
cset "name='IIR1 INP1 MUX' DEC1"
|
||||
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 1"
|
||||
]
|
||||
DisableSequence[
|
||||
cdev "${var:WcdCapturePCM}"
|
||||
cset "name='ADC2 Volume' 4"
|
||||
cset "name='DEC1 MUX' ZERO"
|
||||
cset "name='ADC2 MUX' ZERO"
|
||||
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 0"
|
||||
]
|
||||
Value {
|
||||
CapturePCM "${var:WcdCapturePCM}"
|
||||
CaptureChannels 2
|
||||
CapturePriority 100
|
||||
JackControl "Headset Mic Jack"
|
||||
}
|
||||
}
|
|
@ -1,18 +1,19 @@
|
|||
Syntax 2
|
||||
Syntax 3
|
||||
|
||||
SectionUseCase."HiFi" {
|
||||
File "HiFi.conf"
|
||||
File "HiFi.conf"
|
||||
Comment "Play and record HiFi quality Music"
|
||||
}
|
||||
|
||||
SectionDefaults [
|
||||
cdev "hw:msm8953sndcardm"
|
||||
cdev "hw:${CardId}"
|
||||
cset "name='TTY Mode' OFF"
|
||||
cset "name='RX HPH Mode' NORMAL"
|
||||
cset "name='COMP0 RX1' 0"
|
||||
cset "name='COMP0 RX2' 0"
|
||||
cset "name='RX1 Digital Volume' 84"
|
||||
cset "name='RX2 Digital Volume' 84"
|
||||
cset "name='RX3 Digital Volume' 78"
|
||||
## cset "name='RX1 Digital Volume' 84"
|
||||
## cset "name='RX2 Digital Volume' 84"
|
||||
## cset "name='RX3 Digital Volume' 78"
|
||||
cset "name='IIR1 INP1 Volume' 53"
|
||||
cset "name='IIR1 INP2 Volume' 84"
|
||||
cset "name='IIR1 INP3 Volume' 84"
|
||||
|
@ -20,7 +21,7 @@ SectionDefaults [
|
|||
cset "name='ADC1 Volume' 4"
|
||||
cset "name='ADC2 Volume' 4"
|
||||
cset "name='ADC3 Volume' 4"
|
||||
cset "name='DEC1 Volume' 84"
|
||||
## cset "name='DEC1 Volume' 84"
|
||||
cset "name='DEC2 Volume' 84"
|
||||
cset "name='DEC2 MUX' ZERO"
|
||||
cset "name='DEC1 MUX' ZERO"
|
Loading…
Reference in a new issue