platform/upstream/pulseaudio.git
11 years agobluetooth: Support transport auto-release
Mikel Astiz [Fri, 10 May 2013 08:30:47 +0000 (10:30 +0200)]
bluetooth: Support transport auto-release

With BlueZ 5, if the remote device suspends the audio, the transport
state will change to "idle" and the endpoint is not required to release
the transport, since this could introduce race conditions. Therefore,
ignore the call to pa_bluetooth_transport_release() if the transport is
not acquired any more.

11 years agobluetooth: Update to new BlueZ 5 transport acquire/release API
Mikel Astiz [Fri, 10 May 2013 08:30:46 +0000 (10:30 +0200)]
bluetooth: Update to new BlueZ 5 transport acquire/release API

The new D-Bus API doesn't support access rights, which weren't used by
PulseAudio anyway, but it does solve a race condition: now optional
acquires can be implemented by bluetooth-util atomically using the D-Bus
TryAcquire() method.

11 years agobluetooth: Support media transport's State property
Mikel Astiz [Fri, 10 May 2013 08:30:45 +0000 (10:30 +0200)]
bluetooth: Support media transport's State property

BlueZ 5 exposes a 'State' property in the media transport interface.
With regard to PA, this replaces the profile-specific interfaces, since
they were being used to know if the audio was streaming or not.

11 years agobluetooth: Parse media transport's properties
Mikel Astiz [Fri, 10 May 2013 08:30:44 +0000 (10:30 +0200)]
bluetooth: Parse media transport's properties

Add the code to parse the properties of the media transport object when
a PropertiesChanged signal is received.

Note that the transport might have an owner other than BlueZ, and thus
the property changes would be emitted from arbitrary senders. For
performance reasons, the installed match considers the interface name
where the property has changed.

It could be possible to install and remove the D-Bus matches dynamically
when a new owner is registered/unregistered, but filtering based on the
interface name seems good enough already.

11 years agobluetooth: Support Properties.PropertiesChanged signal
Mikel Astiz [Fri, 10 May 2013 08:30:43 +0000 (10:30 +0200)]
bluetooth: Support Properties.PropertiesChanged signal

Install matches for signal Properties.PropertiesChanged and process the
properties corresponding to the tracked devices.

11 years agobluetooth: Support ObjectManager interface add/remove
Mikel Astiz [Fri, 10 May 2013 08:30:42 +0000 (10:30 +0200)]
bluetooth: Support ObjectManager interface add/remove

Install matches for signals ObjectManager.InterfacesAdded and
ObjectManager.InterfacesRemoved, and process the devices that are
registered and unregistered dynamically.

11 years agocore: Add an "internal" suspend cause
Arun Raghavan [Mon, 23 Jul 2012 08:50:05 +0000 (14:20 +0530)]
core: Add an "internal" suspend cause

This lets us suspend devices from within the core for short periods
without having to overload one of the existing suspend causes.

https://bugs.freedesktop.org/show_bug.cgi?id=64118

11 years agopactl: Flush stdout buffer when printing subscribe events.
Nikolay Amiantov [Sun, 5 May 2013 11:22:53 +0000 (15:22 +0400)]
pactl: Flush stdout buffer when printing subscribe events.

"pactl subscribe" is running continuously, and without flushing its output is
not usable for "process-on-arrival" per-line tasks, such as grepping. This
patch should fix this. For example, now:
pactl subscribe | grep 'server'
should print only server events as they arrive.

11 years agobluetooth: BlueZ 5 interface rename to org.bluez.MediaTransport1
Mikel Astiz [Mon, 29 Apr 2013 16:28:04 +0000 (18:28 +0200)]
bluetooth: BlueZ 5 interface rename to org.bluez.MediaTransport1

Use the new interface name if BlueZ 5 has been detected.

11 years agobluetooth: BlueZ 5 interface rename to org.bluez.Media1
Mikel Astiz [Mon, 29 Apr 2013 16:28:03 +0000 (18:28 +0200)]
bluetooth: BlueZ 5 interface rename to org.bluez.Media1

Use the new interface name if BlueZ 5 has been detected.

11 years agobluetooth: BlueZ 5 interface rename to org.bluez.MediaEndpoint1
Mikel Astiz [Mon, 29 Apr 2013 16:28:02 +0000 (18:28 +0200)]
bluetooth: BlueZ 5 interface rename to org.bluez.MediaEndpoint1

Use the new interface name if BlueZ 5 has been detected.

11 years agobluetooth: Fix error checking style
Tanu Kaskinen [Wed, 1 May 2013 10:39:36 +0000 (13:39 +0300)]
bluetooth: Fix error checking style

11 years agobluetooth: Parse the tree returned by ObjectManager
Mikel Astiz [Mon, 29 Apr 2013 16:27:59 +0000 (18:27 +0200)]
bluetooth: Parse the tree returned by ObjectManager

Parse the result of ObjectManager.GetManagedObjects(), which includes
all objects registered, their interfaces and the corresponding
properties per interface.

11 years agobluetooth: Detect BlueZ 5
Mikel Astiz [Mon, 29 Apr 2013 16:27:58 +0000 (18:27 +0200)]
bluetooth: Detect BlueZ 5

Check the existence of ObjectManager to detect the version of the
running daemon. If the interface exists, it should be BlueZ 5.

11 years agomodule: Assign the index before calling init()
Tanu Kaskinen [Mon, 29 Apr 2013 13:46:13 +0000 (16:46 +0300)]
module: Assign the index before calling init()

Any code that runs inside the init() callback sees an invalid module
index. Sometimes init() does things that cause hooks to be fired. This
means that any code that uses hooks may see an invalid module index.
Fix this by assigning the module index before init() is called.

There are no known issues in the upstream code base where an invalid
module index would be used, but an out-of-tree module
(module-murphy-ivi) had a problem with this.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=63923
11 years agobluetooth: Remove the 'bluez.name' property
João Paulo Rechi Vita [Sat, 27 Apr 2013 00:24:52 +0000 (21:24 -0300)]
bluetooth: Remove the 'bluez.name' property

The 'Name' property of the Device interface became optional in BlueZ 5
and may not be present anymore (that happens when testing against the
PTS 4.7.0), so it's better not to expose it to clients so they don't
rely on its existence.

11 years agobluetooth: Use 'Alias' value as the device description
João Paulo Rechi Vita [Sat, 27 Apr 2013 00:26:36 +0000 (21:26 -0300)]
bluetooth: Use 'Alias' value as the device description

The 'Alias' property should be preffered over the 'Name' property,
according to the BlueZ API documentation.

11 years agobluetooth: Add 'bluez.alias' property
João Paulo Rechi Vita [Fri, 26 Apr 2013 15:30:24 +0000 (12:30 -0300)]
bluetooth: Add 'bluez.alias' property

11 years ago.gitignore: Ignore src/*.gcno files created when building with --enable-gcov
Peter Meerwald [Wed, 17 Apr 2013 07:49:03 +0000 (09:49 +0200)]
.gitignore: Ignore src/*.gcno files created when building with --enable-gcov

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agoswitch-on-port-available: Silence gcc warning.
poljar (Damir Jelić) [Fri, 19 Apr 2013 14:35:14 +0000 (16:35 +0200)]
switch-on-port-available: Silence gcc warning.

This silences this gcc warning:
module-switch-on-port-available.c:111:12: warning:
    'good' may be used uninitialized in this function

11 years agomodule: initialize module index to invalid value.
Ismo Puustinen [Fri, 12 Apr 2013 14:38:12 +0000 (17:38 +0300)]
module: initialize module index to invalid value.

m->init() was called while m->index was uninitialized, which was bad
style.

11 years agofdsem: Remember pa_write() type in pa_fdsem_post()
Peter Meerwald [Tue, 9 Apr 2013 14:10:16 +0000 (16:10 +0200)]
fdsem: Remember pa_write() type in pa_fdsem_post()

pa_write() knows two types of operation:
calling send() and calling write()

there is a flag (a pointer to an int) passed to pa_write()
which can remember which write type was successful

if the pointer is NULL or the int is 0, send() is tried first,
with a fallback to write() if send() resulted in ENOTSOCK

pa_fdsem_post() calls pa_write() with a NULL pointer;
unfortunately (at least with HAVE_SYS_EVENTFD_H #define'd) send()
always fails here and write() is called -- causing an extra syscall
quite frequently

strace:
send(17, "\1\0\0\0\0\0\0\0", 8, MSG_NOSIGNAL) = -1 ENOTSOCK (Socket operation on non-socket)
write(17, "\1\0\0\0\0\0\0\0", 8) = 8

the patch adds a write_type field to pa_fdsem to the successful
pa_write() type can be remembered and unnecessary send() calls are
avoided

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agopasuspender: Resume before exiting in case of SIGINT or fork() failure.
Tanu Kaskinen [Wed, 13 Jun 2012 09:45:16 +0000 (12:45 +0300)]
pasuspender: Resume before exiting in case of SIGINT or fork() failure.

Pressing Ctrl-C in a terminal while pasuspender is running
causes the sinks and sources to stay suspended after
pasuspender has exited, which is very annoying. This patch
fixes that problem, and also a similar problem with fork()
failures.

11 years agoalsa: Don't use pa_strna() for port names
Tanu Kaskinen [Fri, 29 Mar 2013 15:17:14 +0000 (17:17 +0200)]
alsa: Don't use pa_strna() for port names

The name variable is never NULL, so there's no point in using
pa_strna().

11 years agocore-util: Don't accept random words in pa_parse_boolean()
Tanu Kaskinen [Wed, 13 Jun 2012 08:15:03 +0000 (11:15 +0300)]
core-util: Don't accept random words in pa_parse_boolean()

The old code accepted any word that started with "y", "Y",
"n", "N", "t", "T", "f" or "F". Fix this by having
a whitelist of full strings instead of checking just the
first letter.

11 years agobuild: make ARM NEON check in configure.ac more strict
Peter Meerwald [Thu, 28 Mar 2013 13:46:48 +0000 (14:46 +0100)]
build: make ARM NEON check in configure.ac more strict

the check for NEON so far only checked if -mfpu=neon is understood by the compiler,
however, this is not enough:

(i) #include <arm_neon.h> should be checked
(ii) -mfpu=neon must be passed before CFLAGS because eventually the per-library CFLAGS
for NEON code in src/Makefile.am are passed to the compiler before the global CFLAGS

in case the build environment passes CFLAGS to configure and we try to set conflicting
CFLAGS option, the former take precedence; CFLAGS cannot be overridden

this does not fix
http://lists.freedesktop.org/archives/pulseaudio-discuss/2012-December/015570.html
but at least makes the build fail in configure (and not while compiling stuff)
and gives better diagnostics

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agodevice-port: Introduce pa_device_port_new_data
poljar (Damir Jelić) [Thu, 28 Mar 2013 11:05:11 +0000 (12:05 +0100)]
device-port: Introduce pa_device_port_new_data

Port creation is now slightly different. It is now similar to how
other objects are created (e.g. sinks/sources/cards).

This should become more useful in the future when we move more stuff to
the ports.

Functionally nothing has changed.

11 years ago.gitignore: Update m4/ ignore list
Tanu Kaskinen [Thu, 28 Mar 2013 08:49:27 +0000 (10:49 +0200)]
.gitignore: Update m4/ ignore list

11 years agobuild-sys: Use upstream gettext instead glib one
Javier Jardón [Wed, 27 Mar 2013 14:00:36 +0000 (14:00 +0000)]
build-sys: Use upstream gettext instead glib one

11 years agobluetooth: Improve code and log readability
João Paulo Rechi Vita [Wed, 27 Mar 2013 13:45:33 +0000 (10:45 -0300)]
bluetooth: Improve code and log readability

This commit makes the code cleaner, avoiding unnecessary line breaks. It
also changes the debug message elements order, to make it look more
natural ("path, interface, member" instead of "interface, path,
member").

11 years agobluetooth: Remove unnecessary braces
João Paulo Rechi Vita [Wed, 27 Mar 2013 13:45:32 +0000 (10:45 -0300)]
bluetooth: Remove unnecessary braces

11 years agodevice-port: Make it impossible to have dual-direction ports
Tanu Kaskinen [Fri, 29 Jun 2012 15:04:59 +0000 (18:04 +0300)]
device-port: Make it impossible to have dual-direction ports

11 years agoalsa-mixer: Remove the "name" option from the "General" section of path configuration...
Tanu Kaskinen [Fri, 29 Jun 2012 15:04:58 +0000 (18:04 +0300)]
alsa-mixer: Remove the "name" option from the "General" section of path configuration files

This means that the path names will always correspond to the
path configuration file names, so they will automatically be
unique (in the scope of one card).

11 years agoalsa-mixer: Introduce "description-key" option for paths
Tanu Kaskinen [Fri, 29 Jun 2012 15:04:57 +0000 (18:04 +0300)]
alsa-mixer: Introduce "description-key" option for paths

Previously the path description was looked up based on the
path name only. Since there can be multiple paths that use
the same description, it had to be possible to have multiple
paths with the same name.

Having the same name with multiple paths makes identifying
the paths more complex than necessary, so the plan is to
make it impossible to have paths with the same name. This
patch prepares for that by retaining the possibility to
still have the same description with multiple paths. Instead
of the path name, the path description is looked up by using
the "path description key" if it is set (path name is still
used as a fallback lookup key).

11 years agoswitch-on-port-available: Fix error reporting style
Tanu Kaskinen [Wed, 27 Mar 2013 14:06:04 +0000 (16:06 +0200)]
switch-on-port-available: Fix error reporting style

11 years agoswitch-on-port-available: Remove a redundant function argument
Tanu Kaskinen [Wed, 27 Mar 2013 14:05:26 +0000 (16:05 +0200)]
switch-on-port-available: Remove a redundant function argument

11 years agoswitch-on-port-available: Prepare for dual-direction ports going away
Tanu Kaskinen [Fri, 29 Jun 2012 15:04:56 +0000 (18:04 +0300)]
switch-on-port-available: Prepare for dual-direction ports going away

As an extra, I broke try_to_switch_profile() into smaller
functions, because the two levels of loops with continue
statements inside both were a bit hard to follow.

11 years agobuild-sys: Bump soname v4.0
Arun Raghavan [Mon, 3 Jun 2013 18:43:42 +0000 (00:13 +0530)]
build-sys: Bump soname

11 years agoAdd a NEWS file
Arun Raghavan [Mon, 3 Jun 2013 18:38:14 +0000 (00:08 +0530)]
Add a NEWS file

Short version based on Tanu's longer notes posted on list (and now on
the wiki, linked from this file.

11 years agoosx: Fix latency querying
Vadim Troshchinskiy [Wed, 29 May 2013 10:58:36 +0000 (13:58 +0300)]
osx: Fix latency querying

get_latency_us() used an uninitialized variable, and an incorrect
scope for some of the AudioObjectGetPropertyData() calls. As a result,
audio would randomly not work at all.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=65122
11 years agobuild-sys: Bump soname v3.99.2
Arun Raghavan [Thu, 23 May 2013 03:04:17 +0000 (08:34 +0530)]
build-sys: Bump soname

We dropped pa_format_info_free2 as an exposed symbol, but this was never
exposed via headers, so not counting this as ABI change.

11 years agortp: Reset timestamp with correct size if not found
David Henningsson [Wed, 22 May 2013 11:26:24 +0000 (13:26 +0200)]
rtp: Reset timestamp with correct size if not found

This fixes a compiler warning when building under Ubuntu.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agomodule-device-manager: Fix description restore
David Henningsson [Wed, 22 May 2013 11:21:24 +0000 (13:21 +0200)]
module-device-manager: Fix description restore

e->description is a pointer, not a fixed char array. Hence it
makes no sense to use strncmp.

This fixes a compiler warning when compiling under Ubuntu.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agocore-util: Add pa_safe_streq
David Henningsson [Wed, 22 May 2013 12:08:19 +0000 (14:08 +0200)]
core-util: Add pa_safe_streq

Like pa_streq, but does not blow up on NULL pointers.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agosink-input,source-output: Deal with FIX* flags and extended API
Arun Raghavan [Mon, 13 May 2013 16:03:22 +0000 (21:33 +0530)]
sink-input,source-output: Deal with FIX* flags and extended API

The sample spec fixup when FIX* flags are set was not being propagated
to the pa_format_info, causing the two to be out of sync when FIX* was
used.

11 years agobluetooth: Fix missing port->profile association
Mikel Astiz [Mon, 20 May 2013 09:48:33 +0000 (11:48 +0200)]
bluetooth: Fix missing port->profile association

Commit 17b3cb954b179392e80b0a46d8f2ba4693aec386 merged Bluetooth ports
into two ports (one for input, one for output) but the association
between ports and profiles was lost.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=64713
11 years agobluetooth: Create ports before card profiles
Mikel Astiz [Mon, 20 May 2013 09:48:32 +0000 (11:48 +0200)]
bluetooth: Create ports before card profiles

Both operations are currently independent and their order can therefore
be swapped.

11 years agosink-input/source-output: Don't set save_volume if volume is not writable
David Henningsson [Wed, 15 May 2013 12:20:08 +0000 (14:20 +0200)]
sink-input/source-output: Don't set save_volume if volume is not writable

This fixes a later assertion failure in module-stream-restore.

Buglink: https://bugs.launchpad.net/bugs/896602
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agomap-file: Remove pa_format_info_free2
Tanu Kaskinen [Mon, 20 May 2013 07:56:42 +0000 (10:56 +0300)]
map-file: Remove pa_format_info_free2

The function doesn't exist anymore.

11 years agoalsa-mixer: Add "Line Out Jack" to analog-output.conf
David Henningsson [Thu, 16 May 2013 08:56:21 +0000 (10:56 +0200)]
alsa-mixer: Add "Line Out Jack" to analog-output.conf

A stationary computer usually has headphone jack(s) and line out jacks.
In some cases analog-output.conf will be a subset of
analog-output-headphones.conf, causing line outs to be unusable (because
headphones are unplugged).

This late in the cycle, this was the safest way I could think of to try
to fix this for a particular computer. In later versions of PulseAudio
we could consider making a dedicated line out path instead, and have
proper jack detection there.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoalsa: Fix crash when profile_set == NULL
David Henningsson [Tue, 14 May 2013 09:01:13 +0000 (11:01 +0200)]
alsa: Fix crash when profile_set == NULL

Better check if the pointer is NULL before dereferencing it, instead of
after!

BugLink: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1159853
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agopo: Fix error in hungarian translation
David Henningsson [Tue, 14 May 2013 03:49:11 +0000 (05:49 +0200)]
po: Fix error in hungarian translation

The stray %s caused PulseAudio to crash.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoecho-cancel: Fix send/recv_counter in calc_diff()
Peter Meerwald [Mon, 22 Apr 2013 13:36:12 +0000 (15:36 +0200)]
echo-cancel: Fix send/recv_counter in calc_diff()

send_counter/recv_counter relate to the bytes (play stream) passed
through the queue, hence the same sample spec must be used

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Acked-by: Stefan Huber <shuber@sthu.org>
11 years agoalsa-mixer: Don't use the mono path in the analog-stereo mapping.
Tanu Kaskinen [Wed, 12 Sep 2012 13:03:59 +0000 (16:03 +0300)]
alsa-mixer: Don't use the mono path in the analog-stereo mapping.

As far as I can see, having a mono path in a stereo mapping doesn't
make any sense. It also causes breakage: if the Master Mono mixer
element has two volume channels, the analog-output path gets removed
due to being a subset of analog-output-mono, and that in turn causes
the Master element getting muted. Users generally don't like that.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=54673
11 years agodoc: Reword description of meta commands in pulse-cli-syntax.5
Peter Meerwald [Wed, 17 Apr 2013 13:07:32 +0000 (15:07 +0200)]
doc: Reword description of meta commands in pulse-cli-syntax.5

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agodoc: Fix description how boolean values can be specified
Peter Meerwald [Wed, 17 Apr 2013 13:07:31 +0000 (15:07 +0200)]
doc: Fix description how boolean values can be specified

"any word starting with the letters" parts; this does not hold
any longer with commit 0e29e7365907ffbe90df768a4dea277dba40d495
core-util: Don't accept random words in pa_parse_boolean()

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agodoc: Mention just one CLI language in default.pa.5
Peter Meerwald [Wed, 17 Apr 2013 13:07:30 +0000 (15:07 +0200)]
doc: Mention just one CLI language in default.pa.5

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agopstream: Fix case in log message
Peter Meerwald [Wed, 17 Apr 2013 13:16:36 +0000 (15:16 +0200)]
pstream: Fix case in log message

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agobuild-sys: json-c changed everything :(
Arun Raghavan [Sat, 27 Apr 2013 03:27:05 +0000 (08:57 +0530)]
build-sys: json-c changed everything :(

json-c 0.11 ships a pkg-config file with a different name, and changes
the name of its library as well.

11 years agoalsa-mixer: Switch to Headphone when Headphone mic jack is plugged in
David Henningsson [Tue, 16 Apr 2013 04:40:40 +0000 (06:40 +0200)]
alsa-mixer: Switch to Headphone when Headphone mic jack is plugged in

When a "Headphone Mic" jack becomes available, we do not know if
a headphone or a mic has been plugged in. Therefore, setting both
paths to "unknown" is, in theory, the correct thing to do.
However, in practice, people are more likely to plug in a headphone
rather than a mic. Therefore, allow autoswitch to the headphone port
when the jack is plugged in.

A more advanced implementation would consider what was plugged in last
time depending on what port was selected on the input side at that
time, and set availability accordingly. However, such an implementation
will have to wait (probably at least until we have our fancy routing
system implementation).

Buglink: https://bugs.launchpad.net/bugs/1169143
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoalsa-mixer: Allow input fallback port for devices with no gain control
David Henningsson [Wed, 24 Apr 2013 08:59:42 +0000 (10:59 +0200)]
alsa-mixer: Allow input fallback port for devices with no gain control

I recently came across a device without any ALSA-level mixer controls,
everything was physical knobs on the hardware.

This patch enables that device to get a port too ("Analog Input").

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoalsa: Fix ELD access warning on shutdown
David Henningsson [Tue, 16 Apr 2013 12:56:35 +0000 (14:56 +0200)]
alsa: Fix ELD access warning on shutdown

The hdmi_eld_changed callback is called by alsa-lib at shutdown.
In that case, just exit instead of trying to access something with
already closed handles.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agodefault.pa: Load switch-on-port-available before udev-detect
David Henningsson [Tue, 16 Apr 2013 11:09:38 +0000 (13:09 +0200)]
default.pa: Load switch-on-port-available before udev-detect

We need to pick the right port as early as possible, before the
first volume is picked up. Hence this module needs to be loaded
before the sound card modules are loaded.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agomodule-switch-on-port-available: Handle hotplugged cards
David Henningsson [Tue, 16 Apr 2013 14:20:36 +0000 (16:20 +0200)]
module-switch-on-port-available: Handle hotplugged cards

If a card is hot-plugged (which all cards will be when we load
this module before module-*-detect), make sure we don't start up
a sink with an unavailable port selected.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoalsa: Initialize ports before sinks/sources
David Henningsson [Tue, 16 Apr 2013 13:17:37 +0000 (15:17 +0200)]
alsa: Initialize ports before sinks/sources

This way port availability has been filled in when we create the
sink, which will later enable us to pick the right port directly.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoi18n: Update Polish translation
Piotr Drąg [Tue, 16 Apr 2013 18:03:57 +0000 (20:03 +0200)]
i18n: Update Polish translation

11 years agopulsecore: Make run-from-build not readlink() on every call
Arun Raghavan [Sat, 20 Apr 2013 04:42:34 +0000 (10:12 +0530)]
pulsecore: Make run-from-build not readlink() on every call

Since this is no longer only defined in debug builds, let's make sure
that there is no impact if this is indavertently called repeatedly at
startup.

11 years agodaemon: Fix dlsearchpath while running from build tree
Arun Raghavan [Sat, 20 Apr 2013 04:20:38 +0000 (09:50 +0530)]
daemon: Fix dlsearchpath while running from build tree

It appears that, libltdl will find the .la file in the builddir and
figure out where the real .so is.

This also requires .ifexists to be fixed up to correspondingly search in
<dlsearchpath>/.libs.

11 years agorygel: Set DLNA profile on our MediaItems
Arun Raghavan [Fri, 19 Apr 2013 09:34:45 +0000 (15:04 +0530)]
rygel: Set DLNA profile on our MediaItems

We know we always serve up LPCM, and exposing this via D-Bus lets Rygel
set the appropriate metadata while presenting the raw (i.e.
non-transcoded) stream to clients.

11 years agodoc: Explain PULSE_SERVER string in pulseaudio.1
Peter Meerwald [Fri, 12 Apr 2013 08:53:00 +0000 (10:53 +0200)]
doc: Explain PULSE_SERVER string in pulseaudio.1

first attempt to document the "server string"
See https://bugs.freedesktop.org/show_bug.cgi?id=62444

quite a bit is missing: [hostname], defaults

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
11 years agodoc: Document PULSE_COOKIE in pulseaudio.1
Peter Meerwald [Fri, 12 Apr 2013 09:27:54 +0000 (11:27 +0200)]
doc: Document PULSE_COOKIE in pulseaudio.1

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
11 years agoalsa-source: Fix log message
João Paulo Rechi Vita [Tue, 16 Apr 2013 22:26:27 +0000 (19:26 -0300)]
alsa-source: Fix log message

The log message when updating the source sample rate wrongly mentions
"Sink" instead of "Source". This was probably a copy and paste error.

11 years agodoc: Some more nitpicking in pulse/def.h doxygen documentation
Peter Meerwald [Wed, 10 Apr 2013 16:59:22 +0000 (18:59 +0200)]
doc: Some more nitpicking in pulse/def.h doxygen documentation

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agodoc: Mostly fixing up i.e. versus i.e.\ in doxygen documentation
Peter Meerwald [Wed, 10 Apr 2013 16:59:21 +0000 (18:59 +0200)]
doc: Mostly fixing up i.e. versus i.e.\ in doxygen documentation

same for e.g. versus e.g.\ and e.g. versus E.g.

this is ueber-nitpicking: will anybody ever notice?

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agoalsa-mixer: Change profile-sets directory to PA_SRCDIR
David Henningsson [Tue, 16 Apr 2013 12:44:05 +0000 (14:44 +0200)]
alsa-mixer: Change profile-sets directory to PA_SRCDIR

A recent patch changed the path files from PA_BUILDDIR to PA_SRCDIR.
Do the same to the profile-set files for consistency (and to fix
out of tree builds).

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoFix various typos in messages and comments
Yuri Chornoivan [Sat, 13 Apr 2013 18:32:57 +0000 (21:32 +0300)]
Fix various typos in messages and comments

11 years agoequalizer: Fix compiler warning due use of 'signal'
Arun Raghavan [Tue, 16 Apr 2013 06:08:23 +0000 (11:38 +0530)]
equalizer: Fix compiler warning due use of 'signal'

Changing uses of the symbol 'signal' as it redefines the signal-handling
libc function of the same name.

11 years agobuild-sys: Bump sonames v3.99.1
Arun Raghavan [Mon, 15 Apr 2013 18:03:13 +0000 (23:33 +0530)]
build-sys: Bump sonames

libpulse-simple changed this time as well (addition of hole-handling).

11 years agoalsa: Fix mixer path when running from build tree
Arun Raghavan [Sun, 14 Apr 2013 05:54:41 +0000 (11:24 +0530)]
alsa: Fix mixer path when running from build tree

The mixer paths are not available in ${builddir} - we need to look in
${srcdir}. This should fix running an in-tree build without make install
as well as alsa-mixer-path-test in make distcheck.

Since the most straightforward way to define PA_SRCDIR was in
Makefile.am, I'm moving PA_BUILDDIR there as well for consistency.

11 years agopulsecore: Don't conditionally inline pa_run_from_build_tree()
Arun Raghavan [Sun, 14 Apr 2013 05:02:26 +0000 (10:32 +0530)]
pulsecore: Don't conditionally inline pa_run_from_build_tree()

There's no good reason to assume an in-tree build will be debug-only.
This breaks alsa-mixer-path-test on make distcheck, for example.

11 years agoalsa-mixer: Add more jack detection for Headset mic path
David Henningsson [Fri, 12 Apr 2013 09:56:17 +0000 (11:56 +0200)]
alsa-mixer: Add more jack detection for Headset mic path

On some machines which has a headset jack, the headset mic does not have its own
jack detection. Then we can look at the headphone jack to get some indication:
We know that if the headphone is unplugged, so is the headset mic. The opposite
is not guaranteed since the user might have plugged in a headphone, not a headset.

Also, there exist multi-function jacks which support both Headphone, Mic in headphone jack
and Headset Mic. In this case the jack name will be "Headphone Mic", not "Headphone", so
we need to include this name too.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agosink, source: Send notifications when flags change
Tanu Kaskinen [Thu, 28 Mar 2013 15:30:16 +0000 (17:30 +0200)]
sink, source: Send notifications when flags change

The hooks aren't currently used, but for example, the D-Bus protocol
could use them if it implemented flag change signals.

11 years agosink, source: Really set the fixed latency in set_fixed_latency_within_thread(),...
Tanu Kaskinen [Thu, 28 Mar 2013 15:30:15 +0000 (17:30 +0200)]
sink, source: Really set the fixed latency in set_fixed_latency_within_thread(), always.

The old assumption seemed to be that if a sink or source has the
DYNAMIC_LATENCY flag set, it can never change, so the fixed latency
will always be zero. This assumption doesn't hold with filter sinks
and sources that are moved around.

This fixes a crash with two module-virtual-sink instances on top of
each other, when the bottom one is moved from a sink without dynamic
latency to a sink with dynamic latency. What happened was that first
the bottom virtual sink "updated" (due to this bug nothing was
actually updated) its fixed latency to match the master sink (zero
fixed latency), and then the top virtual sink updated its fixed
latency to match the master sink. The master sink was the bottom
virtual sink, whose fixed latency should have been set to zero, but it
was not, so the pa_sink_set_fixed_latency_within_thread() failed in
the assertion "latency == 0".

11 years agosink, source: Propagate flag changes to filters
Tanu Kaskinen [Thu, 28 Mar 2013 15:30:14 +0000 (17:30 +0200)]
sink, source: Propagate flag changes to filters

An example: let's say that there's an alsa sink and two filter sinks
on top of each other:

        alsa-sink <- filter1 <- filter2

With the old code, if filter1 gets moved to another sink, and the
new sink doesn't have the LATENCY and DYNAMIC_LATENCY flags set
(unlike alsa-sink), filter1's flags are updated fine in the moving()
callback, but filter2 is not notified at all about the flag changes.
With this patch, the flag changes are propagated to filter2 too.

11 years agoshm: Don't force the shm files to be read-only
Tanu Kaskinen [Tue, 9 Apr 2013 08:32:20 +0000 (11:32 +0300)]
shm: Don't force the shm files to be read-only

Forcing the shm file to be read-only makes shm_unlink() fail on OS X.
Thanks to Albert Zeyer for reporting the bug and investigating the
root cause.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=62988
11 years agopstream: Optimise write of smaller packages
David Henningsson [Fri, 5 Apr 2013 19:13:04 +0000 (21:13 +0200)]
pstream: Optimise write of smaller packages

During a stream, most packets sent are either memblocks (with SHM info),
or requests for more data. These are only slightly bigger than the
header.

This patch makes it possible to write these packages in one write
instead of two: a memcpy of just a few bytes is worth saving extra
syscalls for write and poll.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agomix: Mix the right number of streams
Tanu Kaskinen [Tue, 9 Apr 2013 11:52:54 +0000 (14:52 +0300)]
mix: Mix the right number of streams

Passing channels instead of nstreams to pa_mix_ch2_s16ne() caused that
only the first two streams got mixed.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=63093
11 years agosemaphore-osx: posix implementation based on named semaphores
Albert Zeyer [Tue, 2 Apr 2013 11:10:39 +0000 (13:10 +0200)]
semaphore-osx: posix implementation based on named semaphores

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=63014
11 years agosocket-server: Make the new channel low-delay, not the listening one
David Henningsson [Fri, 5 Apr 2013 14:48:21 +0000 (16:48 +0200)]
socket-server: Make the new channel low-delay, not the listening one

I don't know if it matters a lot, but most certainly it must be
the new channel that's supposed to be made low-delay, not the existing
listening socket, right?

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agopstream: Rename "do_something" function
David Henningsson [Fri, 5 Apr 2013 09:17:55 +0000 (11:17 +0200)]
pstream: Rename "do_something" function

Rename it to "do_pstream_read_write" that better describes what the
function does.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoalsa-mixer: Add "Headset Playback|Capture" element
David Henningsson [Mon, 25 Mar 2013 13:56:05 +0000 (14:56 +0100)]
alsa-mixer: Add "Headset Playback|Capture" element

Found on Logitech B530 USB Headset / kernel 3.8. Because we don't
have different path for headset and headphone today, just add
Headset to the existing headphone path.

BugLink: https://bugs.launchpad.net/bugs/1159687
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agodoc: Fix suggested dl-search-path in README
Peter Meerwald [Tue, 2 Apr 2013 12:59:07 +0000 (14:59 +0200)]
doc: Fix suggested dl-search-path in README

the README suggests to set the following dl-search-path: -p $(pwd)/src/.libs/

N: [lt-pulseaudio] daemon-conf.c: Detected that we are run from the build tree, fixing search path.
E: [lt-pulseaudio] ltdl-bind-now.c: Failed to open module /redacted/pulseaudio/src/.libs/.libs/module-device-restore.so: /home/pmeerw/src/pulseaudio/src/.libs/.libs/module-device-restore.so: cannot open shared object file: No such file or directory

the last part seems superfluous, so -p $(pwd)/src/

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agoalsa: skip eld initialization if hctl_handle is NULL
Maarten Lankhorst [Tue, 2 Apr 2013 09:27:38 +0000 (11:27 +0200)]
alsa: skip eld initialization if hctl_handle is NULL

Due to a misconfiguration on my side my hdmi card didn't load with
snd-hda-codec-hdmi but through the fallback mechanism. Pulseaudio
would crash during early because hctl_handle was null, so skip
init_eld_ctls when hctl_handle is null to prevent a crash.

Thanks to David Henningsson for helping me find the underlying issue.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
11 years agosystemd-login: Remove unused variable session.
poljar (Damir Jelić) [Fri, 29 Mar 2013 11:49:42 +0000 (12:49 +0100)]
systemd-login: Remove unused variable session.

11 years agoconsole-kit, systemd-login: Check for logind, not for systemd
Martin Pitt [Thu, 21 Mar 2013 13:17:33 +0000 (14:17 +0100)]
console-kit, systemd-login: Check for logind, not for systemd

It is possible to build systemd without logind, in which case sd_booted() wo
succeed. Check for /run/systemd/seats to test for logind instead, as
recommended by systemd upstream.

For details, see:
<https://mail.gnome.org/archives/desktop-devel-list/2013-March/msg00092.html

Drop the now unnecessary linking against libsystemd-daemon, and stop linking
the consolekit module to any systemd library.

https://bugs.freedesktop.org/show_bug.cgi?id=62593

11 years agoremap: fix check when to apply specialized code path
Peter Meerwald [Thu, 28 Mar 2013 13:46:49 +0000 (14:46 +0100)]
remap: fix check when to apply specialized code path

the specialized code path just duplicate samples, so are only
applicable if the volume in map_table is == 1.0 (or == 0x10000);
don't use them for volumes >= 1.0

compare the integer version of the volume stored in map_table;
comparing floats is ugly (als leads to compiler warnings)

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
11 years agosink: Fix flag name typo
Tanu Kaskinen [Thu, 28 Mar 2013 15:15:00 +0000 (17:15 +0200)]
sink: Fix flag name typo

11 years agoresample: Switch to speex-float-1 by default
Arun Raghavan [Mon, 19 Nov 2012 09:38:34 +0000 (15:08 +0530)]
resample: Switch to speex-float-1 by default

This consumes less power, has low (no?) perceivable difference, and
allows the default configuration to work out of the box on low-end
systems (such as netbooks).

11 years agoalsa-mixer: It's valid to have zero elements in a path
David Henningsson [Mon, 25 Mar 2013 12:47:08 +0000 (13:47 +0100)]
alsa-mixer: It's valid to have zero elements in a path

It's valid for a path to have zero elements, e g if it contains
a single jack only. Earlier, this would cause an assertion failure
in pa_path_condense.

Also convert pa_bool_t to bool.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
11 years agoRevert "card: Support adding ports dynamically"
Mikel Astiz [Thu, 7 Mar 2013 10:32:24 +0000 (11:32 +0100)]
Revert "card: Support adding ports dynamically"

This reverts commit a9c3f2fb0fc1a1ee0072aac6425ad7311a2a5888.

It has been recently agreed that ports should somehow have some physical
meaning, leading to the port merge in module-bluetooth-device.

With this assumption in mind, it is very unlikely that a card would
add or remove ports dynamically. Therefore, the core can be simplified
by removing the support for this.

The revert affects the code added to module-card-restore in commit
a1a0ad1af209e58c136ac1c884aa5d14672a7144, which can now be partially
removed.

Conflicts:
src/pulsecore/card.c
src/pulsecore/core.h