Commit graph

7827 commits

Author SHA1 Message Date
Peter Meerwald
7974a17d1d srbchannel: Cleanup when pa_fdsem_open_shm() fails
pa_fdsem_open_shm() returns NULL when HAVE_SYS_EVENTFD_H is #undefined

pa_srbchannel_new() and pa_srbchannel_new_from_template() depend on
pa_fdsem_open_shm() and shall properly cleanup stuff, and return NULL as well;
otherwise, function pa_fdsem_get() will assert:

Assertion 'f' failed at pulsecore/fdsem.c:284, function pa_fdsem_get(). Aborting.

Debian/kFreeBSD doesn't HAVE_SYS_EVENTFD_H

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Cc: David Henningsson <david.henningsson@canonical.com>
2014-08-18 23:21:59 +02:00
Peter Meerwald
dc7ed820ab memtrap: Debian/kFreeBSD seems to signal SIGSEGV, not SIGBUS
handle both signals on Debian/kFreeBSD, otherwise sigbus-test fails:

Running suite(s): Sig Bus
Let's see if this worked: This is a test that should work fine.
And memtrap says it is good: yes
tests/sigbus-test.c:59:E:sigbus:sigbus_test:0: (after this point) Received signal 11 (Segmentation fault)

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-08-18 15:31:48 +02:00
Peter Meerwald
c32e12e7b9 tests: Check expected result of sigbus-test
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-08-18 15:31:41 +02:00
Peter Meerwald
4540401167 core-util: Avoid warnings when missing certain system calls
on systems lacking #defines HAVE_ACCEPT4, HAVE_PIPE2, SOCK_CLOEXEC

pulsecore/core-util.c: In function 'pa_open_cloexec':
pulsecore/core-util.c:3348:1: warning: label 'finish' defined but not used [-Wunused-label]
pulsecore/core-util.c: In function 'pa_socket_cloexec':
pulsecore/core-util.c:3370:1: warning: label 'finish' defined but not used [-Wunused-label]
pulsecore/core-util.c: In function 'pa_pipe_cloexec':
pulsecore/core-util.c:3393:1: warning: label 'finish' defined but not used [-Wunused-label]
pulsecore/core-util.c: In function 'pa_accept_cloexec':
pulsecore/core-util.c:3415:1: warning: label 'finish' defined but not used [-Wunused-label]

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-08-18 15:31:31 +02:00
Peter Meerwald
1849cfdad9 misc: Fix format specifiers
to print a pa_usec_t, the format specifier to use is "%" PRIu64

modules/module-combine-sink.c: In function 'update_latency_range':
modules/module-combine-sink.c:750:5: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'pa_usec_t' [-Wformat]
modules/module-combine-sink.c:750:5: warning: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'pa_usec_t' [-Wformat]

to print a size_t, use %zu

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-08-18 15:31:19 +02:00
Peter Meerwald
8d2d7da5e6 echo-cancel: Fix spelling of canceller
use canceller consistently

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-08-18 15:30:38 +02:00
Peter Meerwald
eaab16d8ba tests: Add *.log and *.trs to src/.gitignore
these files are created by running 'make check'

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-08-18 15:30:29 +02:00
Tanu Kaskinen
c49c6b75f0 device-restore: Sync the database on unload
If there are unsaved changes, those need to be written to disk before
the module is unloaded, otherwise the changes are lost.
2014-08-18 13:52:11 +03:00
Tanu Kaskinen
facfd3a664 alsa-mixer: Fix path subset detection
The old logic assumed that if path A was a subset of path B, the
element list in B would have all elements of A in the beginning of
B's list, in the same order as A. This assumption was invalid, causing
some subset cases to not get detected. We need to search through the
full element list of B every time before we can conclude that B
doesn't have the element that we're inspecting.
2014-08-18 13:44:44 +03:00
Peter Meerwald
97d9f4c5dd remap: Add 4-channel to mono channel rearrangement
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-08-18 10:10:52 +02:00
Arun Raghavan
6fdddf45f7 echo-cancel: Fix drift timer restart logic across suspend
The IS_ACTIVE() macro does a pa_sink/source_get_state() on our sink and
source, which does not work in the state change callback, since the
state is not actually committed at that point.
2014-08-18 08:28:06 +05:30
Alexander E. Patrakov
1b600a2d54 resampler: Changed style of includes
There was no code that included files from other directories using
the #include "..." style before.

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
2014-08-17 13:11:55 +03:00
Alexander E. Patrakov
ee658fa074 resampler: Moved speex_is_fixed_point() to speex.c
IMHO code that calls into speex belongs in speex.c, not in resampler.c.

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
2014-08-17 13:06:20 +03:00
poljar (Damir Jelić)
72103e1e33 resampler: Split the resampler implementations into separate files
Rebased by Peter Meerwald.

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: poljar (Damir Jelić) <poljarinho@gmail.com>
2014-08-17 11:18:17 +03:00
Tanu Kaskinen
64d17a6b0a shell-completion: zsh: Add "=" to the end of some command options
Without the equals sign, only the "--server foo" form is recognized,
so the "--server=foo" form doesn't get completion support.
2014-08-17 09:30:16 +03:00
Tanu Kaskinen
db6d5011cd shell-completion: zsh: Use -S and -A with _arguments
-S makes the option parser to not try parsing arguments as options
after "--" has appeared in the command line.

-A "-*" makes the option parser to not try parsing arguments as
options after the first non-option argument. The "-*" pattern means
that if there are unrecognized parameters that look like options
(i.e. start with a dash), those should not terminate the option
parsing.
2014-08-17 09:30:16 +03:00
Tanu Kaskinen
cd3cae9285 shell-completion: zsh: Don't use multiple option sets for one command
The options were divided to multiple sets to prevent (or at least try
to prevent) completing e.g. --server after -s was already given. This,
however, caused problems, because after the user had written
"pactl --server foo", further completions stopped to work. The
"server" option set didn't contain any other options, so once Zsh
detected that the "server" option set was in use, it thought that no
other options were valid.

The special casing for "-s", "-n", "--server" and "--client-*" at the
end of _pactl_completion() was probably an attempt to deal with this
problem. Those special cases are unnecessary now that the option
specification given to _arguments is more correct.
2014-08-17 09:26:55 +03:00
Tanu Kaskinen
74c724db05 shell-completion: zsh: Don't say "this help" when it's a different help
The option descriptions that Zsh prints are not the same thing as the
help text that pactl, pacmd etc. print when given --help.
2014-08-17 09:20:51 +03:00
Tanu Kaskinen
1f9d4cbe93 shell-completion: zsh: Support also --server in remote detection
_set_remote() is supposed to find out if a remote server has been
specified on the command line, but previously it only checked for -s
and ignored --server, causing the completion code to connect to the
local server instead when it should have connected to the remote
server to get the data for the completions.
2014-08-17 09:20:51 +03:00
Tanu Kaskinen
09e9d13e2d shell-completion: zsh: Move duplicated code into a function
This is just refactoring, no functional changes.
2014-08-17 09:20:51 +03:00
Tanu Kaskinen
be8171be79 shell-completion: Install the Zsh completions
This makes the Zsh completions work out-of-the-box. I also moved
pulseaudio-zsh-completion.zsh to zsh/_pulseaudio to be in line with
the common naming convention of Zsh completion files.
2014-08-17 08:24:47 +03:00
Tanu Kaskinen
f480fb38a7 sink-input, source-output: Assign to reference_ratio from a single place
This makes it easy to log a message every time the reference ratio
changes. I also need to add a hook for reference ratio changes, but
that need will go away if the stream relative volume controls will be
created by the core in the future.
2014-08-17 08:17:59 +03:00
Peter Meerwald
8a4a4f408c util: Fix pa_get_binary_name() on Debian/kFreeBSD
Debian GNU/kFreeBSD uses a FreeBSD kernel and GLIBC,
it #defines __FreeBSD_kernel__, but not __FreeBSD__ nor __linux__
Debian GNU/kFreeBSD does have a /proc/self/exe

FreeBSD #defines __FreeBSD__ and __FreeBSD_kernel__

problem reporte here:
http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-July/020998.html

http://stackoverflow.com/questions/1023306/finding-current-executables-path-without-proc-self-exe and
http://stackoverflow.com/questions/933850/how-to-find-the-location-of-the-executable-in-c have some
background info

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-08-12 22:13:23 +02:00
Peter Meerwald
eca6217129 tests: Fix mix-test on big-endian systems
the mix test code never worked on big-endian systems

patch saves a lot of duplicate test and uses more logical naming

see
http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-August/021035.html

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Reported-by: Felipe Sateler <fsateler@debian.org>
2014-08-12 21:28:52 +02:00
Peter Meerwald
a39a3b3f7d endianmacros: Fix PA_MAYBE_INT16_SWAP() macro
PA_MAYBE_INT16_SWAP() should call PA_INT16_SWAP(), not PA_INT32_SWAP

PA_MAYBE_INT16_SWAP() is not used (yet), so no big deal :)

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-08-10 12:22:52 +03:00
Peter Meerwald
e14863334b tests: Cleanup mix-test
indentation and use of fabsf() for floats

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-08-10 12:20:52 +03:00
Peter Meerwald
6d9891e8b9 sconv: Use optimized conversion function for both directions
for example, the conversion function for
convert_from_float32ne(PA_SAMPLE_S16LE) can also be used for
convert_to_s16ne(PA_SAMPLE_FLOAT32LE)

v2: ARM can potentially be big- or little endian; only apply
optimization on LE based on WORDS_BIGENDIAN #define (thanks, Tanu)

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-08-10 11:59:28 +03:00
Peter Meerwald
1499271f46 mix: Fix mixing of S24 samples stored as S32RE
pa_mix_s24_32re_c() should advance m->ptr by sizeof(int32_t)

http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-July/020998.html

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-08-10 10:33:28 +03:00
Rafael Ferreira
c57f8422f3 i18n: Updated Brazilian Portuguese translation
Signed-off-by: Rafael Ferreira <rafael.f.f1@gmail.com>
2014-08-04 12:25:32 +03:00
Sajeesh Sidharthan
7dfffdf8e5 core: Closing proper file descriptor when pipe creation fails 2014-08-04 14:11:42 +05:30
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