Commit graph

6098 commits

Author SHA1 Message Date
Arun Raghavan
3c547194fc gitignore: Update for recent additions
Adds echo-cancel-test and new cmake files
2011-10-21 10:07:31 +05:30
Colin Guthrie
9af153574c conf: Use .nofail when loading module-jackdbus-detect
When starting via a console login, PA will likely not have a session DBus
to play with. As there is no X11 environment, libdbus will be unable
to launch a session DBus for us and thus the module will fail to load
which in turn prevents PA from loading.

If the user subsequently logs into X11 this it will still not be possible
to load the module as the server will be ignorant of the X11 and DBus
environment variables so a longer term solution for handling this should
be found.
2011-10-20 14:29:06 +01:00
Arun Raghavan
5bb9d52b7e solaris: Use real_volume for set/get volume
This got missed when other bits were updated. Patch submitted by
Brian Cameron <brian.cameron@oracle.com>.
2011-10-20 15:05:04 +05:30
Arun Raghavan
4ce0eb18c2 native: Fix Solaris build
tcpwrappers has some Solaris-specific quirks that need to be dealt with.
Patch submitted by Brian Cameron <brian.cameron@oracle.com>.
2011-10-20 15:04:34 +05:30
Colin Guthrie
d80a3cf56e Update LICENSE.
Some of the license wording was less than clear. Try to clarify the
different GPL 'downgrade' scenarios but also be generic to ensure that
those packagers where GPL is a problem check thoroughly before they ship.

Inspired by comments from Brian Cameron @ Oracle via fdo#41822
2011-10-20 10:05:46 +01:00
Tanu Kaskinen
12fe756993 alsa: Handle the "profile" modarg in module-alsa-card 2011-10-20 09:28:44 +05:30
Daniel Mack
9a1eee5c43 osx: module_bonjour_publish needs to be linked against libprotocol-native.la 2011-10-19 23:57:00 +01:00
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