Commit graph

7135 commits

Author SHA1 Message Date
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
Arun Raghavan
36bdd720aa tests: Adjust latency test calibration
This makes the test more robust by:

1. Decreasing the '1' threshold during calibration - the RMS value for
   the sine wave will be 0.5, so the previous code was making us take
   the ALSA mixer past 0dB.

2. Using the difference rather than absolute value for 0->1 transitions,
   so that we're somewhat independent noise in our calculations.
2013-06-04 00:38:44 +05:30
Arun Raghavan
3f16c7100b tests: Make loopback latency test run with rt priority 2013-06-04 00:38:44 +05:30
Arun Raghavan
0862a281aa tests: Add a latency measurement test
This test is intended to measure real latency by playing a sample to a
sink and capturing that over a loopback interface. The loopback can
either be physical (cable running from headphone out to line in) or
virtual (monitor source or module loopback).

Also included in this is calibration code to make sure that volumes are
sufficiently adjusted to be able to detect the played back signal (and
that there aren't false positives due to line noise).

One of the objectives of all this is to later factor out the setup code
to allow us to easily write more loopback tests for various
functionality (volumes, resampling, mixing, etc.).
2013-06-04 00:38:44 +05:30
Tanu Kaskinen
50af14bd5b bluetooth: Fix input port description 2013-06-04 00:38:43 +05:30
Arun Raghavan
5ae5dee75e zeroconf: Make Avahi usage in m-z-publish async
This pushes all avahi-client code to a threaded mainloop from the PA
mainloop context. We need to do this because avahi-client makes blocking
D-Bus calls, and we don't want to block the mainloop for that long.

The only exception to this now that I don't see a workaround for is
during module unload time. However, this shouldn't be a huge problem
since in most cases, this will only happen at server shutdown time.

The bulk of the change is partitioning the data so that PA core objects
only (well, mostly) get accessed in the PA mainloop and Avahi calls
happen only in the Avahi threaded mainloop.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=58758
2013-06-04 00:38:43 +05:30
Arun Raghavan
8d129977ca mainloop: Add API to set thread name for threaded mainloop 2013-06-04 00:38:43 +05:30
Arun Raghavan
1b0136be44 pulsecore: Fix assert in pa_msgobject creation
Allows for creation of derived types that don't have any other fields.
2013-06-04 00:38:43 +05:30
poljar (Damir Jelić)
126a80f3b9 shell-completion: Add list-cards to the pacmd completion.
The list-cards command was missing for both of the shell completions.
This fixes it.
2013-06-04 00:38:43 +05:30
Peter Meerwald
b0ee51e19e rescue-streams: Fix wording of module description
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-06-04 00:38:43 +05:30