Initial audio support on FP2

This commit is contained in:
Luca Weiss 2018-10-10 07:30:21 +00:00 committed by Oliver Smith
parent 632dac179d
commit 272820674e
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
10 changed files with 245 additions and 20 deletions

View file

@ -2,15 +2,17 @@
pkgname="device-fairphone-fp2" pkgname="device-fairphone-fp2"
pkgdesc="Fairphone 2" pkgdesc="Fairphone 2"
pkgver=2 pkgver=2
pkgrel=0 pkgrel=1
url="https://postmarketos.org" url="https://postmarketos.org"
license="MIT" license="MIT"
arch="noarch" arch="noarch"
options="!check" options="!check"
depends="postmarketos-base linux-fairphone-fp2 mkbootimg mesa-dri-swrast" depends="postmarketos-base linux-fairphone-fp2 mkbootimg mesa-dri-swrast"
makedepends="devicepkg-dev" makedepends="devicepkg-dev"
source="deviceinfo" source="deviceinfo
subpackages="$pkgname-nonfree-firmware:nonfree_firmware" FP2.conf
hifi"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware $pkgname-alsa"
build() { build() {
devicepkg_build $startdir $pkgname devicepkg_build $startdir $pkgname
@ -21,9 +23,17 @@ package() {
} }
nonfree_firmware() { nonfree_firmware() {
pkgdesc="WCNSS firmware (WiFi, Bluetooth, FM)" pkgdesc="Firmware for WiFi, Audio, etc."
depends="firmware-fairphone-fp2" depends="firmware-fairphone-fp2-adsp firmware-fairphone-fp2-wcnss $pkgname-alsa"
mkdir "$subpkgdir" mkdir "$subpkgdir"
} }
sha512sums="fe35eb83d1eb5bc0d6bfced5db30238730a2309e8266556f36ca2a9e34ecc2b3825b9533416e93d147ff5488455db7b760d059fde07a714137aae57d0e227e2c deviceinfo" alsa() {
mkdir -p "$subpkgdir"/usr/share/alsa/ucm/FP2
install -Dm644 "$srcdir"/FP2.conf "$subpkgdir"/usr/share/alsa/ucm/FP2/
install -Dm644 "$srcdir"/hifi "$subpkgdir"/usr/share/alsa/ucm/FP2/
}
sha512sums="fe35eb83d1eb5bc0d6bfced5db30238730a2309e8266556f36ca2a9e34ecc2b3825b9533416e93d147ff5488455db7b760d059fde07a714137aae57d0e227e2c deviceinfo
55360b1ba4ddadea341c9edb13c32ba5f19aabf75ab28602f30cfb79b9df8834f115ef979c70569f23ec1293b1fcd408baf320d87803293ce7106bdc73a26c9f FP2.conf
b834461c6866bb0c473dd089dd5da641dd42a00f610aad6503117aa50fe6e200db9ad0a264bb609f12350d59faee1f772907bacd75439f702ea7d52f6f85e2b1 hifi"

View file

@ -0,0 +1,6 @@
# UCM configuration for FP2
Comment "Fairphone 2"
SectionUseCase."HiFi" {
File "hifi"
Comment "Play HiFi quality music."
}

View file

@ -0,0 +1,154 @@
SectionVerb {
EnableSequence [
cdev "hw:msm8974taikomtp"
cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1"
cset "name='SLIM RX1 MUX' AIF1_PB"
]
DisableSequence [
cdev "hw:msm8974taikomtp"
cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0"
]
Value {
TQ "HiFi"
PlaybackPCM "hw:msm8974taikomtp"
CapturePCM "hw:msm8974taikomtp"
}
}
SectionDevice."Speaker" {
Comment "FP2 speaker"
ConflictingDevice [
"Headphones"
]
EnableSequence [
cdev "hw:msm8974taikomtp"
# We need to disable this while setting up the route, else the
# driver will hang if the stream is open.
cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0"
cset "name='SLIM_0_RX Channels' One"
cset "name='RX7 MIX1 INP1' RX1"
# default: 87
cset "name='RX7 Digital Volume' 70"
cset "name='SPK DRV Volume' 8"
# Route has been set up, re-enable the mixer.
cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1"
]
DisableSequence [
cdev "hw:msm8974taikomtp"
# See comment in EnableSequence
cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0"
cset "name='RX7 MIX1 INP1' ZERO"
# Re-enabled in EnableSequence
]
Value {
PlaybackChannels "1"
}
}
SectionDevice."Headphones" {
Comment "FP2 headphones"
ConflictingDevice [
"Speaker"
"Earpiece"
]
EnableSequence [
cdev "hw:msm8974taikomtp"
# We need to disable this while setting up the route, else the
# driver will hang if the stream is open.
cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0"
cset "name='SLIM_0_RX Channels' Two"
cset "name='SLIM RX2 MUX' AIF1_PB"
cset "name='RX1 MIX1 INP1' RX2"
cset "name='RX2 MIX1 INP1' RX1"
cset "name='CLASS_H_DSM MUX' DSM_HPHL_RX1"
cset "name='HPHL DAC Switch' 1"
# default: 84
cset "name='RX1 Digital Volume' 60"
cset "name='RX2 Digital Volume' 60"
# Route has been set up, re-enable the mixer.
cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1"
]
DisableSequence [
cdev "hw:msm8974taikomtp"
# See comment in EnableSequence
cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0"
cset "name='SLIM_0_RX Channels' One"
cset "name='SLIM RX2 MUX' ZERO"
cset "name='RX1 MIX1 INP1' ZERO"
cset "name='RX2 MIX1 INP1' ZERO"
cset "name='CLASS_H_DSM MUX' ZERO"
cset "name='HPHL DAC Switch' 0"
# Re-enabled in EnableSequence
]
Value {
PlaybackChannels "2"
}
}
SectionDevice."Earpiece" {
Comment "FP2 earpiece"
ConflictingDevice [
"Headphones"
]
EnableSequence [
cdev "hw:msm8974taikomtp"
# We need to disable this while setting up the route, else the
# driver will hang if the stream is open.
cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0"
cset "name='SLIM_0_RX Channels' One"
cset "name='RX1 MIX1 INP1' RX1"
# default: 84
cset "name='RX1 Digital Volume' 60"
cset "name='CLASS_H_DSM MUX' DSM_HPHL_RX1"
cset "name='DAC1 Switch' 1"
# Route has been set up, re-enable the mixer.
cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1"
]
DisableSequence [
cdev "hw:msm8974taikomtp"
# See comment in EnableSequence
cset "name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0"
cset "name='RX1 MIX1 INP1' ZERO"
cset "name='CLASS_H_DSM MUX' ZERO"
cset "name='DAC1 Switch' 0"
# Re-enabled in EnableSequence
]
Value {
PlaybackChannels "1"
}
}

View file

@ -77,7 +77,7 @@ package() {
} }
sha512sums="6b440c5d087b790894606d4736af815204d9e6f682b7c1ba78f5852fa7aecd74cb276f4953d270f14c96d5418f4e2a83c5179c54d50e2e5afc9084f83ab54200 linux-fairphone-fp2-284400aea4b9f8a3c97a34408f48d0971897ae02.tar.gz sha512sums="6b440c5d087b790894606d4736af815204d9e6f682b7c1ba78f5852fa7aecd74cb276f4953d270f14c96d5418f4e2a83c5179c54d50e2e5afc9084f83ab54200 linux-fairphone-fp2-284400aea4b9f8a3c97a34408f48d0971897ae02.tar.gz
aa8c8dd8502b7ecbfc7d8aee2146a5b613dbea3f071d8f0a48f213a5be0f4026a596d3c55d72ebdef1897f93133f4111aac50f62f3c560a7a49c838b4bbf6413 config-fairphone-fp2.armhf cb5f1d366daff93b2d4cd8785b095f7113a606ef82736b5d1486f53eeb69f3f684eabf6e4a83d96aaf7b129a41d0e2e9c6bbd6b8c6206bce52e0ba2172414009 config-fairphone-fp2.armhf
d80980e9474c82ba0ef1a6903b434d8bd1b092c40367ba543e72d2c119301c8b2d05265740e4104ca1ac5d15f6c4aa49e8776cb44264a9a28dc551e0d1850dcc compiler-gcc6.h d80980e9474c82ba0ef1a6903b434d8bd1b092c40367ba543e72d2c119301c8b2d05265740e4104ca1ac5d15f6c4aa49e8776cb44264a9a28dc551e0d1850dcc compiler-gcc6.h
19d21a15d5470ba0a77ddfac2ea662f6424bca4af66d310019ba3c3d7d976cae6b7f88422d64e564c47a7347a7338459f61f3ac94d13d7b981defc206f99a120 0001-ARM-8158-1-LLVMLinux-use-static-inline-in-ARM-ftrace.patch 19d21a15d5470ba0a77ddfac2ea662f6424bca4af66d310019ba3c3d7d976cae6b7f88422d64e564c47a7347a7338459f61f3ac94d13d7b981defc206f99a120 0001-ARM-8158-1-LLVMLinux-use-static-inline-in-ARM-ftrace.patch
6f806c8e2a5b6e7e503c2b98ff55cd90f4e77cb7d82b9a3e3f85f4d718265be06f03a81ab9c0d88a95508b4192713c98f3959b18c6119edf209722c3002d19fe 0002-gpu-msm-Fix-compilation.patch 6f806c8e2a5b6e7e503c2b98ff55cd90f4e77cb7d82b9a3e3f85f4d718265be06f03a81ab9c0d88a95508b4192713c98f3959b18c6119edf209722c3002d19fe 0002-gpu-msm-Fix-compilation.patch

View file

@ -1778,9 +1778,11 @@ CONFIG_LEGACY_PTY_COUNT=256
# CONFIG_SERIAL_MAX3100 is not set # CONFIG_SERIAL_MAX3100 is not set
# CONFIG_SERIAL_MAX3107 is not set # CONFIG_SERIAL_MAX3107 is not set
CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_SERIAL_MSM is not set # CONFIG_SERIAL_MSM is not set
CONFIG_SERIAL_MSM_HS=y CONFIG_SERIAL_MSM_HS=y
# CONFIG_SERIAL_MSM_HSL is not set CONFIG_SERIAL_MSM_HSL=y
CONFIG_SERIAL_MSM_HSL_CONSOLE=y
# CONFIG_SERIAL_BCM_BT_LPM is not set # CONFIG_SERIAL_BCM_BT_LPM is not set
# CONFIG_SERIAL_TIMBERDALE is not set # CONFIG_SERIAL_TIMBERDALE is not set
# CONFIG_SERIAL_ALTERA_JTAGUART is not set # CONFIG_SERIAL_ALTERA_JTAGUART is not set

View file

@ -1,33 +1,56 @@
pkgname=firmware-fairphone-fp2 pkgname=firmware-fairphone-fp2
pkgver=17.09.3 pkgver=17.09.3
pkgrel=0 pkgrel=1
pkgdesc="Firmware for Fairphone 2" pkgdesc="Firmware for Fairphone 2"
subpackages="$pkgname-wcnss $pkgname-adsp $pkgname-modem"
url="https://github.com/FairBlobs/firmware" url="https://github.com/FairBlobs/firmware"
arch="noarch" arch="noarch"
license="proprietary" license="proprietary"
depends="wcnss-wlan"
options="!check !strip !archcheck" options="!check !strip !archcheck"
# Sources # Sources
_commit=6785087409c73b046d11a5c88225d4177e172a1d _commit=6785087409c73b046d11a5c88225d4177e172a1d
_files="wcnss.b00 wcnss.b01 wcnss.b02 wcnss.b04 wcnss.b06 wcnss.b07 wcnss.b08 wcnss.b09 wcnss.mdt"
_wififiles="WCNSS_cfg.dat WCNSS_qcom_cfg.ini WCNSS_qcom_wlan_nv.bin" _wififiles="WCNSS_cfg.dat WCNSS_qcom_cfg.ini WCNSS_qcom_wlan_nv.bin"
source="$pkgname-$pkgver.tar.gz::https://github.com/FairBlobs/firmware/archive/$pkgver.tar.gz" source="$pkgname-$pkgver.tar.gz::https://github.com/FairBlobs/firmware/archive/$pkgver.tar.gz"
for _i in $_wififiles; do for _i in $_wififiles; do
source="$source $pkgname-$_commit-$_i::https://raw.githubusercontent.com/LineageOS/android_device_fairphone_FP2/$_commit/wifi/$_i"; source="$source $pkgname-$_commit-$_i::https://raw.githubusercontent.com/LineageOS/android_device_fairphone_FP2/$_commit/wifi/$_i";
done done
package() { package() {
for _i in $_files; do # parent package is empty
install -Dm644 "$srcdir/firmware-$pkgver/$_i" \ mkdir -p "$pkgdir"
"$pkgdir/lib/firmware/postmarketos/$_i" }
wcnss() {
pkgdesc="Fairphone 2 firmware for the Qualcomm Wireless Connectivity Subsystem (WCNSS)"
depends="wcnss-wlan"
cd "$srcdir/firmware-$pkgver"
for _i in wcnss.*; do
install -Dm644 $_i "$subpkgdir"/lib/firmware/postmarketos/$_i
done done
for _i in $_wififiles; do for _i in $_wififiles; do
install -Dm644 "$srcdir/$pkgname-$_commit-$_i" \ install -Dm644 "$srcdir/$pkgname-$_commit-$_i" \
"$pkgdir/lib/firmware/postmarketos/wlan/prima/$_i" "$subpkgdir/lib/firmware/postmarketos/wlan/prima/$_i"
done done
} }
adsp() {
pkgdesc="Fairphone 2 adsp firmware"
cd "$srcdir/firmware-$pkgver"
for _i in adsp.*; do
install -Dm644 $_i "$subpkgdir"/lib/firmware/postmarketos/$_i
done
}
modem() {
pkgdesc="Fairphone 2 modem firmware"
cd "$srcdir/firmware-$pkgver"
for _i in modem.* mba.*; do
install -Dm644 $_i "$subpkgdir"/lib/firmware/postmarketos/$_i
done
}
sha512sums="c7101c0a7477acc04938294e915643fdc3e0d40c6ffab11abb89ae24fee52b0778ae6463668d3b91f8630de96203e4e916a268f4384600c4190e22d638d6a9eb firmware-fairphone-fp2-17.09.3.tar.gz sha512sums="c7101c0a7477acc04938294e915643fdc3e0d40c6ffab11abb89ae24fee52b0778ae6463668d3b91f8630de96203e4e916a268f4384600c4190e22d638d6a9eb firmware-fairphone-fp2-17.09.3.tar.gz
619df454e0dc65ab62894b7f328c015729e8261919032ee9096bb4f983ddd6f7b98dd14f593b4c6b75cf86c09f090a9cde7674f4c8197cda927a2ac47111cd2e firmware-fairphone-fp2-6785087409c73b046d11a5c88225d4177e172a1d-WCNSS_cfg.dat 619df454e0dc65ab62894b7f328c015729e8261919032ee9096bb4f983ddd6f7b98dd14f593b4c6b75cf86c09f090a9cde7674f4c8197cda927a2ac47111cd2e firmware-fairphone-fp2-6785087409c73b046d11a5c88225d4177e172a1d-WCNSS_cfg.dat
50625167fd5d3de8b834327a518714299972de3bd3077cb10d4317fb8135b52eb2f0d89f696f48e0530ac8d7a20e76ad01e30ebabec405ef241dc8b1cd52d94c firmware-fairphone-fp2-6785087409c73b046d11a5c88225d4177e172a1d-WCNSS_qcom_cfg.ini 50625167fd5d3de8b834327a518714299972de3bd3077cb10d4317fb8135b52eb2f0d89f696f48e0530ac8d7a20e76ad01e30ebabec405ef241dc8b1cd52d94c firmware-fairphone-fp2-6785087409c73b046d11a5c88225d4177e172a1d-WCNSS_qcom_cfg.ini

18
main/adsp-audio/APKBUILD Normal file
View file

@ -0,0 +1,18 @@
pkgname=adsp-audio
pkgver=1
pkgrel=1
pkgdesc="Init script for enabling the adsp audio subsystem (downstream Android kernels)"
url="https://gitlab.com/postmarketOS/pmbootstrap"
arch="noarch"
license="GPL3+"
depends=""
makedepends=""
install="$pkgname.post-install"
subpackages=""
source="$pkgname.initd"
options=""
package() {
install -Dm755 "$srcdir/$pkgname.initd" "$pkgdir/etc/init.d/$pkgname"
}
sha512sums="1edd94b45d37d82b37e04a4f3ff9f3c116bee088a0f83c7b605a0107a3da4f5c9f7d0c1a50c082eb05914352979114135bde8942be9f6ac4fe3a7041e9190bc3 adsp-audio.initd"

View file

@ -0,0 +1,9 @@
#!/sbin/openrc-run
description="Initialize adsp audio subsystem"
start()
{
ebegin "Enabling audio subsystem"
echo 1 > /sys/kernel/boot_adsp/boot
}

View file

@ -0,0 +1,4 @@
#!/bin/sh
# Enable adsp-audio init script
rc-update add adsp-audio default

View file

@ -9,11 +9,10 @@ depends=""
makedepends="" makedepends=""
install="$pkgname.post-install" install="$pkgname.post-install"
subpackages="" subpackages=""
source="wcnss-wlan.initd $install" source="$pkgname.initd"
options="" options=""
package() { package() {
install -Dm755 "$srcdir/wcnss-wlan.initd" "$pkgdir/etc/init.d/wcnss-wlan" install -Dm755 "$srcdir/$pkgname.initd" "$pkgdir/etc/init.d/$pkgname"
} }
sha512sums="d4765230ab163dc1417e8a94a180be93996bb30e43b883b9359d120e8cf9b8714a4f7c7deb082e9b2b18ff86930f53dedfed17985b572119de679801b68f06c5 wcnss-wlan.initd sha512sums="d4765230ab163dc1417e8a94a180be93996bb30e43b883b9359d120e8cf9b8714a4f7c7deb082e9b2b18ff86930f53dedfed17985b572119de679801b68f06c5 wcnss-wlan.initd"
767cc4a51fbe52bc8874cd4b74c262b59fb8f1daad529f27bc81795d76e5765a8535dfa5cd5b236d76dcbd675716ee070899cc0bac7cc3dda461991221b0f334 wcnss-wlan.post-install"