Commit graph

2631 commits

Author SHA1 Message Date
Peter Meerwald
7ea740b2c8 alsa: Mention correct ALSA function in debug log 2012-01-11 22:09:26 +05:30
David Henningsson
45262959e2 alsa-mixer: Refactor pa_alsa_profile_set_probe().
Increase readability of the pa_alsa_profile_set_probe function of
alsa-mixer.c

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-01-06 12:10:13 +02:00
David Henningsson
5905094889 alsa-mixer: When selecting an input, turn off boosts of other inputs
Just like we turn off the "Front Mic" element when we select "Rear Mic",
we should also turn off the "Front Mic Boost" element. And the same for
the other inputs.

Reported-by: Len Owens <len@ovenwerks.net>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-01-05 19:19:56 +05:30
Pino Toscano
e2876aeb40 module-rtp-recv: fail when SO_TIMESTAMP is not defined
SO_TIMESTAMP is not POSIX and not available in any platform, so just fail
if the current platform does not have it.

See bug #42715
2012-01-03 00:20:04 +05:30
Pino Toscano
992333697f rtp: use the right type when checking cmsg_type
Use SCM_* instead of SO_* when checking the type of each cmsghdr.

See bug #42715
2012-01-03 00:20:04 +05:30
Pino Toscano
6aa84d6db0 pipe: use pa_pipe_buf instead of the macro PIPE_BUF
This helps when porting to platforms that lack PIPE_BUF.

See bug #42715
2012-01-03 00:20:04 +05:30
Peter Meerwald
be9ef2e96c echo-cancel: Better handling of error conditions in test 2011-12-14 21:53:39 +05:30
Peter Meerwald
6eb0f133c4 echo-cancel: Begin log message with uppercase letter 2011-12-14 21:52:17 +05:30
Peter Meerwald
f40df053c8 echo-cancel: Set file mode to binary in test code 2011-12-14 21:52:05 +05:30
Peter Meerwald
dc5a39b124 echo-cance: Make Adrian canceller optional
makes the Adrian echo canceller implementation optional at compile time

this patch supersedes an earlier patch proposal and addresses the following
comments:
* separate patch from speex dependency rework (Arun)
* check that at least one EC implementation is available (Arun)
* properly align yes/no in configure summary for Adrian (Frederic)
2011-12-13 09:16:32 +05:30
Peter Meerwald
5f2286e6f7 build-sys: Make speex library optional
make speex library dependency optional, this affects the resampler
and the echo canceller module

this patch supersedes an earlier patch proposal and addresses the following
comments:
* fix order of pa_echo_canceller_method_t enum and ec_table (Frederic)
* the default resampler is speex if available as before, otherwise ffmpeg (Arun)
* does not touch the Adrian EC implementation (see separate patch) (Arun)
2011-12-13 09:10:08 +05:30
Peter Meerwald
c6b95d5235 pstream: Fix spelling of 'receive'.
These functions are not exported in the map file and thus do
not form part of the API and can be corrected without any problem.
2011-12-12 22:36:39 +00:00
Tanu Kaskinen
ba33ae4790 alsa-mixer: Remove unused pa_alsa_path_set_probe() declaration. 2011-12-05 20:42:44 +02:00
David Henningsson
c1f3f7709f Fixup a few things in the new path probing
* If mapping_probe_paths() fails to open the mixer, all paths are now
removed from the mapping's path sets.
 * pa_path_set.probed isn't really used for anything (removed).
 * If profile probing is configured to be skipped, mapping_paths_probe()
should still be called.

Thanks to Tanu for spotting.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-12-02 17:51:11 +02:00
David Henningsson
426daaf6bb alsa: add card ports and path probe cache
To be able to add ports to all profiles, we need to probe all
profiles at startup. To speed this up, we now have a cache of
probes paths which is owned by the profile set. Since paths
are now owned by the profile set, the path set must now have
a hashmap of paths instead of a linked list.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-12-01 21:49:17 +02:00
David Henningsson
078a39af88 alsa: Ignore the virtual "thinkpad-acpi" card
The thinkpad ACPI driver sometimes creates a virtual sound card,
which at best exposes a volume control. Save some startup time, and
unnecessary error messages in the log, by ignoring it.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-11-30 12:02:03 +00:00
Peter Meerwald
8fc8d3d586 echo-cancel: Fix memory leak in test program
memory for pa_echo_canceller is allocated in init_common() a second time,
hence the allocated memory in main() is leaked
2011-11-29 10:08:04 +05:30
Arun Raghavan
23fb081795 echo-cancel: Fix warning for undefined HAVE_WEBRTC 2011-11-28 15:16:55 +05:30
Maarten Bosmans
e8028304b3 win32: Avoid some compiler warnings when cross-compiling for mingw32
Autoconf documentation says that AC_FUNC_SELECT_ARGTYPES shouldn't be used anyway.
2011-11-27 16:24:48 +00:00
Colin Guthrie
8969bccdd9 x11: Drop unneeded 'struct' and use the typedef directly. 2011-11-27 15:42:52 +00:00
Mikel Astiz
e199077eca bluetooth: Fix property reply handling for hfgw 2011-11-27 14:54:01 +00:00
David Henningsson
47f28a5843 Notify port available status changes, and update protocol version
The recommended way of setting available status is to call
pa_device_port_set_available, which will send a subscription event
to the relevant card. It will also fire a hook.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-11-26 16:58:37 +02:00
David Henningsson
961ec210a6 Introduce "available" concept for ports, and communicate that to clients. Bump protocol version to 24.
Note: There is still no notification when status availability changes.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-11-26 13:47:33 +02:00
Arun Raghavan
fabb28f935 filters: Handle echo-cancel streams better
This makes handling of echo-cancel streams (and potentially other
filters that need to work with multiple streams) cleaner. We do this by
adding the ability to apply filter on a group of streams rather than
always treating streams individually.

This is required, for example, when changing the input source for an
echo-cancel source output. When this happens, we want to change the
module-echo-cancel instance to actually cancel between the new source
and old sink.

To do this when one stream in a group moves, we create a new filter
instance between the current master sink/source pair and move the
relevant streams to the virtual sink/source from this new instance.
2011-11-24 13:03:26 +05:30
Arun Raghavan
1798c653db proplist: Add internal API to get stream group
This moves out code from module-stream-restore and makes an internal API
out of it to get a "stream group" for a given sink input or source output.
This is factored out for reuse in module-filter-*.

The stream group basically provides some means of attaching a logical
identification to the stream (by role, application id, etc.).
2011-11-24 13:03:26 +05:30
Arun Raghavan
c30a68ebbd filters: Allow a filter to have both sink and source
This sets the base for better representing module-echo-cancel. This
patch itself should change no behaviour -- it only makes way for other
changes.
2011-11-24 12:35:48 +05:30
Arun Raghavan
aaf0f5bd6e filters: Fix the master source/sink when autoloaded
When autoloaded, it is expected that module-filter-apply (or whatever is
loading us) will take care of applying the filter on the correct
sink/source master. Instead of adding complexity by tracking what is
currently being filtered, we just disallow filtering anything except the
original master sink/source and let module-filter-apply or whatever is
loading us deal with dynamic sink/source changes.
2011-11-24 12:35:48 +05:30
Arun Raghavan
ac3d66f978 echo-cancel: Use more human-friendly descriptions
This makes what devices are being cancelled clearer in the UI (at the
cost of being somewhat less clear when multiple devices of the same name
are plugged, but at least that's a much smaller set than everyone).
2011-11-23 12:00:29 +05:30
Arun Raghavan
4b7b244564 echo-cancel: Use speex by default if webrtc isn't available
Thanks to Peter Meerwald <pmeerw@pmeerw.net> for pointing this out.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42925
2011-11-15 12:51:32 +05:30
Maarten Bosmans
c2976b1f87 oss: Use log2 function from core-util instead of own implementation 2011-11-14 11:08:04 +05:30
Maarten Bosmans
93f46b92c7 Squash unused variable compiler warning 2011-11-14 11:08:04 +05:30
Arun Raghavan
d320ae029b alsa: Minor debug code cleanup
Remove a trap on underrun and uncomment a couple of useful debug prints
(still enabled only when DEBUG_TIMING is defined).
2011-11-14 10:54:18 +05:30
Arun Raghavan
cc89b4aff1 echo-cancel: Make WebRTC the default canceller
Works pretty well, and isn't a CPU hog, so let's use it!
2011-11-07 19:36:23 +05:30
Arun Raghavan
c3d714693c echo-cancel: Turn WebRTC analog gain control on by default
Seems to be pretty well-behaved.
2011-11-07 19:36:08 +05:30
Arun Raghavan
fb02d50fe3 echo-cancel: Hook up WebRTC analog gain control 2011-11-07 17:37:50 +05:30
Arun Raghavan
3d2f2424eb 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.
2011-11-07 17:37:50 +05:30
Arun Raghavan
0d13f6ebd2 echo-cancel: Fix webrtc gain control initialisation 2011-11-04 15:25:33 +05:30
Lars R. Damerow
1e6eda8eda alsa: fixed_latency_range modarg for module-alsa-card 2011-11-03 21:31:48 +01:00
Lars R. Damerow
c07c4b353d alsa: fixed latency range handling for udev-detect 2011-11-03 21:31:27 +01:00
Lars R. Damerow
7a387fed36 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.
2011-11-03 21:17:54 +01:00
Frédéric Dalleau
6124bf8951 bluetooth: Remove match for org.bluez.MediaTransport.PropertyChanged 2011-11-03 00:29:00 +05:30
Frédéric Dalleau
12abb05ebd bluetooth: Use static string in DBUS signal handler description 2011-11-03 00:29:00 +05:30
Frédéric Dalleau
79c836ec6a 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.
2011-11-03 00:29:00 +05:30
Frédéric Dalleau
2f24a6e627 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.
2011-11-03 00:21:43 +05:30
Frédéric Dalleau
2c213607e2 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.
2011-11-03 00:21:39 +05:30
Frédéric Dalleau
54f3b9a6fa 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.
2011-11-03 00:21:35 +05:30
Frédéric Dalleau
3f6aa03912 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.
2011-11-03 00:18:49 +05:30
Arun Raghavan
e310f4853e 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.
2011-11-01 18:20:43 +05:30
Arun Raghavan
23ce9a4f79 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.
2011-11-01 18:20:32 +05:30
Johan Hedberg
8c0cca7905 bluetooth: sbc: Reduce for-loop induced indentation in sbc_unpack_frame 2011-10-28 15:43:56 +02:00