Commit graph

5117 commits

Author SHA1 Message Date
Arun Raghavan
d866adee0e echo-cancel: Use S16NE for adrian module
This forces us to get native-endian samples in the adrian module so that
we can rely on the existing endianness conversion mechanisms instead of
doing it in the module.
2011-03-28 14:41:00 +05:30
Arun Raghavan
1212a6fd78 echo-cancel: Ensure correct handling of endianness
The adrian module was using home-brewed endianness conversion instead of
the appropriate mactos, and speex assumed a little-endian host. This
fixes both of these.
2011-03-28 14:41:00 +05:30
Arun Raghavan
d8fab8429d echo-cancel: Fix out-of-tree build 2011-03-28 14:41:00 +05:30
Rico Tzschichholz
d39043c30c echo-cancel: Fix make distcheck
Add missing files to module_echo_cancel_la_SOURCES
Add Adrian license file to EXTRA_DIST
2011-03-28 14:41:00 +05:30
Wim Taymans
e9364476e4 echo-cancel: pause timer when echo canceling is off
While the sink or source is in the suspended state, disable the timer
callback because we are not doing any echo canceling then.
2011-03-28 14:41:00 +05:30
Wim Taymans
56a46842f8 echo-cancel: improve accuracy
Make the echo canceler drift up to 1ms now that things are more accurate.
Add 10 samples of headroom to allow for timing inaccuracies.
2011-03-28 14:41:00 +05:30
Wim Taymans
9f79c0ebb1 echo-cancel: rework alignment code
Rework the code to align capture and playback samples so that we can keep more
accurate timings.
2011-03-28 14:41:00 +05:30
Arun Raghavan
2923c5eb68 echo-cancel: Mark immutable parameters as const in vfunc
Marks the recording and playback streams as const in the
pa_echo_canceller->run method for clarity.
2011-03-28 14:41:00 +05:30
Arun Raghavan
b6b8a7b7a7 echo-cancel: Make blocksize a module-wide parameter
Since all algorithms will need to specify a block size (the amount of
data to be processed together), we make this a common parameter and have
the implementation set it at initialisation time.
2011-03-28 14:41:00 +05:30
Arun Raghavan
4a9fa8cc7f echo-cancel: Allow selection of AEC method using modargs
This adds an "aec_method" module argument to allow us to select the AEC
implementation to use.
2011-03-28 14:41:00 +05:30
Arun Raghavan
47e4dd1ec4 echo-cancel: Add alternative echo-cancellation implementation
This adds Andre Adrian's AEC implementation from his intercom project
(http://andreadrian.de/intercom/) as an alternative to the speex echo
cancellation routines. Since the implementation was in C++ and not in
the form of a library, I have converted the code to C and made a local
copy of the implementation.

The implementation actually works on floating point data, so we can
tweak it to work with both integer and floating point samples (currently
we just use S16LE).
2011-03-28 14:41:00 +05:30
Arun Raghavan
c975dfa5a5 echo-cancel: Let AEC module determine source/sink spec
Since the source and sink specification will need to be determined by
the AEC algorithm (can it handle multi-channel audio, does it work with
a fixed sample rate, etc.), we negotiate these using inout parameters at
initialisation time.

There is opportunity to make the sink-handling more elegant. Since the
sink data isn't used for playback (just processing), we could pass
through the data as-is and resample to the required spec before using in
the cancellation algorithm. This isn't too important immediately, but
would be nice to have.
2011-03-28 14:41:00 +05:30
Arun Raghavan
668f4e49b6 echo-cancel: Pass arguments to the specific canceller module
This allows us to tweak module parameters for whichever AEC module is
chosen.
2011-03-28 14:40:59 +05:30
Arun Raghavan
57c5983937 echo-cancel: Split out speex code from the core module
This splits out the echo-cancelling core from the PA-specific bits to
allow us to plug in other echo-cancellation engines.
2011-03-28 14:40:59 +05:30
Arun Raghavan
6d8a90709e echo-cancel: Move the module into it's own directory
This will make splitting out the canceller parts cleaner.
2011-03-28 14:40:59 +05:30
Wim Taymans
b30bf121d2 echo-cancel: keep frame_size a power of 2
The speex echo canceler prefers a power of 2 for the frame size. Round down the
ideal frame_size to the nearest power of two. This makes sure we don't create
more than the requested frame_size_ms latency while still providing a power of 2
to the speex echo canceller.
2011-03-28 14:40:59 +05:30
Wim Taymans
1c2669452b echo-cancel: improve debug 2011-03-28 14:40:59 +05:30
Wim Taymans
de6cdf9487 echo-cancel: tweak the resync code a little
Try to keep the drift between source and sink within 4ms now that we have more
accurate timings.
Don't force a resync on latency changes but let the drift code handle it.
2011-03-28 14:40:59 +05:30
Wim Taymans
7b972f5a45 echo-cancel: use the phone media role
Tag the source and sink with the phone media roles so that they automatially
connect to phone streams such as Empathy when using the intended-rols module.
2011-03-28 14:40:59 +05:30
Wim Taymans
9fa71e75e5 echo-cancel: take into account snapshot delay
Take into account the delay between taking the snapshot from the source and the
sink. Improves the quality of the timings.
2011-03-28 14:40:59 +05:30
Wim Taymans
1a8cf00ba0 make echo-cancel module that exposes a new sink and source
Make a new echo-cancel module that exposes a new sink and source. All data sent
to the sink is matched against the data captured from the source and
echo-canceled using the speex echo canceler.
2011-03-28 14:40:59 +05:30
Lennart Poettering
c524b4c5b5 memblockq: implement new call pa_memblockq_peek_fixed_size() 2011-03-28 14:40:59 +05:30
Colin Guthrie
9f52c10646 vala: Fix path error in the last commit. 2011-03-26 12:42:57 +00:00
Alexander Kurtz
64985aa9bb vala: move GLibMainLoop class into separate file to fix linker errors
Vala uses the name of the *.vapi file to determine the libraries to link
against. Since the pa_glib_mainloop_*() functions are in a separate
library (libpulse-mainloop-glib.so) the corresponding objects in the
Vala bindings have to be in a separate *.vapi file.

If you are compiling an app without the GLib integration you could use:
 $ valac --pkg=libpulse test.vala
but if you do use GLib you can use:
 $ valac --pkg=libpulse-mainloop-glib test.vala
(libpulse is a dep of the libpulse-mainloop-glib so no need to specify
it explicitly)
2011-03-26 11:33:54 +00:00
Sean McNamara
ea0a2a603c vala: delegate FreeCb does not have a target. 2011-03-25 09:15:15 +00:00
Alexander Kurtz
4fa7495a31 vala: Some bugfixes for the vala bindings
1. PA uses Vala's "Posix" package (see line 23 of libpulse.vapi).
    These dependencies have to be declared in the *.deps file.

 2. Fix obvious copy/paste error.

 3. Rename the parameter to match the C function. This simplifies
    understanding what this parameter means.

 4. According to the official documentation the "dev" parameter
    for playback/capture streams on connection may be NULL and this
    is the default. Change the method definition accordingly.
2011-03-25 09:15:09 +00:00
Colin Guthrie
b872254762 volume: Add a PA_VOLUME_UI_MAX define for the recommended max volume to show in UIs
This value is not a technical upper limit, it's just a 'sensible'
value that is not crazy high, but also allows software amplification
above 0dB (aka 100%) for very quiet audio sources.

We recommend that a comprehensive volume control UI should allow
users to set volumes up to this limit, although of course should
deal gracefully if the user has set the volume even higher than this
without resulting in a feedback loop that effectively limits the
upper volume.

The value chosen is +11dB. This was selected somewhat subjectively
and is very similar to the current 150% that gnome-volume-control
uses (which is ~+10.57dB).

On the plus side, we now recommend that everyone allows
'Volumes up to 11' which is pretty awesome.
http://en.wikipedia.org/wiki/Up_to_eleven

https://tango.0pointer.de/pipermail/pulseaudio-discuss/2010-April/006945.html
https://tango.0pointer.de/pipermail/pulseaudio-discuss/2010-April/006950.html
2011-03-03 13:29:08 +00:00
Colin Guthrie
a8cd9d2880 conf: Make system.pa use udev-detect and not hal-detect.
Also fix a left over reference to HAL in default.pa
2011-03-03 09:37:29 +00:00
Maarten Bosmans
2ee4ec507c module-rtp-recv: Remove smoother from write index
It isn't necessary anymore with the new algorithm.  The slow adjust of the
smoother was even detrimental to the accuracy of the rate estimate.
2011-02-25 10:34:50 +00:00
Maarten Bosmans
2bfc0322c9 module-rtp-recv: Average the estimated real sample rate 2011-02-25 10:34:46 +00:00
Maarten Bosmans
46200391f3 module-rtp-recv: Use new algorithm for adjusting sample rate 2011-02-25 10:34:41 +00:00
Maarten Bosmans
90c5520e03 Limit rate adjustments to small, inaudible jumps
The same logic is applied to the sample rate adjustments in module-rtp-recv,
module-loopback and module-combine:
 - Each time an adjustment is made, the new rate can differ at most 2‰ from the
   old rate.  Such a step is equal to 3.5 cents (a cent is 1/100th of a
   semitone) and as 5 cents is generally considered the smallest observable
   difference in pitch, this results in inaudible adjustments.
 - The sample rate of the stream can only differ from the rate of the
   corresponding sink by 25%.  As these adjustments are meant to account for
   very small clock drifts, any large deviation from the base rate suggests
   something is seriously wrong.
 - If the calculated rate is within 20Hz of the base rate, set it to the base
   rate.  This saves CPU because no resampling is necessary.
2011-02-25 10:34:37 +00:00
Maarten Bosmans
09770e5779 module-loopback: Add adjust_time to valid args 2011-02-25 10:34:33 +00:00
Arun Raghavan
67d188894c client: Don't update smoother while corked
This prevents the smoother attached to the stream clock from being
updated while the stream is corked, which in turn ensures that once
corking is completed, pa_stream_get_time() always returns the same value
until the stream is uncorked - i.e., the clock does not advance when the
client believes that it will not.

The actual call to pa_smoother_put() happens on things like stream
suspend/unsuspend, which trigger timing updates. This changes the
smoother coefficients, which means that a call to pa_smoother_get() for
the same value of 'x' can return different values before and after a
timing update.
2011-02-01 10:38:27 +00:00
David Henningsson
6b280e97e3 Fighting rewinds: Reduce calls to handle_seek
If many small blocks are in queue, handle_seek is being called
for every one of them, sometimes causing a rewind. Delay the
call until all blocks are handled, then call handle_seek only
once.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-01-31 11:38:55 +00:00
David Henningsson
3aeb047282 Fighting rewinds: Seek and write data in the same message
Allow a message in the queue to perform both a seek and a post data.
For clients that do not use PA_SEEK_RELATIVE (e g gstreamer), this
cuts the message count - and sometimes even the rewinds - in half.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-01-31 11:38:44 +00:00
Scott Reeves
1e1b299784 Core: Fix incorrect check of return value 2011-01-23 14:19:39 +00:00
Colin Guthrie
408072519e tunnel: Fix automatic names when source/sink_name argument is missing.
Spotted by palmerdabbelt via #894
2011-01-23 13:12:15 +00:00
Lennart Poettering
ec5a785712 ratelimit: fix log levels of log suppression messages
When logging a suppression message do so on the same log level as the
suppressed messages.
2011-01-22 01:08:36 +01:00
Colin Guthrie
eb966f7455 build-sys: Make --disable-dbus actually work.
Previously this argument passed to configure only worked if --disable-hal and
--disable-bluez was also passed which wasn't immediately obvious to the
untrained compiler.

This change simply makes --disable-dbus disable the other two as well
and errors out of specific, incompatible --enable/--disable flags
are provided.

The summary table is also adjusted and intended to try and show the
dependency relationship a little.
2011-01-11 11:32:07 +00:00
Colin Guthrie
8f8d247386 build-sys: Mention dbus support in the summary 2011-01-11 11:31:57 +00:00
Colin Guthrie
b3ff4f400f build-sys: Put in specific warnings when there is no udev or DBUS support
Users have often come to me when their build doesn't work and typically
this is when they do not have dev headers for DBUS and udev installed
when building. Put in some specific warnings about these optional,
but critical, elements.

This will likely display this message on platforms where they are not
available, so patches welcome to hide them in a semi-intelligent way.
2011-01-11 11:27:43 +00:00
Colin Guthrie
862bbee309 console-kit: Console Kit support is dependent on DBUS and is thus optional.
Therefore, we must reflect this in the default.pa. Several users
have reported an error with consolekit when starting a self-built PA
due to the default config not working properly. This works around the
issue but we should include a warning on configure about the lack of
DBUS and udev support as this is a common mistake.
2011-01-11 11:27:30 +00:00
Michal Schmidt
7cb1401eae padsp: wrap __open_2 and __open64_2
These functions are used in OSS programs where the "flags" parameter for
open() is not a build-time constant and the build has _FORTIFY_SOURCE
enabled.
2011-01-10 20:49:56 +00:00
Chen Rui
6f870f501d fix bug about get source-output status 2010-12-20 11:30:49 +00:00
Zhang Wanming
4269b05b97 Fix typos 2010-12-20 11:08:31 +00:00
Daniel T Chen
1c83b03c27 Further clarify src- and speex- references in pulse-daemon.conf
Based on comments from Arun Raghavan, make clear that we're referring
to the libspeex API documentation for the speex- options. Also correct
the quality range (was incorrectly 0..9 but is 0..10 now) and clean up
the line length.

Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
2010-12-19 15:28:44 +00:00
Vincent Becker
84c8b23c7f Fix return value of pa_sndfile_format_from_string
This prevented to use pacat --file-format option correctly
2010-12-18 11:25:09 +00:00
Yang Xichuan
d963b868de core: Fix variable "has_whined" value bug
In the file src/pulsecore/random.c

I found that the log information "Failed to get proper entropy. Falling
back to seeding with current time." would never be printed.

This change corrects the issue.
2010-12-18 11:21:02 +00:00
Daniel T Chen
52e3268c9f trivial: Mention speex as a resampler reference in pulse-daemon.conf
A Debian user seemed confused that the man page for pulse-daemon.conf
does not refer to the libspeex API Resampler for use in PulseAudio's
*-src. Fix it by explicitly mentioning speex.

(http://bugs.debian.org/541206)

Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
2010-12-18 11:11:45 +00:00