Hajime Fujita | 21 Oct 07:49 2014

incomplete IPv6 support in pa_socket_client_new_string()

Hello,

I'm currently working on IPv6 support for the raop module [1].

During the work I found a potential issue in 
pa_socket_client_new_string() (in pulsecore/socket-client.c) as pointed 
out in [1].

It does not work as expected when an IPv6 address string like 
"2001:db8::1" is passed as the "name" parameter. This is because the 
name parameter is passed to pa_parse_address(), which thinks the last 
colon as a separator between hostname (or address) and a port number. To 
prevent pa_parse_address() from doing this, an IPv6 address must be 
bracketed with "[]" (e.g. "[2001:db8::1]").

I'm wondering what would be the best solution for this situation.
a. Modify callers: callers of pa_socket_client_new_string() must add 
brackets to IPv6 addresses.
b. Modify pa_socket_client_new_string(): if an IPv6 address is given as 
the name parameter, it will be bracketed before being passed to 
pa_parse_address().

Any opinions or suggestions?

[1]: https://github.com/hfujita/pulseaudio-raop2/issues/1

Thanks,
Hajime
David Henningsson | 20 Oct 16:31 2014

[PATCH] module-card/device-restore: Do not legacy load an empty entry

There is no use in trying to load data in legacy format, if we
already know that there is no data at all.
Also clarify in the debug message whether there is invalid data
or no data at all.

Signed-off-by: David Henningsson <david.henningsson <at> canonical.com>
---
 src/modules/module-card-restore.c   | 6 ++++--
 src/modules/module-device-restore.c | 8 +++++---
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/modules/module-card-restore.c b/src/modules/module-card-restore.c
index 5b02602..681acca 100644
--- a/src/modules/module-card-restore.c
+++ b/src/modules/module-card-restore.c
 <at>  <at>  -269,8 +269,10  <at>  <at>  static struct entry* entry_read(struct userdata *u, const char *name) {

     pa_zero(data);

-    if (!pa_database_get(u->database, &key, &data))
-        goto fail;
+    if (!pa_database_get(u->database, &key, &data)) {
+        pa_log_debug("Database contains no data for key: %s", name);
+        return NULL;
+    }

     t = pa_tagstruct_new(data.data, data.size);
     e = entry_new();
diff --git a/src/modules/module-device-restore.c b/src/modules/module-device-restore.c
index b7f172f..cb42207 100644
(Continue reading)

David Henningsson | 20 Oct 13:34 2014

[PATCH] alsa-mixer: Add support for "Headphone+LO" and "Speaker+LO"

These two control names are currently being added to the HDA driver,
so let's support them in PulseAudio as well.

Signed-off-by: David Henningsson <david.henningsson <at> canonical.com>
---
 src/modules/alsa/mixer/paths/analog-output-headphones.conf   | 10 ++++++++++
 src/modules/alsa/mixer/paths/analog-output-lineout.conf      | 12 ++++++++++++
 .../alsa/mixer/paths/analog-output-speaker-always.conf       | 10 ++++++++++
 src/modules/alsa/mixer/paths/analog-output-speaker.conf      | 10 ++++++++++
 4 files changed, 42 insertions(+)

diff --git a/src/modules/alsa/mixer/paths/analog-output-headphones.conf b/src/modules/alsa/mixer/paths/analog-output-headphones.conf
index a41d41f..1645f14 100644
--- a/src/modules/alsa/mixer/paths/analog-output-headphones.conf
+++ b/src/modules/alsa/mixer/paths/analog-output-headphones.conf
 <at>  <at>  -69,6 +69,16  <at>  <at>  override-map.2 = all-left,all-right
 switch = off
 volume = off

+[Element Speaker+LO]
+switch = off
+volume = off
+
+[Element Headphone+LO]
+switch = mute
+volume = merge
+override-map.1 = all
+override-map.2 = all-left,all-right
+
 [Element Headphone]
(Continue reading)

Glenn Golden | 19 Oct 22:39 2014

Re: [PATCH] Don't let user-set PULSE_RUNTIME_PATH values affect behaviour

Tanu Kaskinen <tanu.kaskinen <at> linux.intel.com> [2014-10-06 13:58:09 +0300]:
> On Mon, 2014-10-06 at 12:46 +0200, David Henningsson wrote:
> > 
> > On 2014-10-06 12:41, Tanu Kaskinen wrote:
> > > On Sat, 2014-10-04 at 11:13 -0600, Glenn Golden wrote:
> > >> David Henningsson <david.henningsson <at> canonical.com> [2014-10-02 11:29:50 +0200]:
> > >>>
> > >>>
> > >>> On 2014-10-02 11:17, Tanu Kaskinen wrote:
> > >>>> On Mon, 2014-09-29 at 13:50 +0200, David Henningsson wrote:
> > >>>>>
> > >>>>> On 2014-09-28 11:23, Tanu Kaskinen wrote:
> > >>>>>> The logic for choosing the runtime directory is complicated enough
> > >>>>>> also without adding PULSE_RUNTIME_PATH into the mix. XDG_RUNTIME_DIR
> > >>>>>> is sufficient for users to control the runtime directory.
> > >>>>>> PULSE_RUNTIME_PATH has not been documented, so this change doesn't
> > >>>>>> constitute an interface break.
> > >>>>>
> > >>>>> A quick googling of PULSE_RUNTIME_PATH seems to indicate usage of this
> > >>>>> environment variable in at least chromium and enlightenment, and also
> > >>>>> recommended in several blog posts and mailing lists, including this one.
> > >>>>> It is likely used in several home-made scripts.
> > >>>>>
> > >>>>> I'm hesitant to remove it for that reason.
> > >>>>
> > >>>> The argument that "if you use undocumented interfaces, you can only
> > >>>> blame yourself if your script breaks" probably won't change your mind,
> > >>>> so I guess we'll just have to make this a documented interface then.
> > >>>
> > >>> Well, while not officially documented, we have still advocated the use of it
(Continue reading)

Tanu Kaskinen | 19 Oct 14:21 2014
Picon

About the routing patches

Hi,

In Düsseldorf we discussed a bit about the plan regarding the routing 
patches. The situation remains that nobody else than David has looked 
into the patches, and David would rather not merge the patches, because 
the infrastructure alone doesn't solve any problems. The point was 
repeated that it's hard to review the infrastructure if it's not visible 
how it will be used.

The idea of rewriting the infrastructure as a module was brought up. 
Having the code in a module was considered to be easier to accept in 
upstream, and my impression was that everyone thought that would be a 
good idea. It occurred to me later that we didn't actually discuss it in 
very concrete terms how a module-based approach would work better, so 
let's do it now.

The routing patches that have been written so far are divided into 
several sets. If we imagine that I would have originally put the 
infrastructure in a module, would the patch sets have been accepted to 
the master branch without waiting for more code? Reviewing would have 
been equally hard, because the final picture wouldn't have been 
available in this case either. Would I have got the permission to push 
the code without any review, or with lower-quality review? I guess so, 
but I'd like to get a confirmation for that before I start from scratch 
again.

--

-- 
Tanu
_______________________________________________
pulseaudio-discuss mailing list
(Continue reading)

Tanu Kaskinen | 19 Oct 13:17 2014
Picon

Re: [PATCH] tunnel-sink-new: Fix requested latency check

On Tue, 2014-10-07 at 16:56 +0300, Tanu Kaskinen wrote:
> This fixes a bug in latency configuration. The wrong type in the cast
> caused UINT64_MAX being not treated as special, so the configured
> latency was set to UINT64_MAX usecs, which of course is absurdly huge
> latency.
> ---
>  src/modules/module-tunnel-sink-new.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

No feedback received, I pushed this now.

--

-- 
Tanu
Tanu Kaskinen | 19 Oct 13:15 2014
Picon

Re: Sharing X application the old way with sound

On Tue, 2014-10-07 at 15:03 +0200, Edouard Gaulué wrote:
> Hi community,
> 
> There is a time when too much information kills information (old 
> information, partial information, wrong information...). I've been 
> googling for hours now and read a lot but I still don't know what to do 
> to implement my needs.
> 
> I think they are rather classical: I want to build a Firefox/Iceweasel 
> application server with several simultaneous clients using Raspberry Pi 
> using ssh, everything being in a LAN. Of course each user needs to hears 
> just its own application sound.
> 
> I don't want to send a full desktop manager like Gnome, KDE to the 
> client but just the application.
> 
> I've read that pulsaudio was per user, somewhere else per session, and 
> in a last place that to work with several users at the same time I 
> needed the "system" deamon. I've tried a lot...
> 
> I've also read the documentation regarding connexion between X11 and 
> pulseaudio. I've looked arround x2go and xfreerdp but I never found this 
> particular use case.
> 
> So, as of october 2014, is it just possible? With one only deamon 
> instance? If yes what would be the main setting keys on the server and 
> on the client? Is start-pulseaudio-x11 needed?

If I understood correctly, you have the display and the sound card in
the client machine, and run firefox in the server machine. This blog
(Continue reading)

Tanu Kaskinen | 19 Oct 13:05 2014
Picon

Re: [PATCH] bluetooth: Move stuff to pa_bluetooth_transport_put/unlink()

On Tue, 2014-10-07 at 14:50 +0300, Tanu Kaskinen wrote:
> This should not have any effect on behaviour. The goal is to align
> with the pattern that I think we should follow:
> 
> Object initialization:
>  - put() is the place to create references from other objects to the
>    newly created object. In this case, adding the transport to
>    discovery->transports was moved from new() to put, and adding the
>    transport to device->transports was moved from set_state() to
>    put().
> 
> Object destruction:
>  - unlink() undoes put() and removes all references from other objects
>    to the object being unlinked. In this case setting the
>    device->transports pointer to NULL was moved from set_state() to
>    unlink(), and setting the discovery->transports pointer to NULL was
>    moved from free() to unlink().
>  - free() undoes new(), but also calls unlink() so that object owners
>    don't need to remember to call unlink() before free().
> ---
>  src/modules/bluetooth/backend-ofono.c |  3 ---
>  src/modules/bluetooth/bluez5-util.c   | 19 ++++++++++---------
>  2 files changed, 10 insertions(+), 12 deletions(-)

No feedback received, I pushed this now.

--

-- 
Tanu
Colin Guthrie | 18 Oct 20:43 2014

systemd socket activation support

Hi,

So while at linux plumbers attending the systemd hackfest, I thought a good
use of the hacking time I had available would be to allow PulseAudio to be
activated via systemd's socket activation system.

The changes needed are actually quite minimal, and by doing this we can
disable quite a lot of code in PulseAudio related to autospawning (which
does still seem to cause some problems for some users) and we also get a few
handy side effects too.

It becomes much easier, as a developer, to stop the system PulseAudio and run
your own test instance i.e. you do not have to disable autospawning before
killing the system PA - you just run:

systemctl --user stop pulseaudio.socket pulseaudio.service

and then run your test version.

A second advantage is that there is a relatively simple and documented way to
run e.g. mpd as a normal user before you login via the systemd user lingering
feature.

I've written a few docs about all this here:
http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/Software/PulseAudio/Documentation/User/Running/

(NB I've assumed v6 for landing this but that could be updated as needed)

All the best!

(Continue reading)

Tanu Kaskinen | 18 Oct 20:10 2014
Picon

[PATCH 2/2] shell-completion: zsh: Rework pactl completion

So far the command name has been figured out by looking one or two
items back in the $words array, but I needed a way to figure out the
command given an arbitrary number of parameters. I was implementing
a command for removing devices from the device-manager database, and
the command would take a list of devices. Since the number of devices
that need to be completed can be arbitrarily large, the previous "look
one or two words back" approach didn't work.

This new approach is more verbose, but I think it's also easier to
follow. There's some duplication that would be easy to avoid by
merging some of the commands, but I decided to not do that, to make
it more obvious what the code does.
---
 shell-completion/zsh/_pulseaudio | 264 +++++++++++++++++++++++++++++++++------
 1 file changed, 229 insertions(+), 35 deletions(-)

diff --git a/shell-completion/zsh/_pulseaudio b/shell-completion/zsh/_pulseaudio
index 5f66ed9..cbccaf2 100644
--- a/shell-completion/zsh/_pulseaudio
+++ b/shell-completion/zsh/_pulseaudio
 <at>  <at>  -263,50 +263,244  <at>  <at>  _pactl_completion() {
             'set-sink-formats: set supported formats of a sink'
             'subscribe: subscribe to events'
         )
+
         _describe 'pactl commands' _pactl_commands
     }

-    _pactl_list_commands=(
-        'modules: list loaded modules'
(Continue reading)

Tanu Kaskinen | 18 Oct 20:10 2014
Picon

[PATCH 1/2] shell-completion: zsh: Mark a variable as local

Variables are global by default, and we certainly don't want
_pactl_commands to be a global variable.
---
 shell-completion/zsh/_pulseaudio | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/shell-completion/zsh/_pulseaudio b/shell-completion/zsh/_pulseaudio
index 1c786dc..5f66ed9 100644
--- a/shell-completion/zsh/_pulseaudio
+++ b/shell-completion/zsh/_pulseaudio
 <at>  <at>  -229,6 +229,8  <at>  <at>  _pactl_completion() {
     _set_remote

     _pactl_command(){
+        local -a _pactl_commands
+
         _pactl_commands=(
             'help: show help and exit'
             'stat: dump statistics about the PulseAudio daemon'
--

-- 
1.9.3

Gmane