[pulseaudio-commits] 6 commits - configure.ac man/Makefile.am man/start-pulseaudio-kde.1.xml.in po/POTFILES.in src/daemon src/.gitignore src/Makefile.am src/modules

Tanu Kaskinen tanuk at kemper.freedesktop.org
Mon Mar 3 08:11:21 PST 2014


 configure.ac                                 |    2 -
 man/Makefile.am                              |    3 -
 man/start-pulseaudio-kde.1.xml.in            |   48 ---------------------------
 po/POTFILES.in                               |    1 
 src/.gitignore                               |    1 
 src/Makefile.am                              |   11 ++----
 src/daemon/.gitignore                        |    1 
 src/daemon/pulseaudio-kde.desktop.in         |   10 -----
 src/daemon/pulseaudio.desktop.in             |    1 
 src/daemon/start-pulseaudio-kde.in           |   30 ----------------
 src/daemon/start-pulseaudio-x11.in           |    4 ++
 src/modules/alsa/alsa-mixer.c                |    4 +-
 src/modules/bluetooth/module-bluez4-device.c |   24 +++++++------
 src/modules/bluetooth/module-bluez5-device.c |   24 +++++++------
 14 files changed, 39 insertions(+), 125 deletions(-)

New commits:
commit 9271c11e68ebf1a2781eaf65c1f7d2f836c10280
Author: Tanu Kaskinen <tanu.kaskinen at linux.intel.com>
Date:   Wed Jan 29 20:59:00 2014 +0200

    alsa: Remove a redundant check
    
    If mixer_handle is not NULL, then hctl_handle won't be NULL either.
    The redundant check was confusing, because it looked like we would
    leak the mixer_handle if mixer_handle is non-NULL and hctl_handle is
    NULL.

diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
index 99de0ec..4357e52 100644
--- a/src/modules/alsa/alsa-mixer.c
+++ b/src/modules/alsa/alsa-mixer.c
@@ -3776,8 +3776,8 @@ static void mapping_paths_probe(pa_alsa_mapping *m, pa_alsa_profile *profile,
     pa_assert(pcm_handle);
 
     mixer_handle = pa_alsa_open_mixer_for_pcm(pcm_handle, NULL, &hctl_handle);
-    if (!mixer_handle || !hctl_handle) {
-         /* Cannot open mixer, remove all entries */
+    if (!mixer_handle) {
+        /* Cannot open mixer, remove all entries */
         pa_hashmap_remove_all(ps->paths);
         return;
     }

commit 3f21c216282098e0aaaa3c80cad1479e4f32937a
Author: James Bunton <jamesbunton at delx.net.au>
Date:   Mon Jan 27 01:14:39 2014 +1100

    bluetooth: Fix timing to count based on decoded data
    
    Currently the latency information is being updated based on the encoded
    SBC data instead of the decoded PCM data. Fixing this required moving
    the timing update to be after the packet has been decoded.

diff --git a/src/modules/bluetooth/module-bluez4-device.c b/src/modules/bluetooth/module-bluez4-device.c
index 90b1bcd..c70e4a6 100644
--- a/src/modules/bluetooth/module-bluez4-device.c
+++ b/src/modules/bluetooth/module-bluez4-device.c
@@ -881,6 +881,7 @@ static int a2dp_process_push(struct userdata *u) {
         void *d;
         ssize_t l;
         size_t to_write, to_decode;
+        size_t total_written = 0;
 
         a2dp_prepare_buffer(u);
 
@@ -907,17 +908,12 @@ static int a2dp_process_push(struct userdata *u) {
 
         pa_assert((size_t) l <= a2dp->buffer_size);
 
-        u->read_index += (uint64_t) l;
-
         /* TODO: get timestamp from rtp */
         if (!found_tstamp) {
             /* pa_log_warn("Couldn't find SO_TIMESTAMP data in auxiliary recvmsg() data!"); */
             tstamp = pa_rtclock_now();
         }
 
-        pa_smoother_put(u->read_smoother, tstamp, pa_bytes_to_usec(u->read_index, &u->sample_spec));
-        pa_smoother_resume(u->read_smoother, tstamp, true);
-
         p = (uint8_t*) a2dp->buffer + sizeof(*header) + sizeof(*payload);
         to_decode = l - sizeof(*header) - sizeof(*payload);
 
@@ -943,6 +939,8 @@ static int a2dp_process_push(struct userdata *u) {
 /*             pa_log_debug("SBC: decoded: %lu; written: %lu", (unsigned long) decoded, (unsigned long) written); */
 /*             pa_log_debug("SBC: frame_length: %lu; codesize: %lu", (unsigned long) a2dp->frame_length, (unsigned long) a2dp->codesize); */
 
+            total_written += written;
+
             /* Reset frame length, it can be changed due to bitpool change */
             a2dp->frame_length = sbc_get_frame_length(&a2dp->sbc);
 
@@ -958,6 +956,10 @@ static int a2dp_process_push(struct userdata *u) {
             to_write -= written;
         }
 
+        u->read_index += (uint64_t) total_written;
+        pa_smoother_put(u->read_smoother, tstamp, pa_bytes_to_usec(u->read_index, &u->sample_spec));
+        pa_smoother_resume(u->read_smoother, tstamp, true);
+
         memchunk.length -= to_write;
 
         pa_memblock_release(memchunk.memblock);
diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c
index 61723f8..857a972 100644
--- a/src/modules/bluetooth/module-bluez5-device.c
+++ b/src/modules/bluetooth/module-bluez5-device.c
@@ -402,6 +402,7 @@ static int a2dp_process_push(struct userdata *u) {
         void *d;
         ssize_t l;
         size_t to_write, to_decode;
+        size_t total_written = 0;
 
         a2dp_prepare_buffer(u);
 
@@ -428,17 +429,12 @@ static int a2dp_process_push(struct userdata *u) {
 
         pa_assert((size_t) l <= sbc_info->buffer_size);
 
-        u->read_index += (uint64_t) l;
-
         /* TODO: get timestamp from rtp */
         if (!found_tstamp) {
             /* pa_log_warn("Couldn't find SO_TIMESTAMP data in auxiliary recvmsg() data!"); */
             tstamp = pa_rtclock_now();
         }
 
-        pa_smoother_put(u->read_smoother, tstamp, pa_bytes_to_usec(u->read_index, &u->sample_spec));
-        pa_smoother_resume(u->read_smoother, tstamp, true);
-
         p = (uint8_t*) sbc_info->buffer + sizeof(*header) + sizeof(*payload);
         to_decode = l - sizeof(*header) - sizeof(*payload);
 
@@ -461,6 +457,8 @@ static int a2dp_process_push(struct userdata *u) {
                 return 0;
             }
 
+            total_written += written;
+
             /* Reset frame length, it can be changed due to bitpool change */
             sbc_info->frame_length = sbc_get_frame_length(&sbc_info->sbc);
 
@@ -476,6 +474,10 @@ static int a2dp_process_push(struct userdata *u) {
             to_write -= written;
         }
 
+        u->read_index += (uint64_t) total_written;
+        pa_smoother_put(u->read_smoother, tstamp, pa_bytes_to_usec(u->read_index, &u->sample_spec));
+        pa_smoother_resume(u->read_smoother, tstamp, true);
+
         memchunk.length -= to_write;
 
         pa_memblock_release(memchunk.memblock);

commit 4a5f48e7a42f997793db76e2001b7c252f8d93fe
Author: James Bunton <jamesbunton at delx.net.au>
Date:   Mon Jan 27 01:14:38 2014 +1100

    bluetooth: Don't abort on SBC decoding error
    
    The Nokia E7 running Symbian Belle Refresh seems to generate invalid SBC
    packets every few minutes. This causes pulseaudio to disconnect the
    stream and log "SBC decoding error (-3)".
    
    If a single packet is bad, pulseaudio should keep playing the stream.

diff --git a/src/modules/bluetooth/module-bluez4-device.c b/src/modules/bluetooth/module-bluez4-device.c
index 83e603f..90b1bcd 100644
--- a/src/modules/bluetooth/module-bluez4-device.c
+++ b/src/modules/bluetooth/module-bluez4-device.c
@@ -937,7 +937,7 @@ static int a2dp_process_push(struct userdata *u) {
                 pa_log_error("SBC decoding error (%li)", (long) decoded);
                 pa_memblock_release(memchunk.memblock);
                 pa_memblock_unref(memchunk.memblock);
-                return -1;
+                return 0;
             }
 
 /*             pa_log_debug("SBC: decoded: %lu; written: %lu", (unsigned long) decoded, (unsigned long) written); */
@@ -1039,10 +1039,12 @@ static void thread_func(void *userdata) {
                 if (n_read < 0)
                     goto io_fail;
 
-                /* We just read something, so we are supposed to write something, too */
-                pending_read_bytes += n_read;
-                do_write += pending_read_bytes / u->write_block_size;
-                pending_read_bytes = pending_read_bytes % u->write_block_size;
+                if (n_read > 0) {
+                    /* We just read something, so we are supposed to write something, too */
+                    pending_read_bytes += n_read;
+                    do_write += pending_read_bytes / u->write_block_size;
+                    pending_read_bytes = pending_read_bytes % u->write_block_size;
+                }
             }
         }
 
diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c
index 287e763..61723f8 100644
--- a/src/modules/bluetooth/module-bluez5-device.c
+++ b/src/modules/bluetooth/module-bluez5-device.c
@@ -458,7 +458,7 @@ static int a2dp_process_push(struct userdata *u) {
                 pa_log_error("SBC decoding error (%li)", (long) decoded);
                 pa_memblock_release(memchunk.memblock);
                 pa_memblock_unref(memchunk.memblock);
-                return -1;
+                return 0;
             }
 
             /* Reset frame length, it can be changed due to bitpool change */
@@ -1095,10 +1095,12 @@ static void thread_func(void *userdata) {
                 if (n_read < 0)
                     goto io_fail;
 
-                /* We just read something, so we are supposed to write something, too */
-                pending_read_bytes += n_read;
-                do_write += pending_read_bytes / u->write_block_size;
-                pending_read_bytes = pending_read_bytes % u->write_block_size;
+                if (n_read > 0) {
+                    /* We just read something, so we are supposed to write something, too */
+                    pending_read_bytes += n_read;
+                    do_write += pending_read_bytes / u->write_block_size;
+                    pending_read_bytes = pending_read_bytes % u->write_block_size;
+                }
             }
         }
 

commit f46799579f438125b695dced4edf8bca05cbe90a
Author: Tanu Kaskinen <tanu.kaskinen at linux.intel.com>
Date:   Sun Jan 26 17:40:31 2014 +0200

    Remove all references to the removed KDE files

diff --git a/configure.ac b/configure.ac
index 4854711..e75973f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1382,13 +1382,11 @@ man/pulse-daemon.conf.5.xml
 man/pulse-client.conf.5.xml
 man/default.pa.5.xml
 man/pulse-cli-syntax.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])
 AC_CONFIG_FILES([src/start-pulseaudio-x11:src/daemon/start-pulseaudio-x11.in], [chmod +x src/start-pulseaudio-x11])
-AC_CONFIG_FILES([src/start-pulseaudio-kde:src/daemon/start-pulseaudio-kde.in], [chmod +x src/start-pulseaudio-kde])
 AC_CONFIG_FILES([src/client.conf:src/pulse/client.conf.in])
 AC_CONFIG_FILES([src/daemon.conf:src/daemon/daemon.conf.in],
     [m4 src/daemon.conf > src/daemon.conf.gen && mv src/daemon.conf.gen src/daemon.conf])
diff --git a/man/Makefile.am b/man/Makefile.am
index d0cc8e7..d80ba6a 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -32,7 +32,6 @@ noinst_DATA = \
 	pulse-client.conf.5.xml \
 	default.pa.5.xml \
 	pulse-cli-syntax.5.xml \
-	start-pulseaudio-kde.1.xml \
 	start-pulseaudio-x11.1.xml
 
 xmllint: $(noinst_DATA)
@@ -56,7 +55,6 @@ dist_man_MANS = \
 	pulse-client.conf.5 \
 	default.pa.5 \
 	pulse-cli-syntax.5 \
-	start-pulseaudio-kde.1 \
 	start-pulseaudio-x11.1
 
 CLEANFILES = \
@@ -81,7 +79,6 @@ EXTRA_DIST = \
 	pulse-client.conf.5.xml.in \
 	default.pa.5.xml.in \
 	pulse-cli-syntax.5.xml.in \
-	start-pulseaudio-kde.1.xml.in \
 	start-pulseaudio-x11.1.xml.in \
 	xmltoman \
 	xmltoman.css \
diff --git a/man/start-pulseaudio-kde.1.xml.in b/man/start-pulseaudio-kde.1.xml.in
deleted file mode 100644
index ef32906..0000000
--- a/man/start-pulseaudio-kde.1.xml.in
+++ /dev/null
@@ -1,48 +0,0 @@
-<?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/po/POTFILES.in b/po/POTFILES.in
index d06932f..f39abae 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -6,7 +6,6 @@ src/daemon/dumpmodules.c
 src/daemon/ltdl-bind-now.c
 src/daemon/main.c
 src/daemon/pulseaudio.desktop.in
-src/daemon/pulseaudio-kde.desktop.in
 src/modules/alsa/alsa-mixer.c
 src/modules/alsa/alsa-sink.c
 src/modules/alsa/alsa-source.c
diff --git a/src/.gitignore b/src/.gitignore
index 80f6f2c..2f92b44 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -22,7 +22,6 @@ pasuspender
 pax11publish
 pulseaudio
 start-pulseaudio-x11
-start-pulseaudio-kde
 *-symdef.h
 *-orc-gen.[ch]
 # tests
diff --git a/src/Makefile.am b/src/Makefile.am
index 59f0bcd..99d76ce 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -116,8 +116,7 @@ endif
 
 if HAVE_X11
 xdgautostart_in_files = \
-		daemon/pulseaudio.desktop.in \
-		daemon/pulseaudio-kde.desktop.in
+		daemon/pulseaudio.desktop.in
 xdgautostart_DATA = $(xdgautostart_in_files:.desktop.in=.desktop)
 @INTLTOOL_DESKTOP_RULE@
 endif
@@ -190,7 +189,7 @@ endif
 
 if HAVE_X11
 bin_PROGRAMS += pax11publish
-bin_SCRIPTS += start-pulseaudio-x11 start-pulseaudio-kde
+bin_SCRIPTS += start-pulseaudio-x11
 endif
 
 pacat_SOURCES = utils/pacat.c
@@ -2104,8 +2103,8 @@ module_rygel_media_server_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
 #        Some minor stuff         #
 ###################################
 
-CLEANFILES += daemon/pulseaudio.desktop daemon/pulseaudio-kde.desktop
-DISTCLEANFILES = esdcompat client.conf default.pa system.pa daemon.conf start-pulseaudio-x11 start-pulseaudio-kde
+CLEANFILES += daemon/pulseaudio.desktop
+DISTCLEANFILES = esdcompat client.conf default.pa system.pa daemon.conf start-pulseaudio-x11
 
 if OS_IS_WIN32
 SYMLINK_PROGRAM=cd $(DESTDIR)$(bindir) && cp
diff --git a/src/daemon/.gitignore b/src/daemon/.gitignore
index 54e4299..0efa55b 100644
--- a/src/daemon/.gitignore
+++ b/src/daemon/.gitignore
@@ -1,3 +1,2 @@
 org.pulseaudio.policy
 pulseaudio.desktop
-pulseaudio-kde.desktop

commit 0ddde7c5b19da84b7ff7ee8fcefdc703c6c256a7
Author: Rex Dieter <rdieter at math.unl.edu>
Date:   Wed Jan 22 09:43:27 2014 -0600

    daemon: ensure pulseaudio early startup on kde

diff --git a/src/daemon/pulseaudio.desktop.in b/src/daemon/pulseaudio.desktop.in
index ce99382..06cde27 100644
--- a/src/daemon/pulseaudio.desktop.in
+++ b/src/daemon/pulseaudio.desktop.in
@@ -8,3 +8,4 @@ Type=Application
 Categories=
 GenericName=
 X-GNOME-Autostart-Phase=Initialization
+X-KDE-autostart-phase=1

commit 2b85ae048970b7faa7505fd0cd4746541d1b09eb
Author: Rex Dieter <rdieter at math.unl.edu>
Date:   Wed Jan 22 09:41:35 2014 -0600

    daemon: consolidate startup scripts
    
    simplify pulseaudio autostart into one, avoid needless extra
    work for kde, and avoid possible startup races.

diff --git a/src/Makefile.am b/src/Makefile.am
index 857fda3..59f0bcd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -95,12 +95,10 @@ EXTRA_DIST = \
 		depmod.py \
 		daemon/esdcompat.in \
 		daemon/start-pulseaudio-x11.in \
-		daemon/start-pulseaudio-kde.in \
 		utils/padsp.in \
 		utils/qpaeq \
 		modules/module-defs.h.m4 \
 		daemon/pulseaudio.desktop.in \
-		daemon/pulseaudio-kde.desktop.in \
 		map-file \
 		daemon/pulseaudio-system.conf \
 		modules/echo-cancel/adrian-license.txt
diff --git a/src/daemon/pulseaudio-kde.desktop.in b/src/daemon/pulseaudio-kde.desktop.in
deleted file mode 100644
index f0bfa8f..0000000
--- a/src/daemon/pulseaudio-kde.desktop.in
+++ /dev/null
@@ -1,10 +0,0 @@
-[Desktop Entry]
-Version=1.0
-_Name=PulseAudio Sound System KDE Routing Policy
-_Comment=Start the PulseAudio Sound System with KDE Routing Policy
-Exec=start-pulseaudio-kde
-Terminal=false
-Type=Application
-Categories=
-GenericName=
-OnlyShowIn=KDE;
diff --git a/src/daemon/start-pulseaudio-kde.in b/src/daemon/start-pulseaudio-kde.in
deleted file mode 100755
index c319e7d..0000000
--- a/src/daemon/start-pulseaudio-kde.in
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-
-# 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 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
-# 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.
-
-set -e
-
-[ -z "$PULSE_SERVER" ]
-
- at PA_BINARY@ --start "$@"
-
-if [ x"$DISPLAY" != x ] ; then
-
-    @PACTL_BINARY@ load-module module-device-manager "do_routing=1" > /dev/null
-
-fi
diff --git a/src/daemon/start-pulseaudio-x11.in b/src/daemon/start-pulseaudio-x11.in
index 391a6d3..620e50f 100755
--- a/src/daemon/start-pulseaudio-x11.in
+++ b/src/daemon/start-pulseaudio-x11.in
@@ -26,6 +26,10 @@ if [ x"$DISPLAY" != x ] ; then
     @PACTL_BINARY@ load-module module-x11-publish "display=$DISPLAY" > /dev/null
     @PACTL_BINARY@ load-module module-x11-cork-request "display=$DISPLAY" > /dev/null
 
+    if [ x"$KDE_FULL_SESSION" = x"true" ]; then
+       @PACTL_BINARY@ load-module module-device-manager "do_routing=1" > /dev/null
+    fi
+
     if [ x"$SESSION_MANAGER" != x ] ; then
 	@PACTL_BINARY@ load-module module-x11-xsmp "display=$DISPLAY session_manager=$SESSION_MANAGER" > /dev/null
     fi



More information about the pulseaudio-commits mailing list