Arun Raghavan [Thu, 10 Nov 2011 07:13:09 +0000 (12:43 +0530)]
core: Make debugging a bit simpler
This takes out a bunch of commented debug prints and puts them in
defines. Makes it easier to turn them all on/off at a single point.
Maarten Bosmans [Mon, 7 Nov 2011 18:39:34 +0000 (00:09 +0530)]
tests: Add a target for running manual tests
This adds a check-daemon make target which requires a running PulseAudio
server to test against.
Arun Raghavan [Mon, 7 Nov 2011 14:05:28 +0000 (19:35 +0530)]
echo-cancel: Make WebRTC the default canceller
Works pretty well, and isn't a CPU hog, so let's use it!
Arun Raghavan [Mon, 7 Nov 2011 14:05:05 +0000 (19:35 +0530)]
echo-cancel: Turn WebRTC analog gain control on by default
Seems to be pretty well-behaved.
Arun Raghavan [Fri, 4 Nov 2011 11:08:30 +0000 (16:38 +0530)]
echo-cancel: Hook up WebRTC analog gain control
Arun Raghavan [Fri, 4 Nov 2011 10:47:26 +0000 (16:17 +0530)]
echo-cancel: Add infrastructure for cancellers to do AGC
This adds some infrastructure for canceller implementations to also
perform acoustic gain control. Cancellers now have a couple of new API
calls that allow them to get/set capture volume.
This is made slightly complex by the fact that cancellation happens in
thread context while most volume mangling needs to be done in main
context. To deal with this, while getting the volume we save source
volume updates as they are propagated to thread context and use this
cached value for queries. To set the volume, we send an async message to
main context and let that set the source volume.
Arun Raghavan [Sun, 6 Nov 2011 13:42:19 +0000 (19:12 +0530)]
sink,source: Update sample rate if possible on stream uncork
If a stream is being uncorked and no other stream is running, we try to
update the sink/source sample rate to match it and avoid resampling.
Arun Raghavan [Mon, 7 Nov 2011 09:31:25 +0000 (15:01 +0530)]
sink,source: Allow sample rate switching with corked streams
This updates corked streams' resamplers when switching sample rates on a
sink/source, which means the restriction of allowing sample rate updates
only when no streams are attached to a sink/source is now relaxed to
preventing updates only when there is a running stream attached.
Arun Raghavan [Sun, 6 Nov 2011 12:50:01 +0000 (18:20 +0530)]
sink-input,source-output: Add an update_rate() function
This factors out the resampler updating code from finish_move() and
makes a separate function for use from other points.
Arun Raghavan [Mon, 7 Nov 2011 06:01:42 +0000 (11:31 +0530)]
sink,source: Fix corked stream handling in update_rate()
This fixes the conditional that checks for corked streams and prevents
rate updates.
Arun Raghavan [Thu, 18 Aug 2011 06:26:26 +0000 (11:56 +0530)]
cli: Add a dump-volumes command
The purpose of this command is to print all the internal volume
variables for sinks/sources and all corresponding
sink-inputs/source-outputs to make debugging and reasoning about
volume-related issues easier.
Arun Raghavan [Thu, 3 Nov 2011 13:46:47 +0000 (19:16 +0530)]
echo-cancel: Fix webrtc gain control initialisation
Lars R. Damerow [Thu, 3 Nov 2011 20:31:48 +0000 (21:31 +0100)]
alsa: fixed_latency_range modarg for module-alsa-card
Lars R. Damerow [Thu, 3 Nov 2011 20:29:03 +0000 (21:29 +0100)]
alsa: fixed latency range handling for udev-detect
Lars R. Damerow [Thu, 3 Nov 2011 20:14:45 +0000 (21:14 +0100)]
alsa: support fixed latency range in alsa modules
This adds a boolean module parameter to disable automatic dynamic
latency readjustments on underruns, but leaves automatic dynamic
watermark readjustments untouched.
Frédéric Dalleau [Tue, 4 Oct 2011 07:37:27 +0000 (09:37 +0200)]
bluetooth: Remove match for org.bluez.MediaTransport.PropertyChanged
Frédéric Dalleau [Tue, 4 Oct 2011 07:37:26 +0000 (09:37 +0200)]
bluetooth: Use static string in DBUS signal handler description
Frédéric Dalleau [Tue, 4 Oct 2011 07:37:25 +0000 (09:37 +0200)]
bluetooth: Set hfgw profile when HandsfreeGateway is playing
Allow module-bluetooth-device to listens to HandsfreeGateway state
changes using DBUS signals. When an handsfree connects, module-bluetooth-device
is loaded and goes to playing state. When the handsfree disconnect audio,
the card profile is set to "off". If the headset connects audio again after
that, the card profile should switch to "hfgw" again to match state of audio
connection.
Frédéric Dalleau [Tue, 4 Oct 2011 07:37:24 +0000 (09:37 +0200)]
bluetooth: Set off profile on SCO disconnect
Sends a message from IO thread to main thread using pa_msgobject when POLLERR
or POLLHUP is received on SCO socket.
Frédéric Dalleau [Tue, 4 Oct 2011 07:37:23 +0000 (09:37 +0200)]
bluetooth: Release MediaEnpoint if card profile is set to Off
If card profile is set to "off", the audio stream should be released.
Current implementation releases the stream when the card profile
is changed to "hsp" or "hfgw" again and immediatly reconnects after that.
Frédéric Dalleau [Tue, 4 Oct 2011 07:37:22 +0000 (09:37 +0200)]
bluetooth: Do not unload module-bluetooth-device on ERR or HUP
This happens in the following scenario :
An HandsfreeGateway connects RFCOMM and then SCO. A card appears in
PA and can be used. If for some reason, SCO is disconnected,
module-bluetooth-device is unloaded. The card will disappear, even
if RFCOMM is still connected. After that, it is not possible to
connect SCO again from PA.
Frédéric Dalleau [Tue, 4 Oct 2011 07:37:21 +0000 (09:37 +0200)]
bluetooth: Fix Media Endpoint for HandsfreeGateway
This patch will add the necessary quirks so that pulseaudio can register
an endpoint on the /MediaEndpoint/HFPHS path. This endpoint is to be
used for HFP Handsfree profile.
Arun Raghavan [Wed, 2 Nov 2011 14:10:15 +0000 (19:40 +0530)]
doc: Fix some old 0pointer.de references
Maarten Bosmans [Tue, 4 Oct 2011 12:12:20 +0000 (14:12 +0200)]
tests: Revisit which tests to run with make check
Some tests (remix-test, sig2str) only display information, so they are not
useful for automated testing. Others (interpol-test, once-test, thread-test)
do return an error on failure, so should be included in TESTS.
Maarten Bosmans [Tue, 4 Oct 2011 12:08:05 +0000 (14:08 +0200)]
tests: Rename voltest to volume-test
Maarten Bosmans [Tue, 4 Oct 2011 12:01:03 +0000 (14:01 +0200)]
tests: More useful output of make check
Instead of spilling thousands of lines of output, make check now runs the
test-suite in about 100 lines or so. If running under make check, the output of
tests is reduced. The MAKE_CHECK environment variable is used for this, so that
when running the test manually, the full output is still shown. Furthermore,
pa_log is used consistently instead of printf, so that all test output goes to
stderr by default. Colored output from make check goes to stdout.
Maarten Bosmans [Fri, 28 Oct 2011 14:30:05 +0000 (16:30 +0200)]
tests: Make sure tests assert on failures and return error status
When a test program exits with a nonzero return value (or an assert is hit),
the test is regarded as a FAIL.
This makes `make check` a little more useful.
Maarten Bosmans [Fri, 28 Oct 2011 14:24:18 +0000 (16:24 +0200)]
tests: refactor ipacl-test
Common test code is moved to a separate function.
Tanu Kaskinen [Mon, 31 Oct 2011 18:45:50 +0000 (20:45 +0200)]
sink, source: Join two ifs with the same condition.
Changes in v2:
* Moved the comment in source.c to the right place.
Arun Raghavan [Mon, 10 Oct 2011 17:01:38 +0000 (22:31 +0530)]
echo-cancel: Adapt test code for drift compensation
This dumps out an additional file with each line having a command of the
form:
p <number of playback samples processed>
c <number of capture samples processed>
d <drift as passed to set_drift()>
The test program can be provided this file to "replay" the data exactly
as when it was run live.
The non-drift-compensation path is retained as-is since it is much
simpler.
Arun Raghavan [Fri, 7 Oct 2011 10:58:11 +0000 (16:28 +0530)]
echo-cancel: Plug in WebRTC drift compensation
This adds the ability for echo cancellers to provide their own drift
compensation, and hooks in the appropriate bits to implement this in the
WebRTC canceller.
We do this by introducing an alternative model for the canceller. So
far, the core engine just provided a run() method which was given
blocksize-sized chunks of playback and record samples. The new model has
the engine provide play() and record() methods that can (in theory) be
called by the playback and capture threads. The latter would actually do
the processing required.
In addition to this a set_drift() method may be provided by the
implementation. PA will provide periodic samples of the drift to the
engine. These values need to be aggregated and processed over some time,
since the point values vary quite a bit (but generally fit a linear
regression reasonably accurately). At some point of time, we might move
the actual drift calculation into PA and change the semantics of this
function.
NOTE: This needs further testing before being deemed ready for wider use.
Johan Hedberg [Thu, 20 Oct 2011 12:47:49 +0000 (15:47 +0300)]
bluetooth: sbc: Reduce for-loop induced indentation in sbc_unpack_frame
Siarhei Siamashka [Thu, 20 Oct 2011 12:47:48 +0000 (15:47 +0300)]
bluetooth: sbc: overflow bugfix and audio decoding quality improvement
The "(((audio_sample << 1) | 1) << frame->scale_factor[ch][sb])"
part of expression
"frame->sb_sample[blk][ch][sb] =
(((audio_sample << 1) | 1) << frame->scale_factor[ch][sb]) /
levels[ch][sb] - (1 << frame->scale_factor[ch][sb])"
in "sbc_unpack_frame" function can sometimes overflow 32-bit signed int.
This problem can be reproduced by first using bitpool 128 and encoding
some random noise data, and then feeding it to sbc decoder. The obvious
thing to do would be to change "audio_sample" variable type to uint32_t.
However the problem is a little bit more complicated. According
to the section "12.6.2 Scale Factors" of A2DP spec:
scalefactor[ch][sb] = pow(2.0, (scale_factor[ch][sb] + 1))
And according to "12.6.4 Reconstruction of the Subband Samples":
sb_sample[blk][ch][sb] = scalefactor[ch][sb] *
((audio_sample[blk][ch][sb]*2.0+1.0) / levels[ch][sb]-1.0);
Hence the current code for calculating "sb_sample[blk][ch][sb]" is
not quite correct, because it loses one least significant bit of
sample data and passes twice smaller sample values to the synthesis
filter (the filter also deviates from the spec to compensate this).
This all has quite a noticeable impact on audio quality. Moreover,
it makes sense to keep a few extra bits of precision here in order
to minimize rounding errors. So the proposed patch introduces a new
SBCDEC_FIXED_EXTRA_BITS constant and uses uint64_t data type
for intermediate calculations in order to safeguard against
overflows. This patch intentionally addresses only the quality
issue, but performance can be also improved later (like replacing
division with multiplication by reciprocal).
Test for the difference of sbc encoding/decoding roundtrip vs.
the original audio file for joint stereo, bitpool 128, 8 subbands
and http://media.xiph.org/sintel/sintel-master-st.flac sample
demonstrates some quality improvement:
=== before ===
--- comparing original / sbc_encoder.exe + sbcdec ---
stddev: 4.64 PSNR: 82.97 bytes:
170495708/
170496000
=== after ===
--- comparing original / sbc_encoder.exe + sbcdec ---
stddev: 1.95 PSNR: 90.50 bytes:
170495708/
170496000
Marcel Holtmann [Fri, 26 Aug 2011 18:18:54 +0000 (11:18 -0700)]
bluetooth: audio: Update license for shared header files
The header files with constants and structures for audio specific
interaction with Pulseaudio are suppose to be under LGPL license.
For some odd reason a2dp-codecs.h ended up being under GPL license
which is against the intention of this being shared and re-used by
non-GPL programs. Fix this now to avoid any future confusion.
Arun Raghavan [Thu, 27 Oct 2011 10:49:18 +0000 (12:49 +0200)]
core: Add a string list membership check function
This adds a pa_str_in_list() to check for a given string in a
space-separated list of strings. For now, this is merely present to
avoid duplication of role matching code (intended roles can be a
space-separate list) across modules.
Arun Raghavan [Thu, 27 Oct 2011 10:54:17 +0000 (12:54 +0200)]
doc: Correct intended roles property documentation
The documentation says we expect a comma-separate list of intended
roles, but the code splits the string on whitespaces, so this corrects
the documentation to match the implementation.
Dylan Reid [Wed, 26 Oct 2011 03:34:31 +0000 (20:34 -0700)]
alsa: Set return code before printing it.
The error message for snd_pcm_hw_params_set_period_wakeup was
printing "ret", but "ret" wasn't being set.
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Colin Guthrie [Mon, 24 Oct 2011 21:51:20 +0000 (23:51 +0200)]
role-cork: Allow module-role-cork to act globally.
Allow a module argument to specify that we should act globally
rather than just within a given sink.
The default value is to not opporate globally thus retaining the
current behaviour.
Colin Guthrie [Mon, 24 Oct 2011 21:35:38 +0000 (23:35 +0200)]
role-cork: Make module-role-cork more generic.
Operate on a list of 'trigger roles' and 'cork roles'. i.e.
react to any stream with a role in the trigger list and apply a
cork to any stream with the a role in the cork list.
The trigger roles default to 'phone' and the cork roles default
to both 'music' and 'video' thus achieving the same functionality
as currently when called without any arguments.
Colin Guthrie [Mon, 24 Oct 2011 20:55:45 +0000 (22:55 +0200)]
role-cork: Rename module-cork-music-on-phone to module-role-cork.
This module will be extended to be a bit more generic so the
old name will soon be obsolete.
Arun Raghavan [Fri, 21 Oct 2011 04:37:31 +0000 (10:07 +0530)]
gitignore: Update for recent additions
Adds echo-cancel-test and new cmake files
Colin Guthrie [Thu, 20 Oct 2011 13:11:53 +0000 (14:11 +0100)]
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.
Arun Raghavan [Thu, 20 Oct 2011 09:16:23 +0000 (14:46 +0530)]
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>.
Arun Raghavan [Thu, 20 Oct 2011 09:14:22 +0000 (14:44 +0530)]
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>.
Colin Guthrie [Thu, 20 Oct 2011 09:04:49 +0000 (10:04 +0100)]
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
Tanu Kaskinen [Mon, 3 Oct 2011 15:11:47 +0000 (18:11 +0300)]
alsa: Handle the "profile" modarg in module-alsa-card
Daniel Mack [Mon, 17 Oct 2011 09:33:27 +0000 (11:33 +0200)]
osx: module_bonjour_publish needs to be linked against libprotocol-native.la
Colin Guthrie [Tue, 11 Oct 2011 19:42:42 +0000 (20:42 +0100)]
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.
Arun Raghavan [Tue, 18 Oct 2011 04:23:20 +0000 (09:53 +0530)]
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).
Pierre-Louis Bossart [Mon, 17 Oct 2011 19:43:50 +0000 (14:43 -0500)]
alsa: fix list of sampling rates
add all standard audio rates
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Arun Raghavan [Mon, 17 Oct 2011 17:16:06 +0000 (22:46 +0530)]
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.
Arun Raghavan [Mon, 17 Oct 2011 15:46:23 +0000 (21:16 +0530)]
alsa: Remove unused variable
Arun Raghavan [Mon, 17 Oct 2011 14:33:52 +0000 (20:03 +0530)]
sink,source: Handle equal default and alternate sample rates
Arun Raghavan [Mon, 17 Oct 2011 14:31:03 +0000 (20:01 +0530)]
sink,source: Add the ability to disable alternat sample rate switching
Setting the alternate sample rate to 0 in config disables this feature.
Arun Raghavan [Mon, 10 Oct 2011 19:17:56 +0000 (00:47 +0530)]
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.
Pierre-Louis Bossart [Tue, 2 Aug 2011 23:37:29 +0000 (18:37 -0500)]
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>
Pierre-Louis Bossart [Tue, 2 Aug 2011 23:37:28 +0000 (18:37 -0500)]
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>
Pierre-Louis Bossart [Tue, 2 Aug 2011 23:37:27 +0000 (18:37 -0500)]
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>
Arun Raghavan [Mon, 17 Oct 2011 11:39:24 +0000 (17:09 +0530)]
build-sys: Minor CXXFLAGS fix
Set it on echo-cancel-test only if webrtc support is enabled.
Arun Raghavan [Mon, 19 Sep 2011 08:11:13 +0000 (13:41 +0530)]
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++.
Arun Raghavan [Mon, 19 Sep 2011 08:08:03 +0000 (13:38 +0530)]
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.
Arun Raghavan [Mon, 17 Oct 2011 10:25:51 +0000 (15:55 +0530)]
echo-cancel: Simplify checking if AEC is active
This removes the active_mask bits and just check source and sink states
directly.
Tanu Kaskinen [Thu, 6 Oct 2011 20:09:15 +0000 (23:09 +0300)]
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.
David Henningsson [Thu, 13 Oct 2011 15:30:39 +0000 (17:30 +0200)]
Fix deferred volume not being applied if sink is closed
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Arun Raghavan [Mon, 17 Oct 2011 04:12:25 +0000 (09:42 +0530)]
build-sys: Drop libsamplerate from pulsecommon deps
This was erroneously added in:
commit
d766b38e1ba5d483ad7eec105860e9b9f7f55702
build: Remove unnecessary flags in AM_CFLAGS
Arun Raghavan [Wed, 12 Oct 2011 12:14:30 +0000 (17:44 +0530)]
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.
Maarten Bosmans [Mon, 10 Oct 2011 10:28:22 +0000 (12:28 +0200)]
qpaeq: Make it python3 and python2 compatible
Arun Raghavan [Wed, 12 Oct 2011 07:34:57 +0000 (13:04 +0530)]
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.
Maarten Bosmans [Wed, 12 Oct 2011 05:35:14 +0000 (07:35 +0200)]
tests: Fix calculation of memblock size in resampler-test
And remove useless volume scaling.
Tanu Kaskinen [Thu, 6 Oct 2011 20:28:37 +0000 (23:28 +0300)]
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
Maarten Bosmans [Mon, 10 Oct 2011 07:27:17 +0000 (09:27 +0200)]
pacat: Fail early if the media name cannot be set
Otherwise you get an "invalid argument" error from pa_stream_new later.
Maarten Bosmans [Mon, 10 Oct 2011 07:27:16 +0000 (09:27 +0200)]
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.
Arun Raghavan [Mon, 10 Oct 2011 16:47:55 +0000 (22:17 +0530)]
echo-cancel: Close debug files on module unload
Arun Raghavan [Wed, 28 Sep 2011 08:58:32 +0000 (14:28 +0530)]
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
Arun Raghavan [Wed, 5 Oct 2011 07:43:38 +0000 (13:13 +0530)]
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.
Arun Raghavan [Wed, 5 Oct 2011 06:59:10 +0000 (12:29 +0530)]
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.
Arun Raghavan [Thu, 29 Sep 2011 07:19:11 +0000 (12:49 +0530)]
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.
Arun Raghavan [Wed, 5 Oct 2011 08:11:43 +0000 (13:41 +0530)]
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.
Arun Raghavan [Thu, 6 Oct 2011 09:06:50 +0000 (14:36 +0530)]
echo-cancel: Don't crash if adjust_time = 0
Arun Raghavan [Thu, 29 Sep 2011 04:47:37 +0000 (10:17 +0530)]
echo-cancel: Remove redundant variable
Arun Raghavan [Mon, 26 Sep 2011 16:00:49 +0000 (21:30 +0530)]
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.
Pierre-Louis Bossart [Fri, 7 Oct 2011 23:12:32 +0000 (18:12 -0500)]
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>
David Henningsson [Wed, 5 Oct 2011 09:15:53 +0000 (11:15 +0200)]
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")
David Henningsson [Wed, 5 Oct 2011 08:28:50 +0000 (10:28 +0200)]
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>
Arun Raghavan [Tue, 4 Oct 2011 19:28:52 +0000 (00:58 +0530)]
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.
Maarten Bosmans [Mon, 3 Oct 2011 18:09:06 +0000 (20:09 +0200)]
doc: Add some more doxygen tags to existing comments
Arun Raghavan [Tue, 4 Oct 2011 08:36:26 +0000 (14:06 +0530)]
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.
Arun Raghavan [Tue, 4 Oct 2011 04:59:03 +0000 (10:29 +0530)]
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.
Arun Raghavan [Tue, 4 Oct 2011 05:35:59 +0000 (11:05 +0530)]
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).
Maarten Bosmans [Wed, 28 Sep 2011 07:50:26 +0000 (09:50 +0200)]
Make pulse build with clang again
The casts are not supported there.
Sudarshan Bisht [Fri, 30 Sep 2011 09:49:54 +0000 (12:49 +0300)]
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.
Daniel Mack [Thu, 29 Sep 2011 11:25:12 +0000 (13:25 +0200)]
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.
Tanu Kaskinen [Fri, 30 Sep 2011 14:09:29 +0000 (17:09 +0300)]
doc: Add an example stream-restore fallback table file.
Marc-André Lureau [Sat, 1 Oct 2011 11:16:35 +0000 (12:16 +0100)]
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.
Tanu Kaskinen [Thu, 29 Sep 2011 15:54:03 +0000 (18:54 +0300)]
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.
Tanu Kaskinen [Thu, 29 Sep 2011 15:54:02 +0000 (18:54 +0300)]
sink: Add some comments about the rewind handling during stream moves.
Tanu Kaskinen [Thu, 29 Sep 2011 15:54:01 +0000 (18:54 +0300)]
sink: Move updating the requested latency after the rewind request when finishing a stream move.
Colin Guthrie [Sat, 1 Oct 2011 11:03:44 +0000 (12:03 +0100)]
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.
Arun Raghavan [Tue, 27 Sep 2011 16:22:24 +0000 (21:52 +0530)]
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.
Arun Raghavan [Tue, 27 Sep 2011 13:27:48 +0000 (18:57 +0530)]
extended: Fix doxygen comment style typos
Thanks to Rémi Denis-Courmont for pointing this out on IRC.