summaryrefslogtreecommitdiffstats
path: root/src/modules/echo-cancel/module-echo-cancel.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary #includesMaarten Bosmans2011-06-221-5/+0
|
* capture: Implement per-stream volume control for capture streams.Colin Guthrie2011-06-221-11/+7
| | | | | | | This piggy backs onto the previous changes for protocol 22 and thus does not bump the version. This and the previous commits should be seen as mostly atomic. Apologies for any bisecting issues this causes (although I would expect these to be minimal)
* capture: Add the passthrough format negotiation to capture streams.Colin Guthrie2011-06-221-1/+1
| | | | | This helps to keep the API more symmetrical and also potentially allows support for passthrough monitor sources at some point in the future.
* echo-cancel: More preprocessing fixesArun Raghavan2011-06-131-2/+6
| | | | | The speex_preprocess_ctl() function takes a spx_int32_t, but we've been passing a pa_bool_t, which could potentially crash.
* echo-cancel: Fix preprocessor initialisationArun Raghavan2011-06-131-1/+1
| | | | | | We were using the block size in bytes instead of samples, which meant preprocessing was broken. This fix makes a large-ish difference in the quality of echo-cancellation with speex.
* echo-cancel: Fix echo suppression, add some knobsBart Cerneels2011-05-281-3/+34
| | | | | | | The echo suppress attenuation value was being incorrectly modified. Fixed and added 2 arguments to change the attenuation of the residual echo filter. Default values of the speex preprocessor will be used when omitted.
* echo-cancel: Speex preprocessor has to run *after* the AEC.Bart Cerneels2011-05-281-3/+4
| | | | This is how it is expected to be run.
* echo-cancel: Add speex preprocessingArun Raghavan2011-05-241-3/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows the selective enabling of speex' preprocessing algorithms before running the echo-canceller -- for now this includes automatic gain control, noise suppression and echo suppression. It's all off by default for now, though at some point in the near future we might want to enable at least denoising by default. The denoising works pretty well, though we might want to add a way to tweak the noise-suppression knob that libspeex provides. The AGC option is just a stop-gap -- we need a real AGC mechanism that tweaks the source volume rather than doing this in software. The speex documentation mentions VAD and dereverb, but it appears that these are not complete yet. We don't do all this in a separate module from module-echo-cancel to avoid the overhead of adding another virtual source. It makes more sense to make a separate virtual source module that can be used for cases where preprocessing is useful but AEC is not (for e.g. noise suppression for fan noise in a recording application). Another reason to keep this integrated with the AEC module is that the echo suppression bits use the speex echo canceller state. This does leak some information about the AEC implementation into module-echo-cancel, but this is unavoidable.
* echo-cancel: Remove extraneous debug messageArun Raghavan2011-05-201-1/+0
| | | | This was making it impossible to run in debug mode with save_aec=1
* core: Add extended stream API to support compressed formatsArun Raghavan2011-05-021-1/+1
| | | | | | | | | | | | | | | This is the beginning of work to support compressed formats natively in PulseAudio. This adds a pa_stream_new_extended() that takes a format structure, sends it to the server (=> protocol extension) and has the server negotiate with the appropropriate sink to figure out what format it should use. This is work in progress, and works only with PCM streams. Actual compressed format support in some sink needs to be implemented, and extensive testing is required. More details on how this is supposed to work is available at: http://pulseaudio.org/wiki/PassthroughSupport
* filter-apply: Mark modules as being autoloadedArun Raghavan2011-05-021-9/+9
| | | | | | | (Based on Colin's review) We mark modules as being autoloaded so that they can handle this as a special case if needed (which is required by module-echo-cancel for now). This inverts how things were done and makes using these modules manually less error-prone.
* echo-cancel: Play nice with module-filter-*Arun Raghavan2011-04-231-2/+14
| | | | | | | | | | | | | | With automaticl filter loading by module-filter-apply, setting the virtual sink/source to have the "phone" intended role will break routing when you first connect a phone stream to an ALSA device and then turn on your Bluetooth headset. This happens because module-intended-roles doesn't move a stream if it is already on a device that provides the required role. This patch introduces a "manual_load" parameter that is meant to be used when not using module-filter-apply for loading the AEC module. If this parameter is set, the virtual devices are given the "phone" role, else we count on module-filter-heuristics to do the right thing.
* echo-cancel: Fix warning/typoColin Guthrie2011-03-201-1/+1
|
* Get rid of some warningsMaarten Bosmans2011-03-201-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mostly warnings about unused stuff. Furthermore, the first hunk is a fix for the change in 177948a6. Finally, comment in AEC_dtd was translated and the code simplified slightly. CC module_bluetooth_device_la-module-bluetooth-device.lo modules/bluetooth/module-bluetooth-device.c: In function ‘a2dp_process_render’: modules/bluetooth/module-bluetooth-device.c:1335:30: warning: pointer targets in passing argument 6 of ‘sbc_encode’ differ in signedness [-Wpointer-sign] ../src/modules/bluetooth/sbc/sbc.h:92:9: note: expected ‘ssize_t *’ but argument is of type ‘size_t *’ CC module_rygel_media_server_la-module-rygel-media-server.lo modules/module-rygel-media-server.c:383:13: warning: ‘append_property_dict_entry_object_array’ defined but not used [-Wunused-function] CC module_echo_cancel_la-adrian-aec.lo modules/echo-cancel/adrian-aec.h:360:15: warning: ‘AEC_getambient’ defined but not used [-Wunused-function] modules/echo-cancel/adrian-aec.h:368:14: warning: ‘AEC_setgain’ defined but not used [-Wunused-function] modules/echo-cancel/adrian-aec.h:374:14: warning: ‘AEC_setaes’ defined but not used [-Wunused-function] modules/echo-cancel/adrian-aec.h:377:16: warning: ‘AEC_max_dotp_xf_xf’ declared ‘static’ but never defined [-Wunused-function] CC module_echo_cancel_la-module-echo-cancel.lo modules/echo-cancel/module-echo-cancel.c: In function ‘time_callback’: modules/echo-cancel/module-echo-cancel.c:266:12: warning: variable ‘fs’ set but not used [-Wunused-but-set-variable] CC module-virtual-sink.lo modules/module-virtual-sink.c: In function ‘sink_input_pop_cb’: modules/module-virtual-sink.c:206:15: warning: variable ‘current_latency’ set but not used [-Wunused-but-set-variable]
* Fix up some double spacesMaarten Bosmans2011-03-181-1/+1
|
* Fix up according to Coding StyleMaarten Bosmans2011-03-111-12/+11
| | | | Only whitespace changes in here
* core: Link virtual sinks and sources to their streams.Tanu Kaskinen2011-02-221-0/+6
| | | | | | | | | | | | | | | This change doesn't add any functionality in itself, but it will be useful in the future for operating on chains of sinks or sources that are piggy-backing on each other. For example, the PA_PROP_DEVICE_MASTER_DEVICE property could be handled in the core so that each virtual device doesn't have to maintain it separately. By using the origin_sink and destination_source pointers the core is able to see at stream creation time that the stream is created by a virtual device, and then update that device's property list using the name of the master device that the stream is being connected to. The same thing can be done also when the stream is being moved from a device to another, in which case the _MASTER_DEVICE property needs updating.
* echo-cancel: Fix source may_move_to functionArun Raghavan2010-12-021-1/+1
| | | | | | | 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.
* echo-cancel: Add SSE optimisation to the adrian moduleArun Raghavan2010-09-231-1/+1
| | | | | | 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.
* echo-cancel: pause timer when echo canceling is offWim Taymans2010-09-091-16/+25
| | | | | While the sink or source is in the suspended state, disable the timer callback because we are not doing any echo canceling then.
* echo-cancel: improve accuracyWim Taymans2010-09-091-1/+5
| | | | | Make the echo canceler drift up to 1ms now that things are more accurate. Add 10 samples of headroom to allow for timing inaccuracies.
* echo-cancel: rework alignment codeWim Taymans2010-09-091-59/+76
| | | | | Rework the code to align capture and playback samples so that we can keep more accurate timings.
* echo-cancel: Make blocksize a module-wide parameterArun Raghavan2010-09-071-21/+16
| | | | | | 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.
* echo-cancel: Allow selection of AEC method using modargsArun Raghavan2010-09-071-8/+27
| | | | | This adds an "aec_method" module argument to allow us to select the AEC implementation to use.
* echo-cancel: Add alternative echo-cancellation implementationArun Raghavan2010-09-071-0/+8
| | | | | | | | | | | | 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).
* echo-cancel: Let AEC module determine source/sink specArun Raghavan2010-09-071-17/+19
| | | | | | | | | | | | | 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.
* echo-cancel: Pass arguments to the specific canceller moduleArun Raghavan2010-09-071-25/+3
| | | | | This allows us to tweak module parameters for whichever AEC module is chosen.
* echo-cancel: Split out speex code from the core moduleArun Raghavan2010-09-071-35/+58
| | | | | This splits out the echo-cancelling core from the PA-specific bits to allow us to plug in other echo-cancellation engines.
* echo-cancel: Move the module into it's own directoryArun Raghavan2010-09-071-0/+1625
This will make splitting out the canceller parts cleaner.