[-]
[+]
|
Changed |
_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">7c7caed93bc09d358f05ab385b44e81874f1f616</param>
+ <param name="revision">c60108b79985105372da74062e523255277c9fce</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.74.tar.bz2/README
^
|
@@ -326,6 +326,11 @@
doing voicecall routing. If there is no voicecall audio you can
try enabling this quirk so that the realcall parameter is applied
when switching to voicecall profile.
+ * unload_call_exit
+ * Disabled by default.
+ * Some HAL module implementations get stuck in mutex or segfault when
+ trying to unload the module. To avoid confusing segfaults call
+ exit(0) instead of calling unload for the module.
For example, to disable input_atoi and enable close_input quirks, use module
argument
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.74.tar.bz2/src/common/droid-config.c
^
|
@@ -102,6 +102,43 @@
return config;
}
+pa_droid_config_audio *pa_droid_config_dup(const pa_droid_config_audio *config) {
+ pa_droid_config_audio *config_copy;
+ pa_droid_config_hw_module *module, *module_copy;
+ pa_droid_config_device *device, *device_copy;
+
+ pa_assert(config);
+
+ config_copy = pa_xnew0(pa_droid_config_audio, 1);
+
+ if (config->global_config)
+ config_copy->global_config = pa_xmemdup(config->global_config, sizeof(*config->global_config));
+
+ SLLIST_FOREACH(module, config->hw_modules) {
+ module_copy = pa_droid_config_hw_module_new(config_copy, module->name);
+ if (module->global_config)
+ module_copy->global_config = pa_xmemdup(module->global_config, sizeof(*module->global_config));
+
+ SLLIST_FOREACH(device, module->outputs) {
+ device_copy = pa_xmemdup(device, sizeof(*device));
+ device_copy->module = module_copy;
+ device_copy->name = pa_xstrdup(device->name);
+ SLLIST_APPEND(pa_droid_config_device, module_copy->outputs, device_copy);
+ }
+
+ SLLIST_FOREACH(device, module->inputs) {
+ device_copy = pa_xmemdup(device, sizeof(*device));
+ device_copy->module = module_copy;
+ device_copy->name = pa_xstrdup(device->name);
+ SLLIST_APPEND(pa_droid_config_device, module_copy->inputs, device_copy);
+ }
+
+ SLLIST_APPEND(pa_droid_config_hw_module, config_copy->hw_modules, module_copy);
+ }
+
+ return config_copy;
+}
+
pa_droid_config_audio *pa_parse_droid_audio_config(const char *filename) {
const char *suffix;
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.74.tar.bz2/src/common/droid-util.c
^
|
@@ -23,6 +23,7 @@
#include <config.h>
#endif
+#include <stdlib.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
@@ -78,6 +79,7 @@
{ "no_hw_volume", QUIRK_NO_HW_VOLUME },
{ "output_make_writable", QUIRK_OUTPUT_MAKE_WRITABLE },
{ "realcall", QUIRK_REALCALL },
+ { "unload_call_exit", QUIRK_UNLOAD_CALL_EXIT },
};
@@ -1008,7 +1010,7 @@
return pa_sprintf_malloc("droid-hardware-module-%s", module_id);
}
-static pa_droid_hw_module *droid_hw_module_open(pa_core *core, pa_droid_config_audio *config, const char *module_id) {
+static pa_droid_hw_module *droid_hw_module_open(pa_core *core, const pa_droid_config_audio *config, const char *module_id) {
const pa_droid_config_hw_module *module;
pa_droid_hw_module *hw = NULL;
struct hw_module_t *hwmod = NULL;
@@ -1019,13 +1021,13 @@
pa_assert(core);
pa_assert(module_id);
- pa_log_info("Droid hw module %s", VERSION);
-
if (!config) {
- pa_log("No configuration provided for opening module with id %s", module_id);
+ pa_log_debug("No configuration provided for opening module with id %s", module_id);
goto fail;
}
+ pa_log_info("Droid hw module %s", VERSION);
+
if (!(module = pa_droid_config_find_module(config, module_id))) {
pa_log("Couldn't find module with id %s", module_id);
goto fail;
@@ -1064,7 +1066,7 @@
hw->output_mutex = pa_mutex_new(true, false);
hw->input_mutex = pa_mutex_new(true, false);
hw->device = device;
- hw->config = config; /* We take ownership of config struct. */
+ hw->config = pa_droid_config_dup(config);
hw->enabled_module = pa_droid_config_find_module(hw->config, module_id);
hw->module_id = hw->enabled_module->name;
hw->shared_name = shared_name_get(hw->module_id);
@@ -1098,7 +1100,7 @@
return NULL;
}
-pa_droid_hw_module *pa_droid_hw_module_get(pa_core *core, pa_droid_config_audio *config, const char *module_id) {
+pa_droid_hw_module *pa_droid_hw_module_get(pa_core *core, const pa_droid_config_audio *config, const char *module_id) {
pa_droid_hw_module *hw;
char *shared_name;
@@ -1146,8 +1148,12 @@
if (hw->config)
pa_droid_config_free(hw->config);
- if (hw->device && !pa_droid_quirk(hw, QUIRK_UNLOAD_NO_CLOSE))
- audio_hw_device_close(hw->device);
+ if (hw->device) {
+ if (pa_droid_quirk(hw, QUIRK_UNLOAD_CALL_EXIT))
+ exit(EXIT_SUCCESS);
+ else if (!pa_droid_quirk(hw, QUIRK_UNLOAD_NO_CLOSE))
+ audio_hw_device_close(hw->device);
+ }
if (hw->hw_mutex)
pa_mutex_free(hw->hw_mutex);
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.74.tar.bz2/src/common/include/droid/droid-config.h
^
|
@@ -83,6 +83,7 @@
/* Config parser */
pa_droid_config_audio *pa_droid_config_load(pa_modargs *ma);
+pa_droid_config_audio *pa_droid_config_dup(const pa_droid_config_audio *config);
void pa_droid_config_free(pa_droid_config_audio *config);
pa_droid_config_audio *pa_parse_droid_audio_config_legacy(const char *filename);
pa_droid_config_audio *pa_parse_droid_audio_config_xml(const char *filename);
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.74.tar.bz2/src/common/include/droid/droid-util.h
^
|
@@ -215,6 +215,7 @@
QUIRK_NO_HW_VOLUME,
QUIRK_OUTPUT_MAKE_WRITABLE,
QUIRK_REALCALL,
+ QUIRK_UNLOAD_CALL_EXIT,
QUIRK_COUNT
};
@@ -224,9 +225,7 @@
/* Open hardware module */
/* 'config' can be NULL if it is assumed that hw module with module_id already is open. */
-/* if opening of hw_module succeeds, config ownership is transferred to hw_module and config
- * shouldn't be freed. */
-pa_droid_hw_module *pa_droid_hw_module_get(pa_core *core, pa_droid_config_audio *config, const char *module_id);
+pa_droid_hw_module *pa_droid_hw_module_get(pa_core *core, const pa_droid_config_audio *config, const char *module_id);
pa_droid_hw_module *pa_droid_hw_module_ref(pa_droid_hw_module *hw);
void pa_droid_hw_module_unref(pa_droid_hw_module *hw);
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.74.tar.bz2/src/droid/droid-sink.c
^
|
@@ -1139,18 +1139,17 @@
* hw module ourself.
*
* First let's find out if hw module has already been opened, or if we need to
- * do it ourself.
- */
+ * do it ourself. */
if (!(u->hw_module = pa_droid_hw_module_get(u->core, NULL, module_id))) {
-
/* No hw module object in shared object db, let's open the module now. */
-
if (!(config = pa_droid_config_load(ma)))
goto fail;
- /* Ownership of config transfers to hw_module if opening of hw module succeeds. */
if (!(u->hw_module = pa_droid_hw_module_get(u->core, config, module_id)))
goto fail;
+
+ pa_droid_config_free(config);
+ config = NULL;
}
}
@@ -1309,6 +1308,7 @@
return u->sink;
fail:
+ pa_droid_config_free(config);
pa_xfree(thread_name);
if (config)
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.74.tar.bz2/src/droid/droid-source.c
^
|
@@ -596,15 +596,20 @@
u->card_data = card_data;
pa_assert_se((u->hw_module = pa_droid_hw_module_get(u->core, NULL, card_data->module_id)));
} else {
- /* Stand-alone source */
-
+ /* Source wasn't created from inside card module, so we'll need to open
+ * hw module ourself.
+ *
+ * First let's find out if hw module has already been opened, or if we need to
+ * do it ourself. */
if (!(u->hw_module = pa_droid_hw_module_get(u->core, NULL, module_id))) {
if (!(config = pa_droid_config_load(ma)))
goto fail;
- /* Ownership of config transfers to hw_module if opening of hw module succeeds. */
if (!(u->hw_module = pa_droid_hw_module_get(u->core, config, module_id)))
goto fail;
+
+ pa_droid_config_free(config);
+ config = NULL;
}
}
@@ -720,11 +725,9 @@
return u->source;
fail:
+ pa_droid_config_free(config);
pa_xfree(thread_name);
- if (config)
- pa_xfree(config);
-
if (u)
userdata_free(u);
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.74.tar.bz2/src/droid/module-droid-card.c
^
|
@@ -720,14 +720,21 @@
u->core = m->core;
m->userdata = u;
- if (!(config = pa_droid_config_load(ma)))
- goto fail;
-
module_id = pa_modargs_get_value(ma, "module_id", DEFAULT_MODULE_ID);
- /* Ownership of config transfers to hw_module if opening of hw module succeeds. */
- if (!(u->hw_module = pa_droid_hw_module_get(u->core, config, module_id)))
- goto fail;
+ /* First let's find out if hw module has already been opened, or if we need to
+ * do it ourself. */
+ if (!(u->hw_module = pa_droid_hw_module_get(u->core, NULL, module_id))) {
+ /* No hw module object in shared object db, let's open the module now. */
+ if (!(config = pa_droid_config_load(ma)))
+ goto fail;
+
+ if (!(u->hw_module = pa_droid_hw_module_get(u->core, config, module_id)))
+ goto fail;
+
+ pa_droid_config_free(config);
+ config = NULL;
+ }
if ((quirks = pa_modargs_get_value(ma, "quirks", NULL))) {
if (!pa_droid_quirk_parse(u->hw_module, quirks)) {
@@ -835,6 +842,8 @@
return 0;
fail:
+ pa_droid_config_free(config);
+
if (ma)
pa_modargs_free(ma);
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.74.tar.bz2/src/droid/module-droid-keepalive.c
^
|
@@ -103,42 +103,52 @@
u->active = false;
}
-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);
+static void update_sink(pa_sink *sink, struct userdata *u) {
+ pa_assert(sink);
pa_assert(u);
- if (pa_source_isinstance(o)) {
- pa_source *s = PA_SOURCE(o);
+ if (pa_sink_get_state(sink) != PA_SINK_SUSPENDED)
+ start(u);
+ else
+ stop(u);
+}
- /* Don't react on monitor state changes. */
- if (!s->monitor_of) {
- pa_source_state_t state = pa_source_get_state(s);
-
- if (state != PA_SOURCE_SUSPENDED)
- start(u);
- else
- stop(u);
- }
- } else if (pa_sink_isinstance(o)) {
- pa_sink *s = PA_SINK(o);
- pa_sink_state_t state = pa_sink_get_state(s);
+static void update_source(pa_source *source, struct userdata *u) {
+ pa_assert(source);
+ pa_assert(u);
- if (state != PA_SINK_SUSPENDED)
+ /* 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);
- struct userdata *u = pa_xnew0(struct userdata, 1);
+ u = pa_xnew0(struct userdata, 1);
u->core = m->core;
u->active = false;
u->module = m;
@@ -152,6 +162,12 @@
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:
@@ -173,7 +189,7 @@
pa_hook_slot_free(u->source_state_changed_slot);
if (u->keepalive) {
- stop(u);
+ pa_droid_keepalive_stop(u->keepalive);
pa_droid_keepalive_free(u->keepalive);
}
|