Commit graph

6091 commits

Author SHA1 Message Date
Colin Guthrie
ce546b22eb build-sys: Provide a simple CMake Config setup (similar to pkgconfig)
I'd rather not have to do this, as I don't really see the point in
duplicating what is done in pkgconfig, but this is likely the
easiest way to avoid nasty hacks.
2011-10-19 23:49:23 +01:00
Arun Raghavan
034006ec90 sink,source: Account for corked streams in update_rate()
pa_sink/source_used_by() ignores corked/monitor streams, but we need to
make sure there aren't any of these while updating rate (at least for
now -- this is a restriction that would be nice to get rid of).
2011-10-18 09:53:20 +05:30
Pierre-Louis Bossart
72377fcad5 alsa: fix list of sampling rates
add all standard audio rates

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2011-10-18 09:00:58 +05:30
Arun Raghavan
e67440e220 alsa: Probe sink/source sample rates
This probes sink and source sample rates and uses this information to
validate rate changes and check incoming passthrough formats.
2011-10-17 22:52:47 +05:30
Arun Raghavan
3555634e6e alsa: Remove unused variable 2011-10-17 21:16:23 +05:30
Arun Raghavan
59d058dea4 sink,source: Handle equal default and alternate sample rates 2011-10-17 20:20:14 +05:30
Arun Raghavan
ac469a25c0 sink,source: Add the ability to disable alternat sample rate switching
Setting the alternate sample rate to 0 in config disables this feature.
2011-10-17 20:16:37 +05:30
Arun Raghavan
b9ff90fef8 source: Bring rate update code in sync with sink code
Basically adds code to handle passthrough sources. This isn't a tested
path at the moment, but in the future, when we do wish to support these,
it'll save us the trouble of having to sync all the code again.
2011-10-17 20:09:50 +05:30
Pierre-Louis Bossart
b232fbd8f8 alsa: support for alternate sampling rate
This is where the actual changes happen.
Some additional checks would be required to make sure the
rate is actually supported
Tested with both PCM and passthrough streams

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2011-10-17 20:09:50 +05:30
Pierre-Louis Bossart
f0ec495938 sink,source: support for rate update
Avoid resampling or use integer resampling when supported by the
sinks/sources

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2011-10-17 20:09:46 +05:30
Pierre-Louis Bossart
5bcfd2b630 core: infrastructure for alternate sampling rate
New parameter to avoid resampling. BIG power savings here...

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2011-10-17 19:23:26 +05:30
Arun Raghavan
31a9f195fa build-sys: Minor CXXFLAGS fix
Set it on echo-cancel-test only if webrtc support is enabled.
2011-10-17 17:09:24 +05:30
Arun Raghavan
6df6eb959e echo-cancel: Add the WebRTC echo canceller
This adds the WebRTC echo canceller as another module-echo-cancel
backend. We're exposing both the full echo canceller as well as the
mobile echo control version as modargs.

Pending items:

1. The mobile canceller doesn't seem to work at the moment.

2. We still need to add bits to hook in drift compensation (to support
   sink and source from different devices).

The most controversial part of this patch would probably be the
mandatory build-time dependency on a C++ compiler. If the optional
--enable-webrtc-aec is set, then there's also a dependency on libstdc++.
2011-10-17 16:42:59 +05:30
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