[-]
[+]
|
Added |
_service:tar_git:pulseaudio-modules-droid.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -6,7 +6,7 @@
<service name="tar_git">
<param name="url">https://github.com/mer-hybris/pulseaudio-modules-droid.git</param>
<param name="branch">master</param>
- <param name="revision">adebe4792926ff8e5ab4682fcfda2518710ca914</param>
+ <param name="revision">a574c42d7c4163b99b6c8492cd6cdf8f59fa9416</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Deleted |
_service:tar_git:pulseaudio-modules-droid-%{expand:%(echo.80+master.20191008112316.adebe47.tar.bz2/src/droid/keepalive.c
^
|
@@ -1,243 +0,0 @@
-/*
- * Copyright (C) 2013-2018 Jolla Ltd.
- *
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
- *
- * These PulseAudio Modules are free software; you can redistribute
- * it and/or modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <signal.h>
-#include <stdio.h>
-
-#ifdef HAVE_VALGRIND_MEMCHECK_H
-#include <valgrind/memcheck.h>
-#endif
-
-#include <pulse/rtclock.h>
-#include <pulse/timeval.h>
-#include <pulse/xmalloc.h>
-
-#include <pulsecore/core.h>
-#include <pulsecore/core-error.h>
-#include <pulsecore/dbus-shared.h>
-#include <pulsecore/dbus-util.h>
-#include <pulsecore/atomic.h>
-
-#include "keepalive.h"
-
-#define MCE_BUS (DBUS_BUS_SYSTEM)
-#define MCE_DBUS_NAME "com.nokia.mce"
-#define MCE_DBUS_PATH "/com/nokia/mce/request"
-#define MCE_DBUS_IFACE "com.nokia.mce.request"
-#define MCE_DBUS_KEEPALIVE_PERIOD_REQ "req_cpu_keepalive_period"
-#define MCE_DBUS_KEEPALIVE_START_REQ "req_cpu_keepalive_start"
-#define MCE_DBUS_KEEPALIVE_STOP_REQ "req_cpu_keepalive_stop"
-
-struct pa_droid_keepalive {
- pa_core *core;
- pa_dbus_connection *dbus_connection;
- DBusPendingCall *pending;
-
- pa_atomic_t started;
- pa_usec_t timeout;
- pa_time_event *timer_event;
-
-};
-
-pa_droid_keepalive* pa_droid_keepalive_new(pa_core *c) {
- pa_droid_keepalive *k;
- pa_dbus_connection *dbus;
- DBusError error;
-
- pa_assert(c);
-
- dbus_error_init(&error);
-
- dbus = pa_dbus_bus_get(c, MCE_BUS, &error);
- if (dbus_error_is_set(&error)) {
- pa_log("Failed to get %s bus: %s", MCE_BUS == DBUS_BUS_SESSION ? "session" : "system", error.message);
- dbus_error_free(&error);
- return NULL;
- }
-
- k = pa_xnew0(pa_droid_keepalive, 1);
- k->core = c;
- k->dbus_connection = dbus;
- k->timeout = 0;
- pa_atomic_store(&k->started, 0);
-
- return k;
-}
-
-static void send_dbus_signal(pa_dbus_connection *dbus) {
- DBusMessage *msg;
-
- pa_assert(dbus);
-
- /* pa_log_debug("Send keepalive heartbeat."); */
-
- pa_assert_se((msg = dbus_message_new_method_call(MCE_DBUS_NAME,
- MCE_DBUS_PATH,
- MCE_DBUS_IFACE,
- MCE_DBUS_KEEPALIVE_START_REQ)));
-
- dbus_connection_send(pa_dbus_connection_get(dbus), msg, NULL);
- dbus_message_unref(msg);
-}
-
-static void keepalive_cb(pa_mainloop_api *m, pa_time_event *e, const struct timeval *t, void *userdata) {
- pa_droid_keepalive *k = userdata;
-
- pa_assert(k);
- pa_assert(k->timer_event == e);
-
- send_dbus_signal(k->dbus_connection);
- pa_core_rttime_restart(k->core, k->timer_event, pa_rtclock_now() + k->timeout);
-}
-
-static void keepalive_start(pa_droid_keepalive *k) {
- pa_assert(k);
- pa_assert(k->timeout);
- pa_assert(!k->timer_event);
-
- pa_log_info("Start keepalive heartbeat with interval %lu seconds.", (unsigned long) (k->timeout / PA_USEC_PER_SEC));
-
- /* Send first keepalive heartbeat immediately. */
- send_dbus_signal(k->dbus_connection);
-
- k->timer_event = pa_core_rttime_new(k->core, pa_rtclock_now() + k->timeout, keepalive_cb, k);
-}
-
-static void pending_req_reply_cb(DBusPendingCall *pending, void *userdata) {
- pa_droid_keepalive *k = userdata;
- DBusMessage *msg;
- uint32_t period;
-
- pa_assert(pending);
- pa_assert(k);
- pa_assert(pending == k->pending);
-
- k->pending = NULL;
- pa_assert_se(msg = dbus_pending_call_steal_reply(pending));
-
- if (dbus_message_get_type(msg) == DBUS_MESSAGE_TYPE_ERROR) {
- pa_log("Failed to get %s", MCE_DBUS_KEEPALIVE_PERIOD_REQ);
- goto finish;
- }
-
- pa_assert_se(dbus_message_get_args(msg, NULL,
- DBUS_TYPE_INT32, &period,
- DBUS_TYPE_INVALID));
-
- k->timeout = PA_USEC_PER_SEC * period;
-
- keepalive_start(k);
-
-finish:
- dbus_message_unref(msg);
- dbus_pending_call_unref(pending);
-}
-
-void pa_droid_keepalive_start(pa_droid_keepalive *k) {
- DBusMessage *msg = NULL;
-
- pa_assert(k);
-
- /* Only allow first call go through. pa_atomic_inc() returns previous value before incrementing. */
- if (pa_atomic_inc(&k->started) > 0)
- return;
-
- pa_assert(!k->timer_event);
- pa_assert(!k->pending);
-
- /* Period time already requested, just start hearbeat. */
- if (k->timeout > 0) {
- keepalive_start(k);
- return;
- }
-
- pa_log_debug("Starting keepalive - Request keepalive period.");
- /* Send first keepalive heartbeat immediately. */
- send_dbus_signal(k->dbus_connection);
-
- pa_assert_se((msg = dbus_message_new_method_call(MCE_DBUS_NAME,
- MCE_DBUS_PATH,
- MCE_DBUS_IFACE,
- MCE_DBUS_KEEPALIVE_PERIOD_REQ)));
-
- dbus_connection_send_with_reply(pa_dbus_connection_get(k->dbus_connection), msg, &k->pending, -1);
- dbus_message_unref(msg);
-
- if (k->pending)
- dbus_pending_call_set_notify(k->pending, pending_req_reply_cb, k, NULL);
- else
- pa_log("D-Bus method call failed.");
-}
-
-void pa_droid_keepalive_stop(pa_droid_keepalive *k) {
- DBusMessage *msg;
-
- pa_assert(k);
-
- /* Only allow last call go through. pa_atomic_dec() returns previous value before decrementing. */
|
[-]
[+]
|
Deleted |
_service:tar_git:pulseaudio-modules-droid-%{expand:%(echo.80+master.20191008112316.adebe47.tar.bz2/src/droid/keepalive.h
^
|
@@ -1,44 +0,0 @@
-#ifndef foodroidkeepalivefoo
-#define foodroidkeepalivefoo
-
-/*
- * Copyright (C) 2013-2018 Jolla Ltd.
- *
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
- *
- * These PulseAudio Modules are free software; you can redistribute
- * it and/or modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <pulsecore/core.h>
-#include <pulsecore/core-util.h>
-#include <pulsecore/macro.h>
-#include <pulsecore/dbus-shared.h>
-#include <pulsecore/atomic.h>
-
-typedef struct pa_droid_keepalive pa_droid_keepalive;
-
-pa_droid_keepalive* pa_droid_keepalive_new(pa_core *c);
-void pa_droid_keepalive_free(pa_droid_keepalive *k);
-
-void pa_droid_keepalive_start(pa_droid_keepalive *k);
-void pa_droid_keepalive_stop(pa_droid_keepalive *k);
-
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:pulseaudio-modules-droid-%{expand:%(echo.80+master.20191008112316.adebe47.tar.bz2/src/droid/module-droid-keepalive-symdef.h
^
|
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2013-2018 Jolla Ltd.
- *
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
- *
- * These PulseAudio Modules are free software; you can redistribute
- * it and/or modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA.
- */
-#ifndef foomoduledroidkeepalivesymdeffoo
-#define foomoduledroidkeepalivesymdeffoo
-
-#include <pulsecore/core.h>
-#include <pulsecore/module.h>
-
-#define pa__init module_droid_keepalive_LTX_pa__init
-#define pa__done module_droid_keepalive_LTX_pa__done
-#define pa__get_author module_droid_keepalive_LTX_pa__get_author
-#define pa__get_description module_droid_keepalive_LTX_pa__get_description
-#define pa__get_usage module_droid_keepalive_LTX_pa__get_usage
-#define pa__get_version module_droid_keepalive_LTX_pa__get_version
-
-int pa__init(struct pa_module*m);
-void pa__done(struct pa_module*m);
-
-const char* pa__get_author(void);
-const char* pa__get_description(void);
-const char* pa__get_usage(void);
-const char* pa__get_version(void);
-
-#endif
|
[-]
[+]
|
Deleted |
_service:tar_git:pulseaudio-modules-droid-%{expand:%(echo.80+master.20191008112316.adebe47.tar.bz2/src/droid/module-droid-keepalive.c
^
|
@@ -1,198 +0,0 @@
-/*
- * Copyright (C) 2013-2018 Jolla Ltd.
- *
- * Contact: Juho Hämäläinen <juho.hamalainen@jolla.com>
- *
- * These PulseAudio Modules are free software; you can redistribute
- * it and/or modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <signal.h>
-#include <stdio.h>
-
-#ifdef HAVE_VALGRIND_MEMCHECK_H
-#include <valgrind/memcheck.h>
-#endif
-
-#include <pulse/xmalloc.h>
-
-#include <pulsecore/core.h>
-#include <pulsecore/i18n.h>
-#include <pulsecore/module.h>
-#include <pulsecore/sink.h>
-#include <pulsecore/source.h>
-#include <pulsecore/modargs.h>
-#include <pulsecore/core-util.h>
-#include <pulsecore/log.h>
-#include <pulsecore/macro.h>
-#include <pulsecore/idxset.h>
-
-#include "keepalive.h"
-
-#include "module-droid-keepalive-symdef.h"
-
-PA_MODULE_AUTHOR("Juho Hämäläinen");
-PA_MODULE_DESCRIPTION("Droid keepalive. Send cpu wakeup heartbeat while streams are active.");
-PA_MODULE_VERSION(PACKAGE_VERSION);
-PA_MODULE_USAGE(
- "-"
-);
-
-static const char* const valid_modargs[] = {
- NULL,
-};
-
-struct userdata {
- pa_core *core;
- pa_module *module;
-
- pa_droid_keepalive *keepalive;
- bool active;
- pa_hook_slot *sink_state_changed_slot;
- pa_hook_slot *source_state_changed_slot;
-};
-
-static void start(struct userdata *u) {
- if (u->active)
- return;
-
- u->active = true;
-
- pa_droid_keepalive_start(u->keepalive);
-}
-
-static void stop(struct userdata *u) {
- void *state = NULL;
- pa_sink *sink;
- pa_source *source;
-
- if (!u->active)
- return;
-
- while ((sink = pa_idxset_iterate(u->core->sinks, &state, NULL))) {
- if (pa_sink_get_state(sink) != PA_SINK_SUSPENDED)
- return;
- }
-
- state = NULL;
- while ((source = pa_idxset_iterate(u->core->sources, &state, NULL))) {
- if (source->monitor_of)
- continue;
- if (pa_source_get_state(source) != PA_SOURCE_SUSPENDED)
- return;
- }
-
- /* We get here if all sinks and sources are in suspended state. */
- pa_droid_keepalive_stop(u->keepalive);
- u->active = false;
-}
-
-static void update_sink(pa_sink *sink, struct userdata *u) {
- pa_assert(sink);
- pa_assert(u);
-
- if (pa_sink_get_state(sink) != PA_SINK_SUSPENDED)
- start(u);
- else
- stop(u);
-}
-
-static void update_source(pa_source *source, struct userdata *u) {
- pa_assert(source);
- pa_assert(u);
-
- /* Don't react on monitor state changes. */
- if (!source->monitor_of) {
- if (pa_source_get_state(source) != PA_SOURCE_SUSPENDED)
- start(u);
- else
- stop(u);
- }
-}
-
-static pa_hook_result_t device_state_changed_hook_cb(pa_core *c, pa_object *o, struct userdata *u) {
- pa_assert(c);
- pa_object_assert_ref(o);
- pa_assert(u);
-
- if (pa_source_isinstance(o))
- update_source(PA_SOURCE(o), u);
- else if (pa_sink_isinstance(o))
- update_sink(PA_SINK(o), u);
-
- return PA_HOOK_OK;
-}
-
-
-int pa__init(pa_module *m) {
- uint32_t idx = 0;
- pa_sink *sink;
- pa_source *source;
- struct userdata *u;
-
- pa_assert(m);
-
- u = pa_xnew0(struct userdata, 1);
- u->core = m->core;
- u->active = false;
- u->module = m;
- m->userdata = u;
-
- if (!(u->keepalive = pa_droid_keepalive_new(u->core))) {
- pa_log("Failed to create keepalive handler.");
- goto fail;
- }
-
- u->sink_state_changed_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_STATE_CHANGED], PA_HOOK_NORMAL, (pa_hook_cb_t) device_state_changed_hook_cb, u);
- u->source_state_changed_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SOURCE_STATE_CHANGED], PA_HOOK_NORMAL, (pa_hook_cb_t) device_state_changed_hook_cb, u);
-
- PA_IDXSET_FOREACH(source, u->core->sources, idx)
- update_source(source, u);
-
- PA_IDXSET_FOREACH(sink, u->core->sinks, idx)
- update_sink(sink, u);
-
- return 0;
-
-fail:
- pa__done(m);
-
- return -1;
-}
-
-void pa__done(pa_module *m) {
- struct userdata *u;
-
- pa_assert(m);
-
- if ((u = m->userdata)) {
-
- if (u->sink_state_changed_slot)
- pa_hook_slot_free(u->sink_state_changed_slot);
- if (u->source_state_changed_slot)
- pa_hook_slot_free(u->source_state_changed_slot);
-
- if (u->keepalive) {
- pa_droid_keepalive_stop(u->keepalive);
- pa_droid_keepalive_free(u->keepalive);
- }
-
- pa_xfree(u);
- }
-}
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-12.2.82.tar.bz2/README
^
|
@@ -80,10 +80,12 @@
By default files are tried in following order,
- /vendor/etc/audio_policy_configuration.xml (new xml format)
- /vendor/etc/audio_policy.conf (legacy format)
- /system/etc/audio_policy_configuration.xml (new xml format)
- /system/etc/audio_policy.conf (legacy format)
+ /odm/etc/audio_policy_configuration.xml (new xml format)
+ /vendor/etc/audio/audio_policy_configuration.xml (new xml format)
+ /vendor/etc/audio_policy_configuration.xml (new xml format)
+ /vendor/etc/audio_policy.conf (legacy format)
+ /system/etc/audio_policy_configuration.xml (new xml format)
+ /system/etc/audio_policy.conf (legacy format)
module-droid-card
-----------------
@@ -406,6 +408,4 @@
module-droid-keepalive
----------------------
-Keepalive module is MCE (https://github.com/nemomobile/mce) specific module
-tracking sink/source activity and keeping a WAKELOCK when there are active
-streams.
+Module relocated to its own package pulseaudio-module-keepalive.
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-12.2.82.tar.bz2/configure.ac
^
|
@@ -183,10 +183,6 @@
AC_SUBST(HYBRIS_CFLAGS)
AC_SUBST(HYBRIS_LIBS)
-PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.2])
-AC_SUBST(DBUS_CFLAGS)
-AC_SUBST(DBUS_LIBS)
-
#### expat (for xml config format parsing) (optional) ####
AC_ARG_ENABLE([xml],
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-12.2.82.tar.bz2/src/common/droid-config.c
^
|
@@ -66,6 +66,8 @@
#include <hardware/audio.h>
#include <hardware_legacy/audio_policy_conf.h>
+#define ODM_AUDIO_POLICY_CONFIG_XML_FILE "/odm/etc/audio_policy_configuration.xml"
+#define VENDOR_AUDIO_AUDIO_POLICY_CONFIG_XML_FILE "/vendor/etc/audio/audio_policy_configuration.xml"
#define VENDOR_AUDIO_POLICY_CONFIG_XML_FILE "/vendor/etc/audio_policy_configuration.xml"
#define SYSTEM_AUDIO_POLICY_CONFIG_XML_FILE "/system/etc/audio_policy_configuration.xml"
@@ -74,6 +76,8 @@
pa_droid_config_audio *config = NULL;
const char *manual_config;
const char *config_location[] = {
+ ODM_AUDIO_POLICY_CONFIG_XML_FILE,
+ VENDOR_AUDIO_AUDIO_POLICY_CONFIG_XML_FILE,
VENDOR_AUDIO_POLICY_CONFIG_XML_FILE,
AUDIO_POLICY_VENDOR_CONFIG_FILE,
SYSTEM_AUDIO_POLICY_CONFIG_XML_FILE,
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-12.2.82.tar.bz2/src/droid/Makefile.am
^
|
@@ -15,17 +15,11 @@
modlibexec_LTLIBRARIES = \
libdroid-sink.la \
libdroid-source.la \
- module-droid-keepalive.la \
module-droid-sink.la \
module-droid-source.la \
module-droid-card.la
-noinst_HEADERS = module-droid-sink-symdef.h module-droid-source-symdef.h module-droid-card-symdef.h module-droid-keepalive-symdef.h
-
-module_droid_keepalive_la_SOURCES = keepalive.c keepalive.h module-droid-keepalive.c
-module_droid_keepalive_la_LDFLAGS = -module -avoid-version -Wl,-z,noexecstack
-module_droid_keepalive_la_LIBADD = $(AM_LIBADD) $(DBUS_LIBS)
-module_droid_keepalive_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
+noinst_HEADERS = module-droid-sink-symdef.h module-droid-source-symdef.h module-droid-card-symdef.h
libdroid_sink_la_SOURCES = droid-sink.c droid-sink.h
libdroid_sink_la_LDFLAGS = -avoid-version -Wl,-z,noexecstack -lhybris-common
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-12.2.82.tar.bz2/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 @@
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);
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-12.2.82.tar.bz2/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>
@@ -211,7 +212,11 @@
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,7 @@
pa_log_debug("Source set port %#010x", data->device);
- if (!PA_SOURCE_IS_OPENED(pa_source_get_state(u->source)))
+ if (!PA_SOURCE_IS_OPENED(u->source->state))
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);
|