[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.15-test5-66-g98a5f4a
Lennart Poettering
gitmailer-noreply at 0pointer.de
Tue Mar 24 16:45:32 PDT 2009
This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.
The master branch has been updated
from a7246bd635ab5eb9f708937383d7c3ebf5c1345c (commit)
- Log -----------------------------------------------------------------
98a5f4a don't fiddle with latency range in sources with static latency
d0bd3d9 initialize max_request
bcfe51f again, don't fiddle with latency range in sinks with static latency
59b7e53 Don't initialize userdata twice
b815a1c don't fiddle with latency range because we cannot adjust it dynamically
0316dba set latency range only in tsched mode
171c88f link jack modules's max_request to the jack buffer size
892a839 simplify things and make sure timing setters can be called in most contexts
44ca897 introduce new flag that marks sinks/sources which can adjust the latency dynamically
9bca59e make pa_source_set_max_rewind() work similar to pa_sink_set_max_rewind()
9151107 get rid of 'default' min/max latencies, simplify things by just having absolute boundaries
-----------------------------------------------------------------------
Summary of changes:
src/modules/alsa/alsa-sink.c | 23 ++++++-----
src/modules/alsa/alsa-source.c | 19 ++++-----
src/modules/module-combine.c | 11 ++---
src/modules/module-jack-sink.c | 21 ++++++++-
src/modules/module-jack-source.c | 10 ++---
src/modules/module-ladspa-sink.c | 2 +-
src/modules/module-null-sink.c | 6 +--
src/modules/module-pipe-sink.c | 1 +
src/modules/module-remap-sink.c | 2 +-
src/modules/module-sine-source.c | 5 +-
src/pulse/def.h | 14 ++++++-
src/pulsecore/cli-text.c | 43 +++++++++++++-------
src/pulsecore/sink.c | 60 +++++++++++++++--------------
src/pulsecore/sink.h | 2 +-
src/pulsecore/source.c | 80 ++++++++++++++++++++++++-------------
src/pulsecore/source.h | 4 +-
16 files changed, 181 insertions(+), 122 deletions(-)
-----------------------------------------------------------------------
commit 9151107cb9a1fe0620d3ddb53ac6982a75e1d010
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Mar 25 00:25:17 2009 +0100
get rid of 'default' min/max latencies, simplify things by just having absolute boundaries
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index a3bf03a..1fec018 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -49,7 +49,6 @@
#define MAX_MIX_CHANNELS 32
#define MIX_BUFFER_LENGTH (PA_PAGE_SIZE)
#define ABSOLUTE_MIN_LATENCY (500)
-#define DEFAULT_MIN_LATENCY (4*PA_USEC_PER_MSEC)
#define ABSOLUTE_MAX_LATENCY (10*PA_USEC_PER_SEC)
static PA_DEFINE_CHECK_TYPE(pa_sink, pa_msgobject);
@@ -232,8 +231,8 @@ pa_sink* pa_sink_new(
s->thread_info.max_request = 0;
s->thread_info.requested_latency_valid = FALSE;
s->thread_info.requested_latency = 0;
- s->thread_info.min_latency = DEFAULT_MIN_LATENCY;
- s->thread_info.max_latency = DEFAULT_MIN_LATENCY;
+ s->thread_info.min_latency = ABSOLUTE_MIN_LATENCY;
+ s->thread_info.max_latency = ABSOLUTE_MAX_LATENCY;
pa_assert_se(pa_idxset_put(core->sinks, s, &s->index) >= 0);
@@ -1857,21 +1856,15 @@ void pa_sink_set_latency_range(pa_sink *s, pa_usec_t min_latency, pa_usec_t max_
pa_sink_assert_ref(s);
/* min_latency == 0: no limit
- * min_latency == (size_t) -1: default limit
* min_latency anything else: specified limit
*
* Similar for max_latency */
- if (min_latency == (pa_usec_t) -1)
- min_latency = DEFAULT_MIN_LATENCY;
-
if (min_latency < ABSOLUTE_MIN_LATENCY)
min_latency = ABSOLUTE_MIN_LATENCY;
- if (max_latency == (pa_usec_t) -1)
- max_latency = min_latency;
-
- if (max_latency > ABSOLUTE_MAX_LATENCY || max_latency <= 0)
+ if (max_latency <= 0 ||
+ max_latency > ABSOLUTE_MAX_LATENCY)
max_latency = ABSOLUTE_MAX_LATENCY;
pa_assert(min_latency <= max_latency);
diff --git a/src/pulsecore/sink.h b/src/pulsecore/sink.h
index f3f2542..7d1e11e 100644
--- a/src/pulsecore/sink.h
+++ b/src/pulsecore/sink.h
@@ -219,9 +219,9 @@ void pa_sink_unlink(pa_sink* s);
void pa_sink_set_description(pa_sink *s, const char *description);
void pa_sink_set_asyncmsgq(pa_sink *s, pa_asyncmsgq *q);
void pa_sink_set_rtpoll(pa_sink *s, pa_rtpoll *p);
+
void pa_sink_set_max_rewind(pa_sink *s, size_t max_rewind);
void pa_sink_set_max_request(pa_sink *s, size_t max_request);
-
void pa_sink_set_latency_range(pa_sink *s, pa_usec_t min_latency, pa_usec_t max_latency);
void pa_sink_detach(pa_sink *s);
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index da3ae79..6e5bf1f 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -42,7 +42,6 @@
#include "source.h"
#define ABSOLUTE_MIN_LATENCY (500)
-#define DEFAULT_MIN_LATENCY (4*PA_USEC_PER_MSEC)
#define ABSOLUTE_MAX_LATENCY (10*PA_USEC_PER_SEC)
static PA_DEFINE_CHECK_TYPE(pa_source, pa_msgobject);
@@ -220,8 +219,8 @@ pa_source* pa_source_new(
s->thread_info.max_rewind = 0;
s->thread_info.requested_latency_valid = FALSE;
s->thread_info.requested_latency = 0;
- s->thread_info.min_latency = DEFAULT_MIN_LATENCY;
- s->thread_info.max_latency = DEFAULT_MIN_LATENCY;
+ s->thread_info.min_latency = ABSOLUTE_MIN_LATENCY;
+ s->thread_info.max_latency = ABSOLUTE_MAX_LATENCY;
pa_assert_se(pa_idxset_put(core->sources, s, &s->index) >= 0);
@@ -1124,21 +1123,15 @@ void pa_source_set_latency_range(pa_source *s, pa_usec_t min_latency, pa_usec_t
pa_source_assert_ref(s);
/* min_latency == 0: no limit
- * min_latency == (size_t) -1: default limit
* min_latency anything else: specified limit
*
* Similar for max_latency */
- if (min_latency == (pa_usec_t) -1)
- min_latency = DEFAULT_MIN_LATENCY;
-
if (min_latency < ABSOLUTE_MIN_LATENCY)
min_latency = ABSOLUTE_MIN_LATENCY;
- if (max_latency == (pa_usec_t) -1)
- max_latency = min_latency;
-
- if (max_latency > ABSOLUTE_MAX_LATENCY || max_latency <= 0)
+ if (max_latency <= 0 ||
+ max_latency > ABSOLUTE_MAX_LATENCY)
max_latency = ABSOLUTE_MAX_LATENCY;
pa_assert(min_latency <= max_latency);
commit 9bca59efc1500770008345ff12571892eeaa5b50
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Mar 25 00:26:44 2009 +0100
make pa_source_set_max_rewind() work similar to pa_sink_set_max_rewind()
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index 6e5bf1f..f1f8ef7 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -956,6 +956,11 @@ int pa_source_process_msg(pa_msgobject *object, int code, void *userdata, int64_
*((size_t*) userdata) = s->thread_info.max_rewind;
return 0;
+ case PA_SOURCE_MESSAGE_SET_MAX_REWIND:
+
+ pa_source_set_max_rewind_within_thread(s, (size_t) offset);
+ return 0;
+
case PA_SOURCE_MESSAGE_GET_LATENCY:
if (s->monitor_of) {
@@ -1083,7 +1088,7 @@ pa_usec_t pa_source_get_requested_latency(pa_source *s) {
}
/* Called from IO thread */
-void pa_source_set_max_rewind(pa_source *s, size_t max_rewind) {
+void pa_source_set_max_rewind_within_thread(pa_source *s, size_t max_rewind) {
pa_source_output *o;
void *state = NULL;
@@ -1100,6 +1105,17 @@ void pa_source_set_max_rewind(pa_source *s, size_t max_rewind) {
}
}
+/* Called from main thread */
+void pa_source_set_max_rewind(pa_source *s, size_t max_rewind) {
+ pa_source_assert_ref(s);
+
+ if (PA_SOURCE_IS_LINKED(s->state))
+ pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_SET_MAX_REWIND, NULL, max_rewind, NULL) == 0);
+ else
+ pa_source_set_max_rewind_within_thread(s, max_rewind);
+}
+
+/* Called from IO thread */
void pa_source_invalidate_requested_latency(pa_source *s) {
pa_source_output *o;
void *state = NULL;
diff --git a/src/pulsecore/source.h b/src/pulsecore/source.h
index 862e1aa..210f534 100644
--- a/src/pulsecore/source.h
+++ b/src/pulsecore/source.h
@@ -159,6 +159,7 @@ typedef enum pa_source_message {
PA_SOURCE_MESSAGE_SET_LATENCY_RANGE,
PA_SOURCE_MESSAGE_GET_LATENCY_RANGE,
PA_SOURCE_MESSAGE_GET_MAX_REWIND,
+ PA_SOURCE_MESSAGE_SET_MAX_REWIND,
PA_SOURCE_MESSAGE_MAX
} pa_source_message_t;
@@ -205,6 +206,7 @@ void pa_source_set_description(pa_source *s, const char *description);
void pa_source_set_asyncmsgq(pa_source *s, pa_asyncmsgq *q);
void pa_source_set_rtpoll(pa_source *s, pa_rtpoll *p);
+void pa_source_set_max_rewind(pa_source *s, size_t max_rewind);
void pa_source_set_latency_range(pa_source *s, pa_usec_t min_latency, pa_usec_t max_latency);
void pa_source_detach(pa_source *s);
@@ -259,7 +261,7 @@ void pa_source_detach_within_thread(pa_source *s);
pa_usec_t pa_source_get_requested_latency_within_thread(pa_source *s);
-void pa_source_set_max_rewind(pa_source *s, size_t max_rewind);
+void pa_source_set_max_rewind_within_thread(pa_source *s, size_t max_rewind);
void pa_source_set_latency_range_within_thread(pa_source *s, pa_usec_t min_latency, pa_usec_t max_latency);
/*** To be called exclusively by source output drivers, from IO context */
commit 44ca897769bc34e6672223cd43cddbfa1b201976
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Mar 25 00:30:54 2009 +0100
introduce new flag that marks sinks/sources which can adjust the latency dynamically
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index bcca57d..a7728a0 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -1662,7 +1662,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
pa_alsa_init_description(data.proplist);
- u->sink = pa_sink_new(m->core, &data, PA_SINK_HARDWARE|PA_SINK_LATENCY);
+ u->sink = pa_sink_new(m->core, &data, PA_SINK_HARDWARE|PA_SINK_LATENCY|(u->use_tsched ? PA_SINK_DYNAMIC_LATENCY : 0));
pa_sink_new_data_done(&data);
if (!u->sink) {
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index 7c09c00..8b76ee5 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -1514,7 +1514,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
pa_alsa_init_description(data.proplist);
- u->source = pa_source_new(m->core, &data, PA_SOURCE_HARDWARE|PA_SOURCE_LATENCY);
+ u->source = pa_source_new(m->core, &data, PA_SOURCE_HARDWARE|PA_SOURCE_LATENCY|(u->use_tsched ? PA_SOURCE_DYNAMIC_LATENCY : 0));
pa_source_new_data_done(&data);
if (!u->source) {
diff --git a/src/modules/module-ladspa-sink.c b/src/modules/module-ladspa-sink.c
index 81546ff..e619acd 100644
--- a/src/modules/module-ladspa-sink.c
+++ b/src/modules/module-ladspa-sink.c
@@ -705,7 +705,7 @@ int pa__init(pa_module*m) {
pa_proplist_sets(sink_data.proplist, "device.ladspa.copyright", d->Copyright);
pa_proplist_setf(sink_data.proplist, "device.ladspa.unique_id", "%lu", (unsigned long) d->UniqueID);
- u->sink = pa_sink_new(m->core, &sink_data, PA_SINK_LATENCY);
+ u->sink = pa_sink_new(m->core, &sink_data, PA_SINK_LATENCY|PA_SINK_DYNAMIC_LATENCY);
pa_sink_new_data_done(&sink_data);
if (!u->sink) {
diff --git a/src/modules/module-remap-sink.c b/src/modules/module-remap-sink.c
index 8c43a72..f9777be 100644
--- a/src/modules/module-remap-sink.c
+++ b/src/modules/module-remap-sink.c
@@ -354,7 +354,7 @@ int pa__init(pa_module*m) {
pa_proplist_sets(sink_data.proplist, PA_PROP_DEVICE_MASTER_DEVICE, master->name);
pa_proplist_sets(sink_data.proplist, PA_PROP_DEVICE_CLASS, "filter");
- u->sink = pa_sink_new(m->core, &sink_data, PA_SINK_LATENCY);
+ u->sink = pa_sink_new(m->core, &sink_data, PA_SINK_LATENCY|PA_SINK_DYNAMIC_LATENCY);
pa_sink_new_data_done(&sink_data);
if (!u->sink) {
diff --git a/src/pulse/def.h b/src/pulse/def.h
index 3629aab..8bcb691 100644
--- a/src/pulse/def.h
+++ b/src/pulse/def.h
@@ -702,9 +702,13 @@ typedef enum pa_sink_flags {
/**< Volume can be translated to dB with pa_sw_volume_to_dB()
* \since 0.9.11 */
- PA_SINK_FLAT_VOLUME = 0x0040U
+ PA_SINK_FLAT_VOLUME = 0x0040U,
/**< This sink is in flat volume mode, i.e. always the maximum of
* the volume of all connected inputs. \since 0.9.15 */
+
+ PA_SINK_DYNAMIC_LATENCY = 0x0080U
+ /**< The latency can be adjusted dynamically depending on the
+ * needs of the connected streams. \since 0.9.15 */
} pa_sink_flags_t;
/** \cond fulldocs */
@@ -715,6 +719,7 @@ typedef enum pa_sink_flags {
#define PA_SINK_HW_MUTE_CTRL PA_SINK_HW_MUTE_CTRL
#define PA_SINK_DECIBEL_VOLUME PA_SINK_DECIBEL_VOLUME
#define PA_SINK_FLAT_VOLUME PA_SINK_FLAT_VOLUME
+#define PA_SINK_DYNAMIC_LATENCY PA_SINK_DYNAMIC_LATENCY
/** \endcond */
/** Sink state. \since 0.9.15 */
@@ -780,9 +785,13 @@ typedef enum pa_source_flags {
PA_SOURCE_HW_MUTE_CTRL = 0x0010U,
/**< Supports hardware mute control \since 0.9.11 */
- PA_SOURCE_DECIBEL_VOLUME = 0x0020U
+ PA_SOURCE_DECIBEL_VOLUME = 0x0020U,
/**< Volume can be translated to dB with pa_sw_volume_to_dB()
* \since 0.9.11 */
+
+ PA_SOURCE_DYNAMIC_LATENCY = 0x0080U
+ /**< The latency can be adjusted dynamically depending on the
+ * needs of the connected streams. \since 0.9.15 */
} pa_source_flags_t;
/** \cond fulldocs */
@@ -792,6 +801,7 @@ typedef enum pa_source_flags {
#define PA_SOURCE_NETWORK PA_SOURCE_NETWORK
#define PA_SOURCE_HW_MUTE_CTRL PA_SOURCE_HW_MUTE_CTRL
#define PA_SOURCE_DECIBEL_VOLUME PA_SOURCE_DECIBEL_VOLUME
+#define PA_SOURCE_DYNAMIC_LATENCY PA_SOURCE_DYNAMIC_LATENCY
/** \endcond */
/** Source state. \since 0.9.15 */
diff --git a/src/pulsecore/cli-text.c b/src/pulsecore/cli-text.c
index 76adc4d..8d39dcf 100644
--- a/src/pulsecore/cli-text.c
+++ b/src/pulsecore/cli-text.c
@@ -220,19 +220,17 @@ char *pa_sink_list_to_string(pa_core *c) {
v[PA_VOLUME_SNPRINT_MAX],
vdb[PA_SW_VOLUME_SNPRINT_DB_MAX],
cm[PA_CHANNEL_MAP_SNPRINT_MAX], *t;
- pa_usec_t min_latency, max_latency;
const char *cmn;
cmn = pa_channel_map_to_pretty_name(&sink->channel_map);
- pa_sink_get_latency_range(sink, &min_latency, &max_latency);
pa_strbuf_printf(
s,
" %c index: %u\n"
"\tname: <%s>\n"
"\tdriver: <%s>\n"
- "\tflags: %s%s%s%s%s%s%s\n"
+ "\tflags: %s%s%s%s%s%s%s%s\n"
"\tstate: %s\n"
"\tvolume: %s%s%s\n"
"\t balance %0.2f\n"
@@ -240,7 +238,6 @@ char *pa_sink_list_to_string(pa_core *c) {
"\tvolume steps: %u\n"
"\tmuted: %s\n"
"\tcurrent latency: %0.2f ms\n"
- "\tconfigured latency: %0.2f ms; range is %0.2f .. %0.2f ms\n"
"\tmax request: %lu KiB\n"
"\tmax rewind: %lu KiB\n"
"\tmonitor source: %u\n"
@@ -259,6 +256,7 @@ char *pa_sink_list_to_string(pa_core *c) {
sink->flags & PA_SINK_DECIBEL_VOLUME ? "DECIBEL_VOLUME " : "",
sink->flags & PA_SINK_LATENCY ? "LATENCY " : "",
sink->flags & PA_SINK_FLAT_VOLUME ? "FLAT_VOLUME" : "",
+ sink->flags & PA_SINK_DYNAMIC_LATENCY ? "DYNAMIC_LATENCY" : "",
sink_state_to_string(pa_sink_get_state(sink)),
pa_cvolume_snprint(cv, sizeof(cv), pa_sink_get_volume(sink, FALSE)),
sink->flags & PA_SINK_DECIBEL_VOLUME ? "\n\t " : "",
@@ -270,9 +268,6 @@ char *pa_sink_list_to_string(pa_core *c) {
sink->n_volume_steps,
pa_yes_no(pa_sink_get_mute(sink, FALSE)),
(double) pa_sink_get_latency(sink) / (double) PA_USEC_PER_MSEC,
- (double) pa_sink_get_requested_latency(sink) / (double) PA_USEC_PER_MSEC,
- (double) min_latency / PA_USEC_PER_MSEC,
- (double) max_latency / PA_USEC_PER_MSEC,
(unsigned long) pa_sink_get_max_request(sink) / 1024,
(unsigned long) pa_sink_get_max_rewind(sink) / 1024,
sink->monitor_source ? sink->monitor_source->index : PA_INVALID_INDEX,
@@ -283,6 +278,18 @@ char *pa_sink_list_to_string(pa_core *c) {
pa_sink_used_by(sink),
pa_sink_linked_by(sink));
+ if (sink->flags & PA_SINK_DYNAMIC_LATENCY) {
+ pa_usec_t min_latency, max_latency;
+ pa_sink_get_latency_range(sink, &min_latency, &max_latency);
+
+ pa_strbuf_printf(
+ s,
+ "\tconfigured latency: %0.2f ms; range is %0.2f .. %0.2f ms\n",
+ (double) pa_sink_get_requested_latency(sink) / (double) PA_USEC_PER_MSEC,
+ (double) min_latency / PA_USEC_PER_MSEC,
+ (double) max_latency / PA_USEC_PER_MSEC);
+ }
+
if (sink->card)
pa_strbuf_printf(s, "\tcard: %u <%s>\n", sink->card->index, sink->card->name);
if (sink->module)
@@ -313,19 +320,16 @@ char *pa_source_list_to_string(pa_core *c) {
v[PA_VOLUME_SNPRINT_MAX],
vdb[PA_SW_VOLUME_SNPRINT_DB_MAX],
cm[PA_CHANNEL_MAP_SNPRINT_MAX], *t;
- pa_usec_t min_latency, max_latency;
const char *cmn;
cmn = pa_channel_map_to_pretty_name(&source->channel_map);
- pa_source_get_latency_range(source, &min_latency, &max_latency);
-
pa_strbuf_printf(
s,
" %c index: %u\n"
"\tname: <%s>\n"
"\tdriver: <%s>\n"
- "\tflags: %s%s%s%s%s%s\n"
+ "\tflags: %s%s%s%s%s%s%s\n"
"\tstate: %s\n"
"\tvolume: %s%s%s\n"
"\t balance %0.2f\n"
@@ -333,7 +337,6 @@ char *pa_source_list_to_string(pa_core *c) {
"\tvolume steps: %u\n"
"\tmuted: %s\n"
"\tcurrent latency: %0.2f ms\n"
- "\tconfigured latency: %0.2f ms; range is %0.2f .. %0.2f ms\n"
"\tmax rewind: %lu KiB\n"
"\tsample spec: %s\n"
"\tchannel map: %s%s%s\n"
@@ -349,6 +352,7 @@ char *pa_source_list_to_string(pa_core *c) {
source->flags & PA_SOURCE_HW_VOLUME_CTRL ? "HW_VOLUME_CTRL " : "",
source->flags & PA_SOURCE_DECIBEL_VOLUME ? "DECIBEL_VOLUME " : "",
source->flags & PA_SOURCE_LATENCY ? "LATENCY " : "",
+ source->flags & PA_SOURCE_DYNAMIC_LATENCY ? "DYNAMIC_LATENCY" : "",
source_state_to_string(pa_source_get_state(source)),
pa_cvolume_snprint(cv, sizeof(cv), pa_source_get_volume(source, FALSE)),
source->flags & PA_SOURCE_DECIBEL_VOLUME ? "\n\t " : "",
@@ -360,9 +364,6 @@ char *pa_source_list_to_string(pa_core *c) {
source->n_volume_steps,
pa_yes_no(pa_source_get_mute(source, FALSE)),
(double) pa_source_get_latency(source) / PA_USEC_PER_MSEC,
- (double) pa_source_get_requested_latency(source) / PA_USEC_PER_MSEC,
- (double) min_latency / PA_USEC_PER_MSEC,
- (double) max_latency / PA_USEC_PER_MSEC,
(unsigned long) pa_source_get_max_rewind(source) / 1024,
pa_sample_spec_snprint(ss, sizeof(ss), &source->sample_spec),
pa_channel_map_snprint(cm, sizeof(cm), &source->channel_map),
@@ -371,6 +372,18 @@ char *pa_source_list_to_string(pa_core *c) {
pa_source_used_by(source),
pa_source_linked_by(source));
+ if (source->flags & PA_SOURCE_DYNAMIC_LATENCY) {
+ pa_usec_t min_latency, max_latency;
+ pa_source_get_latency_range(source, &min_latency, &max_latency);
+
+ pa_strbuf_printf(
+ s,
+ "\tconfigured latency: %0.2f ms; range is %0.2f .. %0.2f ms\n",
+ (double) pa_source_get_requested_latency(source) / PA_USEC_PER_MSEC,
+ (double) min_latency / PA_USEC_PER_MSEC,
+ (double) max_latency / PA_USEC_PER_MSEC);
+ }
+
if (source->monitor_of)
pa_strbuf_printf(s, "\tmonitor_of: %u\n", source->monitor_of->index);
if (source->card)
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index 1fec018..c2012df 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -1869,6 +1869,11 @@ void pa_sink_set_latency_range(pa_sink *s, pa_usec_t min_latency, pa_usec_t max_
pa_assert(min_latency <= max_latency);
+ /* Hmm, let's see if someone forgot to set PA_SINK_DYNAMIC_LATENCY here... */
+ pa_assert((min_latency == ABSOLUTE_MIN_LATENCY &&
+ max_latency == ABSOLUTE_MAX_LATENCY) ||
+ (s->flags & PA_SINK_DYNAMIC_LATENCY));
+
if (PA_SINK_IS_LINKED(s->state)) {
pa_usec_t r[2];
@@ -1917,6 +1922,11 @@ void pa_sink_set_latency_range_within_thread(pa_sink *s, pa_usec_t min_latency,
pa_assert(max_latency <= ABSOLUTE_MAX_LATENCY);
pa_assert(min_latency <= max_latency);
+ /* Hmm, let's see if someone forgot to set PA_SINK_DYNAMIC_LATENCY here... */
+ pa_assert((min_latency == ABSOLUTE_MIN_LATENCY &&
+ max_latency == ABSOLUTE_MAX_LATENCY) ||
+ (s->flags & PA_SINK_DYNAMIC_LATENCY));
+
s->thread_info.min_latency = min_latency;
s->thread_info.max_latency = max_latency;
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index f1f8ef7..0fe6f8d 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -1152,6 +1152,11 @@ void pa_source_set_latency_range(pa_source *s, pa_usec_t min_latency, pa_usec_t
pa_assert(min_latency <= max_latency);
+ /* Hmm, let's see if someone forgot to set PA_SOURCE_DYNAMIC_LATENCY here... */
+ pa_assert((min_latency == ABSOLUTE_MIN_LATENCY &&
+ max_latency == ABSOLUTE_MAX_LATENCY) ||
+ (s->flags & PA_SOURCE_DYNAMIC_LATENCY));
+
if (PA_SOURCE_IS_LINKED(s->state)) {
pa_usec_t r[2];
@@ -1196,6 +1201,11 @@ void pa_source_set_latency_range_within_thread(pa_source *s, pa_usec_t min_laten
pa_assert(max_latency <= ABSOLUTE_MAX_LATENCY);
pa_assert(min_latency <= max_latency);
+ /* Hmm, let's see if someone forgot to set PA_SOURCE_DYNAMIC_LATENCY here... */
+ pa_assert((min_latency == ABSOLUTE_MIN_LATENCY &&
+ max_latency == ABSOLUTE_MAX_LATENCY) ||
+ (s->flags & PA_SOURCE_DYNAMIC_LATENCY));
+
s->thread_info.min_latency = min_latency;
s->thread_info.max_latency = max_latency;
commit 892a83945e7cd56039fcbbefc4c16ffdb3a7d722
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Mar 25 00:33:35 2009 +0100
simplify things and make sure timing setters can be called in most contexts
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index c2012df..68f8856 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -1843,12 +1843,15 @@ void pa_sink_invalidate_requested_latency(pa_sink *s) {
s->thread_info.requested_latency_valid = FALSE;
- if (s->update_requested_latency)
- s->update_requested_latency(s);
+ if (PA_SINK_IS_LINKED(s->thread_info.state)) {
- while ((i = pa_hashmap_iterate(s->thread_info.inputs, &state, NULL)))
- if (i->update_sink_requested_latency)
- i->update_sink_requested_latency(i);
+ if (s->update_requested_latency)
+ s->update_requested_latency(s);
+
+ while ((i = pa_hashmap_iterate(s->thread_info.inputs, &state, NULL)))
+ if (i->update_sink_requested_latency)
+ i->update_sink_requested_latency(i);
+ }
}
/* Called from main thread */
@@ -1881,15 +1884,8 @@ void pa_sink_set_latency_range(pa_sink *s, pa_usec_t min_latency, pa_usec_t max_
r[1] = max_latency;
pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SINK_MESSAGE_SET_LATENCY_RANGE, r, 0, NULL) == 0);
- } else {
- s->thread_info.min_latency = min_latency;
- s->thread_info.max_latency = max_latency;
-
- s->monitor_source->thread_info.min_latency = min_latency;
- s->monitor_source->thread_info.max_latency = max_latency;
-
- s->thread_info.requested_latency_valid = s->monitor_source->thread_info.requested_latency_valid = FALSE;
- }
+ } else
+ pa_sink_set_latency_range_within_thread(s, min_latency, max_latency);
}
/* Called from main thread */
@@ -1913,7 +1909,6 @@ void pa_sink_get_latency_range(pa_sink *s, pa_usec_t *min_latency, pa_usec_t *ma
/* Called from IO thread */
void pa_sink_set_latency_range_within_thread(pa_sink *s, pa_usec_t min_latency, pa_usec_t max_latency) {
- pa_sink_input *i;
void *state = NULL;
pa_sink_assert_ref(s);
@@ -1930,9 +1925,13 @@ void pa_sink_set_latency_range_within_thread(pa_sink *s, pa_usec_t min_latency,
s->thread_info.min_latency = min_latency;
s->thread_info.max_latency = max_latency;
- while ((i = pa_hashmap_iterate(s->thread_info.inputs, &state, NULL)))
- if (i->update_sink_latency_range)
- i->update_sink_latency_range(i);
+ if (PA_SINK_IS_LINKED(s->thread_info.state)) {
+ pa_sink_input *i;
+
+ while ((i = pa_hashmap_iterate(s->thread_info.inputs, &state, NULL)))
+ if (i->update_sink_latency_range)
+ i->update_sink_latency_range(i);
+ }
pa_sink_invalidate_requested_latency(s);
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index 0fe6f8d..5b4378a 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -1124,17 +1124,21 @@ void pa_source_invalidate_requested_latency(pa_source *s) {
s->thread_info.requested_latency_valid = FALSE;
- if (s->update_requested_latency)
- s->update_requested_latency(s);
+ if (PA_SOURCE_IS_LINKED(s->thread_info.state)) {
- while ((o = pa_hashmap_iterate(s->thread_info.outputs, &state, NULL)))
- if (o->update_source_requested_latency)
- o->update_source_requested_latency(o);
+ if (s->update_requested_latency)
+ s->update_requested_latency(s);
+
+ while ((o = pa_hashmap_iterate(s->thread_info.outputs, &state, NULL)))
+ if (o->update_source_requested_latency)
+ o->update_source_requested_latency(o);
+ }
if (s->monitor_of)
pa_sink_invalidate_requested_latency(s->monitor_of);
}
+/* Called from main thread */
void pa_source_set_latency_range(pa_source *s, pa_usec_t min_latency, pa_usec_t max_latency) {
pa_source_assert_ref(s);
@@ -1164,14 +1168,11 @@ void pa_source_set_latency_range(pa_source *s, pa_usec_t min_latency, pa_usec_t
r[1] = max_latency;
pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_SET_LATENCY_RANGE, r, 0, NULL) == 0);
- } else {
- s->thread_info.min_latency = min_latency;
- s->thread_info.max_latency = max_latency;
-
- s->thread_info.requested_latency_valid = FALSE;
- }
+ } else
+ pa_source_set_latency_range_within_thread(s, min_latency, max_latency);
}
+/* Called from main thread */
void pa_source_get_latency_range(pa_source *s, pa_usec_t *min_latency, pa_usec_t *max_latency) {
pa_source_assert_ref(s);
pa_assert(min_latency);
@@ -1190,9 +1191,8 @@ void pa_source_get_latency_range(pa_source *s, pa_usec_t *min_latency, pa_usec_t
}
}
-/* Called from IO thread */
+/* Called from IO thread, and from main thread before pa_sink_put() is called */
void pa_source_set_latency_range_within_thread(pa_source *s, pa_usec_t min_latency, pa_usec_t max_latency) {
- pa_source_output *o;
void *state = NULL;
pa_source_assert_ref(s);
@@ -1209,13 +1209,18 @@ void pa_source_set_latency_range_within_thread(pa_source *s, pa_usec_t min_laten
s->thread_info.min_latency = min_latency;
s->thread_info.max_latency = max_latency;
- while ((o = pa_hashmap_iterate(s->thread_info.outputs, &state, NULL)))
- if (o->update_source_latency_range)
- o->update_source_latency_range(o);
+ if (PA_SOURCE_IS_LINKED(s->thread_info.state)) {
+ pa_source_output *o;
+
+ while ((o = pa_hashmap_iterate(s->thread_info.outputs, &state, NULL)))
+ if (o->update_source_latency_range)
+ o->update_source_latency_range(o);
+ }
pa_source_invalidate_requested_latency(s);
}
+/* Called from main thread */
size_t pa_source_get_max_rewind(pa_source *s) {
size_t r;
pa_source_assert_ref(s);
commit 171c88f1324acc85a71d13a386f05aa8e38895a6
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Mar 25 00:40:12 2009 +0100
link jack modules's max_request to the jack buffer size
diff --git a/src/modules/module-jack-sink.c b/src/modules/module-jack-sink.c
index 63fdd2d..31b8a96 100644
--- a/src/modules/module-jack-sink.c
+++ b/src/modules/module-jack-sink.c
@@ -112,6 +112,7 @@ static const char* const valid_modargs[] = {
enum {
SINK_MESSAGE_RENDER = PA_SINK_MESSAGE_MAX,
+ SINK_MESSAGE_BUFFER_SIZE,
SINK_MESSAGE_ON_SHUTDOWN
};
@@ -158,6 +159,10 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
return 0;
+ case SINK_MESSAGE_BUFFER_SIZE:
+ pa_sink_set_max_request_within_thread(u->sink, (size_t) offset * pa_frame_size(&u->sink->sample_spec));
+ return 0;
+
case SINK_MESSAGE_ON_SHUTDOWN:
pa_asyncmsgq_post(u->thread_mq.outq, PA_MSGOBJECT(u->core), PA_CORE_MESSAGE_UNLOAD_MODULE, u->module, 0, NULL, NULL);
return 0;
@@ -184,6 +189,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
return 0;
}
+
}
return pa_sink_process_msg(o, code, data, offset, memchunk);
@@ -263,10 +269,18 @@ static void jack_init(void *arg) {
static void jack_shutdown(void* arg) {
struct userdata *u = arg;
- pa_log_info("JACK thread shutting down..");
+ pa_log_info("JACK thread shutting down.");
pa_asyncmsgq_post(u->jack_msgq, PA_MSGOBJECT(u->sink), SINK_MESSAGE_ON_SHUTDOWN, NULL, 0, NULL, NULL);
}
+static int jack_buffer_size(jack_nframes_t nframes, void *arg) {
+ struct userdata *u = arg;
+
+ pa_log_info("JACK buffer size changed.");
+ pa_asyncmsgq_post(u->jack_msgq, PA_MSGOBJECT(u->sink), SINK_MESSAGE_BUFFER_SIZE, NULL, nframes, NULL, NULL);
+ return 0;
+}
+
int pa__init(pa_module*m) {
struct userdata *u = NULL;
pa_sample_spec ss;
@@ -297,10 +311,9 @@ int pa__init(pa_module*m) {
server_name = pa_modargs_get_value(ma, "server_name", NULL);
client_name = pa_modargs_get_value(ma, "client_name", "PulseAudio JACK Sink");
- u = pa_xnew0(struct userdata, 1);
+ m->userdata = u = pa_xnew0(struct userdata, 1);
u->core = m->core;
u->module = m;
- m->userdata = u;
u->saved_frame_time_valid = FALSE;
u->rtpoll = pa_rtpoll_new();
pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll);
@@ -386,10 +399,12 @@ int pa__init(pa_module*m) {
pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq);
pa_sink_set_rtpoll(u->sink, u->rtpoll);
+ pa_sink_set_max_request(u->sink, jack_get_buffer_size(u->client) * pa_frame_size(&u->sink->sample_spec));
jack_set_process_callback(u->client, jack_process, u);
jack_on_shutdown(u->client, jack_shutdown, u);
jack_set_thread_init_callback(u->client, jack_init, u);
+ jack_set_buffer_size_callback(u->client, jack_buffer_size, u);
if (!(u->thread = pa_thread_new(thread_func, u))) {
pa_log("Failed to create thread.");
diff --git a/src/modules/module-jack-source.c b/src/modules/module-jack-source.c
index c77c958..41f09a8 100644
--- a/src/modules/module-jack-source.c
+++ b/src/modules/module-jack-source.c
@@ -270,12 +270,11 @@ int pa__init(pa_module*m) {
server_name = pa_modargs_get_value(ma, "server_name", NULL);
client_name = pa_modargs_get_value(ma, "client_name", "PulseAudio JACK Source");
- u = pa_xnew0(struct userdata, 1);
+ m->userdata = u = pa_xnew0(struct userdata, 1);
u->core = m->core;
u->module = m;
m->userdata = u;
u->saved_frame_time_valid = FALSE;
-
u->rtpoll = pa_rtpoll_new();
pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll);
@@ -372,14 +371,14 @@ int pa__init(pa_module*m) {
for (i = 0, p = ports; i < ss.channels; i++, p++) {
if (!*p) {
- pa_log("not enough physical output ports, leaving unconnected.");
+ pa_log("Not enough physical output ports, leaving unconnected.");
break;
}
- pa_log_info("connecting %s to %s", jack_port_name(u->port[i]), *p);
+ pa_log_info("Connecting %s to %s", jack_port_name(u->port[i]), *p);
if (jack_connect(u->client, *p, jack_port_name(u->port[i]))) {
- pa_log("failed to connect %s to %s, leaving unconnected.", jack_port_name(u->port[i]), *p);
+ pa_log("Failed to connect %s to %s, leaving unconnected.", jack_port_name(u->port[i]), *p);
break;
}
}
commit 0316dba9d1bb519259076f580869cf65147bde44
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Mar 25 00:41:23 2009 +0100
set latency range only in tsched mode
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index a7728a0..3040582 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -1685,26 +1685,27 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
u->tsched_watermark = pa_usec_to_bytes_round_up(pa_bytes_to_usec_round_up(tsched_watermark, &requested_ss), &u->sink->sample_spec);
pa_cvolume_mute(&u->hardware_volume, u->sink->sample_spec.channels);
+ pa_log_info("Using %u fragments of size %lu bytes, buffer time is %0.2fms",
+ nfrags, (long unsigned) u->fragment_size,
+ (double) pa_bytes_to_usec(u->hwbuf_size, &ss) / PA_USEC_PER_MSEC);
+
+ pa_sink_set_max_request(u->sink, u->hwbuf_size);
+
if (use_tsched) {
fix_min_sleep_wakeup(u);
fix_tsched_watermark(u);
u->watermark_step = pa_usec_to_bytes(TSCHED_WATERMARK_STEP_USEC, &u->sink->sample_spec);
- }
- pa_sink_set_max_rewind(u->sink, use_tsched ? u->hwbuf_size : 0);
- pa_sink_set_max_request(u->sink, u->hwbuf_size);
- pa_sink_set_latency_range(u->sink,
- use_tsched ? (pa_usec_t) -1 : pa_bytes_to_usec(u->hwbuf_size, &ss),
- pa_bytes_to_usec(u->hwbuf_size, &ss));
+ pa_sink_set_max_rewind(u->sink, u->hwbuf_size);
- pa_log_info("Using %u fragments of size %lu bytes, buffer time is %0.2fms",
- nfrags, (long unsigned) u->fragment_size,
- (double) pa_bytes_to_usec(u->hwbuf_size, &ss) / PA_USEC_PER_MSEC);
+ pa_sink_set_latency_range(u->sink,
+ 0,
+ pa_bytes_to_usec(u->hwbuf_size, &ss));
- if (use_tsched)
pa_log_info("Time scheduling watermark is %0.2fms",
(double) pa_bytes_to_usec(u->tsched_watermark, &ss) / PA_USEC_PER_MSEC);
+ }
reserve_update(u);
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index 8b76ee5..4a535aa 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -1537,24 +1537,23 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
u->tsched_watermark = pa_usec_to_bytes_round_up(pa_bytes_to_usec_round_up(tsched_watermark, &requested_ss), &u->source->sample_spec);
pa_cvolume_mute(&u->hardware_volume, u->source->sample_spec.channels);
+ pa_log_info("Using %u fragments of size %lu bytes, buffer time is %0.2fms",
+ nfrags, (long unsigned) u->fragment_size,
+ (double) pa_bytes_to_usec(u->hwbuf_size, &ss) / PA_USEC_PER_MSEC);
+
if (use_tsched) {
fix_min_sleep_wakeup(u);
fix_tsched_watermark(u);
u->watermark_step = pa_usec_to_bytes(TSCHED_WATERMARK_STEP_USEC, &u->source->sample_spec);
- }
- pa_source_set_latency_range(u->source,
- use_tsched ? (pa_usec_t) -1 : pa_bytes_to_usec(u->hwbuf_size, &ss),
- pa_bytes_to_usec(u->hwbuf_size, &ss));
+ pa_source_set_latency_range(u->source,
+ 0,
+ pa_bytes_to_usec(u->hwbuf_size, &ss));
- pa_log_info("Using %u fragments of size %lu bytes, buffer time is %0.2fms",
- nfrags, (long unsigned) u->fragment_size,
- (double) pa_bytes_to_usec(u->hwbuf_size, &ss) / PA_USEC_PER_MSEC);
-
- if (use_tsched)
pa_log_info("Time scheduling watermark is %0.2fms",
(double) pa_bytes_to_usec(u->tsched_watermark, &ss) / PA_USEC_PER_MSEC);
+ }
reserve_update(u);
commit b815a1c7eb16e79b3b9ded80edda522202ad25f9
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Mar 25 00:42:32 2009 +0100
don't fiddle with latency range because we cannot adjust it dynamically
diff --git a/src/modules/module-combine.c b/src/modules/module-combine.c
index f72223d..b7e18bc 100644
--- a/src/modules/module-combine.c
+++ b/src/modules/module-combine.c
@@ -69,7 +69,7 @@ PA_MODULE_USAGE(
#define DEFAULT_ADJUST_TIME 10
-#define REQUEST_LATENCY_USEC (PA_USEC_PER_MSEC * 200)
+#define BLOCK_USEC (PA_USEC_PER_MSEC * 200)
static const char* const valid_modargs[] = {
"sink_name",
@@ -817,7 +817,7 @@ static int output_create_sink_input(struct output *o) {
o->sink_input->kill = sink_input_kill_cb;
o->sink_input->userdata = o;
- pa_sink_input_set_requested_latency(o->sink_input, REQUEST_LATENCY_USEC);
+ pa_sink_input_set_requested_latency(o->sink_input, BLOCK_USEC);
return 0;
}
@@ -1088,11 +1088,8 @@ int pa__init(pa_module*m) {
pa_sink_set_rtpoll(u->sink, u->rtpoll);
pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq);
- pa_sink_set_latency_range(u->sink, REQUEST_LATENCY_USEC, REQUEST_LATENCY_USEC);
- u->block_usec = u->sink->thread_info.max_latency;
-
- u->sink->thread_info.max_request =
- pa_usec_to_bytes(u->block_usec, &u->sink->sample_spec);
+ u->block_usec = BLOCK_USEC;
+ pa_sink_set_max_request(u->sink, pa_usec_to_bytes(u->block_usec, &u->sink->sample_spec));
if (!u->automatic) {
const char*split_state;
commit 59b7e530cac58ce82c293db77d993274456e7370
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Mar 25 00:42:47 2009 +0100
Don't initialize userdata twice
diff --git a/src/modules/module-jack-source.c b/src/modules/module-jack-source.c
index 41f09a8..9a215c5 100644
--- a/src/modules/module-jack-source.c
+++ b/src/modules/module-jack-source.c
@@ -273,7 +273,6 @@ int pa__init(pa_module*m) {
m->userdata = u = pa_xnew0(struct userdata, 1);
u->core = m->core;
u->module = m;
- m->userdata = u;
u->saved_frame_time_valid = FALSE;
u->rtpoll = pa_rtpoll_new();
pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll);
commit bcfe51ffd5bb7e4b9e5f90cc73f8af3ebcc34a36
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Mar 25 00:44:21 2009 +0100
again, don't fiddle with latency range in sinks with static latency
diff --git a/src/modules/module-null-sink.c b/src/modules/module-null-sink.c
index c8edd0c..129bc1c 100644
--- a/src/modules/module-null-sink.c
+++ b/src/modules/module-null-sink.c
@@ -62,7 +62,7 @@ PA_MODULE_USAGE(
"description=<description for the sink>");
#define DEFAULT_SINK_NAME "null"
-#define MAX_LATENCY_USEC (PA_USEC_PER_SEC * 2)
+#define BLOCK_USEC (PA_USEC_PER_SEC * 2)
struct userdata {
pa_core *core;
@@ -299,9 +299,7 @@ int pa__init(pa_module*m) {
pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq);
pa_sink_set_rtpoll(u->sink, u->rtpoll);
- pa_sink_set_latency_range(u->sink, (pa_usec_t) -1, MAX_LATENCY_USEC);
-
- u->block_usec = u->sink->thread_info.max_latency;
+ u->block_usec = BLOCK_USEC;
nbytes = pa_usec_to_bytes(u->block_usec, &u->sink->sample_spec);
pa_sink_set_max_rewind(u->sink, nbytes);
pa_sink_set_max_request(u->sink, nbytes);
commit d0bd3d95922b1b3582fff70a3d2fba6d269e7488
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Mar 25 00:44:36 2009 +0100
initialize max_request
diff --git a/src/modules/module-pipe-sink.c b/src/modules/module-pipe-sink.c
index def4f75..26b6b96 100644
--- a/src/modules/module-pipe-sink.c
+++ b/src/modules/module-pipe-sink.c
@@ -292,6 +292,7 @@ int pa__init(pa_module*m) {
pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq);
pa_sink_set_rtpoll(u->sink, u->rtpoll);
+ pa_sink_set_max_request(u->sink, PIPE_BUF);
u->rtpoll_item = pa_rtpoll_item_new(u->rtpoll, PA_RTPOLL_NEVER, 1);
pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL);
commit 98a5f4a9919c67792f3bbf01ee5ed7e666b8b216
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Mar 25 00:45:13 2009 +0100
don't fiddle with latency range in sources with static latency
diff --git a/src/modules/module-sine-source.c b/src/modules/module-sine-source.c
index 206c45f..50e4730 100644
--- a/src/modules/module-sine-source.c
+++ b/src/modules/module-sine-source.c
@@ -60,7 +60,7 @@ PA_MODULE_USAGE(
"frequency=<frequency in Hz>");
#define DEFAULT_SOURCE_NAME "sine_input"
-#define MAX_LATENCY_USEC (PA_USEC_PER_SEC * 2)
+#define BLOCK_USEC (PA_USEC_PER_SEC * 2)
struct userdata {
pa_core *core;
@@ -263,8 +263,7 @@ int pa__init(pa_module*m) {
pa_source_set_asyncmsgq(u->source, u->thread_mq.inq);
pa_source_set_rtpoll(u->source, u->rtpoll);
- pa_source_set_latency_range(u->source, (pa_usec_t) -1, MAX_LATENCY_USEC);
- u->block_usec = u->source->thread_info.max_latency;
+ u->block_usec = BLOCK_USEC;
if (!(u->thread = pa_thread_new(thread_func, u))) {
pa_log("Failed to create thread.");
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list