modem/q6voiced: new aport (MR 1233)

linux-postmarketos-qcom-msm8916 now supports voice call audio.
However, at the moment the audio stream needs to be explicitly started
by opening some PCM audio devices when the call is started
(even though no audio data is written to the PCM device).

Eventually this should go away by implementing codec2codec support
for q6voice in the kernel. In that case, the stream would be started
once the audio routes are set up using ALSA UCM. However, this is a bit
complicated actually so for now it's nice to have a workaround:

q6voiced listens on dbus for signals from oFono, and opens/closes the
PCM device when a call is initiated/ended in oFono. This essentially
makes voice call audio work out of the box (provided that the audio
routing, e.g. Earpiece and a microphone is set up appropriately).

Co-Authored-By: Nikita Travkin <nikitos.tr@gmail.com>
This commit is contained in:
Minecrell 2020-05-13 22:18:50 +02:00 committed by Bart Ribbers
parent 8437d79df7
commit cc689bb4d1
No known key found for this signature in database
GPG key ID: 699D16185DAFAE61
2 changed files with 43 additions and 0 deletions

29
modem/q6voiced/APKBUILD Normal file
View file

@ -0,0 +1,29 @@
# Maintainer: Minecrell <minecrell@minecrell.net>
pkgname=q6voiced
pkgver=0_git20200523
_commit="8e3710eecd31821ca4133c912e135c9efc2ddf12"
pkgrel=0
pkgdesc="Enable q6voice audio when call is performed with oFono"
url="https://github.com/msm8916-mainline/linux"
arch="all"
license="MIT"
makedepends="tinyalsa-dev dbus-dev"
subpackages="$pkgname-openrc"
source="https://gitlab.com/postmarketOS/q6voiced/-/archive/$_commit/q6voiced-$_commit.tar.gz
q6voiced.initd
"
options="!check" # no tests
builddir="$srcdir/q6voiced-$_commit"
build() {
gcc -o q6voiced q6voiced.c -I/usr/include/dbus-1.0/ \
-I/usr/lib/dbus-1.0/include -ltinyalsa -ldbus-1
}
package() {
install -Dm755 q6voiced "$pkgdir"/usr/bin/q6voiced
install -Dm755 "$srcdir"/q6voiced.initd "$pkgdir"/etc/init.d/q6voiced
}
sha512sums="9ef4870e2b7a1796a1ca02e770669fd71d8e61968a2fc7e3235e278a1e066fdb6e5fe54ed6334b3337847ca777db5108060cf7bea822013a345aaa70c53bee83 q6voiced-8e3710eecd31821ca4133c912e135c9efc2ddf12.tar.gz
02e5b338f2b1ed2bbcb1f8cc29d57a5915bf5fc03bc946906b545d2c31bd16302399508bbe8000ec660eee54bb1a6407689a4f85631be727ebd963e1964a54b9 q6voiced.initd"

View file

@ -0,0 +1,14 @@
#!/sbin/openrc-run
supervisor=supervise-daemon
name="q6voiced"
description="Enable q6voice audio when call is performed with oFono"
# Note: q6voice_card/q6voice_device need to be set in /etc/conf.d/q6voiced
command="/usr/bin/q6voiced"
command_args="hw:${q6voice_card},${q6voice_device}"
supervise_daemon_args="--user nobody --group audio"
depend() {
need dbus
}