hybris/pulseaudio-modules-droid: upgrade to 12.2.84 and make configurable (!931)

Signed-off-by: Danct12 <danct12@disroot.org>
This commit is contained in:
Danct12 2020-02-09 17:59:22 +03:00 committed by Oliver Smith
parent c79a5df924
commit 29de974b89
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
3 changed files with 19 additions and 173 deletions

View file

@ -1,147 +0,0 @@
From 78273e5c65600392ad077bd05d6e8703553acae3 Mon Sep 17 00:00:00 2001
From: Alexey Min <alexey.min@gmail.com>
Date: Sun, 6 Oct 2019 23:14:46 +0300
Subject: [PATCH] Fix compatibility with pulseaudio>=13.0
There were some API changes:
- https://gitlab.freedesktop.org/pulseaudio/pulseaudio/commit/878ef440797f0fe319dcb1e866c29cec39b8a36d
- https://gitlab.freedesktop.org/pulseaudio/pulseaudio/commit/6665b466d28ca6f166c22846777f541f5bc9cef7
Leading to:
Error relocating /usr/lib/pulse-13.0/modules/libdroid-sink.so: pa_make_realtime: symbol not found
Error relocating /usr/lib/pulse-13.0/modules/libdroid-source.so: pa_make_realtime: symbol not found
Error relocating /usr/lib/pulse-13.0/modules/libdroid-source.so: pa_source_get_state: symbol not found
Fixes are:
- include <pulse/util.h>, replace pa_make_realtime -> pa_thread_make_realtime
- replace pa_source_get_state(X) -> X->state
- replace pa_sink_get_state(X) -> X->state
---
src/droid/droid-sink.c | 5 +++++
src/droid/droid-source.c | 9 +++++++++
src/droid/module-droid-keepalive.c | 17 +++++++++++++++++
3 files changed, 31 insertions(+)
diff --git a/src/droid/droid-sink.c b/src/droid/droid-sink.c
index a857f6c..1cb290e 100644
--- a/src/droid/droid-sink.c
+++ b/src/droid/droid-sink.c
@@ -54,6 +54,7 @@
#include <pulsecore/time-smoother.h>
#include <pulsecore/hashmap.h>
#include <pulsecore/core-subscribe.h>
+#include <pulse/version.h>
#include "droid-sink.h"
#include <droid/droid-util.h>
@@ -371,7 +372,11 @@ static void thread_func(void *userdata) {
pa_log_debug("Thread starting up.");
if (u->core->realtime_scheduling)
+#if (PA_CHECK_VERSION(13,0,0))
+ pa_thread_make_realtime(u->core->realtime_priority);
+#else
pa_make_realtime(u->core->realtime_priority);
+#endif
pa_thread_mq_install(&u->thread_mq);
diff --git a/src/droid/droid-source.c b/src/droid/droid-source.c
index 999060f..55ff99f 100644
--- a/src/droid/droid-source.c
+++ b/src/droid/droid-source.c
@@ -51,6 +51,7 @@
#include <pulsecore/rtpoll.h>
#include <pulsecore/time-smoother.h>
#include <pulsecore/resampler.h>
+#include <pulse/version.h>
#include "droid-source.h"
#include <droid/droid-util.h>
@@ -208,7 +209,11 @@ static void thread_func(void *userdata) {
pa_log_debug("Thread starting up.");
if (u->core->realtime_scheduling)
+#if (PA_CHECK_VERSION(13,0,0))
+ pa_thread_make_realtime(u->core->realtime_priority);
+#else
pa_make_realtime(u->core->realtime_priority);
+#endif
pa_thread_mq_install(&u->thread_mq);
@@ -366,7 +371,11 @@ static int source_set_port_cb(pa_source *s, pa_device_port *p) {
pa_log_debug("Source set port %u", data->device);
+#if (PA_CHECK_VERSION(13,0,0))
+ if (!PA_SOURCE_IS_OPENED(u->source->state))
+#else
if (!PA_SOURCE_IS_OPENED(pa_source_get_state(u->source)))
+#endif
do_routing(u, data->device);
else {
pa_asyncmsgq_post(u->source->asyncmsgq, PA_MSGOBJECT(u->source), SOURCE_MESSAGE_DO_ROUTING, PA_UINT_TO_PTR(data->device), 0, NULL, NULL);
diff --git a/src/droid/module-droid-keepalive.c b/src/droid/module-droid-keepalive.c
index 5f0b70a..40b2b9e 100644
--- a/src/droid/module-droid-keepalive.c
+++ b/src/droid/module-droid-keepalive.c
@@ -31,6 +31,7 @@
#endif
#include <pulse/xmalloc.h>
+#include <pulse/version.h>
#include <pulsecore/core.h>
#include <pulsecore/i18n.h>
@@ -86,7 +87,11 @@ static void stop(struct userdata *u) {
return;
while ((sink = pa_idxset_iterate(u->core->sinks, &state, NULL))) {
+#if (PA_CHECK_VERSION(13,0,0))
+ if (sink->state != PA_SINK_SUSPENDED)
+#else
if (pa_sink_get_state(sink) != PA_SINK_SUSPENDED)
+#endif
return;
}
@@ -94,7 +99,11 @@ static void stop(struct userdata *u) {
while ((source = pa_idxset_iterate(u->core->sources, &state, NULL))) {
if (source->monitor_of)
continue;
+#if (PA_CHECK_VERSION(13,0,0))
+ if (source->state != PA_SOURCE_SUSPENDED)
+#else
if (pa_source_get_state(source) != PA_SOURCE_SUSPENDED)
+#endif
return;
}
@@ -107,7 +116,11 @@ static void update_sink(pa_sink *sink, struct userdata *u) {
pa_assert(sink);
pa_assert(u);
+#if (PA_CHECK_VERSION(13,0,0))
+ if (sink->state != PA_SINK_SUSPENDED)
+#else
if (pa_sink_get_state(sink) != PA_SINK_SUSPENDED)
+#endif
start(u);
else
stop(u);
@@ -119,7 +132,11 @@ static void update_source(pa_source *source, struct userdata *u) {
/* Don't react on monitor state changes. */
if (!source->monitor_of) {
+#if (PA_CHECK_VERSION(13,0,0))
+ if (source->state != PA_SOURCE_SUSPENDED)
+#else
if (pa_source_get_state(source) != PA_SOURCE_SUSPENDED)
+#endif
start(u);
else
stop(u);
--
2.21.0

View file

@ -5,22 +5,20 @@ pkgname="pulseaudio-modules-droid"
pkgver=13.0
# _pkgver used in URL to download tarball
# Yes, we can build slightly older modules version against newer pulseaudio, if we are lucky
_pkgver=12.2.79
pkgrel=1
_pkgver=12.2.84
pkgrel=2
pkgdesc="PulseAudio Droid modules by Mer project"
url="https://github.com/mer-hybris/pulseaudio-modules-droid"
arch="armv7 aarch64"
arch="armhf armv7 aarch64"
license="LGPL-2.1-or-later"
depends="pulseaudio"
makedepends="autoconf automake libtool m4 intltool dbus-dev expat-dev pulseaudio-dev pulsecore-private-headers android-headers-7.1 android-headers-7.1-caf libhybris-dev libhybris-7.1"
options="!check" # No test suite available
source="
$pkgname-$_pkgver.tar.gz::https://github.com/mer-hybris/$pkgname/archive/$_pkgver.tar.gz
$pkgname-$_pkgver.tar.gz::https://github.com/mer-hybris/pulseaudio-modules-droid/archive/$_pkgver.tar.gz
0001-configure-ac-compat.patch
0002-Fix-compatibility-with-pulseaudio-13.0.patch
"
install="$pkgname.post-install"
subpackages=""
_headers_variants="7.1 7.1-caf"
for _ver in $_headers_variants; do
subpackages="$subpackages $pkgname-$_ver:_variant"
@ -33,7 +31,6 @@ _list_of_libs="
libdroid-source.so
libdroid-util.so
module-droid-card.so
module-droid-keepalive.so
module-droid-sink.so
module-droid-source.so
"
@ -76,7 +73,7 @@ build() {
make
# each variation is installed into a unique temporary directory
make DESTDIR="${_tmppkgdir}/$pkgname-$_ver" install
make DESTDIR="$_tmppkgdir/$pkgname-$_ver" install
done
}
@ -92,11 +89,10 @@ _variant() {
mkdir -p "$subpkgdir"
# Copy libs from temp install folder to a proper subpackage dir
for _lib in $_list_of_libs; do
install -Dm644 ${_tmppkgdir}/${subpkgname}/usr/lib/pulse-${pkgver}/modules/${_lib} \
${subpkgdir}/usr/lib/pulse-${pkgver}/modules/${_lib}
install -Dm644 "$_tmppkgdir/$subpkgname/usr/lib/pulse-$pkgver/modules/$_lib" \
"$subpkgdir/usr/lib/pulse-$pkgver/modules/$_lib"
done
}
sha512sums="9190dfd5891e0ed580e3135eebb322a00ec99cd3af708047e75c23bd5bf6681151ac1facda08f933679464afff15d421168e549b0ae84756b0e3c97d52693865 pulseaudio-modules-droid-12.2.79.tar.gz
2aa283c64d8623c035522b89b62c80130d14c145a73e6193e2e98c26525cc12670e50f8db4649029e731b61d08c1e5ab2bd4e1a3dae8ca077bbdabe3a69eaa17 0001-configure-ac-compat.patch
e5cf7c3c11fa096bcd2fbe95c9e4135c0b9c1383b2c8c2c0cf43a554122849cc01d9e2b99cab9ec0ef51375ca013e653c6bdfd5c86145a18b3a70cef8bdf7b3e 0002-Fix-compatibility-with-pulseaudio-13.0.patch"
sha512sums="7a573573bbcfb3a6b3b82a6d75a79506809b00ab2f000b31cd2f81c6fa433daaa81eeb6a7965ab995e2e36ac87c02252dc1aad413447e82e3b70031dfa9d5e82 pulseaudio-modules-droid-12.2.84.tar.gz
2aa283c64d8623c035522b89b62c80130d14c145a73e6193e2e98c26525cc12670e50f8db4649029e731b61d08c1e5ab2bd4e1a3dae8ca077bbdabe3a69eaa17 0001-configure-ac-compat.patch"

View file

@ -2,19 +2,16 @@
# pulseaudio default config file name
DEFAULT_PA=/etc/pulse/default.pa
# configuration lines
L1="load-module module-droid-card"
append_line() {
FN=$1
LINE=$2
if ! grep -q "${LINE}" "${FN}"; then
echo "Adding $LINE..."
echo "${LINE}" >> "${FN}"
else
echo "Not adding ${LINE}"
fi
}
PA_LINES="
.ifexists /etc/pulse/arm_droid_card_custom.pa
.include /etc/pulse/arm_droid_card_custom.pa
.else
load-module module-droid-card
.endif
"
if [ -f ${DEFAULT_PA} ]; then
append_line "${DEFAULT_PA}" "${L1}"
if ! grep -q "module-droid-card" $DEFAULT_PA; then
echo "$PA_LINES" >> $DEFAULT_PA
fi
fi