Peter Meerwald | 24 Oct 23:21 2014
Picon

[PATCH RFC 00/17] memory optimizations

this patch series aims to save memory allocations and some system calls
related to PA's client/server protocol implementation

patches 1 to 5 ('tagstruct:') introduce a new tagstruct type _APPENDED
which can hold tagstruct data up to a certain size; tagstructs are now 
kept in a specific free-list -- this typically replaces two malloc()/free()s
with one flist push()/pop()

patches 6 to 8 ('packet:') make packets fixed-size (typically); packets are
kept in a specific free-list -- this replaces one malloc()/free() with one
flist push()/pop()

patches 9 to 14 ('pstream:') allows to send tagstructs directly to a pstream
without encapsulation in a packet -- this saves one flist push()/pop()

patches 15 and 16 ('pstream') often save a read() call by reading more than
just the descriptor (up to 40 bytes, e.g. description (20 bytes) + shm
info (16 bytes)); the idea is similar to b4342845d, "Optimize write 
of smaller packages", but for read -- this trades some extra memcpy() for
a read()

patch 17 ('iochannel') fixes a strange behaviour in iochannel/mainloop that
deleted the input_event with every read which caused a rebuild of the pollfds
for every read()!

with these patches typical playback (i.e. after setup) runs without any malloc()/free()
thanks to the use of free-lists; number of memory management operations is reduced

no benchmarking yet

(Continue reading)

Wim Taymans | 24 Oct 09:56 2014
Picon

[PATCH 0/4] Add simple HSP support in new native backend v3

This set of patches adds a simple handler for the HSP profile to bluez
and makes a new card for each connected device. This makes it possible to
send audio to a Headset. The profile is implemented in a new native
headset backend.

The first 2 patches are mostly some very small cleanups and little bits to
implement the following patches.

The patches also switches the default backend from ofono to native.

This patchset replaces the previously posted native backend patches and
incorporates the suggestions I received to date.

Wim Taymans (4):
  bluez5-device: use get_profile_direction
  bluez5-util: add dispose function
  backend-native: add a new native headset backend
  backend-native: implement volume control

 configure.ac                                 |   6 +-
 src/modules/bluetooth/backend-native.c       | 490 +++++++++++++++++++++++++++
 src/modules/bluetooth/bluez5-util.c          |   2 +
 src/modules/bluetooth/bluez5-util.h          |  11 +
 src/modules/bluetooth/module-bluez5-device.c | 172 +++++++++-
 5 files changed, 661 insertions(+), 20 deletions(-)
 create mode 100644 src/modules/bluetooth/backend-native.c

--

-- 
1.9.3
(Continue reading)

Tanu Kaskinen | 18 Oct 20:10 2014
Picon

[PATCH 0/2] A couple of Zsh completion patches

Tanu Kaskinen (2):
  shell-completion: zsh: Mark a variable as local
  shell-completion: zsh: Rework pactl completion

 shell-completion/zsh/_pulseaudio | 266 +++++++++++++++++++++++++++++++++------
 1 file changed, 231 insertions(+), 35 deletions(-)

--

-- 
1.9.3
David Henningsson | 15 Oct 09:10 2014

[PATCH 1/2] configure: Move path to modules to /usr/lib/pulseaudio/modules-x.y

The path /usr/lib/pulse-x.y is non-standard, both considering that
other software more often than not have a non-versioned directory
under /usr/lib, and that we ourselves don't use "pulse-x.y" anywhere
else.

It could still be reasonable to have more than one version of PA
installed, so let's have the x.y at the module directory instead.

Signed-off-by: David Henningsson <david.henningsson <at> canonical.com>
---
 configure.ac | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index f13ddb0..fe4a1e3 100644
--- a/configure.ac
+++ b/configure.ac
 <at>  <at>  -1354,8 +1354,8  <at>  <at>  fi

 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"])
+        AS_HELP_STRING([--with-module-dir],[Directory where to install the modules to (defaults to ${libdir}/pulseaudio/modules-${PA_MAJORMINOR}]),
+        [modlibexecdir=$withval], [modlibexecdir="${libdir}/pulseaudio/modules-${PA_MAJORMINOR}"])

 AC_SUBST(modlibexecdir)
 AX_DEFINE_DIR(PA_DLSEARCHPATH, modlibexecdir, [Modules dir])
--

-- 
1.9.1
(Continue reading)

Tanu Kaskinen | 7 Oct 15:54 2014
Picon

[PATCH] tunnel-sink-new: Limit the maximum latency to 200 ms

The default maximum latency is 10 seconds, which is not good,
especially since the tunnel sink doesn't support rewinding. Due to the
lack of rewinding, e.g. volume changes take a long time with large
latencies.

Change-Id: I13753d30a17598ebc9e6a3eda3db4096ff6fcf4e
---
 src/modules/module-tunnel-sink-new.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/modules/module-tunnel-sink-new.c b/src/modules/module-tunnel-sink-new.c
index c74a7c1..2a91be9 100644
--- a/src/modules/module-tunnel-sink-new.c
+++ b/src/modules/module-tunnel-sink-new.c
 <at>  <at>  -60,6 +60,7  <at>  <at>  PA_MODULE_USAGE(
         "cookie=<cookie file path>"
         );

+#define MAX_LATENCY_USEC (200 * PA_USEC_PER_MSEC)
 #define TUNNEL_THREAD_FAILED_MAINLOOP 1

 static void stream_state_cb(pa_stream *stream, void *userdata);
 <at>  <at>  -525,6 +526,7  <at>  <at>  int pa__init(pa_module *m) {
     u->sink->userdata = u;
     u->sink->parent.process_msg = sink_process_msg_cb;
     u->sink->update_requested_latency = sink_update_requested_latency_cb;
+    pa_sink_set_latency_range(u->sink, 0, MAX_LATENCY_USEC);

     /* set thread message queue */
     pa_sink_set_asyncmsgq(u->sink, u->thread_mq->inq);
(Continue reading)

Sjoerd Simons | 24 Oct 22:33 2014
Picon

[PATCH] Alsa: Correct port availability with multiple jacks

In case there are two independent jacks for one port (e.g. Dock
Headphone Jack and Headphone Jack), the availability ends up being
incorrect for one of the first was _NO (not plugged) and the second gets
_YES (plugged). Also pulse complains about the state being inconsistent
which isn't true.

Fix this by preferring higher states (_YES > _NO > _UNKNOWN)
---
 src/modules/alsa/module-alsa-card.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c
index ed332e0..0026e0f 100644
--- a/src/modules/alsa/module-alsa-card.c
+++ b/src/modules/alsa/module-alsa-card.c
 <at>  <at>  -335,14 +335,8  <at>  <at>  static void report_port_state(pa_device_port *p, struct userdata *u) {

         cpa = jack->plugged_in ? jack->state_plugged : jack->state_unplugged;

-        /* "Yes" and "no" trumphs "unknown" if we have more than one jack */
-        if (cpa == PA_AVAILABLE_UNKNOWN)
-            continue;
-
-        if ((cpa == PA_AVAILABLE_NO && pa == PA_AVAILABLE_YES) ||
-            (pa == PA_AVAILABLE_NO && cpa == PA_AVAILABLE_YES))
-            pa_log_warn("Availability of port '%s' is inconsistent!", p->name);
-        else
+        /* Prefer going towards _YES in case of multiple jacks */
+        if (cpa > pa)
             pa = cpa;
(Continue reading)

Peter Meerwald | 23 Oct 17:35 2014
Picon

[PATCH 2/7] Cleanup !! for bool

From: Peter Meerwald <p.meerwald <at> bct-electronic.com>

!!x makes no sense if x is bool (this is a leftover from the
convertion pa_bool_t -> bool, d806b197)

Signed-off-by: Peter Meerwald <pmeerw <at> pmeerw.net>
---
 src/daemon/main.c                 |   12 ++++++------
 src/modules/module-tunnel.c       |   12 ++++++------
 src/modules/rtp/module-rtp-send.c |    2 +-
 src/pulse/context.c               |    4 ++--
 src/pulsecore/iochannel.c         |    2 +-
 src/pulsecore/memblock.c          |    2 +-
 src/pulsecore/pid.c               |    2 +-
 src/pulsecore/sink-input.c        |    2 +-
 src/pulsecore/sink.c              |    2 +-
 src/pulsecore/sink.h              |    2 +-
 src/pulsecore/source-output.c     |    2 +-
 src/pulsecore/source.c            |    2 +-
 12 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/src/daemon/main.c b/src/daemon/main.c
index 4fd245a..d2a8a8a 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
 <at>  <at>  -1009,11 +1009,11  <at>  <at>  int main(int argc, char *argv[]) {
     c->scache_idle_time = conf->scache_idle_time;
     c->resample_method = conf->resample_method;
     c->realtime_priority = conf->realtime_priority;
-    c->realtime_scheduling = !!conf->realtime_scheduling;
(Continue reading)

Peter Meerwald | 23 Oct 17:33 2014
Picon

[PATCH 0/7] misc cleanup

From: Peter Meerwald <p.meerwald <at> bct-electronic.com>

misc. trivial cleanups queued up while working on 'real stuff'

Peter Meerwald (7):
  Remove link to CIA from README
  Cleanup !! for bool
  mainloop: Fix typo
  modules: Fix )== typos
  alsa-sink: Check for after-avail is redundant
  tests: Make global variables static in srbchannel-test
  tests: Be careful with data types to avoid cast

 README                              |    3 ---
 src/daemon/main.c                   |   12 ++++++------
 src/modules/alsa/alsa-sink.c        |    4 ++--
 src/modules/alsa/alsa-source.c      |    2 +-
 src/modules/module-equalizer-sink.c |    2 +-
 src/modules/module-tunnel.c         |   12 ++++++------
 src/modules/rtp/module-rtp-send.c   |    2 +-
 src/pulse/context.c                 |    4 ++--
 src/pulse/mainloop.c                |    4 ++--
 src/pulsecore/iochannel.c           |    2 +-
 src/pulsecore/memblock.c            |    2 +-
 src/pulsecore/pid.c                 |    2 +-
 src/pulsecore/sink-input.c          |    2 +-
 src/pulsecore/sink.c                |    2 +-
 src/pulsecore/sink.h                |    2 +-
 src/pulsecore/source-output.c       |    2 +-
 src/pulsecore/source.c              |    2 +-
(Continue reading)

Felipe Sateler | 23 Oct 01:38 2014
Picon

[PATCH] Don't crash if pa_stream_peek returns NULL

From: Christer Stenbrenden <christer <at> uggwar.net>

pa_stream_peek can return NULL if either the buffer is empty or if it
has a hole. In either case we need to avoid derefencing the data
pointer. Additionally, if there is a hole, we need to call pa_stream_drop,
if the buffer is empty we should not call it.

Thanks to Christer Stenbrenden for the initial patch.
BugLink: https://bugs.debian.org/735898
---
 src/mainwindow.cc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/mainwindow.cc b/src/mainwindow.cc
index 5d205fb..ff9ec52 100644
--- a/src/mainwindow.cc
+++ b/src/mainwindow.cc
 <at>  <at>  -493,6 +493,14  <at>  <at>  static void read_callback(pa_stream *s, size_t length, void *userdata) {
         return;
     }

+    if (!data) {
+        // NULL data means either a hole or empty buffer.
+	// Only drop the stream when there is a hole (length > 0)
+        if (length)
+            pa_stream_drop(s);
+        return;
+    }
+
     assert(length > 0);
(Continue reading)

Felipe Sateler | 23 Oct 01:48 2014
Picon

[PATCH] pavucontrol: Handle IO errors in icon setting code

If gtk cannot load the file, it may throw a Gio::Error. In that case
fall back to setting the name.

BugLink: https://bugs.debian.org/765725
---
 src/mainwindow.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mainwindow.cc b/src/mainwindow.cc
index 5d205fb..ff0011c 100644
--- a/src/mainwindow.cc
+++ b/src/mainwindow.cc
 <at>  <at>  -251,6 +251,8  <at>  <at>  static void set_icon_name_fallback(Gtk::Image *i, const char *name, Gtk::IconSiz
             i->set(name);
     } catch (Gtk::IconThemeError &e) {
         i->set(name);
+    } catch (Gio::Error &e) {
+        i->set(name);
     }
 }

--

-- 
2.1.1
Alexander E. Patrakov | 22 Oct 18:21 2014
Picon

[PATCH] Change the default fragment size to 5 ms

Of course, this only applies to ALSA devices that can't use tsched, as
well as to OSS on more exotic platforms.

This is needed for compatibility with Wine games that use DirectSound8
on distributions such as Arch Linux who don't accept the unofficial
winepulse patch. The reason is that Wine DirectSound8 emulation requests
a period of 10 ms and expects it to work for the purposes of timing. And
in fact, it cannot know (via ALSA API) that it is not going to work!

A known malware-free test application is Foobar2000 version 1.2. Later
versions no longer use DirectSound.

This issue is not going to be fixed on the Wine side, because the audio
subsystem in Wine is not really maintained, and the maintainer has
already privately expressed some negative thoughts about the state of
the linux audio ecosystem in general.

The correct solution (at least from the "isolate the clients from
hardware limitations as thoroughly as possible" viewpoint) would be to
consume audio from sink inputs using a timer if the actual sink does not
provide sufficiently small minreq. In other words, adapt tsched to BATCH
cards and drop non-tsched. But that's a whole project. So, as a stopgap
solution for running Wine games on e.g. USB audio (which is a topic that
pops up regularly on #pulseaudio IRC channel), let's reduce the default
fragment size to a value suitable for unpatched Wine.

Regarding the value: on my system, for mp3 playback through Foobar2000,
8ms fragments work, 9ms fragments result in constant underruns.

Wine wiki recommends 5ms.
(Continue reading)


Gmane