[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid.spec
^
|
|
[-]
[+]
|
Deleted |
_service:tar_git:pulseaudio-modules-droid-12.2.83.tar.bz2/README
^
|
@@ -1,420 +0,0 @@
-PulseAudio Droid modules
-========================
-
-Building of droid modules is split to two packages
- * common (and common-devel) which contains shared library code for use in
- PulseAudio modules in this package and for inclusion in other projects
- * droid with actual PulseAudio modules
-
-Supported Android versions:
-
- * 4.1.x with Qualcomm extensions (tested with 4.1.2)
- * 4.2.x
- * 4.4.x
- * 5.x
- * 6.0.x
- * 7.x
- * 8.x
- * 9.x
-
-Headers for defining devices and strings for different droid versions are in
-src/common/droid-util-audio.h (legacy headers for Jolla 1 in droid-util-41qc.h).
-
-When new devices with relevant new enums appear, add enum check to configure.ac.
-CC_CHECK_DROID_ENUM macro will create macros HAVE_ENUM_FOO, STRING_ENTRY_IF_FOO
-and FANCY_ENTRY_IF_FOO if enum FOO exists in HAL audio.h.
-
-For example:
-
-# configure.ac:
- CC_CHECK_DROID_ENUM([${DROIDHEADERS_CFLAGS}], [AUDIO_DEVICE_OUT_IP])
- CC_CHECK_DROID_ENUM([${DROIDHEADERS_CFLAGS}], [AUDIO_DEVICE_OUT_OTHER_NEW])
-
-# and then in droid-util-audio.h add macros to proper tables:
- /* string_conversion_table_output_device[] */
- STRING_ENTRY_IF_OUT_IP
- STRING_ENTRY_IF_OUT_OTHER_NEW
-
- /* string_conversion_table_output_device_fancy[] */
- FANCY_ENTRY_IF_OUT_IP("output-ip")
- FANCY_ENTRY_IF_OUT_OTHER_NEW("output-other_new")
-
-In addition to the above macros there are also now defines
-HAVE_ENUM_AUDIO_DEVICE_OUT_IP and HAVE_ENUM_AUDIO_DEVICE_OUT_OTHER_NEW.
-
-The purpose of droid-modules is to "replace AudioFlinger". Many hardware
-adaptations use ALSA as the kernel interface, but there is no saying that
-someday vendor would create and use something proprietary or otherwise
-different from ALSA. Also the ALSA implementation in droid devices may contain
-funny ways to achieve things (notable example is voicecall) which might be
-difficult to do if interfacing directly with ALSA to replace AudioFlinger.
-Also using ALSA directly would mean that the whole HAL adaptation would need to
-be ported for each new device adaptation. With droid-modules this is much more
-simpler, with somewhat stable HAL (HALv3 as of now, also different vendors add
-their own incompatible extensions) API. In best scenarios using droid-modules
-with new device is just compiling against target.
-
-Components
-==========
-
-common
-------
-
-The common part of PulseAudio Droid modules contains library for handling
-most operations towards audio HAL.
-
-### Audio policy configuration parsing
-
-To populate our configuration structs there exists two parsers, legacy parser
-for old .conf format present in Android versions 7.0 and older and new xml
-format present from version 7.0 upwards. The legacy format is obsoleted in
-version 7.0 but by default still in use and most 7.0 adaptations probably
-contain the legacy format. But 8.0 adaptations and up start to include only
-the new style xml format configuration files.
-
-### Configuration files
-
-By default new style xml format is tried first and if it is not found old
-config is read next. If the configuration is in non-default location for
-some reason "config" module argument (available for all modules, card, sink,
-and source) can be used to point to the configuration file location.
-
-By default files are tried in following order,
-
- /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
------------------
-
-Ideally only module-droid-card is loaded and then droid-card loads
-configuration, creates profiles and loads sinks and sources based on the
-selected profile.
-
-default profile
----------------
-
-When module-droid-card is loaded with default arguments, droid-card will try
-to create a default profile (called surprisingly "default"). The default
-profile will try to merge useful output and input streams to one profile,
-to allow use of possible low latency or deep buffer outputs.
-
-For example configuration with
-
- audio_hw_modules {
- primary {
- outputs {
- primary {}
- deep_buffer {}
- }
- inputs {
- primary {}
- voice_rx {}
- }
- }
- other {
- ...
- }
- }
-
-The default profile would contain two sinks, sink.primary and sink.deep_buffer
-and one source, source.droid.
-
-Usually this default profile is everything that is needed in normal use, and
-additional profiles created should be needed only for testing things out etc.
-
-virtual profiles
-----------------
-
-In addition to aforementioned card profiles, droid-card creates some additional
-virtual profiles. These virtual profiles are used when enabling voicecall
-routings etc. When virtual profile is enabled, possible sinks and sources
-previously active profile had are not removed.
-
-As an illustration, following command line sequence enables voicecall mode and
-routes audio to internal handsfree (ihf - "handsfree speaker"):
-
-(Before starting, droid_card.primary is using profile primary-primary and
-sink.primary port output-speaker)
-
-pactl set-card-profile droid_card.primary voicecall
-pactl set-sink-port sink.primary output-parking
-pactl set-sink-port sink.primary output-speaker
-
-After this, when there is an active voicecall (created by ofono for example),
-voice audio starts to flow between modem and audio chip.
-
-To disable voicecall and return to media audio:
-
-pactl set-card-profile droid_card.primary primary-primary
-pactl set-sink-port sink.primary output-parking
-pactl set-sink-port sink.primary output-speaker
-
-With this example sequence sinks and sources are the ones from primary-primary
-card profile, and they are maintained for the whole duration of the voicecall
-and after.
-
-This sequence follows the droid HAL idea that when changing audio mode the mode
-change is done when next routing change happens. output-parking and
-input-parking ports are just convenience for PulseAudio, where setting already
-active port is a no-op (output/input-parking doesn't do any real routing
-changes).
-
-Current virtual profiles are:
- * voicecall
- * voicecall-record
- * communication
- * ringtone
-
-Communication profile is used for VoIP-like applications, to enable some
-voicecall related algorithms without being in voicecall. Ringtone profile
-should be used when ringtone is playing, to again enable possible loudness
-related optimizations etc. Voicecall-record profile can be enabled when
-voicecall profile is active.
-
-debugging profiles
-------------------
-
-If needed in favour of default profile one can opt to creating combinations
-of all output and input definitions in a module definition. This can be
-done by passing "default=false" to module-droid-card. Module argument
-module_id will then defines which module to load (by default "primary").
-Without default profile all input and output definitions are translated
-to PulseAudio card profiles. For example configuration with
-
- audio_hw_modules {
- primary {
- outputs {
- primary {}
- lpa {}
- }
- inputs {
- primary {}
- }
- }
- other {
|
[-]
[+]
|
Deleted |
_service:tar_git:pulseaudio-modules-droid-12.2.83.tar.bz2/src/droid/module-droid-card-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 foomoduledroidcardsymdeffoo
-#define foomoduledroidcardsymdeffoo
-
-#include <pulsecore/core.h>
-#include <pulsecore/module.h>
-
-#define pa__init module_droid_card_LTX_pa__init
-#define pa__done module_droid_card_LTX_pa__done
-#define pa__get_author module_droid_card_LTX_pa__get_author
-#define pa__get_description module_droid_card_LTX_pa__get_description
-#define pa__get_usage module_droid_card_LTX_pa__get_usage
-#define pa__get_version module_droid_card_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-12.2.83.tar.bz2/src/droid/module-droid-sink-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 foomoduledroidsinksymdeffoo
-#define foomoduledroidsinksymdeffoo
-
-#include <pulsecore/core.h>
-#include <pulsecore/module.h>
-
-#define pa__init module_droid_sink_LTX_pa__init
-#define pa__done module_droid_sink_LTX_pa__done
-#define pa__get_author module_droid_sink_LTX_pa__get_author
-#define pa__get_description module_droid_sink_LTX_pa__get_description
-#define pa__get_usage module_droid_sink_LTX_pa__get_usage
-#define pa__get_version module_droid_sink_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-12.2.83.tar.bz2/src/droid/module-droid-source-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 foomoduledroidsourcesymdeffoo
-#define foomoduledroidsourcesymdeffoo
-
-#include <pulsecore/core.h>
-#include <pulsecore/module.h>
-
-#define pa__init module_droid_source_LTX_pa__init
-#define pa__done module_droid_source_LTX_pa__done
-#define pa__get_author module_droid_source_LTX_pa__get_author
-#define pa__get_description module_droid_source_LTX_pa__get_description
-#define pa__get_usage module_droid_source_LTX_pa__get_usage
-#define pa__get_version module_droid_source_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
|
[-]
[+]
|
Added |
_service:tar_git:pulseaudio-modules-droid-14.2.92.tar.bz2/README.md
^
|
@@ -0,0 +1,442 @@
+PulseAudio Droid modules
+========================
+
+Building of droid modules is split to two packages
+* **common** (and **common-devel**) which contains shared library code for use in
+ PulseAudio modules in this package and for inclusion in other projects
+* **droid** with actual PulseAudio modules
+
+Supported Android versions:
+
+* 4.1.x with Qualcomm extensions (tested with 4.1.2)
+* 4.2.x
+* 4.4.x
+* 5.x
+* 6.0.x
+* 7.x
+* 8.x
+* 9.x
+* 10.x
+
+Headers for defining devices and strings for different droid versions are in
+src/common/droid-util-audio.h (legacy headers for Jolla 1 in droid-util-41qc.h).
+
+When new devices with relevant new enums appear, add enum check to configure.ac.
+CC_CHECK_DROID_ENUM macro will create macros HAVE_ENUM_FOO, STRING_ENTRY_IF_FOO
+and FANCY_ENTRY_IF_FOO if enum FOO exists in HAL audio.h.
+
+For example:
+
+ # configure.ac:
+ CC_CHECK_DROID_ENUM([${DROIDHEADERS_CFLAGS}], [AUDIO_DEVICE_OUT_IP])
+ CC_CHECK_DROID_ENUM([${DROIDHEADERS_CFLAGS}], [AUDIO_DEVICE_OUT_OTHER_NEW])
+
+ # and then in droid-util-audio.h add macros to proper tables:
+ /* string_conversion_table_output_device[] */
+ STRING_ENTRY_IF_OUT_IP
+ STRING_ENTRY_IF_OUT_OTHER_NEW
+
+ /* string_conversion_table_output_device_fancy[] */
+ FANCY_ENTRY_IF_OUT_IP("output-ip")
+ FANCY_ENTRY_IF_OUT_OTHER_NEW("output-other_new")
+
+In addition to the above macros there are also now defines
+HAVE_ENUM_AUDIO_DEVICE_OUT_IP and HAVE_ENUM_AUDIO_DEVICE_OUT_OTHER_NEW.
+
+The purpose of droid-modules is to "replace AudioFlinger". Many hardware
+adaptations use ALSA as the kernel interface, but there is no saying that
+someday vendor would create and use something proprietary or otherwise
+different from ALSA. Also the ALSA implementation in droid devices may contain
+funny ways to achieve things (notable example is voicecall) which might be
+difficult to do if interfacing directly with ALSA to replace AudioFlinger.
+Also using ALSA directly would mean that the whole HAL adaptation would need to
+be ported for each new device adaptation. With droid-modules this is much more
+simpler, with somewhat stable HAL (HALv3 as of now, also different vendors add
+their own incompatible extensions) API. In best scenarios using droid-modules
+with new device is just compiling against target.
+
+Components
+==========
+
+common
+------
+
+The common part of PulseAudio Droid modules contains library for handling
+most operations towards audio HAL.
+
+### Audio policy configuration parsing
+
+To populate our configuration structs there exists two parsers, legacy parser
+for old .conf format present in Android versions 7.0 and older and new xml
+format present from version 7.0 upwards. The legacy format is obsoleted in
+version 7.0 but by default still in use and most 7.0 adaptations probably
+contain the legacy format. But 8.0 adaptations and up start to include only
+the new style xml format configuration files.
+
+### Configuration files
+
+By default new style xml format is tried first and if it is not found old
+config is read next. If the configuration is in non-default location for
+some reason "config" module argument (available for all modules, card, sink,
+and source) can be used to point to the configuration file location.
+
+By default files are tried in following order,
+
+ /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
+-----------------
+
+Ideally only module-droid-card is loaded and then droid-card loads
+configuration, creates profiles and loads sinks and sources based on the
+selected profile.
+
+default profile
+---------------
+
+When module-droid-card is loaded with default arguments, droid-card will try
+to create a default profile (called surprisingly "default"). The default
+profile will try to merge useful output and input streams to one profile,
+to allow use of possible low latency or deep buffer outputs.
+
+For example configuration with
+
+ audio_hw_modules {
+ primary {
+ outputs {
+ primary {}
+ deep_buffer {}
+ }
+ inputs {
+ primary {}
+ voice_rx {}
+ }
+ }
+ other {
+ ...
+ }
+ }
+
+The default profile would contain two sinks, sink.primary and sink.deep_buffer
+and one source, source.droid.
+
+Usually this default profile is everything that is needed in normal use, and
+additional profiles created should be needed only for testing things out etc.
+
+virtual profiles
+----------------
+
+In addition to aforementioned card profiles, droid-card creates some additional
+virtual profiles. These virtual profiles are used when enabling voicecall
+routings etc. When virtual profile is enabled, possible sinks and sources
+previously active profile had are not removed.
+
+As an illustration, following command line sequence enables voicecall mode and
+routes audio to internal handsfree (ihf - "handsfree speaker"):
+
+(Before starting, droid_card.primary is using profile primary-primary and
+sink.primary port output-speaker)
+
+ pactl set-card-profile droid_card.primary voicecall
+ pactl set-sink-port sink.primary output-parking
+ pactl set-sink-port sink.primary output-speaker
+
+After this, when there is an active voicecall (created by ofono for example),
+voice audio starts to flow between modem and audio chip.
+
+To disable voicecall and return to media audio:
+
+ pactl set-card-profile droid_card.primary primary-primary
+ pactl set-sink-port sink.primary output-parking
+ pactl set-sink-port sink.primary output-speaker
+
+With this example sequence sinks and sources are the ones from primary-primary
+card profile, and they are maintained for the whole duration of the voicecall
+and after.
+
+This sequence follows the droid HAL idea that when changing audio mode the mode
+change is done when next routing change happens. output-parking and
+input-parking ports are just convenience for PulseAudio, where setting already
+active port is a no-op (output/input-parking doesn't do any real routing
+changes).
+
+Current virtual profiles are:
+* voicecall
+* voicecall-record
+* communication
+* ringtone
+
+Communication profile is used for VoIP-like applications, to enable some
+voicecall related algorithms without being in voicecall. Ringtone profile
+should be used when ringtone is playing, to again enable possible loudness
+related optimizations etc. Voicecall-record profile can be enabled when
+voicecall profile is active.
+
+debugging profiles
+------------------
+
+If needed in favour of default profile one can opt to creating combinations
+of all output and input definitions in a module definition. This can be
+done by passing "default=false" to module-droid-card. Module argument
+module_id will then defines which module to load (by default "primary").
+Without default profile all input and output definitions are translated
+to PulseAudio card profiles. For example configuration with
+
+ audio_hw_modules {
+ primary {
+ outputs {
+ primary {}
+ lpa {}
+ }
+ inputs {
+ primary {}
+ }
+ }
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-14.2.92.tar.bz2/src/common/config-parser-xml.c
^
|
@@ -42,6 +42,7 @@
#include <pulse/xmalloc.h>
#include <pulsecore/core-util.h>
#include <pulsecore/core-error.h>
+#include <pulsecore/strbuf.h>
#include "droid/conversion.h"
#include "droid/sllist.h"
@@ -70,6 +71,7 @@
/* ELEMENT_profile */
#define ELEMENT_routes "routes"
#define ELEMENT_route "route"
+#define ELEMENT_include "xi:include"
#define ATTRIBUTE_version "version"
#define ATTRIBUTE_name "name"
@@ -83,6 +85,7 @@
#define ATTRIBUTE_sink "sink"
#define ATTRIBUTE_sources "sources"
#define ATTRIBUTE_type "type"
+#define ATTRIBUTE_href "href"
#define PORT_TYPE_sink "sink"
#define PORT_TYPE_source "source"
@@ -133,6 +136,7 @@
static void parse_item(struct parser_data *data, const char *str);
static bool parse_module(struct parser_data *data, const char *element_name, const XML_Char **attributes);
static bool parse_global_configuration(struct parser_data *data, const char *element_name, const XML_Char **attributes);
+static bool parse_module_include(struct parser_data *data, const char *element_name, const XML_Char **attributes);
static const struct element_parser element_parse_route = {
ELEMENT_route,
@@ -214,12 +218,20 @@
&element_parse_item
};
+static const struct element_parser element_parse_module_include = {
+ ELEMENT_include,
+ parse_module_include,
+ NULL,
+ &element_parse_attached_devices,
+ NULL
+};
+
static const struct element_parser element_parse_module = {
ELEMENT_module,
parse_module,
NULL,
NULL,
- &element_parse_attached_devices
+ &element_parse_module_include
};
static const struct element_parser element_parse_modules = {
@@ -309,9 +321,17 @@
struct module *next;
};
+struct includes {
+ char *href;
+ struct module *module;
+
+ struct includes *next;
+};
+
struct audio_policy_configuration {
struct global_configuration *global;
struct module *modules;
+ struct includes *includes;
};
struct parser_data {
@@ -319,7 +339,6 @@
const char *fn;
unsigned lineno;
- const struct element_parser *root;
const struct element_parser *current;
struct element_parser_stack *stack;
@@ -327,6 +346,7 @@
struct module *current_module;
struct mix_port *current_mix_port;
struct device_port *current_device_port;
+ struct includes *current_include;
};
@@ -412,9 +432,15 @@
pa_xfree(m);
}
+static void includes_free(struct includes *i) {
+ pa_assert(i);
+
+ pa_xfree(i->href);
+ pa_xfree(i);
+}
+
static void audio_policy_configuration_free(struct audio_policy_configuration *xml_config) {
struct global_configuration *global;
- struct module *m;
pa_assert(xml_config);
@@ -426,9 +452,16 @@
}
while (xml_config->modules) {
+ struct module *m;
SLLIST_STEAL_FIRST(m, xml_config->modules);
module_free(m);
- };
+ }
+
+ while (xml_config->includes) {
+ struct includes *i;
+ SLLIST_STEAL_FIRST(i, xml_config->includes);
+ includes_free(i);
+ }
pa_xfree(xml_config);
}
@@ -572,10 +605,37 @@
return true;
}
+static bool parse_module_include(struct parser_data *data, const char *element_name, const XML_Char **attributes) {
+ struct includes *i;
+ char *href = NULL;
+
+ if (!get_element_attr(data, attributes, true, ATTRIBUTE_href, &href)) {
+ pa_log("[%s:%u] Include but no href.", data->fn, data->lineno);
+ return false;
+ }
+
+ /* We ignore xpointer attribute for now and just use the module element
+ * we are currently in when parsing the included file. */
+
+ i = pa_xmalloc0(sizeof(*i));
+ i->module = data->current_module;
+ i->href = href;
+
+ SLLIST_APPEND(struct includes, data->conf->includes, i);
+
+ return true;
+}
+
static bool parse_module(struct parser_data *data, const char *element_name, const XML_Char **attributes) {
struct module *m;
char *halVersion = NULL;
+ if (data->current_include && data->current_include->module) {
+ /* We are processing included file, get our module definition from cache. */
+ data->current_module = data->current_include->module;
+ return true;
+ }
+
m = pa_xmalloc0(sizeof(*m));
get_element_attr(data, attributes, false, ATTRIBUTE_name, &m->name);
@@ -834,7 +894,7 @@
return parsed;
}
-static bool parse_file(struct parser_data *data, const char *filename) {
+static bool parse_file(struct parser_data *data, const struct element_parser *root, const char *filename) {
char buf[BUFSIZ];
FILE *f = NULL;
XML_Parser parser = NULL;
@@ -858,6 +918,8 @@
if (!data->conf)
data->conf = pa_xnew0(struct audio_policy_configuration, 1);
+ data->current = root;
+
XML_SetUserData(parser, data);
XML_SetElementHandler(parser, xml_start_element, xml_end_element);
XML_SetCharacterDataHandler(parser, xml_character_data_handler);
@@ -1020,6 +1082,31 @@
return config;
}
+/* Take base filename and relative path to filename and construct new
+ * path replacing file part from the base filename with new filename.
+ * For example, base_file="x/y/file.xml", filename="a/other.xml"
+ * result "x/y/a/other.xml"
+ */
+static char *build_path(const char *base_file, const char *filename) {
+ char *fn = NULL;
+ pa_strbuf *buf;
+ char *end;
+ int len;
+
+ pa_assert(base_file);
+ pa_assert(filename);
+
+ if ((end = strrchr(base_file, '/'))) {
+ buf = pa_strbuf_new();
+ len = end - base_file + 1;
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-14.2.92.tar.bz2/src/common/droid-util.c
^
|
@@ -27,6 +27,10 @@
#include <signal.h>
#include <stdio.h>
#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <grp.h>
#ifdef HAVE_VALGRIND_MEMCHECK_H
#include <valgrind/memcheck.h>
@@ -37,6 +41,7 @@
#include <pulse/volume.h>
#include <pulse/xmalloc.h>
#include <pulse/direction.h>
+#include <pulse/util.h>
#include <pulsecore/core.h>
#include <pulsecore/core-error.h>
@@ -82,19 +87,35 @@
{ "unload_call_exit", QUIRK_UNLOAD_CALL_EXIT },
{ "output_fast", QUIRK_OUTPUT_FAST },
{ "output_deep_buffer", QUIRK_OUTPUT_DEEP_BUFFER },
+ { "audio_cal_wait", QUIRK_AUDIO_CAL_WAIT },
+ { "standby_set_route", QUIRK_STANDBY_SET_ROUTE },
+ { "speaker_before_voice", QUIRK_SPEAKER_BEFORE_VOICE },
};
+#define QUIRK_AUDIO_CAL_WAIT_S (10)
+#define QUIRK_AUDIO_CAL_FILE "/data/vendor/audio/cirrus_sony.cal"
+#define QUIRK_AUDIO_CAL_GROUP "audio"
+#define QUIRK_AUDIO_CAL_MODE (0664)
#define DEFAULT_PRIORITY (100)
#define DEFAULT_AUDIO_FORMAT (AUDIO_FORMAT_PCM_16_BIT)
-static const char * const droid_combined_auto_outputs[3] = { "primary", "low_latency", NULL };
-static const char * const droid_combined_auto_inputs[2] = { "primary", NULL };
+#ifndef AUDIO_PARAMETER_VALUE_ON
+#define AUDIO_PARAMETER_VALUE_ON "on"
+#endif
+
+#ifndef AUDIO_PARAMETER_VALUE_OFF
+#define AUDIO_PARAMETER_VALUE_OFF "off"
+#endif
+
+#define AUDIO_PARAMETER_BT_SCO_ON "BT_SCO=" AUDIO_PARAMETER_VALUE_ON
+#define AUDIO_PARAMETER_BT_SCO_OFF "BT_SCO=" AUDIO_PARAMETER_VALUE_OFF
static void droid_port_free(pa_droid_port *p);
static int input_stream_set_route(pa_droid_hw_module *hw_module, pa_droid_stream *s);
+static int droid_set_parameters(pa_droid_hw_module *hw, const char *parameters);
static pa_droid_profile *profile_new(pa_droid_profile_set *ps,
const pa_droid_config_hw_module *module,
@@ -688,30 +709,20 @@
pa_assert(hw);
- if (hw->quirks) {
- for (i = 0; i < sizeof(valid_quirks) / sizeof(struct droid_quirk); i++) {
- if (hw->quirks->enabled[i]) {
- pa_log_debug("Enabled quirks:");
- for (i = 0; i < sizeof(valid_quirks) / sizeof(struct droid_quirk); i++)
- if (hw->quirks->enabled[i])
- pa_log_debug(" %s", valid_quirks[i].name);
- return;
- }
+ for (i = 0; i < sizeof(valid_quirks) / sizeof(struct droid_quirk); i++) {
+ if (hw->quirks.enabled[i]) {
+ pa_log_debug("Enabled quirks:");
+ for (i = 0; i < sizeof(valid_quirks) / sizeof(struct droid_quirk); i++)
+ if (hw->quirks.enabled[i])
+ pa_log_debug(" %s", valid_quirks[i].name);
+ return;
}
}
}
-static pa_droid_quirks *get_quirks(pa_droid_quirks *q) {
- if (!q)
- q = pa_xnew0(pa_droid_quirks, 1);
-
- return q;
-}
-
static pa_droid_quirks *set_default_quirks(pa_droid_quirks *q) {
- q = NULL;
+ pa_assert(q);
- q = get_quirks(q);
q->enabled[QUIRK_CLOSE_INPUT] = true;
q->enabled[QUIRK_OUTPUT_FAST] = true;
q->enabled[QUIRK_OUTPUT_DEEP_BUFFER] = true;
@@ -732,19 +743,23 @@
return q;
}
-bool pa_droid_quirk_parse(pa_droid_hw_module *hw, const char *quirks) {
+bool pa_droid_quirk_parse(pa_droid_quirks *quirks, const char *quirks_def) {
char *quirk = NULL;
char *d;
const char *state = NULL;
- pa_assert(hw);
pa_assert(quirks);
- hw->quirks = get_quirks(hw->quirks);
+ memset(quirks, 0, sizeof(*quirks));
+ set_default_quirks(quirks);
- while ((quirk = pa_split(quirks, ",", &state))) {
+ if (!quirks_def)
+ return true;
+
+ while ((quirk = pa_split(quirks_def, ",", &state))) {
uint32_t i;
bool enable = false;
+ bool found = false;
if (strlen(quirk) < 2)
goto error;
@@ -759,17 +774,22 @@
goto error;
for (i = 0; i < sizeof(valid_quirks) / sizeof(struct droid_quirk); i++) {
- if (pa_streq(valid_quirks[i].name, d))
- hw->quirks->enabled[valid_quirks[i].value] = enable;
+ if (pa_streq(valid_quirks[i].name, d)) {
+ quirks->enabled[valid_quirks[i].value] = enable;
+ found = true;
+ }
}
+ if (!found)
+ goto error;
+
pa_xfree(quirk);
}
return true;
error:
- pa_log("Incorrect quirk definition \"%s\" (\"%s\")", quirk ? quirk : "<null>", quirks);
+ pa_log("Incorrect quirk definition \"%s\" (\"%s\")", quirk ? quirk : "<null>", quirks_def);
pa_xfree(quirk);
return false;
@@ -862,7 +882,68 @@
return pa_sprintf_malloc("droid-hardware-module-%s", module_id);
}
-static pa_droid_hw_module *droid_hw_module_open(pa_core *core, const pa_droid_config_audio *config, const char *module_id) {
+static void quirk_audio_cal(pa_droid_hw_module *hw, uint32_t flags) {
+ struct group *grp;
+
+ pa_assert(hw);
+
+ if (!pa_droid_quirk(hw, QUIRK_AUDIO_CAL_WAIT))
+ return;
+
+ if (access(QUIRK_AUDIO_CAL_FILE, F_OK) == 0) {
+ if (flags & AUDIO_OUTPUT_FLAG_PRIMARY) {
+ pa_log_info("Waiting for audio calibration to load.");
+ /* 1 second is enough, so let's double that. */
+ pa_msleep(2 * PA_MSEC_PER_SEC);
+ }
+ return;
+ }
+
+ pa_log_info("Waiting for audio calibration to finish... (%d seconds)", QUIRK_AUDIO_CAL_WAIT_S);
+
+ /* First wait until the calibration file appears on file system. */
+ for (int i = 0; i < QUIRK_AUDIO_CAL_WAIT_S; i++) {
+ pa_log_debug("%d...", QUIRK_AUDIO_CAL_WAIT_S - i);
+ pa_msleep(PA_MSEC_PER_SEC);
+ if (access(QUIRK_AUDIO_CAL_FILE, F_OK) == 0) {
+ pa_log_debug("Calibration file " QUIRK_AUDIO_CAL_FILE " appeared, wait one second more.");
+ /* Then wait for a bit more. */
+ pa_msleep(PA_MSEC_PER_SEC);
+ break;
+ }
+ }
+
+ if (access(QUIRK_AUDIO_CAL_FILE, F_OK) != 0)
+ goto fail;
+
+ if (!(grp = getgrnam(QUIRK_AUDIO_CAL_GROUP))) {
+ pa_log("couldn't get gid for " QUIRK_AUDIO_CAL_GROUP);
+ goto fail;
+ }
+
+ if (chown(QUIRK_AUDIO_CAL_FILE, getuid(), grp->gr_gid) < 0) {
+ pa_log("chown failed for " QUIRK_AUDIO_CAL_FILE);
+ goto fail;
+ }
+
+ if (chmod(QUIRK_AUDIO_CAL_FILE, QUIRK_AUDIO_CAL_MODE) < 0) {
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-14.2.92.tar.bz2/src/common/include/droid/droid-util.h
^
|
@@ -30,6 +30,7 @@
#include <pulsecore/mutex.h>
#include <pulsecore/strlist.h>
#include <pulsecore/atomic.h>
+#include <pulsecore/modargs.h>
#include <droid/version.h>
#include <droid/droid-config.h>
@@ -67,6 +68,26 @@
PA_DROID_HOOK_MAX
} pa_droid_hook_t;
+enum pa_droid_quirk_type {
+ QUIRK_INPUT_ATOI,
+ QUIRK_SET_PARAMETERS,
+ QUIRK_CLOSE_INPUT,
+ QUIRK_UNLOAD_NO_CLOSE,
+ QUIRK_NO_HW_VOLUME,
+ QUIRK_OUTPUT_MAKE_WRITABLE,
+ QUIRK_REALCALL,
+ QUIRK_UNLOAD_CALL_EXIT,
+ QUIRK_OUTPUT_FAST,
+ QUIRK_OUTPUT_DEEP_BUFFER,
+ QUIRK_AUDIO_CAL_WAIT,
+ QUIRK_STANDBY_SET_ROUTE,
+ QUIRK_SPEAKER_BEFORE_VOICE,
+ QUIRK_COUNT
+};
+
+struct pa_droid_quirks {
+ bool enabled[QUIRK_COUNT];
+};
struct pa_droid_hw_module {
PA_REFCNT_DECLARE;
@@ -95,7 +116,7 @@
pa_atomic_t active_outputs;
- pa_droid_quirks *quirks;
+ pa_droid_quirks quirks;
/* Mode and input control */
struct _state {
@@ -217,27 +238,12 @@
#define PA_DROID_OUTPUT_PARKING "output-parking"
#define PA_DROID_INPUT_PARKING "input-parking"
-enum pa_droid_quirk_type {
- QUIRK_INPUT_ATOI,
- QUIRK_SET_PARAMETERS,
- QUIRK_CLOSE_INPUT,
- QUIRK_UNLOAD_NO_CLOSE,
- QUIRK_NO_HW_VOLUME,
- QUIRK_OUTPUT_MAKE_WRITABLE,
- QUIRK_REALCALL,
- QUIRK_UNLOAD_CALL_EXIT,
- QUIRK_OUTPUT_FAST,
- QUIRK_OUTPUT_DEEP_BUFFER,
- QUIRK_COUNT
-};
-
-struct pa_droid_quirks {
- bool enabled[QUIRK_COUNT];
-};
-
/* Open hardware module */
/* 'config' can be NULL if it is assumed that hw module with module_id already is open. */
pa_droid_hw_module *pa_droid_hw_module_get(pa_core *core, const pa_droid_config_audio *config, const char *module_id);
+/* First try to get already open hw module and if none found parse config and quirks from modargs
+ * and do initial open. */
+pa_droid_hw_module *pa_droid_hw_module_get2(pa_core *core, pa_modargs *ma, 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);
@@ -245,11 +251,11 @@
bool pa_droid_hw_module_try_lock(pa_droid_hw_module *hw);
void pa_droid_hw_module_unlock(pa_droid_hw_module *hw);
-bool pa_droid_quirk_parse(pa_droid_hw_module *hw, const char *quirks);
+bool pa_droid_quirk_parse(pa_droid_quirks *quirks, const char *quirks_def);
void pa_droid_quirk_log(pa_droid_hw_module *hw);
static inline bool pa_droid_quirk(pa_droid_hw_module *hw, enum pa_droid_quirk_type quirk) {
- return hw->quirks && hw->quirks->enabled[quirk];
+ return hw && hw->quirks.enabled[quirk];
}
bool pa_droid_hw_set_mode(pa_droid_hw_module *hw_module, audio_mode_t mode);
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-14.2.92.tar.bz2/src/droid/Makefile.am
^
|
@@ -19,8 +19,6 @@
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
-
libdroid_sink_la_SOURCES = droid-sink.c droid-sink.h
libdroid_sink_la_LDFLAGS = -avoid-version -Wl,-z,noexecstack -lhybris-common
libdroid_sink_la_LIBADD = $(top_builddir)/src/common/libdroid-util.la $(AM_LIBADD)
@@ -34,14 +32,14 @@
module_droid_sink_la_SOURCES = module-droid-sink.c
module_droid_sink_la_LDFLAGS = -module -avoid-version -Wl,-z,noexecstack -lhybris-common
module_droid_sink_la_LIBADD = -lm libdroid-sink.la $(AM_LIBADD)
-module_droid_sink_la_CFLAGS = $(AM_CFLAGS)
+module_droid_sink_la_CFLAGS = $(AM_CFLAGS) -DPA_MODULE_NAME=module_droid_sink
module_droid_source_la_SOURCES = module-droid-source.c
module_droid_source_la_LDFLAGS = -module -avoid-version -Wl,-z,noexecstack -lhybris-common
module_droid_source_la_LIBADD = -lm libdroid-source.la $(AM_LIBADD)
-module_droid_source_la_CFLAGS = $(AM_CFLAGS)
+module_droid_source_la_CFLAGS = $(AM_CFLAGS) -DPA_MODULE_NAME=module_droid_source
module_droid_card_la_SOURCES = module-droid-card.c
module_droid_card_la_LDFLAGS = -module -avoid-version -Wl,-z,noexecstack -lhybris-common
module_droid_card_la_LIBADD = -lm libdroid-sink.la libdroid-source.la $(top_builddir)/src/common/libdroid-util.la $(AM_LIBADD)
-module_droid_card_la_CFLAGS = $(AM_CFLAGS)
+module_droid_card_la_CFLAGS = $(AM_CFLAGS) -DPA_MODULE_NAME=module_droid_card
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-14.2.92.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/util.h>
#include <pulse/version.h>
#include "droid-sink.h"
@@ -79,6 +80,7 @@
pa_usec_t write_time;
pa_usec_t write_threshold;
audio_devices_t prewrite_devices;
+ bool prewrite_always;
uint32_t prewrite_silence;
pa_hook_slot *sink_put_hook_slot;
pa_hook_slot *sink_unlink_hook_slot;
@@ -94,7 +96,6 @@
bool use_voice_volume;
char *voice_property_key;
char *voice_property_value;
- pa_sink_input *voice_control_sink_input;
pa_hook_slot *sink_input_volume_changed_hook_slot;
pa_hook_slot *sink_input_put_hook_slot;
@@ -129,6 +130,8 @@
static void parameter_free(droid_parameter_mapping *m);
static void userdata_free(struct userdata *u);
static void set_voice_volume(struct userdata *u, pa_sink_input *i);
+static void apply_volume(pa_sink *s);
+static pa_sink_input *find_volume_control_sink_input(struct userdata *u);
static void set_primary_devices(struct userdata *u, audio_devices_t devices) {
pa_assert(u);
@@ -289,7 +292,7 @@
pa_memblockq_drop(u->memblockq, c.length);
pa_memblock_unref(c.memblock);
u->write_time = 0;
- pa_log("failed to write stream (%d)", wrote);
+ pa_log("failed to write stream (%zd)", wrote);
return -1;
}
@@ -391,6 +394,9 @@
if (pa_rtpoll_timer_elapsed(u->rtpoll)) {
pa_usec_t sleept = 0;
+ if (u->use_hw_volume)
+ pa_sink_volume_change_apply(u->sink, NULL);
+
thread_render(u);
thread_write(u);
@@ -398,6 +404,9 @@
sleept = u->buffer_time;
pa_rtpoll_set_timer_relative(u->rtpoll, sleept);
+
+ if (u->use_hw_volume)
+ pa_sink_volume_change_apply(u->sink, NULL);
}
} else
pa_rtpoll_set_timer_disabled(u->rtpoll);
@@ -455,9 +464,11 @@
pa_log_info("Resuming...");
+ apply_volume(u->sink);
+
if (u->prewrite_silence &&
(u->primary_devices | u->extra_devices) & u->prewrite_devices &&
- pa_droid_output_stream_any_active(u->stream) == 0) {
+ (u->prewrite_always || pa_droid_output_stream_any_active(u->stream) == 0)) {
for (i = 0; i < u->prewrite_silence; i++)
thread_write_silence(u);
}
@@ -523,14 +534,6 @@
*((pa_usec_t*) data) = pa_droid_stream_get_latency(u->stream);
return 0;
}
-
-#if PULSEAUDIO_VERSION < 12
- case PA_SINK_MESSAGE_SET_STATE: {
- int r;
- if ((r = sink_set_state_in_io_thread_cb(u->sink, PA_PTR_TO_UINT(data), 0)) < 0)
- return r;
- }
-#endif
}
return pa_sink_process_msg(o, code, data, offset, chunk);
@@ -561,30 +564,39 @@
return 0;
}
-static void sink_set_volume_cb(pa_sink *s) {
+static void apply_volume(pa_sink *s) {
struct userdata *u = s->userdata;
pa_cvolume r;
+ float val;
+
+ if (u->use_voice_volume)
+ return;
+
+ if (!u->use_hw_volume)
+ return;
/* Shift up by the base volume */
pa_sw_cvolume_divide_scalar(&r, &s->real_volume, s->base_volume);
- if (r.channels == 1) {
- float val = pa_sw_volume_to_linear(r.values[0]);
- pa_log_debug("Set %s hw volume %f", s->name, val);
- pa_droid_hw_module_lock(u->hw_module);
- if (u->stream->output->stream->set_volume(u->stream->output->stream, val, val) < 0)
- pa_log_warn("Failed to set hw volume.");
- pa_droid_hw_module_unlock(u->hw_module);
- } else if (r.channels == 2) {
- float val[2];
- for (unsigned i = 0; i < 2; i++)
- val[i] = pa_sw_volume_to_linear(r.values[i]);
- pa_log_debug("Set %s hw volume %f : %f", s->name, val[0], val[1]);
- pa_droid_hw_module_lock(u->hw_module);
- if (u->stream->output->stream->set_volume(u->stream->output->stream, val[0], val[1]) < 0)
- pa_log_warn("Failed to set hw volume.");
- pa_droid_hw_module_unlock(u->hw_module);
- }
+ /* So far every hal implementation doing volume control expects
+ * both channels to have equal value, so we can just average the value
+ * from all channels. */
+ val = pa_sw_volume_to_linear(pa_cvolume_avg(&r));
+
+ pa_log_debug("Set %s volume -> %f", s->name, val);
+ pa_droid_hw_module_lock(u->hw_module);
+ if (u->stream->output->stream->set_volume(u->stream->output->stream, val, val) < 0)
+ pa_log_warn("Failed to set volume.");
+ pa_droid_hw_module_unlock(u->hw_module);
+}
+
+static void sink_set_volume_cb(pa_sink *s) {
+ (void) s;
+ /* noop */
+}
+
+static void sink_write_volume_cb(pa_sink *s) {
+ apply_volume(s);
}
/* Called from main thread */
@@ -631,8 +643,10 @@
u->use_hw_volume ? "hardware" : "software", u->sink->name);
}
- if (u->use_hw_volume)
+ if (u->use_hw_volume) {
pa_sink_set_set_volume_callback(u->sink, sink_set_volume_cb);
+ pa_sink_set_write_volume_callback(u->sink, sink_write_volume_cb);
+ }
}
static void set_sink_name(pa_modargs *ma, pa_sink_new_data *data, const char *module_id) {
@@ -696,13 +710,8 @@
if (!u->use_voice_volume)
return PA_HOOK_OK;
- if (!u->voice_control_sink_input && sink_input_is_voice_control(u, sink_input))
- u->voice_control_sink_input = sink_input;
-
- if (u->voice_control_sink_input != sink_input)
- return PA_HOOK_OK;
-
- set_voice_volume(u, sink_input);
+ if (sink_input_is_voice_control(u, sink_input))
+ set_voice_volume(u, sink_input);
return PA_HOOK_OK;
}
@@ -734,29 +743,21 @@
pa_assert(!u->sink_input_volume_changed_hook_slot);
- if (u->use_hw_volume)
- pa_sink_set_set_volume_callback(u->sink, NULL);
-
u->sink_input_volume_changed_hook_slot = pa_hook_connect(&u->core->hooks[PA_CORE_HOOK_SINK_INPUT_VOLUME_CHANGED],
PA_HOOK_LATE+10, (pa_hook_cb_t) sink_input_volume_changed_hook_cb, u);
if ((i = find_volume_control_sink_input(u))) {
- u->voice_control_sink_input = i;
set_voice_volume(u, i);
}
} else {
pa_assert(u->sink_input_volume_changed_hook_slot);
- u->voice_control_sink_input = NULL;
pa_hook_slot_free(u->sink_input_volume_changed_hook_slot);
u->sink_input_volume_changed_hook_slot = NULL;
pa_log_debug("Using %s volume control with %s",
u->use_hw_volume ? "hardware" : "software", u->sink->name);
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-14.2.92.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/util.h>
#include <pulse/version.h>
#include "droid-source.h"
@@ -173,7 +174,7 @@
pa_memblock_release(chunk.memblock);
if (readd < 0) {
- pa_log("Failed to read from stream. (err %i)", readd);
+ pa_log("Failed to read from stream. (err %zd)", readd);
goto end;
}
@@ -324,23 +325,6 @@
return 0;
}
-/* Called from IO context */
-static int source_process_msg(pa_msgobject *o, int code, void *data, int64_t offset, pa_memchunk *chunk) {
-#if PULSEAUDIO_VERSION < 12
- struct userdata *u = PA_SOURCE(o)->userdata;
-
- switch (code) {
- case PA_SOURCE_MESSAGE_SET_STATE: {
- int r;
- if ((r = source_set_state_in_io_thread_cb(u->source, PA_PTR_TO_UINT(data), 0)) < 0)
- return r;
- }
- }
-#endif
-
- return pa_source_process_msg(o, code, data, offset, chunk);
-}
-
static int source_set_port_cb(pa_source *s, pa_device_port *p) {
struct userdata *u = s->userdata;
pa_droid_port_data *data;
@@ -430,9 +414,9 @@
if (u->source_buffer_size) {
u->buffer_size = pa_droid_buffer_size_round_up(u->source_buffer_size, u->buffer_size);
- pa_log_info("Using buffer size %u (requested %u).", u->buffer_size, u->source_buffer_size);
+ pa_log_info("Using buffer size %zu (requested %zu).", u->buffer_size, u->source_buffer_size);
} else
- pa_log_info("Using buffer size %u.", u->buffer_size);
+ pa_log_info("Using buffer size %zu.", u->buffer_size);
if (pa_thread_mq_get())
pa_source_set_fixed_latency_within_thread(u->source, pa_bytes_to_usec(u->buffer_size, pa_droid_stream_sample_spec(u->stream)));
@@ -574,7 +558,6 @@
pa_channel_map channel_map;
const char *format;
bool namereg_fail = false;
- pa_droid_config_audio *config = NULL; /* Only used when source is created without card */
uint32_t source_buffer = 0;
pa_assert(m);
@@ -650,20 +633,10 @@
pa_assert_se((u->hw_module = pa_droid_hw_module_get(u->core, NULL, card_data->module_id)));
} else {
/* 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;
-
- if (!(u->hw_module = pa_droid_hw_module_get(u->core, config, module_id)))
- goto fail;
+ * hw module ourself. */
- pa_droid_config_free(config);
- config = NULL;
- }
+ if (!(u->hw_module = pa_droid_hw_module_get2(u->core, ma, module_id)))
+ goto fail;
}
/* Default routing */
@@ -740,10 +713,8 @@
u->source->userdata = u;
- u->source->parent.process_msg = source_process_msg;
-#if PULSEAUDIO_VERSION >= 12
+ u->source->parent.process_msg = pa_source_process_msg;
u->source->set_state_in_io_thread = source_set_state_in_io_thread_cb;
-#endif
source_set_mute_control(u);
@@ -788,7 +759,6 @@
return u->source;
fail:
- pa_droid_config_free(config);
pa_xfree(thread_name);
if (u)
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-14.2.92.tar.bz2/src/droid/module-droid-card.c
^
|
@@ -64,8 +64,6 @@
#include "droid-sink.h"
#include "droid-source.h"
-#include "module-droid-card-symdef.h"
-
PA_MODULE_AUTHOR("Juho Hämäläinen");
PA_MODULE_DESCRIPTION("Droid card");
PA_MODULE_VERSION(PACKAGE_VERSION);
@@ -543,7 +541,7 @@
pa_log_debug("Leave virtual profile %s", current->droid_profile->name);
if (next->mode != current->mode) {
- park_profile(current->droid_profile);
+ park_profile(card_get_droid_profile(u->real_profile));
pa_droid_hw_set_mode(u->hw_module, next->mode);
}
@@ -596,7 +594,7 @@
}
if (next->mode != current->mode) {
- park_profile(current->droid_profile);
+ park_profile(card_get_droid_profile(u->real_profile));
pa_droid_hw_set_mode(u->hw_module, next->mode);
}
@@ -724,11 +722,9 @@
struct userdata *u = NULL;
pa_modargs *ma = NULL;
pa_card_new_data data;
- pa_droid_config_audio *config = NULL;
const char *module_id;
bool namereg_fail = false;
bool default_profile = true;
- const char *quirks;
pa_card_profile *voicecall = NULL;
pa_assert(m);
@@ -751,26 +747,8 @@
module_id = pa_modargs_get_value(ma, "module_id", DEFAULT_MODULE_ID);
- /* 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)) {
- pa_log("Failed to parse quirks.");
- goto fail;
- }
- }
+ if (!(u->hw_module = pa_droid_hw_module_get2(u->core, ma, module_id)))
+ goto fail;
pa_droid_quirk_log(u->hw_module);
@@ -872,8 +850,6 @@
return 0;
fail:
- pa_droid_config_free(config);
-
if (ma)
pa_modargs_free(ma);
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-14.2.92.tar.bz2/src/droid/module-droid-sink.c
^
|
@@ -41,8 +41,6 @@
#include <droid/conversion.h>
#include "droid-sink.h"
-#include "module-droid-sink-symdef.h"
-
PA_MODULE_AUTHOR("Juho Hämäläinen");
PA_MODULE_DESCRIPTION("Droid sink");
PA_MODULE_USAGE("master_sink=<sink to connect to> "
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-14.2.92.tar.bz2/src/droid/module-droid-source.c
^
|
@@ -40,8 +40,6 @@
#include <droid/droid-util.h>
#include "droid-source.h"
-#include "module-droid-source-symdef.h"
-
PA_MODULE_AUTHOR("Juho Hämäläinen");
PA_MODULE_DESCRIPTION("Droid source");
PA_MODULE_USAGE("master_source=<source to connect to> "
|