Commit graph

7827 commits

Author SHA1 Message Date
Peter Meerwald
ce9318fb72 tests: Add ARM NEON test code to cpu-remap-test
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 17:56:03 +02:00
Peter Meerwald
d8be5cbf8b tests: Add rearrange remapping test cases to cpu-remap-test
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 17:55:59 +02:00
Peter Meerwald
c68c9f3aa2 tests: Add to remapping special case code tests to cpu-remap-test
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 17:54:51 +02:00
Peter Meerwald
7ae700941c tests: Reorganize cpu-remap-test program
Make run_remap_test() support up to 8 input and output channels.

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 17:54:39 +02:00
Peter Meerwald
8f4897e162 tests: Use remap function passed in remap struct
Cleanup and add function to setup remap struct

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 16:34:12 +02:00
Peter Meerwald
173649e4f7 tests: Add ARM NEON test code to cpu-mix-test
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 16:34:12 +02:00
Peter Meerwald
d58446963f tests: Add tests for mix special-case code
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 16:34:12 +02:00
Peter Meerwald
9576ba2d9e tests: Use single-line #ifdef for ARM NEON code
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 16:34:11 +02:00
Peter Meerwald
4ca3216ee3 tests: Split cpu tests in separate files
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 16:34:11 +02:00
Peter Meerwald
f4ab8bd835 cpu: Add force_generic_code flag to cpu_info struct
The remapper and channel mixing code have (faster) specialized and (slower)
generic code certain code path. The flag force_generic_code can be set to
force the generic code path which is useful for testing. Code duplication
(such as in mix-special-test) can be avoided, cleanup patches follow.

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 16:34:11 +02:00
Peter Meerwald
61c888dc93 cpu: Don't check for both x86 and ARM code
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 16:01:57 +02:00
Peter Meerwald
380591eb18 core: Add pa_cpu_init() / cpu.c
move code dealing with CPU specific code path initialization
from daemon/main.c to pulsecore/cpu.c

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 16:01:14 +02:00
Luiz Augusto von Dentz
f508b34b8b bluetooth: Add discovery to pa_bluetooth_backend_new 2014-09-10 13:25:36 +03:00
Luiz Augusto von Dentz
5c2ed8abed bluetooth: Only create backend instance once objects are listed
This makes sure the devices are discovered before the backend start
creating new transports.
2014-09-10 13:25:36 +03:00
David Henningsson
fcfaa77fe7 configure: Fix spelling of "backend"
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-09-10 11:28:45 +02:00
Wim Taymans
f782155da5 configure: fix headset check 2014-09-10 11:25:47 +02:00
Lukasz Marek
78ca8cfc96 Client API: Add pa_stream_write_ext_free() function.
New function allows to pass data pointer that is a member
of the outer structure that need to be freed too when data
is not needed anymore.

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2014-09-10 10:12:08 +02:00
Sjoerd Simons
594da41d07 alsa-mixer: recognize Dock headphone jack
Recognize the Dock headphone jack in the same way the normal & front
headphone jacks are detected.

Reviewed-by: David Henningsson <david.henningsson@canonical.com>
2014-09-10 09:59:00 +02:00
David Henningsson
076601ee28 core-util: Fail if XDG_RUNTIME_DIR belongs to someone else
Usually, PA will use the PULSE_SERVER X11 property instead of using XDG_RUNTIME_DIR,
so this environment variable does not matter.

If this property is not available, or if one is using the pacmd cli protocol,
the client will go ahead and call pa_make_secure_dir on XDG_RUNTIME_DIR/pulse.
This will either fail (if you're another regular user), or succeed (if you're root).
Both scenarios are bad - failing will cause the connection to fail, and succeeding
is even worse, as it can cause *other* connections to fail (as the directory
ownership has changed).

Instead fail and complain loudly.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=83007
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-09-08 13:46:01 +02:00
David Henningsson
b8656afe4a alsa-mixer: Improve workaround for Valgrind's false warnings
Valgrind is not correctly handling ALSA TLV syscalls, which leads
to false warnings, looking like this:
 "Conditional jump or move depends on uninitialised value(s)"

Unfortunately, alsa-lib itself also uses these values which valgrind
falsely believe are uninitialized, so not all warnings are removed,
but this is what we can do from PA until the valgrind bug is fixed.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-09-08 13:05:10 +02:00
Luiz Augusto von Dentz
19180345fa bluetooth: Add pa_bluetooth_transport_unlink 2014-09-08 13:19:59 +03:00
Luiz Augusto von Dentz
4e041f7b36 bluetooth: Add pa_bluetooth_transport_set_state 2014-09-08 13:00:54 +03:00
Tanu Kaskinen
610704d225 alsa-mixer: Mark "Line HP Swap" as required-any
In the (theoretical) case that no other elements exists but
"Line HP Swap", the presence of that element signals that there are
headphone and line-out outputs, otherwise there would be nothing to
swap.
2014-09-08 11:26:00 +03:00
Peter Meerwald
293a1739e2 endianmacros: Replace borked PA_FLOAT32_SWAP() with PA_READ_FLOAT32RE() / PA_WRITE_FLOAT32RE()
building PA with -O0 leads to test failure in mix-test on i386

issue reported by Felipe, see
http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-August/021406.html

the problem is the value 0xbeffbd7f: when byte-swapped it becomes 0x7fbdffbe and according
to IEEE-754 represents a signalling NaN (starting with s111 1111 10, see http://en.wikipedia.org/wiki/NaN)

when this value is assigned to a floating point register, it becomes 0x7ffdffbe, representing
a quiet NaN (starting with s111 1111 11) -- a signalling NaN is turned into a quiet NaN!

so PA_FLOAT32_SWAP(PA_FLOAT32_SWAP(x)) != x for certain values, uhuh!

the following test code can be used; due to volatile, it will always demonstrate the issue;
without volatile, it depends on the optimization level (i386, 32-bit, gcc 4.9):

// snip

static inline float PA_FLOAT32_SWAP(float x) {
    union {
        float f;
        uint32_t u;
    } t;

    t.f = x;
    t.u = bswap_32(t.u);
    return t.f;
}

int main() {
  unsigned x = 0xbeffbd7f;
  volatile float f = PA_FLOAT32_SWAP(*(float *)&x);
  printf("%08x %08x %08x %f\n", 0xbeffbd7f, *(unsigned *)&f, bswap_32(*(unsigned *)&f), f);
}
// snip

the problem goes away with optimization when no temporary floating point registers are used

the proposed solution is to avoid passing swapped floating point data in a
float; this is done with new functions PA_READ_FLOAT32RE() and PA_WRITE_FLOAT32RE()
which use uint32_t to dereference a pointer and byte-swap the data, hence no temporary
float variable is used

also delete PA_FLOAT32_TO_LE()/_BE(), not used

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Reported-by: Felipe Sateler <fsateler@debian.org>
2014-09-04 09:58:20 +02:00
Peter Meerwald
5d7b5e509c svolume: Make volume pointer parameter const for pa_volume_float32re_c()
const obviously missing

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-03 12:51:22 +02:00
Peter Meerwald
c6bc835e45 daemon: Debian/kFreeBSD 9.2 fails to compile due to caps
Debian/kFreeBSD 9.2 comes with sys/capability.h but it is not usable; work around it

the patch does several things:
* it makes the comment point to the correct bugtracker issue: https://bugs.freedesktop.org/show_bug.cgi?id=72580
* it handles Debian/kFreeBSD the same way as FreeBSD
* it logs a warning that capabilities are actually NOT dropped

daemon/caps.c: In function ‘pa_drop_caps’:
daemon/caps.c:93:2: error: #error "Don't know how to do capabilities on your system.  Please send a patch."
 #error "Don't know how to do capabilities on your system.  Please send a patch."
  ^
Makefile:9575: recipe for target 'daemon/pulseaudio-caps.o' failed

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-02 19:35:51 +02:00
David Henningsson
58cffdcfc8 Replace "authorization" with "authentication"
Since we don't have "limited" clients, a client that authenticates
correctly is automatically authorized. However, it's the authentication
that can go wrong, rather than the authorization.

Buglink: https://bugs.freedesktop.org/show_bug.cgi?id=78566
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-09-02 12:50:48 +02:00
David Henningsson
764da4260a Make all debug/info level messages untranslatable
Debug and info messages are primarily meant for developers,
rather than end users. Let's save translators' time,
and leave them untranslated.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-09-02 12:50:22 +02:00
Lukas Peleska
5d20f571bc jack: made it possible to use multiple jack sources and sinks 2014-09-01 08:19:17 +02:00
Arun Raghavan
a7667b990e srbchannel: Fix documentation error
I seem to have misread the code previously.
2014-08-31 15:10:22 +05:30
David Henningsson
f611b9b7aa resampler: Remove duplicate forward declaration of pa_resampler
This duplicated line also caused a compiler warning on some compilers.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-08-29 15:34:34 +02:00
David Henningsson
5dba418160 sink/source: Fix restore of volume on devices without hw volume
Module-device-restore sets reference_volume, but soft_volume remains at
zero dB, so if a device only has soft_volume (i e no hw volume controls),
its volume was not restored correctly.

Reported-by: Richardo Salveti de Araujo <ricardo.salveti@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-08-29 15:34:18 +02:00
Tanu Kaskinen
10da0578c1 device-manager: Don't allow setting an empty description in the client API
The module implementation treats an empty description as a protocol
error, so we should validate the description already at client side.
2014-08-24 12:43:11 +03:00
Tanu Kaskinen
638d0a51e2 bluetooth: Always initialize profile->available
If the transport for the profile doesn't exist, the old behaviour was
to leave cp->available at the default value, which is
PA_AVAILABLE_UNKNOWN, but if there's no transport, the profile should
be marked as unavailable.
2014-08-24 12:38:18 +03:00
Tanu Kaskinen
b1c4e7bf6b raop: Don't use incompatible default sample spec parameters
Since the RAOP sink supports only some formats and channel counts, we
shouldn't blindly use pa_core.default_sample_spec. This patch changes
things so that we default to PA_SAMPLE_S16NE and 2 channels, and only
take the sample rate from pa_core.default_sample_spec.
2014-08-24 12:08:12 +03:00
David Henningsson
dc2299e961 conf-parser: Add debug print of parsed files
This is useful for debugging.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-08-23 15:54:19 +02:00
David Henningsson
2575b102b9 alsa: Remove four channel input profile
With the new multichannel profile, we can remove this one and
handle the four channel input as a generic multichannel fallback.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-08-23 15:54:13 +02:00
Peter Meerwald
3a04554f9e format: Don't use deprecated json-c is_error() macro
json_tokener_parse() simply returns NULL on error these days

latest json-c (post 0.12) doesn't automatically include json-c/bits.h anymore
causing compilation errors

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-08-22 15:36:01 +02:00
Peter Meerwald
329bb6d7df build-sys: Drop support for json 0.9
drop support for json 0.9 and require json-c 0.11 (this will also avoids confusion
which json package is needed due to the upstream rename)

json 0.9 lacks json_object_object_get_ex()

json-c 0.11 was released 20130402

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-08-22 15:35:53 +02:00
Peter Meerwald
a940877224 format: Use json_object_object_get_ex() instead of deprecated json_object_object_get()
pulse/format.c: In function 'pa_format_info_get_prop_type':
pulse/format.c:252:5: warning: implicit declaration of function 'is_error' [-Wimplicit-function-declaration]
pulse/format.c:287:13: warning: 'json_object_object_get' is deprecated (declared at /usr/local/include/json-c/json_object.h:290) [-Wdeprecated-declarations]
pulse/format.c:293:13: warning: 'json_object_object_get' is deprecated (declared at /usr/local/include/json-c/json_object.h:290) [-Wdeprecated-declarations]
pulse/format.c: In function 'pa_format_info_get_prop_int_range':
pulse/format.c:364:5: warning: 'json_object_object_get' is deprecated (declared at /usr/local/include/json-c/json_object.h:290) [-Wdeprecated-declarations]
pulse/format.c:369:5: warning: 'json_object_object_get' is deprecated (declared at /usr/local/include/json-c/json_object.h:290) [-Wdeprecated-declarations]
pulse/format.c: In function 'pa_format_info_prop_compatible':
pulse/format.c:676:9: warning: 'json_object_object_get' is deprecated (declared at /usr/local/include/json-c/json_object.h:290) [-Wdeprecated-declarations]
pulse/format.c:680:9: warning: 'json_object_object_get' is deprecated (declared at /usr/local/include/json-c/json_object.h:290) [-Wdeprecated-declarations]

json-c 0.10 (released 20120530) added json_object_object_get_ex()
json-c 0.12 (released 20140410) deprecated json_object_object_get()

PulseAudio depends on json 0.9 or json-c 0.11, drop support for json 0.9
in a subsequent patch and require json-c 0.11 (this will also avoids confusion
which json package is needed due to the upstream rename)

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-08-22 15:35:33 +02:00
Peter Meerwald
514766a79f format: Don't _put() objects obtained with json_object_object_get() or json_object_array_get_idx()
json-c documentation states that "No reference counts will be changed.
There is no need to manually adjust reference counts through the
json_object_put/json_object_get methods unless..."

hence fix pa_format_info_get_prop_type() and pa_format_info_get_prop_int_range();
note that pa_format_info_prop_compatible() is OK

the json_object_array_get_idx() bug reported by Arun, thanks!

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Cc: Arun Raghavan <arun@accosted.net>
2014-08-22 15:35:24 +02:00
João Paulo Rechi Vita
6d88a139fc bluetooth: Create oFono backend 2014-08-22 12:26:18 +03:00
João Paulo Rechi Vita
dca5d07937 bluetooth: Create NULL backend 2014-08-22 12:24:39 +03:00
João Paulo Rechi Vita
2198048e5d bluetooth: Add BlueZ 5 headset profile names in policy module 2014-08-22 12:24:39 +03:00
Luiz Augusto von Dentz
bdef2dbd0a bluetooth: Assert transport has a matching profile
It is a bug if a transport has no matching profile.
2014-08-22 12:24:39 +03:00
João Paulo Rechi Vita
1f0de01bfc bluetooth: Add basic support for HEADSET profiles
This commit adds basic support for devices implementing HSP Headset
Unit, HSP Audio Gateway, HFP Handsfree Unit, HFP Audio Gateway to the
BlueZ 5 bluetooth audio devices driver module (module-bluez5-device).
2014-08-22 12:10:12 +03:00
Arun Raghavan
a27e6d6d9e srbchannel: Trivial whitespace and style fixes
Mostly to improve readability and make things a bit more consistent.
2014-08-21 15:40:42 +05:30
Peter Meerwald
096c8903a9 context: Handle client-side failure of pa_srbchannel_new_from_template()
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
fc0447ce88 context: Stop and return if srbchannel memblock looks fishy
handle_srbchannel_memblock() should return when memblock sanity checks fail

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
fd19327327 srbchannel: pa_srbchannel_new() may fail
return from setup_srbchannel() when pa_srbchannel_new() fails

pa_srbchannel_new() depends on HAVE_SYS_EVENTFD_H, e.g. Debian/kFreeBSD doesn't
have it

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: David Henningsson <david.henningsson@canonical.com>
2014-08-18 23:21:59 +02:00