[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid.spec
^
|
|
|
Changed |
_service
^
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/README
^
|
@@ -289,6 +289,18 @@
* Some broken implementations are incorrectly probed for supporting hw
volume control. This is manifested by always full volume with volume
control not affecting volume level. To fix this enable this quirk.
+ * output_make_writable
+ * Disabled by default.
+ * Some implementations modify write buffer in-place when this should
+ not be done. This can result in random segfaults when playing audio.
+ As a workaround make the buffer memchunk writable before passing to
+ audio HAL.
+ * realcall
+ * Disabled by default.
+ * Some vendors apply custom realcall parameter to HAL device when
+ 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.
For example, to disable input_atoi and enable close_input quirks, use module
argument
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/configure.ac
^
|
@@ -174,8 +174,6 @@
AC_SUBST(PULSEAUDIO_CFLAGS)
AC_SUBST(PULSEAUDIO_LIBS)
-pulseaudiodir=`pkg-config --variable=prefix pulsecore`
-
#PKG_CHECK_MODULES([DROIDHEADERS], [android-headers >= 0.0.6])
# android-headers.pc has broken version field
PKG_CHECK_MODULES([DROIDHEADERS], [android-headers])
@@ -260,9 +258,10 @@
CC_CHECK_DROID_ENUM([${DROIDHEADERS_CFLAGS}], [AUDIO_FORMAT_FLAC])
CC_CHECK_DROID_ENUM([${DROIDHEADERS_CFLAGS}], [AUDIO_FORMAT_OPUS])
-AC_ARG_WITH([module-dir],
- AS_HELP_STRING([--with-module-dir],[Directory where to install the modules to (defaults to ${pulseaudiodir}/lib/pulse-${PA_MAJORMINOR}/modules/]),
- [modlibexecdir=$withval], [modlibexecdir="${pulseaudiodir}/lib/pulse-${PA_MAJORMINOR}/modules"])
+AC_ARG_WITH(
+ [module-dir],
+ AS_HELP_STRING([--with-module-dir],[Directory where to install the modules to (defaults to ${libdir}/pulse-${PA_MAJORMINOR}/modules]),
+ [modlibexecdir=$withval], [modlibexecdir="${libdir}/pulse-${PA_MAJORMINOR}/modules"])
AC_SUBST(modlibexecdir)
@@ -308,7 +307,6 @@
CFLAGS: ${CFLAGS}
prefix: ${prefix}
- PulseAudio prefix: ${pulseaudiodir}
modules directory: ${modlibexecdir}
Droid device ${droiddevice}
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/common/droid-util.c
^
|
@@ -71,10 +71,8 @@
{ "close_input", QUIRK_CLOSE_INPUT },
{ "unload_no_close", QUIRK_UNLOAD_NO_CLOSE },
{ "no_hw_volume", QUIRK_NO_HW_VOLUME },
-};
-
-struct pa_droid_quirks {
- bool enabled[QUIRK_COUNT];
+ { "output_make_writable", QUIRK_OUTPUT_MAKE_WRITABLE },
+ { "realcall", QUIRK_REALCALL },
};
#define SLLIST_APPEND(t, head, item) \
@@ -1690,15 +1688,6 @@
return false;
}
-bool pa_droid_quirk(pa_droid_hw_module *hw, enum pa_droid_quirk_type quirk) {
- pa_assert(hw);
-
- if (hw->quirks && hw->quirks->enabled[quirk])
- return true;
- else
- return false;
-}
-
static void update_sink_types(pa_droid_hw_module *hw, pa_sink *ignore_sink) {
pa_sink *sink;
pa_sink *primary_sink = NULL;
@@ -2294,7 +2283,7 @@
return NULL;
}
-static int input_stream_open(pa_droid_stream *s) {
+static int input_stream_open(pa_droid_stream *s, bool resume_from_suspend) {
pa_droid_input_stream *input;
audio_stream_in_t *stream;
audio_source_t audio_source = AUDIO_SOURCE_DEFAULT;
@@ -2338,7 +2327,8 @@
pa_droid_hw_module_unlock(s->module);
if (ret < 0 || !stream) {
- pa_log("Failed to open input stream: %d with device: %u flags: %u sample rate: %u channels: %u (%u) format: %u (%u)",
+ pa_logl(resume_from_suspend ? PA_LOG_DEBUG : PA_LOG_ERROR,
+ "Failed to open input stream: %d with device: %u flags: %u sample rate: %u channels: %u (%u) format: %u (%u)",
ret,
input->device,
0, /* AUDIO_INPUT_FLAG_NONE on v3. v1 and v2 don't have input flags. */
@@ -2425,7 +2415,7 @@
/* We need to open the stream for a while so that we can know
* what sample rate we get. We need the rate for droid source. */
- if ((ret = input_stream_open(s)) < 0)
+ if ((ret = input_stream_open(s, false)) < 0)
goto fail;
if ((input->sample_spec.rate = input->stream->common.get_sample_rate(&input->stream->common)) != spec->rate)
@@ -2729,7 +2719,7 @@
return s->input->stream->common.standby(&s->input->stream->common);
}
} else if (s->input->merged || pa_droid_quirk(s->module, QUIRK_CLOSE_INPUT))
- return input_stream_open(s);
+ return input_stream_open(s, true);
}
return 0;
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/common/droid-util.h
^
|
@@ -293,9 +293,15 @@
QUIRK_CLOSE_INPUT,
QUIRK_UNLOAD_NO_CLOSE,
QUIRK_NO_HW_VOLUME,
+ QUIRK_OUTPUT_MAKE_WRITABLE,
+ QUIRK_REALCALL,
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. */
/* if opening of hw_module succeeds, config ownership is transferred to hw_module and config
@@ -309,9 +315,12 @@
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(pa_droid_hw_module *hw, enum pa_droid_quirk_type quirk);
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];
+}
+
/* Conversion helpers */
typedef enum {
CONV_FROM_PA,
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/droid/droid-sink.c
^
|
@@ -276,6 +276,9 @@
u->write_time = pa_rtclock_now();
for (;;) {
+ if (pa_droid_quirk(u->hw_module, QUIRK_OUTPUT_MAKE_WRITABLE))
+ pa_memchunk_make_writable(&c, c.length);
+
p = pa_memblock_acquire_chunk(&c);
wrote = pa_droid_stream_write(u->stream, p, c.length);
pa_memblock_release(c.memblock);
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/droid/droid-source.c
^
|
@@ -79,6 +79,7 @@
pa_droid_card_data *card_data;
pa_droid_hw_module *hw_module;
pa_droid_stream *stream;
+ bool stream_valid;
};
enum {
@@ -91,6 +92,8 @@
#define DROID_AUDIO_SOURCE_UNDEFINED "undefined"
static void userdata_free(struct userdata *u);
+static int suspend(struct userdata *u);
+static void unsuspend(struct userdata *u);
static int do_routing(struct userdata *u, audio_devices_t devices) {
int ret;
@@ -144,8 +147,22 @@
ssize_t readd;
pa_memchunk chunk;
+ chunk.index = 0;
chunk.memblock = pa_memblock_new(u->core->mempool, (size_t) u->buffer_size);
+ if (!u->stream_valid) {
+ /* try to resume or post silence */
+ unsuspend(u);
+ if (!u->stream_valid) {
+ p = pa_memblock_acquire(chunk.memblock);
+ chunk.length = pa_memblock_get_length(chunk.memblock);
+ memset(p, 0, chunk.length);
+ pa_source_post(u->source, &chunk);
+ pa_memblock_release(chunk.memblock);
+ goto end;
+ }
+ }
+
p = pa_memblock_acquire(chunk.memblock);
readd = pa_droid_stream_read(u->stream, p, pa_memblock_get_length(chunk.memblock));
pa_memblock_release(chunk.memblock);
@@ -157,7 +174,6 @@
u->timestamp += pa_bytes_to_usec(readd, &u->source->sample_spec);
- chunk.index = 0;
chunk.length = readd;
if (u->resampler) {
@@ -250,8 +266,11 @@
pa_assert(u);
pa_assert(u->stream);
- pa_droid_stream_suspend(u->stream, false);
- pa_log_info("Resuming...");
+ if (pa_droid_stream_suspend(u->stream, false) >= 0) {
+ u->stream_valid = true;
+ pa_log_info("Resuming...");
+ } else
+ u->stream_valid = false;
}
/* Called from IO context */
@@ -264,9 +283,9 @@
pa_assert(PA_SOURCE_IS_OPENED(u->source->thread_info.state));
- pa_droid_stream_suspend(u->stream, true);
+ suspend(u);
do_routing(u, device);
- pa_droid_stream_suspend(u->stream, false);
+ unsuspend(u);
break;
}
@@ -564,6 +583,7 @@
}
u = pa_xnew0(struct userdata, 1);
+ u->stream_valid = true;
u->core = m->core;
u->module = m;
u->card = card;
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-11.1.68.tar.bz2/src/droid/module-droid-card.c
^
|
@@ -130,6 +130,9 @@
#define COMMUNICATION_PROFILE_NAME "communication"
#define COMMUNICATION_PROFILE_DESC "Communication mode"
+#define VENDOR_EXT_REALCALL_ON "realcall=on"
+#define VENDOR_EXT_REALCALL_OFF "realcall=off"
+
struct userdata;
typedef bool (*virtual_profile_event_cb)(struct userdata *u, pa_droid_profile *p, bool enabling);
@@ -451,12 +454,16 @@
pa_log_debug("Enable " VOICE_RECORD_PROFILE_NAME " profile.");
pa_card_profile_set_available(cp, PA_AVAILABLE_YES);
}
+ if (pa_droid_quirk(u->hw_module, QUIRK_REALCALL))
+ pa_droid_set_parameters(u->hw_module, VENDOR_EXT_REALCALL_ON);
} else {
pa_droid_sink_set_voice_control(am_output->sink, false);
if (cp && cp->available == PA_AVAILABLE_YES) {
pa_log_debug("Disable " VOICE_RECORD_PROFILE_NAME " profile.");
pa_card_profile_set_available(cp, PA_AVAILABLE_NO);
}
+ if (pa_droid_quirk(u->hw_module, QUIRK_REALCALL))
+ pa_droid_set_parameters(u->hw_module, VENDOR_EXT_REALCALL_OFF);
}
return true;
@@ -816,8 +823,15 @@
u->modargs = ma;
u->module = m;
+#if (PULSEAUDIO_VERSION >= 10)
+ pa_card_choose_initial_profile(u->card);
+#endif
init_profile(u);
+#if (PULSEAUDIO_VERSION >= 10)
+ pa_card_put(u->card);
+#endif
+
return 0;
fail:
|