Commit graph

7747 commits

Author SHA1 Message Date
David Henningsson
48edd0a00f alsa: Add a multichannel fallback mapping
In case all other profiles fail, try this fallback mapping as well.
It allows the device to specify the channel count, so it can be used
for devices that only supports being opened in multichannel mode.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-08-01 18:05:49 +02:00
David Henningsson
c15107eaf6 alsa: Allow "fallback" configuration for mappings and profiles
A fallback mapping or profile will only be considered for probing
if all non-fallback profiles fail.

If auto-profiles are used, a profile made up of one non-fallback
mapping and one fallback mapping will be considered a fallback profile.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-08-01 18:05:49 +02:00
David Henningsson
be8311417c alsa: Add "exact-channels" mapping configurability
Allow a mapping to relax the exact channel restriction:

exact-channels = yes | no # If no, and the exact number of channels is not supported,
                          # allow device to be opened with another channel count

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-08-01 18:05:49 +02:00
Alexander E. Patrakov
afbe9605c6 alsa: Add extra HDMI mappings
Remove extra-hdmi.conf, as the performance reasons behind it are invalid
Add 7.1 profiles
Add extra HDMI devices, for a total of 8
Add DTS-encoded profiles (they need dcaenc from git)

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
2014-08-01 11:01:02 +02:00
Joe Marcus Clarke
69fae3e33a daemon: Don't try to lock and synchronise threads on (k)FreeBSD
Credits: Steven Chamberlain <steven@pyro.eu.org> is also a co-author
BugLink: http://bugs.debian.org/705435
Origin: http://svnweb.freebsd.org/ports/head/audio/pulseaudio/files/patch-src_daemon_main.c?revision=231972&view=markup&pathrev=231972
2014-08-01 10:47:18 +03:00
Tanu Kaskinen
c0bda6a7ab simple: Take locally buffered data into account in pa_simple_get_latency()
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=81075
2014-07-28 10:38:23 +03:00
Alexander Couzens
c187441ff9 tunnel-new: remove uncorking in thread_func. Now handled by state change callback.
tunnel-new handled a corked stream conditional in the thread_func to be
sure the stream isn't corked. Un/Corking is now handled in the
state change callback.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2014-07-17 13:01:00 +03:00
Alexander Couzens
5170df86b3 tunnel-new: add un/corking to the state change callback
The stream is now corked when the sink or source becomes suspended and
uncorked when it's back idle/ready.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2014-07-17 12:56:00 +03:00
Ricardo Salveti de Araujo
4ac62d4690 daemon-conf: changing default rlimit_rttime value to 200 ms
Since rtkit v11, the top limit for rttime is 200 ms (previously it
was wrongly limited to 2 seconds).

Reviewed-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
2014-07-13 12:30:35 +03:00
Tanu Kaskinen
273aee1cf5 .gitignore: Add srbchannel-test 2014-07-12 20:21:59 +03:00
Tanu Kaskinen
b2dbce200b device-manager: Add a comment about non-extensible struct
This comment can potentially save a lot of debugging effort and fixing
an ABI break, even though I don't think it's particularly likely that
anyone will ever extend pa_ext_device_manager_role_priority_info.
2014-07-12 20:07:16 +03:00
David Henningsson
2bfedb9f73 creds: Unbreak build without HAVE_CREDS
A recent patch broke the build on FreeBSD, which does not have
HAVE_CREDS defined. Also, make sure any attempts to enable the
srbchannel on such architectures fail.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=80642
Reported-by: Ryan Lortie
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-07-04 14:52:46 +02:00
Felipe Sateler
3be8382fcd zsh-completion: Fix completion for default sink/source 2014-07-03 17:09:56 +05:30
Peter Meerwald
9ae5a03a32 core: Add SRBCHANNEL command names for debug
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-07-02 10:21:17 +02:00
Peter Meerwald
f79b1bc3d9 core: Misc srbchannel cleanup
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-07-02 10:21:11 +02:00
David Henningsson
1afec0e5a3 tests: Add pstream/srbchannel test
Runs four tests:
 1) Small packets, iochannel
 2) Big packets, iochannel
 3) Small packets, srbchannel
 4) Big packets, srbchannel

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-06-27 14:30:56 +02:00
David Henningsson
a476371254 protocol-native: Enable srbchannel
The srbchannel is enabled if protocol version >= 30 and
SHM is available. There is also a module parameter
srbchannel=false that can be used for disabling the srbchannel.

The setup is done in these steps:
1) Server receives authentication (like today)
2) Server sends enable_srbchannel to client
3) Server sends memblock to client
4) Client receives enable_srbchannel
5) Client receives memblock
6) Client sends enable_srbchannel back to server
7) Client switches over
8) Server receives enable_srbchannel and switches over

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-06-27 14:28:21 +02:00
David Henningsson
1827991548 Protocol, client: Add commands to enable srbchannel
This increments protocol version to v30 and adds two new commands
to enable and disable an shm ringbuffer, as well as client side
implementation.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-06-27 14:23:18 +02:00
David Henningsson
4931637f82 pstream: Allow reading/writing through srbchannel
For writing, we prefer writing through the srbchannel if one is available,
and we have no ancil data to send.

For reading, we support reading from both in parallel. This meant replicating
a struct used for reading, so a lot of this patch is just a search/replace in
do_read to use the appropriate channel for reading.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-06-27 14:23:09 +02:00
David Henningsson
b06e616525 core: Add a second rw mempool
To keep the data and the ringbuffer separate, let's add another
mempool just for the ringbuffer(s). That way, the client can open
the ringbuffer shm file in rw mode and keep the data in ro mode.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-06-27 14:16:33 +02:00
Peter Meerwald
073128fbc8 tests: Adapt memblock-test to changed pa_memimport_get()
patch 'memblock, pstream: Allow send/receive of remote writable memblocks'
adds an extra parameter to pa_memimport_get()

change test program accordingly

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Cc: David Henningsson <david.henningsson@canonical.com>
2014-06-27 14:16:33 +02:00
David Henningsson
710c4b39af memblock, pstream: Allow send/receive of remote writable memblocks
The shared ringbuffer memblock must be writable by both sides.
This makes it possible to send such a memblock over a pstream without
the "both sides writable" information getting lost.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-06-27 14:16:32 +02:00
David Henningsson
613177919f shm: Allow to open shm in writable mode
This is a preparation for the shm ringbuffer, which needs to be able
to be writable by both sides, because there are atomic variables they
both need to modify.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-06-27 14:16:32 +02:00
David Henningsson
0cd4d3531a srbchannel: Add the shared ringbuffer object
An shm ringbuffer that is used for low overhead server-client communication.
Signalling is done through eventfd semaphores - it's based on pa_fdsem to avoid
syscalls if nothing is waiting on the other side.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-06-27 14:16:32 +02:00
David Henningsson
cb484805c1 iochannel/pstream: Support sending file descriptors
This patch adds support to iochannel, pstream and pstream-util
to send file descriptors over a unix pipe.

Currently we don't support writing both creds and fds in the same
packet, it's either one or the other (or neither).

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-06-27 14:16:32 +02:00
David Henningsson
06bc22b220 iochannel/pstream/pdispatch: Add support for receiving file descriptors
The file descriptors are read from the iochannel just like the creds are.
So instead of passing just creds (and creds_valid), we now pass the
entire pa_ancil struct.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-06-27 14:16:32 +02:00
David Henningsson
cc7a317e85 creds: Add struct for ancillary data
To support later patches that add sending/receiving file descriptors,
let's add this struct.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-06-27 14:16:32 +02:00
Evan Nemerson
26908afff7 client-conf: add missing directory to pulse/client-conf.x11.h include
https://bugs.freedesktop.org/show_bug.cgi?id=80570
2014-06-27 10:38:51 +03:00
Javier Jardón
3f78d149cf build-sys: Add -fdiagnostics-color=auto to CFLAGS
As a way to highlight warnings and errors in GCC output
This will be available in GCC 4.9, but some distros backported
the feature to lower versions

http://gcc.gnu.org/gcc-4.9/changes.html
2014-06-26 13:49:18 +03:00
Javier Jardón
ba925a0213 build-sys: Use AM_CPPFLAGS instead of AM_CFLAGS for preprocessor arguments
As the automake documentation says:

AM_CPPFLAGS: The contents of this variable are passed to every compilation
    that invokes the C preprocessor; it is a list of arguments to the preprocessor.
    For instance, -I and -D options should be listed here

AM_CFLAGS: This is the variable the Makefile.am author can use to pass in
    additional C compiler flags.

http://www.gnu.org/software/automake/manual/html_node/Program-Variables.html
2014-06-26 13:43:23 +03:00
Yuri Chornoivan
9940fecac7 Update Ukrainian translation 2014-06-24 14:00:27 +03:00
Tanu Kaskinen
15ae55ed9b bluetooth: Refactor POLLHUP handling
The code in the "io_fail" section was only used for HUP handling, but
there were jumps to there also from places where reading or writing
failed, because the read/write failure could have been caused by HUP.
This patch simplifies things by checking for HUP condition before
trying to read or write. Now if reading or writing fails, we will
jump to "fail" directly instead of going via the "io_fail" label. As
a result, the "io_fail" label isn't needed any more.
2014-06-24 13:29:39 +03:00
Tanu Kaskinen
59a8618dcd authkey: Use the config home dir for relative paths
Previously relative cookie paths were searched from the home
directory, now they are searched from the config home directory. This
fixes the problem that XDG_CONFIG_HOME didn't have effect on cookie
paths.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=75006
2014-06-24 13:22:07 +03:00
Tanu Kaskinen
440f37af00 core-util: Add pa_append_to_config_home_dir() 2014-06-24 13:20:22 +03:00
Tanu Kaskinen
6c5c65a718 core-util: Add pa_get_config_home_dir() 2014-06-24 13:17:53 +03:00
Tanu Kaskinen
14845b2c8e esound, native: Pass an absolute path to pa_authkey_load() when using a file in the home directory
If a relative path is passed to pa_authkey_load(), it will interpret
the path as relative to the home directory. This is wrong, because
relative paths should be interpreted to be relative to the config home
directory. Before fixing pa_authkey_load(), this patch prepares for
the change by using absolute paths when the file actually needs to be
in the home directory (i.e. the fallback cookie path for the native
protocol and the default cookie path for the esound protocol).
2014-06-24 13:17:16 +03:00
Tanu Kaskinen
50042da434 core-util: Add pa_append_to_home_dir() 2014-06-24 13:15:43 +03:00
Tanu Kaskinen
71ead4989a authkey: Rename pa_authkey_load_auto() to pa_authkey_load()
pa_authkey_load() was removed earlier, so the _auto suffix isn't
necessary any more.
2014-06-24 13:15:11 +03:00
Tanu Kaskinen
a54d357729 authkey: Remove pa_authkey_load(), it's redundant
The only place where pa_authkey_load() was called was in
pa_authkey_load_auto(), and the only functionality that
pa_authkey_load() was to log a warning if load() fails. That log
message is now in pa_authkey_load_auto(), so pa_authkey_load() has no
use any more.
2014-06-24 13:14:36 +03:00
Tanu Kaskinen
5141188ca8 client-conf: Move x11 and env loading to pa_client_conf_load()
This simplifies the code a bit.
2014-06-24 13:13:50 +03:00
Tanu Kaskinen
067e61cb66 client-conf: Don't report failure from pa_client_conf_load()
pa_context already ignored the return value of pa_client_conf_load(),
so the only places where the return value was not ignored were the
D-Bus server lookup thing and pax11publish. I don't think those cases
are negatively affected if they ignore errors in opening or parsing
client.conf.

pa_client_conf_env() never failed anyway, so returning int was
obviously redundant.
2014-06-24 13:13:04 +03:00
Tanu Kaskinen
d02511115c combine-sink: Rearrange block_usec initialization
block_usec should be determined by the sink max latency, not the other
way around. This change doesn't cause any change in behaviour, but
makes the code more logical. Further updates to block_usec are already
done correctly, so this is the only place that needs modification.
2014-06-17 14:13:21 +03:00
Tanu Kaskinen
a6dbfe55c7 combine-sink: Fix the initial requested latency of new outputs
If the combine-sink is running with low latency, and a new output is
added, the new output was not configured with low latency.
2014-06-17 14:06:04 +03:00
Tanu Kaskinen
3d4a20adba combine-sink: Add a convenience variable 2014-06-17 14:06:04 +03:00
Tanu Kaskinen
ddec7e1080 combine-sink: Make the latency range calculation easier to read
I think this is much easier to understand. This should not result in
any functional change.
2014-06-17 12:52:35 +03:00
Wim Taymans
23f120aabb combine-sink: add support for DYNAMIC_LATENCY
Mark the sink as DYNAMIC_LATENCY and implement update_sink_latency_range
on its sink-input to collect the combined latency range of all sinks.

Implement update_requested_latency on the sink to configure the final
latency by combining the sink-input requested latencies. This makes us
honour the client latency request.

Also add more debug log.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=47899
2014-06-17 12:05:47 +03:00
David Henningsson
38c5d6d585 module-rescue-streams: Fixup previous patch w r t fallback sink/sources
- Make sure "no evacuation sink/source found" is not printed when
   fallback source/sink is selected
 - Restore previous behaviour of fallback sink/source selected
   (first one instead of last one)

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-06-10 08:30:05 +02:00
Hui Wang
618a2167f7 rescue-streams: try to find best one using availability and priority
Recently met a problem: when I disconnect the bluetooth headset, the
pulseaudio automatically switch the sound to sink of HDMI output
instead of the sink of internal speaker even though there is no HDMI
cable connected.

To fix this problem, I want to change the rule of selecting the target
sink if the default sink is not available. (same rules apply to the
source selecting):
construct a new hashmap with all ports (of all relevant sinks) and
then call find_best on the new hashmap to find the best port, finally
find the corresponding sink using the best port.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2014-06-10 08:08:35 +02:00
Pierre Ossman
6f4e08140f daemon: get rid of win32 message timer
We don't need a timer to check for Windows messages anymore
now that our fancy new poll() implementation does that for us.
2014-06-06 15:50:24 +03:00
Pierre Ossman
f70ec2776a poll: don't let select() block on Windows
We cannot let select() block as we won't wake up on the other
things that MsgWaitForMultipleObjects() can monitor.
2014-06-06 15:50:09 +03:00