Commit graph

6078 commits

Author SHA1 Message Date
Arun Raghavan
dbe8f2e595 macro: typedef pa_bool_t to bool instead of _Bool
They're functionally equivalent, and the former lets the header be
included in C++ as well.
2011-10-17 16:42:59 +05:30
Arun Raghavan
e40bddc946 echo-cancel: Simplify checking if AEC is active
This removes the active_mask bits and just check source and sink states
directly.
2011-10-17 16:42:59 +05:30
Tanu Kaskinen
a88b1d5cd4 alsa: New modarg "paths_dir" for module-alsa-card
The new module argument can be used to provide a custom
directory for loading alsa path configuration files. This is
useful for testing: no need to be root to create test
configuration files.
2011-10-17 12:54:23 +05:30
David Henningsson
ca6057316d Fix deferred volume not being applied if sink is closed
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-10-17 09:50:16 +05:30
Arun Raghavan
bb4b8f896e build-sys: Drop libsamplerate from pulsecommon deps
This was erroneously added in:

    commit d766b38e1b
    build: Remove unnecessary flags in AM_CFLAGS
2011-10-17 09:43:38 +05:30
Arun Raghavan
21bfe455da filter-apply: Move sink/source unlink callbacks before m-s-r
module-stream-restore and modile-filter-apply can get into an infinite
loop if m-s-r is called before m-f-a (m-s-r rescues a stream and
attaches it to a sink/source, which then triggers m-f-a to move it back
to the filter sink/source, and so on). The purpose of the m-f-a hooks is
to beat m-s-r, so moving them to be run first.
2011-10-12 17:54:46 +05:30
Maarten Bosmans
b453e13ede qpaeq: Make it python3 and python2 compatible 2011-10-12 13:05:13 +05:30
Arun Raghavan
4bd357ae57 echo-cancel: Don't process if sink is unconnected
If there's no playback data, there's no point in actually processing the
capture data.
2011-10-12 13:04:57 +05:30
Maarten Bosmans
89f00f3e4c tests: Fix calculation of memblock size in resampler-test
And remove useless volume scaling.
2011-10-12 11:11:06 +05:30
Tanu Kaskinen
6d58497dd1 daemon: Don't treat it as a fatal error if we can't connect to the session bus
http://lists.freedesktop.org/archives/pulseaudio-discuss/2011-June/010276.html
2011-10-12 10:51:24 +05:30
Maarten Bosmans
3c4d43d9dc pacat: Fail early if the media name cannot be set
Otherwise you get an "invalid argument" error from pa_stream_new later.
2011-10-11 22:48:25 +05:30
Maarten Bosmans
3b7c6b21f4 Do something sensible when compiled without iconv support
Without this fix, pacat won't start up, because it is unable to set the stream name.
2011-10-11 22:48:21 +05:30
Arun Raghavan
518338ac0e echo-cancel: Close debug files on module unload 2011-10-10 22:18:22 +05:30
Arun Raghavan
5c28acb1db namereg: Don't set default sink/source on get()
This removes the nasty side-effect that a call to
pa_namereg_get_default_{source,sink}() will also *set* the default
source/sink.

This is a more complete fix for commit 766dbc68 ("conf: Make sure
module-dbus-protocol is loaded after module-default-device-restore")

https://bugs.freedesktop.org/show_bug.cgi?id=40897
2011-10-10 16:08:43 +05:30
Arun Raghavan
f1e41a78cc echo-cancel: Drop sink/source samples before processing begins
This moves the bits that skip source/sink samples for resync from inside
the processing loop to just before. The actual effect should be the
the same.
2011-10-10 13:27:17 +05:30
Arun Raghavan
17011fcf70 echo-cancel: Skip processing till there's enough data
This makes sure that we only perform any processing (resync or actual
cancellation) after the source provides enough data to actuall run the
canceller.
2011-10-10 13:26:27 +05:30
Arun Raghavan
cee6011572 echo-cancel: Skip canceller when no source outputs are connected
When a source-output isn't connected to our virtual source, we skip echo
cancellation altogether. This makes sense in general, and makes sure
that we don't end up adjusting for delay/drift when nothing is
connected. This should make convergence faster when the canceller
actually starts being used.
2011-10-10 13:26:06 +05:30
Arun Raghavan
4cacb1b670 echo-cancel: Increase threshold for resyncing, make it configurable
This increase the threshold for difference between the playback and
capture stream before samples are dropped from 1ms to 5ms (the
cancellers are generally robust to this much and higher). Also, we make
this a module parameter to allow easier experimentation with different
values.
2011-10-10 13:25:46 +05:30
Arun Raghavan
0429fe6153 echo-cancel: Don't crash if adjust_time = 0 2011-10-10 13:25:40 +05:30
Arun Raghavan
f9b59e457c echo-cancel: Remove redundant variable 2011-10-10 13:25:35 +05:30
Arun Raghavan
3f5c5582f4 echo-cancel: Add a standalone test program
This is useful to test the canceller implementation on data from disk
rather than testing live. Handy for comparing implementations reliably.
2011-10-10 13:25:25 +05:30
Pierre-Louis Bossart
a103e82029 alsa: reset watermark to initial values on resume
Watermark level and latency values are not restored when
resuming, the values used prior to suspending are reused.
This leads to side effects when underruns happen and buffer
sizes are updated, PulseAudio can never meet lower latency
requirements.

Solution: keep track of watermark and latency values on sink or
source creation, and reapply them on resume to start with
a clean slate.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2011-10-08 14:51:50 +05:30
David Henningsson
60811ec15d source-output: Do not use unset channel map in pa_source_output_new
This problem was found when tracing down a crash coming from the
esound protocol, which does not set a channel map.

BugLink: http://bugs.launchpad.net/bugs/864071
Signed-off-by: David Henningsson <david.henningsson@canonical.com>

N.B.: As Colin notes, this is because commit 117c7145 was incomplete
("format: Fix channel map handling")
2011-10-05 20:58:14 +05:30
David Henningsson
58585db808 module-jackdbus-detect: Avoid double-free of modargs
If module-jackdbus-detect failed in the later part of initialization,
the ma variable was freed twice.

BugLink: http://bugs.launchpad.net/bugs/867444
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-10-05 20:50:03 +05:30
Arun Raghavan
42d056593d alsa: Make mixer error handling more robust still
Instead of relying on the snd_mixer_* functions failing, we check for
POLLERR and POLLNVAL first. After this, any errors in handling the mixer
events are deemed fatal (that is we cause the ALSA source/sink thread to
terminate).

The case where POLLERR is set but POLLNVAL is not does not actually
occur, but we're making this a soft failure (stop polling the mixer, but
don't kill the I/O thread). If other conditions where POLLERR occurs
turn up, we need to handle them explicitly.

Thanks to Linus Torvalds for helping get this right.
2011-10-05 01:55:15 +05:30
Maarten Bosmans
9e92b1977b doc: Add some more doxygen tags to existing comments 2011-10-04 09:40:05 +01:00
Arun Raghavan
e681469154 echo-cancel: Fail if loaded between a sink and its monitor
Loading between a sink and its monitor causes a deadlock (while sending
messages for latency snapshots). It isn't a case that has any real
conceivable use, so let's just disallow it.
2011-10-04 14:08:01 +05:30
Arun Raghavan
d086f15c91 alsa: Better error handling in mixer rtpoll callback
This improves the error handling in the mixer rtpoll callback. It avoids
a crash if an error occurs (the rtpoll_item is freed but still
referenced), and specifically makes sure we don't continue trying to
poll the device if the card is disconnected.
2011-10-04 12:29:46 +05:30
Arun Raghavan
fc8702ee81 alsa: Give compressed formats preference over PCM
This makes set_formats() put PCM formats lower down the list than
compressed formats since we negotiate by picking the first format in
this list that is also in the client-provided list of possible formats
during sink input creation.

This will be incorrect if we ever decide to do encoding in PA (for
things like AC3/DTS encoding for multichannel output over S/PDIF).
2011-10-04 12:29:32 +05:30
Maarten Bosmans
b0d9c78f3e Make pulse build with clang again
The casts are not supported there.
2011-10-01 13:25:16 +01:00
Sudarshan Bisht
cb9ebeffa0 null-sink: Set latency range at the time of initialization of module.
At the time of module initialization latency range is being set so that the null-sink
would be aware of its limitations with latencies.
2011-10-01 13:25:16 +01:00
Daniel Mack
0f363d252c osx: don't build the once-test binary on OS X
This patch was already added earlier with commit ID 2f86ba4f, but the
changes got reverted by commit 3adc43b ("win32: Make once-test work").

However, this still doesn't work on OSX as here, pthread is in general
available, but the barrier APIs aren't.
2011-10-01 13:25:16 +01:00
Tanu Kaskinen
8d0e9c05a5 doc: Add an example stream-restore fallback table file. 2011-10-01 13:25:16 +01:00
Marc-André Lureau
188c91b514 stream-restore: Support a simple fallback volume table
The purpose of this patch is to make it possible to configure stream volumes
before pulseaudio is run for the first time. This is useful, for example, in
embedded products where the default volumes have to be sensible already in
the first boot.
2011-10-01 13:25:16 +01:00
Tanu Kaskinen
666261ece8 memblockq: Improve debuggability by storing a name and a sample spec.
These are not used for anything at this point, but this
makes it easy to add ad-hoc debug prints that show the
memblockq name and to convert between bytes and usecs.
2011-10-01 13:25:16 +01:00
Tanu Kaskinen
4d930f19f9 sink: Add some comments about the rewind handling during stream moves. 2011-10-01 13:25:15 +01:00
Tanu Kaskinen
307911c72e sink: Move updating the requested latency after the rewind request when finishing a stream move. 2011-10-01 13:25:15 +01:00
Colin Guthrie
7563e0bbb5 libpulse: Always return a three part version number in API calls.
For both the headers and the library we should provide clean, three part
strings as this has been what we've previously done in the past
and some external systems apparently rely on this format. While it's not
something we've officially commented on before, there is no real advantage
to us to change it so let's not try to tidy things up too much
considering some third party apps (e.g. Skype) seem to dislike a two
part version string.
2011-10-01 13:21:03 +01:00
Arun Raghavan
6a9272f950 sink,source: Avoid unnecessary call to pa_rtclock_now()
pa_{sink,source}_volume_change_apply were being called by the ALSA I/O
thread on every iteration, causing a pa_rtclock_now() call, which can
sometimes be heavy. We avoid this call by making sure there actually are
changes to apply before proceeding into the function.

While we're at it, also dropping a redundant check on s->write_volume.
2011-09-27 22:30:30 +05:30
Arun Raghavan
6878140662 extended: Fix doxygen comment style typos
Thanks to Rémi Denis-Courmont for pointing this out on IRC.
2011-09-27 18:57:48 +05:30
Colin Guthrie
093d2d6bb5 build-sys: bump soname 2011-09-27 08:56:06 +01:00
Colin Guthrie
002726436b build-sys: Switch to the tar-ustar format (as per a lot of GNOME stuff for 3.2) and distribute .xz files.
We will drop .gz support after 1.0
2011-09-27 08:55:17 +01:00
David Henningsson
0cebb630da Fix crash in threaded message queues
Once in a million or so, this typo causes a crash when two threads
simultaneously try to call "pa_asynqmsgq_write_poll".

BugLink: http://bugs.launchpad.net/bugs/853560
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-09-25 13:44:34 +01:00
David Henningsson
165bd13d9e dbus: Don't crash if the module does not load
If module-dbus-protocol fails to start, pa__done is still called,
which falsified the assumption that u->connections was always set.

BugLink: http://bugs.launchpad.net/bugs/855729
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-09-22 23:15:18 +05:30
Arun Raghavan
cae3235369 sink,source: Handle missing in the shared volume case
This makes sure that when we're traversing the device chain for sources
and sinks with shared volume, we handle the case that a sink-input or
source-output of one of these might be unlinked (while unloading a
module, for example).
2011-09-21 23:00:02 +05:30
Colin Guthrie
fde703be75 build-sys: bump soname 2011-09-15 11:30:47 +01:00
David Henningsson
766dbc6838 conf: Make sure module-dbus-protocol is loaded after module-default-device-restore
module-dbus-protocol gets the default sink, which sets the default sink
if not already set. This is turn makes module-default-device-restore do
nothing.
To solve the problem, make sure module-default-device-restore is loaded
before module-dbus-protocol and not the other way around.

BugLink: http://bugs.launchpad.net/bugs/843780
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-09-15 06:40:18 +05:30
David Henningsson
f8624a7876 sink,source: Avoid crash by not updating volume on shutdown
Sometimes the ALSA mixer can be modified during a point at shutdown
which causes a race condition trying to update the volume of an
unlinked sink.

Includes typo fix by our Chief Typo Spotter, Colin, and a clarifying
comment by me.

BugLink: http://bugs.launchpad.net/bugs/841968
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-09-14 15:47:17 +05:30
Arun Raghavan
38be4a2d44 echo-cancel: Use volume sharing by default
Uses the shared volume infrastructure by default with an option to
fallback on the old pretend-volume-sharing-that-kind-of-works if someone
wants it that way.

Users who keep left != right (or any sort of unbalanced channel volumes)
will likely want to disable shared volumes since it will cause their
master sink/source volume to be balanced.

This really isn't a very pleasant scenario since users would need to
manually set up echo cancellation in their config for this (until we
have a way to store module configuration). That said, the majority case
benefits from the volume sharing, so let's not wait for the
configuration infrastructure to be ready to use this.
2011-09-14 14:15:01 +05:30
Arun Raghavan
ec099f9306 equalizer: Use volume sharing by default
Uses the shared volume infrastructure by default with an option to
fallback on the old pretend-volume-sharing-that-kind-of-works if someone
wants it that way.
2011-09-14 14:15:01 +05:30