configure.ac | 6 +++- man/Makefile.am | 10 ++++++- man/start-pulseaudio-kde.1.xml.in | 48 ++++++++++++++++++++++++++++++++++++ man/start-pulseaudio-x11.1.xml.in | 50 ++++++++++++++++++++++++++++++++++++++ src/map-file | 1 src/pulse/internal.h | 1 src/pulse/stream.c | 26 ++++++++++++++++++- src/pulse/stream.h | 6 ++++ src/pulsecore/protocol-native.c | 4 ++- 9 files changed, 145 insertions(+), 7 deletions(-)
New commits: commit 85291b1954303d577209dbb99c6950995aac7b01 Author: Colin Guthrie <co...@mageia.org> Date: Tue Aug 2 15:56:50 2011 +0100 build-sys: bump soname diff --git a/configure.ac b/configure.ac index 5fdcc60..1bc858f 100644 --- a/configure.ac +++ b/configure.ac @@ -40,7 +40,7 @@ AC_SUBST(PA_PROTOCOL_VERSION, 23) # The stable ABI for client applications, for the version info x:y:z # always will hold y=z -AC_SUBST(LIBPULSE_VERSION_INFO, [12:4:12]) +AC_SUBST(LIBPULSE_VERSION_INFO, [13:0:13]) # A simplified, synchronous, ABI-stable interface for client # applications, for the version info x:y:z always will hold y=z commit 1893234063519af980b17c03f8fec98a26f7ae94 Author: David Henningsson <david.hennings...@canonical.com> Date: Tue Aug 2 14:34:20 2011 +0200 protocol-native: Allow clients to know at what index underrun occurred This patch introduces some extra protocol information, so protocol version is bumped. This functionality is primarily needed to solve a long standing issue in alsa-plugins, which should ignore underruns if and only if it is obsolete, i e, if more data has been written to the pipe in the meantime (which will automatically end the underrun). BugLink: http://bugs.launchpad.net/bugs/805940 Signed-off-by: David Henningsson <david.hennings...@canonical.com> diff --git a/configure.ac b/configure.ac index 077ab43..5fdcc60 100644 --- a/configure.ac +++ b/configure.ac @@ -36,7 +36,7 @@ AC_SUBST(PA_MINOR, pa_minor) AC_SUBST(PA_MAJORMINOR, pa_major.pa_minor) AC_SUBST(PA_API_VERSION, 12) -AC_SUBST(PA_PROTOCOL_VERSION, 22) +AC_SUBST(PA_PROTOCOL_VERSION, 23) # The stable ABI for client applications, for the version info x:y:z # always will hold y=z diff --git a/src/map-file b/src/map-file index d9c3e9f..aacd524 100644 --- a/src/map-file +++ b/src/map-file @@ -277,6 +277,7 @@ pa_stream_get_sample_spec; pa_stream_get_state; pa_stream_get_time; pa_stream_get_timing_info; +pa_stream_get_underflow_index; pa_stream_is_corked; pa_stream_is_suspended; pa_stream_new; diff --git a/src/pulse/internal.h b/src/pulse/internal.h index 9237909..60b3799 100644 --- a/src/pulse/internal.h +++ b/src/pulse/internal.h @@ -169,6 +169,7 @@ struct pa_stream { /* playback */ pa_memblock *write_memblock; void *write_data; + int64_t latest_underrun_at_index; /* recording */ pa_memchunk peek_memchunk; diff --git a/src/pulse/stream.c b/src/pulse/stream.c index 3658064..416efb7 100644 --- a/src/pulse/stream.c +++ b/src/pulse/stream.c @@ -180,6 +180,7 @@ static pa_stream *pa_stream_new_with_proplist_internal( s->timing_info_valid = FALSE; s->previous_time = 0; + s->latest_underrun_at_index = -1; s->read_index_not_before = 0; s->write_index_not_before = 0; @@ -843,10 +844,17 @@ finish: pa_context_unref(c); } +int64_t pa_stream_get_underflow_index(pa_stream *p) +{ + pa_assert(p); + return p->latest_underrun_at_index; +} + void pa_command_overflow_or_underflow(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata) { pa_stream *s; pa_context *c = userdata; uint32_t channel; + int64_t offset = -1; pa_assert(pd); pa_assert(command == PA_COMMAND_OVERFLOW || command == PA_COMMAND_UNDERFLOW); @@ -856,8 +864,19 @@ void pa_command_overflow_or_underflow(pa_pdispatch *pd, uint32_t command, uint32 pa_context_ref(c); - if (pa_tagstruct_getu32(t, &channel) < 0 || - !pa_tagstruct_eof(t)) { + if (pa_tagstruct_getu32(t, &channel) < 0) { + pa_context_fail(c, PA_ERR_PROTOCOL); + goto finish; + } + + if (c->version >= 23 && command == PA_COMMAND_UNDERFLOW) { + if (pa_tagstruct_gets64(t, &offset) < 0) { + pa_context_fail(c, PA_ERR_PROTOCOL); + goto finish; + } + } + + if (!pa_tagstruct_eof(t)) { pa_context_fail(c, PA_ERR_PROTOCOL); goto finish; } @@ -868,6 +887,9 @@ void pa_command_overflow_or_underflow(pa_pdispatch *pd, uint32_t command, uint32 if (s->state != PA_STREAM_READY) goto finish; + if (offset != -1) + s->latest_underrun_at_index = offset; + if (s->buffer_attr.prebuf > 0) check_smoother_status(s, TRUE, FALSE, TRUE); diff --git a/src/pulse/stream.h b/src/pulse/stream.h index 010f968..e50ff0b 100644 --- a/src/pulse/stream.h +++ b/src/pulse/stream.h @@ -570,6 +570,12 @@ void pa_stream_set_read_callback(pa_stream *p, pa_stream_request_cb_t cb, void * /** Set the callback function that is called when a buffer overflow happens. (Only for playback streams) */ void pa_stream_set_overflow_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata); +/** Return at what position the latest underflow occurred, or -1 if this information is not + * known (e g if no underflow has occurred, or server is older than 1.0). + * Can be used inside the underflow callback to get information about the current underflow. + * (Only for playback streams) \since 1.0 */ +int64_t pa_stream_get_underflow_index(pa_stream *p); + /** Set the callback function that is called when a buffer underflow happens. (Only for playback streams) */ void pa_stream_set_underflow_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata); diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c index f069e83..3ed9f1a 100644 --- a/src/pulsecore/protocol-native.c +++ b/src/pulsecore/protocol-native.c @@ -822,6 +822,8 @@ static int playback_stream_process_msg(pa_msgobject *o, int code, void*userdata, pa_tagstruct_putu32(t, PA_COMMAND_UNDERFLOW); pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */ pa_tagstruct_putu32(t, s->index); + if (s->connection->version >= 23) + pa_tagstruct_puts64(t, offset); pa_pstream_send_tagstruct(s->connection->pstream, t); break; } @@ -1562,7 +1564,7 @@ static int sink_input_pop_cb(pa_sink_input *i, size_t nbytes, pa_memchunk *chunk s->drain_request = FALSE; pa_asyncmsgq_post(pa_thread_mq_get()->outq, PA_MSGOBJECT(s), PLAYBACK_STREAM_MESSAGE_DRAIN_ACK, PA_UINT_TO_PTR(s->drain_tag), 0, NULL, NULL); } else if (!s->is_underrun) - pa_asyncmsgq_post(pa_thread_mq_get()->outq, PA_MSGOBJECT(s), PLAYBACK_STREAM_MESSAGE_UNDERFLOW, NULL, 0, NULL, NULL); + pa_asyncmsgq_post(pa_thread_mq_get()->outq, PA_MSGOBJECT(s), PLAYBACK_STREAM_MESSAGE_UNDERFLOW, NULL, pa_memblockq_get_read_index(s->memblockq), NULL, NULL); s->is_underrun = TRUE; commit 00493a4ef02b9e03ef12174720b8a5eb9c8200b4 Author: Daniel Schaal <farb...@web.de> Date: Sat Jul 2 21:17:43 2011 +0200 man: add manpage for start-pulseaudio-kde and start-pulseaudio-x11 diff --git a/configure.ac b/configure.ac index 66dc9ca..077ab43 100644 --- a/configure.ac +++ b/configure.ac @@ -1231,6 +1231,8 @@ man/padsp.1.xml man/pulse-daemon.conf.5.xml man/pulse-client.conf.5.xml man/default.pa.5.xml +man/start-pulseaudio-kde.1.xml +man/start-pulseaudio-x11.1.xml ]) AC_CONFIG_FILES([src/esdcompat:src/daemon/esdcompat.in], [chmod +x src/esdcompat]) diff --git a/man/Makefile.am b/man/Makefile.am index 4f42fe2..b27a9f2 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -30,7 +30,9 @@ noinst_DATA = \ padsp.1.xml \ pulse-daemon.conf.5.xml \ pulse-client.conf.5.xml \ - default.pa.5.xml + default.pa.5.xml \ + start-pulseaudio-kde.1.xml \ + start-pulseaudio-x11.1.xml xmllint: $(noinst_DATA) for f in $(noinst_DATA) ; do \ @@ -51,7 +53,9 @@ dist_man_MANS = \ padsp.1 \ pulse-daemon.conf.5 \ pulse-client.conf.5 \ - default.pa.5 + default.pa.5 \ + start-pulseaudio-kde.1 \ + start-pulseaudio-x11.1 CLEANFILES = \ $(dist_man_MANS) @@ -74,6 +78,8 @@ EXTRA_DIST = \ pulse-daemon.conf.5.xml.in \ pulse-client.conf.5.xml.in \ default.pa.5.xml.in \ + start-pulseaudio-kde.1.xml.in \ + start-pulseaudio-x11.1.xml.in \ xmltoman \ xmltoman.css \ xmltoman.xsl \ diff --git a/man/start-pulseaudio-kde.1.xml.in b/man/start-pulseaudio-kde.1.xml.in new file mode 100644 index 0000000..ef32906 --- /dev/null +++ b/man/start-pulseaudio-kde.1.xml.in @@ -0,0 +1,48 @@ +<?xml version="1.0"?><!--*-nxml-*--> +<!DOCTYPE manpage SYSTEM "xmltoman.dtd"> +<?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?> + +<!-- +This file is part of PulseAudio. + +PulseAudio is 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; either version 2.1 of the +License, or (at your option) any later version. + +PulseAudio 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 PulseAudio; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +USA. +--> + +<manpage name="start-pulseaudio-kde" section="1" desc="PulseAudio Sound Server KDE Startup Script"> + + <synopsis> + <cmd>start-pulseaudio-kde [<arg>pulseaudio options</arg>]</cmd> + </synopsis> + + <description> + <p>This script starts pulseaudio (if not already running) and loads + module-device-manager to use KDE routing policies.</p> + + <p>All arguments are directly passed to pulseaudio.</p> + </description> + + <section name="Authors"> + <p>The PulseAudio Developers <@PACKAGE_BUGREPORT@>; + PulseAudio is available from <url href="@PACKAGE_URL@"/></p> + </section> + + <section name="See also"> + <p> + <manref name="pulseaudio" section="1"/> + </p> + </section> + +</manpage> diff --git a/man/start-pulseaudio-x11.1.xml.in b/man/start-pulseaudio-x11.1.xml.in new file mode 100644 index 0000000..32f1571 --- /dev/null +++ b/man/start-pulseaudio-x11.1.xml.in @@ -0,0 +1,50 @@ +<?xml version="1.0"?><!--*-nxml-*--> +<!DOCTYPE manpage SYSTEM "xmltoman.dtd"> +<?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?> + +<!-- +This file is part of PulseAudio. + +PulseAudio is 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; either version 2.1 of the +License, or (at your option) any later version. + +PulseAudio 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 PulseAudio; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +USA. +--> + +<manpage name="start-pulseaudio-x11" section="1" desc="PulseAudio Sound Server X11 Startup Script"> + + <synopsis> + <cmd>start-pulseaudio-x11 [<arg>pulseaudio options</arg>]</cmd> + </synopsis> + + <description> + <p>This script starts pulseaudio (if not already running) and loads modules to + publish access credentials to the PulseAudio server in the X11 root window and to synthesize + X11 media key events on cork/uncork requests. Additionally it registers + PulseAudio to the X11 Session Manager.</p> + + <p>All arguments are directly passed to pulseaudio.</p> + </description> + + <section name="Authors"> + <p>The PulseAudio Developers <@PACKAGE_BUGREPORT@>; + PulseAudio is available from <url href="@PACKAGE_URL@"/></p> + </section> + + <section name="See also"> + <p> + <manref name="pulseaudio" section="1"/> + </p> + </section> + +</manpage> _______________________________________________ pulseaudio-commits mailing list pulseaudio-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-commits