Commit graph

7144 commits

Author SHA1 Message Date
Peter Meerwald
736e041980 sconv: avoid multiply in ARM NEON s16->float conversion
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-07-05 09:52:19 +03:00
Peter Meerwald
40c3c117e7 sconv: avoid multiply in ARM NEON float->s16 conversion
optimization idea taken from libavresample

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-07-05 09:38:52 +03:00
Tanu Kaskinen
0e8d26a6a1 channelmap, volume: Don't refer to bool in the public API documentation 2013-07-04 12:35:55 +03:00
Tanu Kaskinen
efcc3ba576 mainloop-test: Use FALSE instead of false for gboolean 2013-07-04 12:33:47 +03:00
poljar (Damir Jelić)
b224716f33 macro: Remove unneeded typedef for pa_bool_t. 2013-07-04 12:26:02 +03:00
poljar (Damir Jelić)
24a0639a21 Revert windows BOOL variables to use TRUE/FALSE instead of true/false 2013-07-04 12:25:56 +03:00
poljar (Damir Jelić)
b358aea89b Revert dbus_bool_t variables to use TRUE/FALSE instead of true/false 2013-07-04 12:25:47 +03:00
poljar (Damir Jelić)
408f0ba783 Fix alignment issues introduced by the pa_bool -> bool conversion 2013-07-04 12:25:40 +03:00
poljar (Damir Jelić)
d806b19714 Remove pa_bool_t and replace it with bool.
commands used for this (executed from the pulseaudio/src directory):
    find . -regex '\(.*\.[hc]\|.*\.cc\|.*\.m4\)' -not -name 'macro.h' \
        -a -not -name 'reserve.[ch]' -a -not -name 'reserve-monitor.[ch]' \
        -a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \
        -a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \
        -a -not -name 'poll-win32.c' -a -not -name 'thread-win32.c' \
        -a -not -name 'dllmain.c' -a -not -name 'gconf-helper.c' \
        -exec sed -i -e 's/\bpa_bool_t\b/bool/g' \
        -e 's/\bTRUE\b/true/g' -e 's/\bFALSE\b/false/g' {} \;

and:
    sed -i -e '181,194!s/\bpa_bool_t\b/bool/' \
        -e '181,194!s/\bTRUE\b/true/' -e \
        '181,194!s/\bFALSE\b/false/' pulsecore/macro.h
2013-07-04 12:25:30 +03:00
Tanu Kaskinen
e9822bfcb0 build-sys: Add native-instruments-traktor-audio2.conf to Makefile.am
Thanks to Jan Steffens for reporting the issue.
2013-07-03 15:22:05 +03:00
Tanu Kaskinen
944ffb0323 device-manager: Refuse to load empty descriptions 2013-07-02 17:49:17 +03:00
David Henningsson
242b8e5fd3 Revert "alsa-mixer: Add a couple of assertions"
This reverts commit 2613e4c747.

Please don't replace correct NULL pointer checks with assertions.
2013-06-28 16:16:22 +02:00
Tanu Kaskinen
67132eea1a device-manager: Add a sanity check for reading entries
There is code elsewhere that assumes that if user_set_description is
true, then the description is non-NULL.
2013-06-28 09:58:07 +03:00
Tanu Kaskinen
491c6a3a0b waveout: Simplify setting the device description 2013-06-28 09:57:05 +03:00
Tanu Kaskinen
2613e4c747 alsa-mixer: Add a couple of assertions
I checked the code to ensure that the assertions hold currently.
2013-06-27 19:18:36 +03:00
Tanu Kaskinen
0f2840f4c6 dynarray: Reimplement with nicer semantics
A dynamic array is a nice simple container, but the old interface
wasn't quite what I wanted it to be. I like GLib's way of providing
the free callback at the container creation time, because that way
the free callback doesn't have to be given every time something is
removed from the array.

The allocation pattern was changed too: instead of increasing the
array size always by 25 when the array gets full, the size gets
doubled now (the lowest non-zero size is still 25).

The array can't store NULL pointers anymore, and pa_dynarray_get() was
changed so that it's forbidden to try to access elements outside the
valid range.

The set of supported operations may seem a bit arbitrary. The
operation set is by no means complete at this point. I have included
only those operations that are required by the current code and some
unpublished code of mine.
2013-06-27 11:45:41 +03:00
Tanu Kaskinen
d00d5b6611 source: Fix an indentation mistake 2013-06-26 21:21:41 +03:00
Tanu Kaskinen
c005ec79f7 object: Initialize allocated memory to zero
This is safer and more convenient for subclasses.
2013-06-25 19:15:48 +03:00
Tanu Kaskinen
a9c3503ee9 device-port: Assert that ports have a description
It's easier to work with the port description if it can be assumed
that it's always non-NULL. I have checked that the current code base
always ensures a non-NULL description.
2013-06-25 19:15:11 +03:00
David Henningsson
8127f8f9c5 protocol-esound/http/simple: Make sure callers can handle iochannel_write changes
With the new behaviour, you will not always get a callback after a
successful write. Make sure the callers can properly handle this.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-06-24 22:11:40 +03:00
poljar (Damir Jelić)
97da92d894 Whitespace cleanup: Remove all multiple newlines
This patch removes all occurrences of double and triple
newlines.

Command used for this:
find .  -type d \( -name ffmpeg \) -prune -o \
        -regex '\(.*\.[hc]\|.*\.cc\)' \
        -a -not -name 'adrian-aec.*' -a -not \
        -name reserve.c -a -not -name 'rtkit.*' \
        -exec sed -i -e '/^$/{N;s/^\n$//}' {} \;

Two passes were needed to remove triple newlines.
The excluded files are mirrored files from external sources.
2013-06-24 16:56:24 +03:00
poljar (Damir Jelić)
e95d054e40 Style fix: Remove new lines from opening brackets
This patch replaces every occurrence of ')\n{' with ') {'.

Command used for this:
    find .  -type d \( -name ffmpeg \) -prune -o \
        -regex '\(.*\.[hc]\|.*\.cc\)' \
        -a -not -name core-util.c -a -not \
        -name adrian-aec.c -a -not -name g711.c \
        -exec sed -i -e '/)$/{N;s/)\n{$/) {/}' {} \;

The excluded files are mirrored files from external sources.
2013-06-24 16:56:24 +03:00
poljar (Damir Jelić)
cbd274676d Style fix: Add a space between the closing/opening bracket
This patch replaces every occurrence of '){' with ') {'.
The ffmpeg source tree was excluded since it will disappear anyways.

Command used for this:
    find . -type d \( -name ffmpeg \) -prune -o \
        -regex '\(.*\.[hc]\|.*\.cc\)' \
        -exec sed -i -e 's/){/) {/' {} \;
2013-06-24 16:56:24 +03:00
poljar (Damir Jelić)
faf991ce22 Style fix: Add a space betwen the if statement and the opening bracket
This patch replaces every occurrence of 'if(' with 'if ('.
The ffmpeg source tree was excluded since it will disappear anyways.

Command used for this:
    find . -type d \( -name ffmpeg \) -prune -o \
            -regex '\(.*\.[hc]\|.*\.cc\)' \
            -exec sed -i -e 's/ if(/ if (/' {} \;
2013-06-24 16:56:24 +03:00
poljar (Damir Jelić)
5e11ea06ef Whitespace cleanup: Fix broken indentation by hand
This patch fixes wrong indentation introduced by the last patch.

This was mostly done with vim-s retab feature.
2013-06-24 16:56:24 +03:00
poljar (Damir Jelić)
aab63a3499 Whitespace cleanup: Remove tabs
This patch removes all tabs hidden inside the source tree and replaces
them with 4 spaces.

Command used for this:
    find . -type d \( -name bluetooth \) -prune -o
    -regex '\(.*\.[hc]\|.*\.cc\)' -a -not -name 'reserve*.[ch]'
    -a -not -name 'gnt*.h' -a -not -name 'adrian*'
    -exec sed -i -e 's/\t/    /g' {} \;

The excluded files are mirrored files from external sources containing
tabs.
2013-06-24 16:56:24 +03:00
Tanu Kaskinen
b41d4bfef1 .gitignore: Add build-aux 2013-06-23 10:31:13 +03:00
Tanu Kaskinen
0587b5aa31 core-util: Fix log message levels
This code is from heftig, but the mistake that I'm fixing here is my
own. Before applying heftig's patch, I downgraded the level of one of
the log messages. I managed to downgrade a different message than what
I intended, so now I'm undoing that mistake.
2013-06-23 10:27:28 +03:00
Tanu Kaskinen
cffcaaec68 log: Fix error message
file_path contains the last tried file name, including the suffix, so
the error message was wrong:

    Tried to open target file '/tmp/test.log.99', '/tmp/test.log.99.1',
    '/tmp/test.log.99.2' ... '/tmp/test.log.99.99', but all failed.
2013-06-20 17:22:28 +03:00
Shuai Fan
b0bf132f8f cli, log: Improve the set-log-target functionality
Add a new log target 'newfile:PATH', and refactoring 'pa_log_target_type'.

Signed-off-by: Shuai Fan <shuai900217@126.com>
2013-06-20 16:34:57 +03:00
Tanu Kaskinen
e05c12f28b bluetooth: Fix too late assertion
u was dereferenced before the assertion that checks that u isn't NULL.
2013-06-19 18:25:56 +03:00
Tanu Kaskinen
0e9baa429e combine: Fix crash in output freeing
The outputs are removed from the idxset before output_free() is
called. Trying to remove them again in output_free(), and asserting
that it should succeed caused crashing whenever outputs were freed.

This bug was introduced in commit
061878b5a4.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=65901
2013-06-19 18:21:36 +03:00
Arun Raghavan
e1e154c737 zeroconf: Fix pa_mainloop_api_once usage
We need the mainloop lock to be taken around pa_mainloop_api_once() to
prevent an assert due to the defer event creation and setting of the
destroy callback not being performed atomically.
2013-06-18 08:20:05 +05:30
Arun Raghavan
9a0dd11342 mainloop: Document need for mainloop lock around pa_mainloop_api_once
This needs us to expose a bit of implementation detail, but this seems
to be the cleanest way without an API change.

The specific problem is that pa_mainloop_api_once() needs to first
create a defer event and then set its destroy callback. If the defer
event is completed before the callback is set, an assert will be
trigerred.
2013-06-18 08:20:05 +05:30
David Henningsson
b2792d7837 pstream: Fixup hangs caused by recent iochannel patch
Now that we don't *always* get a callback after having written
something, make sure we can continue writing as long as it fully
succeeds.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-06-17 08:52:07 +02:00
Arun Raghavan
2c1dceeb58 sink-input: Log format negotiation better
This provides more details on format negotiation success and failure to
make debugging problems easier.
2013-06-15 09:42:57 +05:30
Arun Raghavan
4e05333a93 iochannel: Document modified pa_iochannel_write return value 2013-06-14 17:12:44 +05:30
David Henningsson
9c4dcffca5 iochannel: Avoid unnecessary wakeup after successful write
To save some CPU (in low latency scenarios), don't re-enable the
"writable" event after it has succeeded. It is very likely the next
write will succeed right away too.

This means that we always need to handle EAGAIN/EWOULDBLOCK as a
successful write of 0 bytes, so I also verified that all callers to
pa_iochannel_write handled this correctly.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-06-14 13:45:57 +03:00
David Henningsson
e2d1421f61 alsa: Fix "Scheduling delay of..." message
The tsched_watermark is in bytes, not in usecs. Fix this by introducing
a new variable, and also use that variable in some places for optimisation.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-06-13 13:07:42 +03:00
Arun Raghavan
f6291d974a doc: Fix building doxygen docs out of tree 2013-06-12 18:41:08 +05:30
Tanu Kaskinen
1e42a289d4 native: Don't enable prebuffering when draining
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=64284
2013-06-11 13:46:44 +03:00
David Henningsson
ecf3ab2b57 alsa-mixer: Add "Line Out" path
If there is a "Line Out" jack present, then add this path. The fallback
analog-output will be a subset of this path and removed.

I only use the "Line Out Jack" or "Line Out Front Jack" for actual jack
detection - without anything connected to the front jack, it makes little
sense to enable the port.
(Another option could perhaps be to use different paths for stereo line out
and surround line outs, but that could be a possible future improvement.)
2013-06-10 17:03:02 +03:00
Arun Raghavan
22aac4e9fd alsa-mixer: Disable headphones when playing to speakers
Assume that the headphone port volume is lower than the speaker volume.
When plugging in headphones, if the path is active, while the jack is
being inserted and before it is actually detected as being plugged in,
it will still receive the signal being played (which is at a higher
volume than it will be when plugged in completely). The volume
difference manifests as a volume spike when the headphones are plugged
in, before the final volume is set.

This patch is required to prevent such a volume spike when plugging in
headphones. The problem is not fixed completely, but the spike is
shortened. To be fixed completely, we need to apply the port volume
before unmuting the new path.
2013-06-10 17:01:53 +03:00
Jan Alexander Steffens (heftig)
07290d9da7 core-util: Clamp RLIMIT_RTTIME to what RealtimeKit accepts
In the default configuration, PulseAudio's rlimit-rttime is set to
1000000 (100%), which is higher than what RealtimeKit requires from
its clients (200000, 20%).

Make an attempt to still get realtime scheduling by clamping the
current RLIMIT_RTTIME to what RealtimeKit accepts. Warn about doing
this.
2013-06-10 16:52:44 +03:00
Tanu Kaskinen
baee32f2ee .gitignore: Add lo-latency-test 2013-06-06 13:56:30 +03:00
Javier Jardón
7179e7565f build-sys: Do not AC_SUBST *_CFLAGS and *_LIBS
PKG_CHECK_MODULES() already do that for us
2013-06-06 13:30:10 +03:00
Javier Jardón
c58bb9bd62 build-sys: Use build-aux directory to store autogenerated files 2013-06-06 10:10:19 +03:00
Javier Jardón
5b0aaecb0b build-sys: Use autoreconf in bootstrap.sh 2013-06-06 10:03:03 +03:00
Arun Raghavan
c6df40a539 tests: Make loopback latency test more accurate
This makes sure that we always take the timing at the point when we
write out the pulse, making the overall latency measurement more
accurate.
2013-06-04 00:38:44 +05:30
Arun Raghavan
e001cc1424 tests: Factor out loopback setup code
This moves over setup code for the loopback latency test into a private
library so that we can easily write more tests using the same framework.
2013-06-04 00:38:44 +05:30