]> code.delx.au - pulseaudio/log
pulseaudio
12 years agoerror: Fix spelling of 'initialization' in errortab for PA_ERR_MODINITFAILED
Peter Meerwald [Mon, 12 Dec 2011 09:59:45 +0000 (10:59 +0100)]
error: Fix spelling of 'initialization' in errortab for PA_ERR_MODINITFAILED

Also update the related translations.

12 years agoproplist: Consistently use parameter name p for a pa_proplist* in prototype
Peter Meerwald [Mon, 12 Dec 2011 12:19:50 +0000 (13:19 +0100)]
proplist: Consistently use parameter name p for a pa_proplist* in prototype

12 years agoutf8: Fix doxygen file description for utf8.h
Peter Meerwald [Mon, 12 Dec 2011 12:19:49 +0000 (13:19 +0100)]
utf8: Fix doxygen file description for utf8.h

12 years agoproplist: Fix typos in doxygen documentation
Peter Meerwald [Mon, 12 Dec 2011 12:19:48 +0000 (13:19 +0100)]
proplist: Fix typos in doxygen documentation

12 years agoproplist: Add doxygen file description for proplist.h
Peter Meerwald [Mon, 12 Dec 2011 12:19:47 +0000 (13:19 +0100)]
proplist: Add doxygen file description for proplist.h

12 years agointrospect: Fix unresolved doxygen link pa_port_available_t
Peter Meerwald [Mon, 12 Dec 2011 12:19:46 +0000 (13:19 +0100)]
introspect: Fix unresolved doxygen link pa_port_available_t

12 years agoformat: Add description for format.h
Peter Meerwald [Mon, 12 Dec 2011 12:19:45 +0000 (13:19 +0100)]
format: Add description for format.h

12 years agoformat: Add periods to fix brief documentation for pa_format_info_is_pcm()
Peter Meerwald [Mon, 12 Dec 2011 12:19:44 +0000 (13:19 +0100)]
format: Add periods to fix brief documentation for pa_format_info_is_pcm()

12 years agoformat: Fix unknown doxygen command \second
Peter Meerwald [Mon, 12 Dec 2011 12:19:43 +0000 (13:19 +0100)]
format: Fix unknown doxygen command \second

12 years agodef: Document that pa_buffer_attr.maxlength is in bytes.
Peter Meerwald [Sun, 11 Dec 2011 15:07:39 +0000 (16:07 +0100)]
def: Document that pa_buffer_attr.maxlength is in bytes.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=42919

12 years agostream: Fix comments
Peter Meerwald [Sun, 11 Dec 2011 15:07:38 +0000 (16:07 +0100)]
stream: Fix comments

12 years agopstream: Fix spelling of 'receive'.
Peter Meerwald [Mon, 12 Dec 2011 22:36:39 +0000 (22:36 +0000)]
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.

12 years agoalsa-mixer: Remove unused pa_alsa_path_set_probe() declaration.
Tanu Kaskinen [Mon, 5 Dec 2011 18:42:44 +0000 (20:42 +0200)]
alsa-mixer: Remove unused pa_alsa_path_set_probe() declaration.

12 years agodevice-port: Add a property list to ports.
David Henningsson [Fri, 2 Dec 2011 12:34:54 +0000 (13:34 +0100)]
device-port: Add a property list to ports.

They're not used for anything yet, but hopefully soon they'll be.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
12 years agopactl: Show port availability
David Henningsson [Fri, 2 Dec 2011 13:15:28 +0000 (14:15 +0100)]
pactl: Show port availability

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
12 years agoFixup a few things in the new path probing
David Henningsson [Fri, 2 Dec 2011 09:20:23 +0000 (10:20 +0100)]
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>
12 years agoalsa: add card ports and path probe cache
David Henningsson [Fri, 25 Nov 2011 14:17:16 +0000 (15:17 +0100)]
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>
12 years agoalsa: Ignore the virtual "thinkpad-acpi" card
David Henningsson [Wed, 30 Nov 2011 11:51:06 +0000 (12:51 +0100)]
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>
12 years agoecho-cancel: Fix memory leak in test program
Peter Meerwald [Mon, 28 Nov 2011 15:14:16 +0000 (16:14 +0100)]
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

12 years agoresampler: Some minor tweaks
Maarten Bosmans [Mon, 28 Nov 2011 09:36:34 +0000 (10:36 +0100)]
resampler: Some minor tweaks

that were forgotten in the previous peaks resampler commits.

12 years agoecho-cancel: Fix warning for undefined HAVE_WEBRTC
Arun Raghavan [Mon, 28 Nov 2011 09:46:55 +0000 (15:16 +0530)]
echo-cancel: Fix warning for undefined HAVE_WEBRTC

12 years agotests: Don't link tests that only use public api to libpulsecommon
Maarten Bosmans [Wed, 16 Nov 2011 12:00:28 +0000 (13:00 +0100)]
tests: Don't link tests that only use public api to libpulsecommon

12 years agoresamplers: Improve performance of peaks resampler
Maarten Bosmans [Wed, 2 Nov 2011 20:54:17 +0000 (21:54 +0100)]
resamplers: Improve performance of peaks resampler

This is mainly achieved by special-casing the common 1ch float case,
which is used by applications such as pavucontrol.

12 years agoresamplers: Rework the peaks resampler
Maarten Bosmans [Wed, 2 Nov 2011 20:54:16 +0000 (21:54 +0100)]
resamplers: Rework the peaks resampler

The algorithm had been implemented the same way as the trivial resampler.  But
an important difference between the two is that the trivial resampler can write
an output as soon as the first corresponding input sample is seen, whereas the
peaks resampler must have read all input samples before writing an output
sample.

With this rework, the peaks resampler now outputs samples correctly when the
input data is spanning multiple memblocks.

12 years agoshm: Use a goto rather than early return for consistency.
Maarten Bosmans [Sun, 27 Nov 2011 16:12:10 +0000 (16:12 +0000)]
shm: Use a goto rather than early return for consistency.

This is functionally the same but is easier to understand.

12 years agowin32: Avoid some compiler warnings when cross-compiling for mingw32
Maarten Bosmans [Wed, 2 Nov 2011 20:54:13 +0000 (21:54 +0100)]
win32: Avoid some compiler warnings when cross-compiling for mingw32

Autoconf documentation says that AC_FUNC_SELECT_ARGTYPES shouldn't be used anyway.

12 years agodevice-port: Remove redundant include after the better circular dep fix.
Colin Guthrie [Sun, 27 Nov 2011 15:44:23 +0000 (15:44 +0000)]
device-port: Remove redundant include after the better circular dep fix.

12 years agox11: Drop unneeded 'struct' and use the typedef directly.
Colin Guthrie [Sun, 27 Nov 2011 15:23:55 +0000 (15:23 +0000)]
x11: Drop unneeded 'struct' and use the typedef directly.

12 years agoUse simple free function in pa_queue_free
Maarten Bosmans [Fri, 18 Nov 2011 08:58:09 +0000 (09:58 +0100)]
Use simple free function in pa_queue_free

12 years agoUse simple free function in pa_dynarray_free
Maarten Bosmans [Fri, 18 Nov 2011 08:58:08 +0000 (09:58 +0100)]
Use simple free function in pa_dynarray_free

12 years agodevice-port: Fix the circular dependency problem more cleanly.
Tanu Kaskinen [Sun, 27 Nov 2011 15:16:53 +0000 (17:16 +0200)]
device-port: Fix the circular dependency problem more cleanly.

Declaring structs before including anything ensures that the
structs are available for everybody in case of circular includes.

12 years agobluetooth: Fix property reply handling for hfgw
Mikel Astiz [Wed, 23 Nov 2011 16:08:11 +0000 (17:08 +0100)]
bluetooth: Fix property reply handling for hfgw

12 years agoresamplers: Optimize trivial resampler
Maarten Bosmans [Wed, 23 Nov 2011 10:40:08 +0000 (11:40 +0100)]
resamplers: Optimize trivial resampler

This improves the performance of a typical s16 2ch resampling by 88%.

12 years agoresamplers: Use better variable name in trivial resampler
Maarten Bosmans [Wed, 23 Nov 2011 10:40:07 +0000 (11:40 +0100)]
resamplers: Use better variable name in trivial resampler

12 years agobuild-sys: Disable fastpath asserts by default
Maarten Bosmans [Wed, 23 Nov 2011 10:40:06 +0000 (11:40 +0100)]
build-sys: Disable fastpath asserts by default

12 years agoresamplers: Use fastpath assert in trivial resampler
Maarten Bosmans [Wed, 23 Nov 2011 10:40:05 +0000 (11:40 +0100)]
resamplers: Use fastpath assert in trivial resampler

When the assert is disabled, the trivial resampler gets a 35% performance boost.

12 years agopulsecore: Hardcode FRAME_SIZE_MAX_ALLOW
Maarten Bosmans [Tue, 22 Nov 2011 15:09:18 +0000 (16:09 +0100)]
pulsecore: Hardcode FRAME_SIZE_MAX_ALLOW

Instead of using PA_SCACHE_ENTRY_SIZE_MAX, the size for FRAME_SIZE_MAX_ALLOW is
set directly to the same value.  This removes the need for the core-scache.h
include, which caused an unwanted dependency of libpulsecommon on libpulsecore.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=41539

12 years agoUpdate LICENSE
Maarten Bosmans [Tue, 22 Nov 2011 15:08:48 +0000 (16:08 +0100)]
Update LICENSE

Mention gdbm, lirc and fftw there.

12 years agopulsecore: Fix issue with circuilar definitions.
Colin Guthrie [Sun, 27 Nov 2011 14:19:57 +0000 (14:19 +0000)]
pulsecore: Fix issue with circuilar definitions.

Without this fix, errors about previous definitions are generated in
numerous locations.

Example of error:

  CC     libpulsecore_1.98_la-auth-cookie.lo
In file included from ../../src/pulsecore/source.h:46:0,
                 from ../../src/pulsecore/sink.h:40,
                 from ../../src/pulsecore/core.h:50,
                 from ../../src/pulsecore/shared.h:25,
                 from ../../src/pulsecore/auth-cookie.c:33:
../../src/pulsecore/device-port.h:40:24: error: redefinition of typedef
'pa_core'
../../src/pulsecore/core.h:29:24: note: previous declaration of
'pa_core' was here
make[3]: *** [libpulsecore_1.98_la-auth-cookie.lo] Error 1

Overall it would be nicer if we could avoid this kind of fix, but it
would require further reorganisation that I'm not prepared to undertake
right now.

12 years agocli: Show card ports and jack detection status
David Henningsson [Fri, 25 Nov 2011 14:17:15 +0000 (15:17 +0100)]
cli: Show card ports and jack detection status

Expose the new stuff through pacmd.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
12 years agoNotify port available status changes, and update protocol version
David Henningsson [Fri, 25 Nov 2011 14:17:14 +0000 (15:17 +0100)]
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>
12 years agoCards now has ports directly, and device port has list of profiles
David Henningsson [Fri, 25 Nov 2011 14:17:13 +0000 (15:17 +0100)]
Cards now has ports directly, and device port has list of profiles

This forms the base for being able to expose all ports of all
profiles (even inactive ones) to clients.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
12 years agoTurn device ports into reference counted objects
David Henningsson [Fri, 25 Nov 2011 14:17:12 +0000 (15:17 +0100)]
Turn device ports into reference counted objects

Since both cards and sinks can hold references to a port, it makes
sense to reference count them. Although no current implementation
actually has sinks with ports but without a card, it felt wrong
to make it harder to make such an implementation in the future.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
12 years agoIntroduce "available" concept for ports, and communicate that to clients. Bump protoc...
David Henningsson [Fri, 25 Nov 2011 14:17:11 +0000 (15:17 +0100)]
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>
12 years agofilters: Handle echo-cancel streams better
Arun Raghavan [Thu, 17 Nov 2011 14:31:59 +0000 (20:01 +0530)]
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.

12 years agoproplist: Add internal API to get stream group
Arun Raghavan [Wed, 23 Nov 2011 10:56:40 +0000 (16:26 +0530)]
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.).

12 years agofilters: Allow a filter to have both sink and source
Arun Raghavan [Fri, 11 Nov 2011 09:38:24 +0000 (15:08 +0530)]
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.

12 years agofilters: Fix the master source/sink when autoloaded
Arun Raghavan [Wed, 23 Nov 2011 11:16:12 +0000 (16:46 +0530)]
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.

12 years agoecho-cancel: Use more human-friendly descriptions
Arun Raghavan [Tue, 22 Nov 2011 07:54:22 +0000 (13:24 +0530)]
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).

12 years agoecho-cancel: Use speex by default if webrtc isn't available
Arun Raghavan [Tue, 15 Nov 2011 07:20:10 +0000 (12:50 +0530)]
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

12 years agocore: Look up /etc/machine-id if D-Bus machine-id is not found
Arun Raghavan [Mon, 14 Nov 2011 08:12:21 +0000 (13:42 +0530)]
core: Look up /etc/machine-id if D-Bus machine-id is not found

It appears that this is currently the fallback for early boot and other
such cases where /var might not be available. Relevant upstream commit:

http://cgit.freedesktop.org/dbus/dbus/commit/?id=66e52541d5bdd4927a5c702963749760643313f4

Thanks to Samuli Suominen <ssuominen@gentoo.org> for pointing this out
in https://bugs.gentoo.org/show_bug.cgi?id=390287

12 years agooss: Use log2 function from core-util instead of own implementation
Maarten Bosmans [Wed, 2 Nov 2011 20:54:15 +0000 (21:54 +0100)]
oss: Use log2 function from core-util instead of own implementation

12 years agoSquash unused variable compiler warning
Maarten Bosmans [Wed, 2 Nov 2011 20:54:14 +0000 (21:54 +0100)]
Squash unused variable compiler warning

12 years agoRemove vector.h and vector-test
Maarten Bosmans [Wed, 2 Nov 2011 20:54:12 +0000 (21:54 +0100)]
Remove vector.h and vector-test

This code was never used and vectorization is handled by Orc anyway.

12 years agobuild-sys: Remove time-smoother and shm from libpulsecore
Maarten Bosmans [Wed, 19 Oct 2011 12:10:13 +0000 (14:10 +0200)]
build-sys: Remove time-smoother and shm from libpulsecore

As they are already included in libpulsecommon.

12 years agortpoll: Update comment
Maarten Bosmans [Thu, 13 Oct 2011 18:54:17 +0000 (20:54 +0200)]
rtpoll: Update comment

to reflect changes made in
32e2cd6d3216f780c4cffed0f8eb3c30f2c8d732
core: get rid of rt sig/timer handling since modern Linux' ppoll() is finally fixed for granularity

12 years agostream: Fix upload samples' cleanup
Antti-Ville Jansson [Fri, 11 Nov 2011 14:22:24 +0000 (16:22 +0200)]
stream: Fix upload samples' cleanup

In pa_create_stream_callback, a stream is inserted into
s->context->record_streams only if it's a record stream. Otherwise it's
inserted into s->context->playback_streams. However, in stream_unlink the
stream is removed from s->context->playback_streams only if it's a playback
stream and otherwise it's removed from s->context->record_streams.

Thus, if the stream is an upload stream, we first insert it into
s->context->playback_streams in pa_create_stream_callback and then try to
remove it unsuccessfully from s->context->record_streams in stream_unlink. This
means that we are leaking hashmap entries until the context is freed,
constantly consuming more memory with applications that upload and unload a
large number of samples through one context.

Of course, this begs the question whether upload streams even belong in either
of those hashmaps. I don't want to mess around with the code too much at this
point though, so this patch should be a sufficient improvement.

12 years agoalsa: Minor debug code cleanup
Arun Raghavan [Sat, 12 Nov 2011 05:48:25 +0000 (11:18 +0530)]
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).

12 years agotests: Add playback tests to check-daemon
Arun Raghavan [Thu, 10 Nov 2011 07:54:07 +0000 (13:24 +0530)]
tests: Add playback tests to check-daemon

Adds the standard/extended API playback tests to the check-daemon set.

12 years agocore: Make debugging a bit simpler
Arun Raghavan [Thu, 10 Nov 2011 07:13:09 +0000 (12:43 +0530)]
core: Make debugging a bit simpler

This takes out a bunch of commented debug prints and puts them in
defines. Makes it easier to turn them all on/off at a single point.

12 years agotests: Add a target for running manual tests
Maarten Bosmans [Mon, 7 Nov 2011 18:39:34 +0000 (00:09 +0530)]
tests: Add a target for running manual tests

This adds a check-daemon make target which requires a running PulseAudio
server to test against.

12 years agoecho-cancel: Make WebRTC the default canceller
Arun Raghavan [Mon, 7 Nov 2011 14:05:28 +0000 (19:35 +0530)]
echo-cancel: Make WebRTC the default canceller

Works pretty well, and isn't a CPU hog, so let's use it!

12 years agoecho-cancel: Turn WebRTC analog gain control on by default
Arun Raghavan [Mon, 7 Nov 2011 14:05:05 +0000 (19:35 +0530)]
echo-cancel: Turn WebRTC analog gain control on by default

Seems to be pretty well-behaved.

12 years agoecho-cancel: Hook up WebRTC analog gain control
Arun Raghavan [Fri, 4 Nov 2011 11:08:30 +0000 (16:38 +0530)]
echo-cancel: Hook up WebRTC analog gain control

12 years agoecho-cancel: Add infrastructure for cancellers to do AGC
Arun Raghavan [Fri, 4 Nov 2011 10:47:26 +0000 (16:17 +0530)]
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.

12 years agosink,source: Update sample rate if possible on stream uncork
Arun Raghavan [Sun, 6 Nov 2011 13:42:19 +0000 (19:12 +0530)]
sink,source: Update sample rate if possible on stream uncork

If a stream is being uncorked and no other stream is running, we try to
update the sink/source sample rate to match it and avoid resampling.

12 years agosink,source: Allow sample rate switching with corked streams
Arun Raghavan [Mon, 7 Nov 2011 09:31:25 +0000 (15:01 +0530)]
sink,source: Allow sample rate switching with corked streams

This updates corked streams' resamplers when switching sample rates on a
sink/source, which means the restriction of allowing sample rate updates
only when no streams are attached to a sink/source is now relaxed to
preventing updates only when there is a running stream attached.

12 years agosink-input,source-output: Add an update_rate() function
Arun Raghavan [Sun, 6 Nov 2011 12:50:01 +0000 (18:20 +0530)]
sink-input,source-output: Add an update_rate() function

This factors out the resampler updating code from finish_move() and
makes a separate function for use from other points.

12 years agosink,source: Fix corked stream handling in update_rate()
Arun Raghavan [Mon, 7 Nov 2011 06:01:42 +0000 (11:31 +0530)]
sink,source: Fix corked stream handling in update_rate()

This fixes the conditional that checks for corked streams and prevents
rate updates.

12 years agocli: Add a dump-volumes command
Arun Raghavan [Thu, 18 Aug 2011 06:26:26 +0000 (11:56 +0530)]
cli: Add a dump-volumes command

The purpose of this command is to print all the internal volume
variables for sinks/sources and all corresponding
sink-inputs/source-outputs  to make debugging and reasoning about
volume-related issues easier.

12 years agoecho-cancel: Fix webrtc gain control initialisation
Arun Raghavan [Thu, 3 Nov 2011 13:46:47 +0000 (19:16 +0530)]
echo-cancel: Fix webrtc gain control initialisation

12 years agoalsa: fixed_latency_range modarg for module-alsa-card
Lars R. Damerow [Thu, 3 Nov 2011 20:31:48 +0000 (21:31 +0100)]
alsa: fixed_latency_range modarg for module-alsa-card

12 years agoalsa: fixed latency range handling for udev-detect
Lars R. Damerow [Thu, 3 Nov 2011 20:29:03 +0000 (21:29 +0100)]
alsa: fixed latency range handling for udev-detect

12 years agoalsa: support fixed latency range in alsa modules
Lars R. Damerow [Thu, 3 Nov 2011 20:14:45 +0000 (21:14 +0100)]
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.

12 years agobluetooth: Remove match for org.bluez.MediaTransport.PropertyChanged
Frédéric Dalleau [Tue, 4 Oct 2011 07:37:27 +0000 (09:37 +0200)]
bluetooth: Remove match for org.bluez.MediaTransport.PropertyChanged

12 years agobluetooth: Use static string in DBUS signal handler description
Frédéric Dalleau [Tue, 4 Oct 2011 07:37:26 +0000 (09:37 +0200)]
bluetooth: Use static string in DBUS signal handler description

12 years agobluetooth: Set hfgw profile when HandsfreeGateway is playing
Frédéric Dalleau [Tue, 4 Oct 2011 07:37:25 +0000 (09:37 +0200)]
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.

12 years agobluetooth: Set off profile on SCO disconnect
Frédéric Dalleau [Tue, 4 Oct 2011 07:37:24 +0000 (09:37 +0200)]
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.

12 years agobluetooth: Release MediaEnpoint if card profile is set to Off
Frédéric Dalleau [Tue, 4 Oct 2011 07:37:23 +0000 (09:37 +0200)]
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.

12 years agobluetooth: Do not unload module-bluetooth-device on ERR or HUP
Frédéric Dalleau [Tue, 4 Oct 2011 07:37:22 +0000 (09:37 +0200)]
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.

12 years agobluetooth: Fix Media Endpoint for HandsfreeGateway
Frédéric Dalleau [Tue, 4 Oct 2011 07:37:21 +0000 (09:37 +0200)]
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.

12 years agodoc: Fix some old 0pointer.de references
Arun Raghavan [Wed, 2 Nov 2011 14:10:15 +0000 (19:40 +0530)]
doc: Fix some old 0pointer.de references

12 years agotests: Revisit which tests to run with make check
Maarten Bosmans [Tue, 4 Oct 2011 12:12:20 +0000 (14:12 +0200)]
tests: Revisit which tests to run with make check

Some tests (remix-test, sig2str) only display information, so they are not
useful for automated testing.  Others (interpol-test, once-test, thread-test)
do return an error on failure, so should be included in TESTS.

12 years agotests: Rename voltest to volume-test
Maarten Bosmans [Tue, 4 Oct 2011 12:08:05 +0000 (14:08 +0200)]
tests: Rename voltest to volume-test

12 years agotests: More useful output of make check
Maarten Bosmans [Tue, 4 Oct 2011 12:01:03 +0000 (14:01 +0200)]
tests: More useful output of make check

Instead of spilling thousands of lines of output, make check now runs the
test-suite in about 100 lines or so.  If running under make check, the output of
tests is reduced. The MAKE_CHECK environment variable is used for this, so that
when running the test manually, the full output is still shown.  Furthermore,
pa_log is used consistently instead of printf, so that all test output goes to
stderr by default.  Colored output from make check goes to stdout.

12 years agotests: Make sure tests assert on failures and return error status
Maarten Bosmans [Fri, 28 Oct 2011 14:30:05 +0000 (16:30 +0200)]
tests: Make sure tests assert on failures and return error status

When a test program exits with a nonzero return value (or an assert is hit),
the test is regarded as a FAIL.
This makes `make check` a little more useful.

12 years agotests: refactor ipacl-test
Maarten Bosmans [Fri, 28 Oct 2011 14:24:18 +0000 (16:24 +0200)]
tests: refactor ipacl-test

Common test code is moved to a separate function.

12 years agosink, source: Join two ifs with the same condition.
Tanu Kaskinen [Mon, 31 Oct 2011 18:45:50 +0000 (20:45 +0200)]
sink, source: Join two ifs with the same condition.

Changes in v2:
 * Moved the comment in source.c to the right place.

12 years agoecho-cancel: Adapt test code for drift compensation
Arun Raghavan [Mon, 10 Oct 2011 17:01:38 +0000 (22:31 +0530)]
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.

12 years agoecho-cancel: Plug in WebRTC drift compensation
Arun Raghavan [Fri, 7 Oct 2011 10:58:11 +0000 (16:28 +0530)]
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.

12 years agobluetooth: sbc: Reduce for-loop induced indentation in sbc_unpack_frame
Johan Hedberg [Thu, 20 Oct 2011 12:47:49 +0000 (15:47 +0300)]
bluetooth: sbc: Reduce for-loop induced indentation in sbc_unpack_frame

12 years agobluetooth: sbc: overflow bugfix and audio decoding quality improvement
Siarhei Siamashka [Thu, 20 Oct 2011 12:47:48 +0000 (15:47 +0300)]
bluetooth: sbc: overflow bugfix and audio decoding quality improvement

The "(((audio_sample << 1) | 1) << frame->scale_factor[ch][sb])"
part of expression
    "frame->sb_sample[blk][ch][sb] =
        (((audio_sample << 1) | 1) << frame->scale_factor[ch][sb]) /
        levels[ch][sb] - (1 << frame->scale_factor[ch][sb])"
in "sbc_unpack_frame" function can sometimes overflow 32-bit signed int.
This problem can be reproduced by first using bitpool 128 and encoding
some random noise data, and then feeding it to sbc decoder. The obvious
thing to do would be to change "audio_sample" variable type to uint32_t.

However the problem is a little bit more complicated. According
to the section "12.6.2 Scale Factors" of A2DP spec:
    scalefactor[ch][sb] = pow(2.0, (scale_factor[ch][sb] + 1))

And according to "12.6.4 Reconstruction of the Subband Samples":
    sb_sample[blk][ch][sb] = scalefactor[ch][sb] *
        ((audio_sample[blk][ch][sb]*2.0+1.0) / levels[ch][sb]-1.0);

Hence the current code for calculating "sb_sample[blk][ch][sb]" is
not quite correct, because it loses one least significant bit of
sample data and passes twice smaller sample values to the synthesis
filter (the filter also deviates from the spec to compensate this).
This all has quite a noticeable impact on audio quality. Moreover,
it makes sense to keep a few extra bits of precision here in order
to minimize rounding errors. So the proposed patch introduces a new
SBCDEC_FIXED_EXTRA_BITS constant and uses uint64_t data type
for intermediate calculations in order to safeguard against
overflows. This patch intentionally addresses only the quality
issue, but performance can be also improved later (like replacing
division with multiplication by reciprocal).

Test for the difference of sbc encoding/decoding roundtrip vs.
the original audio file for joint stereo, bitpool 128, 8 subbands
and http://media.xiph.org/sintel/sintel-master-st.flac sample
demonstrates some quality improvement:

=== before ===
    --- comparing original / sbc_encoder.exe + sbcdec ---
    stddev:    4.64 PSNR: 82.97 bytes:170495708/170496000
=== after ===
    --- comparing original / sbc_encoder.exe + sbcdec ---
    stddev:    1.95 PSNR: 90.50 bytes:170495708/170496000

12 years agobluetooth: audio: Update license for shared header files
Marcel Holtmann [Fri, 26 Aug 2011 18:18:54 +0000 (11:18 -0700)]
bluetooth: audio: Update license for shared header files

The header files with constants and structures for audio specific
interaction with Pulseaudio are suppose to be under LGPL license.

For some odd reason a2dp-codecs.h ended up being under GPL license
which is against the intention of this being shared and re-used by
non-GPL programs. Fix this now to avoid any future confusion.

12 years agocore: Add a string list membership check function
Arun Raghavan [Thu, 27 Oct 2011 10:49:18 +0000 (12:49 +0200)]
core: Add a string list membership check function

This adds a pa_str_in_list() to check for a given string in a
space-separated list of strings. For now, this is merely present to
avoid duplication of role matching code (intended roles can be a
space-separate list) across modules.

12 years agodoc: Correct intended roles property documentation
Arun Raghavan [Thu, 27 Oct 2011 10:54:17 +0000 (12:54 +0200)]
doc: Correct intended roles property documentation

The documentation says we expect a comma-separate list of intended
roles, but the code splits the string on whitespaces, so this corrects
the documentation to match the implementation.

12 years agoalsa: Set return code before printing it.
Dylan Reid [Wed, 26 Oct 2011 03:34:31 +0000 (20:34 -0700)]
alsa: Set return code before printing it.

The error message for snd_pcm_hw_params_set_period_wakeup was
printing "ret", but "ret" wasn't being set.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
12 years agorole-cork: Allow module-role-cork to act globally.
Colin Guthrie [Mon, 24 Oct 2011 21:51:20 +0000 (23:51 +0200)]
role-cork: Allow module-role-cork to act globally.

Allow a module argument to specify that we should act globally
rather than just within a given sink.

The default value is to not opporate globally thus retaining the
current behaviour.

12 years agorole-cork: Make module-role-cork more generic.
Colin Guthrie [Mon, 24 Oct 2011 21:35:38 +0000 (23:35 +0200)]
role-cork: Make module-role-cork more generic.

Operate on a list of 'trigger roles' and 'cork roles'. i.e.
react to any stream with a role in the trigger list and apply a
cork to any stream with the a role in the cork list.

The trigger roles default to 'phone' and the cork roles default
to both 'music' and 'video' thus achieving the same functionality
as currently when called without any arguments.

12 years agorole-cork: Rename module-cork-music-on-phone to module-role-cork.
Colin Guthrie [Mon, 24 Oct 2011 20:55:45 +0000 (22:55 +0200)]
role-cork: Rename module-cork-music-on-phone to module-role-cork.

This module will be extended to be a bit more generic so the
old name will soon be obsolete.

12 years agogitignore: Update for recent additions
Arun Raghavan [Fri, 21 Oct 2011 04:37:31 +0000 (10:07 +0530)]
gitignore: Update for recent additions

Adds echo-cancel-test and new cmake files