Commit graph

5131 commits

Author SHA1 Message Date
Forest Bond
cc91a8f4b4 module-combine-sink: Initialize smoother with offset pa_rtclock_now()
The smoother was being initialized with offset zero, which caused
the sink latency to be unconditionally reported as zero.
2011-06-05 21:25:44 +02:00
Colin Guthrie
d4c9ad179b streams: Fix the actual resampler method shown in debug messages. 2011-06-05 21:24:07 +02:00
Lennart Poettering
f8e8a038a3 rtkit: use private bus connection in order to avoid threading issues when invoking pa_make_realtime() 2011-05-11 10:55:46 +01:00
Arnaud Fontaine
b72fc9b4f1 x11: More XCB fixes.
Commit 65ef80b fixed building with xcb-util >= 0.3.8, but the reply is never
checked (possible SIGSEGV if the reply is NULL) nor freed (memory leak at each
call of the functions).

Also, remove include and dependencies on xcb-atom, as it was only meaningful
for xcb_atom_get() and STRING, and depend instead on xcb >= 1.6 for
XCB_ATOM_STRING.
2011-05-07 17:01:28 +01:00
Maciej Grela
7fd0771522 x11: Fix build errors with newest xcb-util.
The xcb_atom_get functions were removed from xcb-util. Changed these to
xcb_intern_atom/xcb_intern_atom_reply. Also, STRING is now
XCB_ATOM_STRING.
2011-05-07 17:01:17 +01:00
Alexander Kurtz
3bb6546548 vala: More vala fixes
1. Remove the "has_destroy_function=false" attribute. It was only
necessary because of a bug in vala which is fixed in 0.12. [1]

2. Add sizes to all fixed-size arrays to make vala recognize them as
such. Using symbolic constants for this is not yet supported. [2]

3. CardInfo struct: Move the brackets in the list of available profiles
to the type to make it clear that this is a dynamically-sized array. [3]

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=622773
[2] https://bugzilla.gnome.org/show_bug.cgi?id=647788
[3] http://0pointer.de/lennart/projects/pulseaudio/doxygen/structpa__card__info.html
2011-04-19 11:20:59 +01:00
Matthijs Kooijman
4f677758b5 http: support HTTP HEAD
http://pulseaudio.org/ticket/781
2011-04-15 20:32:16 +02:00
Sean McNamara
93e7a19ee6 vala: ChannelMap has no destroy function. 2011-03-31 12:13:38 +01:00
David Henningsson
fd5b282f51 module-jack-sink/source: protect against null return in jack_get_ports
Just picking up a crash report from Ubuntu, here's the result.

--
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic

From 934c52c79bb6faed56a64d6e15f9b285f687afee Mon Sep 17 00:00:00 2001
From: David Henningsson <david.henningsson@canonical.com>
Date: Mon, 28 Mar 2011 14:30:44 +0200
Subject: [PATCH] module-jack-sink/source: protect against null return in jack_get_ports

According to jack_get_ports documentation, it seems like returning NULL
is valid, and that it should be freed using jack_free.

Reported-by: Grayson Peddie
BugLink: http://bugs.launchpad.net/bugs/733424
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-03-28 15:01:05 +01:00
Jyri Sarha
4be49ae94b build-sys: Link lirc libraries in right order
Wrong order of libraries causes libtool to link primarily from lirc
library location and not from $(libdir) location in install
phase. This is a problem if you have an older version pulseaudio libs
installed under same directory as liblirc and you are building a
newer version with some other directory prefix.
2011-03-28 19:04:33 +05:30
Jyri Sarha
c25207fc17 build-sys: Link binaries linking libpulsecommon to libpulse too
Build fails if a symbol is removed from from libpulsecommon. Linking
explicitly to libpulse fixes the problem.
2011-03-28 19:03:45 +05:30
Jyri Sarha
1ade8dfe43 build-sys: Link binaries linking libpulse to libpulsecommon too
Build appeared to fails when a new function is added to
libpulsecommon. This is because build uses libpulsecommon that is
installed into system instead of the one that is being built. Explicit
linking to libpulsecommon fixes the problem.
2011-03-28 18:59:34 +05:30
Arun Raghavan
6664650bd5 i18n: Update POTFILES.*
Add new modules, and skip module-virtual-sink for i18n since it's really
meant to be a template for writing other modules.
2011-03-28 14:41:00 +05:30
Arun Raghavan
f93b5e1869 echo-cancel: Fix source may_move_to function
This is required to make sure that the source output between
module-echo-cancel and ALSA can't get plugged to the virtual source or
monitor of the virtual sink that we expose. This could be triggered by
changing the profile of the underlying ALSA device.
2011-03-28 14:41:00 +05:30
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