Commit graph

5393 commits

Author SHA1 Message Date
Colin Guthrie
5e442f4e0e augment-properties: Fix debug messages and statement bracketing. 2010-10-06 09:17:01 +01:00
Colin Guthrie
b6be95ef53 sink-input: Fix comment 2010-10-01 01:39:35 +01:00
Colin Guthrie
d195a54979 suspend: Do not assert when checking for device suspended status and a stream is not linked.
When looping through the streams on a given device checking to see if the
stream is 'active' there should be no assert if the stream is not linked, it
should simply be ignored.

This assert can be hit if a sink and a sink input are both created and setup
but the final put calls are left to the end as is done in module-ladspa-sink.

While the order of the calls in module-ladspa-sink could be altered, we should
deal gracefully with the way it is now and not complain about ending up
in this state.

A trigger case was trivial:
 1. Load a ladspa-sink.
 2. Play a stream and move it to it.
 3. Unload the module, then reload it.
 4. Due to module-stream-restore and module-suspend-on-idle, the hook callbacks
    will ultimately hit this assert.

Thanks to Kim Therkelsen for highlighting this issue.
2010-10-01 01:39:35 +01:00
Colin Guthrie
b02abcb613 device-manager: Ensure that sinks/sources populate the device manager lists in order of their priority.
Currently the order of the sinks is simply that of their position in the idxset which is certainly
not what the user would want.
2010-09-29 22:08:37 +01:00
Colin Guthrie
098e9ea1fb augment-properties: Search for .desktop files in subfolders too. 2010-09-29 22:06:01 +01:00
Arun Raghavan
f25676c2bb build: Copy orc dist files to the correct directory 2010-09-29 16:40:27 +01:00
Arun Raghavan
b424008160 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.
2010-09-27 16:57:01 +05:30
Arun Raghavan
6897217d26 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.
2010-09-23 17:46:00 +05:30
Arun Raghavan
83d3c8f22b echo-cancel: orc-ify some bits for optimisation
This uses Orc to optimise an inner loop in the core NLMS function of the
Adrian echo canceller.
2010-09-23 17:17:03 +05:30
Arun Raghavan
963250abb9 echo-cancel: Add SSE optimisation to the adrian module
Optimises the core inner-product function, which takes the most CPU. The
SSE-optimised bits of the adrian echo canceller only if the CPU that PA
is running on actually supports SSE.
2010-09-23 17:17:03 +05:30
Arun Raghavan
ab4223e9cf cpu: Add CPU information to pa_core
This retains CPU information (processor type and supported features) in
pa_core, so that this information can be used by modules at init time to
figure out what optimisations may be used.
2010-09-23 17:17:03 +05:30
Arun Raghavan
ffcf3c8a6c build: Fix make distcheck
src/utils/qpaeq was not being dist'ed
2010-09-23 17:17:03 +05:30
Arun Raghavan
395dae4d1a echo-cancel: Fix out-of-tree build 2010-09-20 14:08:16 +05:30
Colin Guthrie
f73e9c19f7 x11: Use the default screen for X11 properties.
This commit restores the functionality originally included in 65e807
by Leszek Koltunski.
2010-09-18 12:05:38 +01:00
Colin Guthrie
c0e045d003 xcb: xcb_get_setup() can return 0, so make sure we check it before using 2010-09-18 12:05:26 +01:00
Colin Guthrie
24014e779c xcb: Ensure the XCB connection is valid before using it. 2010-09-18 12:05:19 +01:00
Colin Guthrie
38778117f8 x11: Partially convert to XCB.
This commit mostly converts the X11 handling to XCB. There are still
some uses of XLib to deal with the X11 session handling modules, however all
client-side code should now be free of XLib and thus this should fix Bug #799

Note that this removes the screen-based changes by Leszek Koltunski
in 65e80, however this will be restored in due course.
2010-09-18 12:04:09 +01:00
Colin Guthrie
2ecd764662 alsa: Only set the 'first' flag to false when we actually call snd_pcm_start()
Previously, if work_done was false, we could conceivably not call snd_pcm_start().
2010-09-14 19:44:57 +01:00
Colin Guthrie
f97faae006 alsa: Set the rewind safeguard proportionally to sample spec
Currently when rewinding alsa, a fixed value of 256 bytes is used,
which represents 1.33ms @ 48kHz (2ch, 16bit). This is typically fine
and due to DMA constraints we would not want to rewind less than this.

However with more demanding sample specs, (e.g. 8ch 192kHz 32bit)
256 bytes is likely not sufficient, so calculate what 1.33ms would
be and use which ever value is bigger.

Discussed with David Henningsson and Pierre-Louis Bossart here:
 http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/7286
2010-09-14 08:32:51 +01:00
Daniel Mack
d30d22dfb8 alsa-mixer: add profile for Traktor Kontrol S4
This new audio interface from Native Instruments has 2 stereo channels
for both input and output direction. This patch adds mappings for them.
2010-09-12 13:15:36 +01:00
Rico Tzschichholz
49a90649e0 echo-cancel: Fix make distcheck
Add missing files to module_echo_cancel_la_SOURCES
Add Adrian license file to EXTRA_DIST
2010-09-10 12:11:51 +01:00
Wim Taymans
26dfacf20b 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.
2010-09-09 17:03:46 +01:00
Wim Taymans
7b873785ca 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.
2010-09-09 17:03:45 +01:00
Wim Taymans
c47d689613 alsa: make defines for smoother configuration
Make new defines for the smoother window size and adjust time constants instead
of reusing some unrelated constant.

Increase the smoother window size even more because the bigger it is, the
better. Since we have a 200ms max update interval and the max smoother history
is 64 entries, 10seconds is a good default.

Decrease the smoother adjust time to 1 second. The previous value of 4 seconds
was too much to adapt quickly after a resume.
2010-09-09 17:03:45 +01:00
Wim Taymans
771fb0b59b echo-cancel: rework alignment code
Rework the code to align capture and playback samples so that we can keep more
accurate timings.
2010-09-09 17:03:45 +01:00
Wim Taymans
f29acfd0e0 alsa: work around slightly broken _delay implementations
Use snd_pcm_avail_delay() in pa_alsa_safe_delay() so that we can check the delay
value against the avail value and patch it up when it looks invalid. Only do
this for capture.
2010-09-09 17:03:34 +01:00
Wim Taymans
b0042cec71 alsa-time-test: make test usable for capture too
Extend the test to also work for capture devices.
2010-09-07 12:23:14 +02:00
Wim Taymans
e382589d84 alsa-source: refactor smoother and device start
Move the code to start the capture and the smoother closer together to improve
smoother accuracy.
Rework things to look more like the alsa sink where the device is started in
only one place.
2010-09-07 12:22:51 +02:00
Wim Taymans
2ee7cd15b3 smoother: avoid losing precision
Avoid losing precision by subtracting uint64 values before converting them to
doubles.
2010-09-07 12:07:24 +02:00
Arun Raghavan
c36ab6896f 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.
2010-09-07 15:12:12 +05:30
Arun Raghavan
948a3d042c 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.
2010-09-07 15:12:12 +05:30
Arun Raghavan
33a3bc34c8 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.
2010-09-07 15:12:12 +05:30
Arun Raghavan
526277c97c 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).
2010-09-07 15:12:12 +05:30
Arun Raghavan
126e1336b2 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.
2010-09-07 15:12:12 +05:30
Arun Raghavan
21001f49a4 echo-cancel: Pass arguments to the specific canceller module
This allows us to tweak module parameters for whichever AEC module is
chosen.
2010-09-07 15:12:12 +05:30
Arun Raghavan
e7177680d1 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.
2010-09-07 15:12:12 +05:30
Arun Raghavan
10937e4054 echo-cancel: Move the module into it's own directory
This will make splitting out the canceller parts cleaner.
2010-09-07 15:12:12 +05:30
Colin Guthrie
d0f91b1cf7 cli: Allow .include on directories as well as files.
When .including a directory, all files with the extension '.pa'
in that folder will be parsed in alphabetical order.
2010-09-04 17:07:23 +01:00
Wim Taymans
dc5ec2c296 alsa: increase the smoother window
40ms for the smoother window is too small. Increase the size to 4 seconds, like
we do for the sinks.
2010-09-03 16:49:03 +02:00
Wim Taymans
d18cae458f 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.
2010-09-02 17:31:37 +02:00
Wim Taymans
1983337f0e echo-cancel: improve debug 2010-09-02 17:31:36 +02:00
Wim Taymans
c3cc461bf5 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.
2010-09-02 17:31:36 +02:00
Wim Taymans
95bdf67500 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.
2010-09-02 17:31:36 +02:00
Tanu Kaskinen
a543af539c alsa-sink/source: Use the "namereg_fail" module argument.
This allows the name registry to mangle the names of auto-detected sinks and
sources to be unique, which makes it possible to load multiple identical sound
cards using module-udev-detect.

At least for now the module argument can only be passed through
module-alsa-card.
2010-08-30 18:34:41 +03:00
Tanu Kaskinen
0525807b63 alsa-sink: Get rid of a compiler warning regarding rewind_safeguard type.
GCC gave a warning, because the pointer given to pa_modargs_get_value_u32() had
type size_t instead of uint32_t.
2010-08-24 18:19:49 +03:00
Tanu Kaskinen
6e33845783 module-udev-detect: When loading module-alsa-card, use namereg_fail=false. 2010-08-24 18:19:49 +03:00
Tanu Kaskinen
c277dc65a3 module-alsa-card: New argument: namereg_fail.
This is added so that module-udev-detect can load multiple module-alsa-card
instances with the same card name - forcing namereg_fail to false allows the
name registry to mangle the card names to be unique.
2010-08-24 17:58:35 +03:00
Wim Taymans
ef0c73cb9d 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.
2010-08-23 17:47:40 +02:00
Wim Taymans
3dc5469c1f 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.
2010-08-23 16:55:23 +02:00
Wim Taymans
ef8abcb1b5 alsa: resume smoother after unsuspend
The smoother is paused when the device is suspended but never resumed on
unsuspend. Pass the paused = FALSE flag to the pa_smoother_reset() call to make
it unpause when unsuspending. This patch improves source timings quite a bit.
2010-08-23 11:59:13 +02:00