[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.15-test5-134-g76c44d1
Lennart Poettering
gitmailer-noreply at 0pointer.de
Tue Mar 31 12:36:57 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 ef5af553d6bb27d88a97f407fcf9f685f7e36e49 (commit)
- Log -----------------------------------------------------------------
76c44d1 be a bit more verbose about max_request changes
cebaa98 Log underruns
917e8cd handle buffer_attr changed messages properly
5cbd4b7 update command name table
-----------------------------------------------------------------------
Summary of changes:
src/modules/module-tunnel.c | 50 ++++++++++++++++++++++++++++++++++++++-
src/pulsecore/pdispatch.c | 15 +++++++++++-
src/pulsecore/protocol-native.c | 21 +++++++++++----
3 files changed, 78 insertions(+), 8 deletions(-)
-----------------------------------------------------------------------
commit 5cbd4b74a2248a701b00b316f47dc22617d81f3d
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Mar 31 20:43:05 2009 +0200
update command name table
diff --git a/src/pulsecore/pdispatch.c b/src/pulsecore/pdispatch.c
index 305941a..d00106b 100644
--- a/src/pulsecore/pdispatch.c
+++ b/src/pulsecore/pdispatch.c
@@ -165,7 +165,20 @@ static const char *command_names[PA_COMMAND_MAX] = {
[PA_COMMAND_STARTED] = "STARTED",
/* Supported since protocol v14 (0.9.12) */
- [PA_COMMAND_EXTENSION] = "EXTENSION"
+ [PA_COMMAND_EXTENSION] = "EXTENSION",
+
+
+ [PA_COMMAND_GET_CARD_INFO] = "GET_CARD_INFO",
+ [PA_COMMAND_GET_CARD_INFO_LIST] = "GET_CARD_INFO_LIST",
+ [PA_COMMAND_SET_CARD_PROFILE] = "SET_CARD_PROFILE",
+
+ [PA_COMMAND_CLIENT_EVENT] = "GET_CLIENT_EVENT",
+ [PA_COMMAND_PLAYBACK_STREAM_EVENT] = "PLAYBACK_STREAM_EVENT",
+ [PA_COMMAND_RECORD_STREAM_EVENT] = "RECORD_STREAM_EVENT",
+
+ /* SERVER->CLIENT */
+ [PA_COMMAND_PLAYBACK_BUFFER_ATTR_CHANGED] = "PLAYBACK_BUFFER_ATTR_CHANGED",
+ [PA_COMMAND_RECORD_BUFFER_ATTR_CHANGED] = "RECORD_BUFFER_ATTR_CHANGED"
};
#endif
commit 917e8cd0f619c2be0a2e6c38216508c62c56f7e7
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Mar 31 21:35:34 2009 +0200
handle buffer_attr changed messages properly
diff --git a/src/modules/module-tunnel.c b/src/modules/module-tunnel.c
index 7f303f1..79facdd 100644
--- a/src/modules/module-tunnel.c
+++ b/src/modules/module-tunnel.c
@@ -146,6 +146,7 @@ static void command_overflow_or_underflow(pa_pdispatch *pd, uint32_t command, ui
static void command_suspended(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
static void command_moved(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
static void command_stream_or_client_event(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
+static void command_stream_buffer_attr_changed(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
static const pa_pdispatch_cb_t command_table[PA_COMMAND_MAX] = {
#ifdef TUNNEL_SINK
@@ -163,7 +164,9 @@ static const pa_pdispatch_cb_t command_table[PA_COMMAND_MAX] = {
[PA_COMMAND_RECORD_STREAM_MOVED] = command_moved,
[PA_COMMAND_PLAYBACK_STREAM_EVENT] = command_stream_or_client_event,
[PA_COMMAND_RECORD_STREAM_EVENT] = command_stream_or_client_event,
- [PA_COMMAND_CLIENT_EVENT] = command_stream_or_client_event
+ [PA_COMMAND_CLIENT_EVENT] = command_stream_or_client_event,
+ [PA_COMMAND_PLAYBACK_BUFFER_ATTR_CHANGED] = command_stream_buffer_attr_changed,
+ [PA_COMMAND_RECORD_BUFFER_ATTR_CHANGED] = command_stream_buffer_attr_changed
};
struct userdata {
@@ -320,6 +323,51 @@ static void command_moved(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa
request_latency(u);
}
+static void command_stream_buffer_attr_changed(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata) {
+ struct userdata *u = userdata;
+ uint32_t channel, maxlength, tlength, fragsize, prebuf, minreq;
+ pa_usec_t usec;
+
+ pa_assert(pd);
+ pa_assert(t);
+ pa_assert(u);
+ pa_assert(u->pdispatch == pd);
+
+ if (pa_tagstruct_getu32(t, &channel) < 0 ||
+ pa_tagstruct_getu32(t, &maxlength) < 0) {
+
+ pa_log_error("Invalid packet.");
+ pa_module_unload_request(u->module, TRUE);
+ return;
+ }
+
+ if (command == PA_COMMAND_RECORD_BUFFER_ATTR_CHANGED) {
+ if (pa_tagstruct_getu32(t, &fragsize) < 0 ||
+ pa_tagstruct_get_usec(t, &usec) < 0) {
+
+ pa_log_error("Invalid packet.");
+ pa_module_unload_request(u->module, TRUE);
+ return;
+ }
+ } else {
+ if (pa_tagstruct_getu32(t, &tlength) < 0 ||
+ pa_tagstruct_getu32(t, &prebuf) < 0 ||
+ pa_tagstruct_getu32(t, &minreq) < 0 ||
+ pa_tagstruct_get_usec(t, &usec) < 0) {
+
+ pa_log_error("Invalid packet.");
+ pa_module_unload_request(u->module, TRUE);
+ return;
+ }
+ }
+
+#ifdef TUNNEL_SINK
+ pa_log_debug("Server reports buffer attrs changed. tlength now at %lu, before %lu.", (unsigned long) tlength, (unsigned long) u->tlength);
+#endif
+
+ request_latency(u);
+}
+
#ifdef TUNNEL_SINK
/* Called from main context */
commit cebaa98b384c94c910739691a1901b935b64cb4e
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Mar 31 21:36:09 2009 +0200
Log underruns
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 3e75cab..09ac7d2 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -1437,7 +1437,7 @@ static int sink_input_pop_cb(pa_sink_input *i, size_t nbytes, pa_memchunk *chunk
if (pa_memblockq_is_readable(s->memblockq))
s->is_underrun = FALSE;
else {
-/* pa_log("%s, UNDERRUN: %lu", pa_proplist_gets(i->proplist, PA_PROP_MEDIA_NAME), (unsigned long) pa_memblockq_get_length(s->memblockq)); */
+ pa_log_debug("Underrun on '%s', %lu bytes in queue.", pa_strnull(pa_proplist_gets(i->proplist, PA_PROP_MEDIA_NAME)), (unsigned long) pa_memblockq_get_length(s->memblockq));
if (s->drain_request && pa_sink_input_safe_to_remove(i)) {
s->drain_request = FALSE;
commit 76c44d104d8f4ec8729f9601bbad828bd39e253c
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Mar 31 21:36:45 2009 +0200
be a bit more verbose about max_request changes
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 09ac7d2..4f1d9b4 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -1495,17 +1495,26 @@ static void sink_input_update_max_rewind_cb(pa_sink_input *i, size_t nbytes) {
/* Called from thread context */
static void sink_input_update_max_request_cb(pa_sink_input *i, size_t nbytes) {
playback_stream *s;
- size_t tlength;
+ size_t new_tlength, old_tlength;
pa_sink_input_assert_ref(i);
s = PLAYBACK_STREAM(i->userdata);
playback_stream_assert_ref(s);
- tlength = nbytes+2*pa_memblockq_get_minreq(s->memblockq);
+ old_tlength = pa_memblockq_get_tlength(s->memblockq);
+ new_tlength = nbytes+2*pa_memblockq_get_minreq(s->memblockq);
- if (pa_memblockq_get_tlength(s->memblockq) < tlength) {
- pa_memblockq_set_tlength(s->memblockq, tlength);
- pa_asyncmsgq_post(pa_thread_mq_get()->outq, PA_MSGOBJECT(s), PLAYBACK_STREAM_MESSAGE_UPDATE_TLENGTH, NULL, pa_memblockq_get_tlength(s->memblockq), NULL, NULL);
+ if (old_tlength < new_tlength) {
+ pa_log_debug("max_request changed, trying to update from %zu to %zu.", old_tlength, new_tlength);
+ pa_memblockq_set_tlength(s->memblockq, new_tlength);
+ new_tlength = pa_memblockq_get_tlength(s->memblockq);
+
+ if (new_tlength == old_tlength)
+ pa_log_debug("Failed to increase tlength");
+ else {
+ pa_log_debug("Notifying client about increased tlength");
+ pa_asyncmsgq_post(pa_thread_mq_get()->outq, PA_MSGOBJECT(s), PLAYBACK_STREAM_MESSAGE_UPDATE_TLENGTH, NULL, pa_memblockq_get_tlength(s->memblockq), NULL, NULL);
+ }
}
}
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list