Peter Meerwald [Sun, 11 Dec 2011 15:07:38 +0000 (16:07 +0100)]
stream: Fix comments
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.
Tanu Kaskinen [Mon, 5 Dec 2011 18:42:44 +0000 (20:42 +0200)]
alsa-mixer: Remove unused pa_alsa_path_set_probe() declaration.
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>
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>
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>
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>
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>
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
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.
Arun Raghavan [Mon, 28 Nov 2011 09:46:55 +0000 (15:16 +0530)]
echo-cancel: Fix warning for undefined HAVE_WEBRTC
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
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.
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.
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.
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.
Colin Guthrie [Sun, 27 Nov 2011 15:44:23 +0000 (15:44 +0000)]
device-port: Remove redundant include after the better circular dep fix.
Colin Guthrie [Sun, 27 Nov 2011 15:23:55 +0000 (15:23 +0000)]
x11: Drop unneeded 'struct' and use the typedef directly.
Maarten Bosmans [Fri, 18 Nov 2011 08:58:09 +0000 (09:58 +0100)]
Use simple free function in pa_queue_free
Maarten Bosmans [Fri, 18 Nov 2011 08:58:08 +0000 (09:58 +0100)]
Use simple free function in pa_dynarray_free
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.
Mikel Astiz [Wed, 23 Nov 2011 16:08:11 +0000 (17:08 +0100)]
bluetooth: Fix property reply handling for hfgw
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%.
Maarten Bosmans [Wed, 23 Nov 2011 10:40:07 +0000 (11:40 +0100)]
resamplers: Use better variable name in trivial resampler
Maarten Bosmans [Wed, 23 Nov 2011 10:40:06 +0000 (11:40 +0100)]
build-sys: Disable fastpath asserts by default
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.
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
Maarten Bosmans [Tue, 22 Nov 2011 15:08:48 +0000 (16:08 +0100)]
Update LICENSE
Mention gdbm, lirc and fftw there.
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.
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>
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>
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>
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>
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>
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.
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.).
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.
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.
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).
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
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
Maarten Bosmans [Wed, 2 Nov 2011 20:54:15 +0000 (21:54 +0100)]
oss: Use log2 function from core-util instead of own implementation
Maarten Bosmans [Wed, 2 Nov 2011 20:54:14 +0000 (21:54 +0100)]
Squash unused variable compiler warning
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.
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.
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
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.
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).
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.
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.
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.
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!
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.
Arun Raghavan [Fri, 4 Nov 2011 11:08:30 +0000 (16:38 +0530)]
echo-cancel: Hook up WebRTC analog gain control
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.
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.
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.
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.
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.
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.
Arun Raghavan [Thu, 3 Nov 2011 13:46:47 +0000 (19:16 +0530)]
echo-cancel: Fix webrtc gain control initialisation
Lars R. Damerow [Thu, 3 Nov 2011 20:31:48 +0000 (21:31 +0100)]
alsa: fixed_latency_range modarg for module-alsa-card
Lars R. Damerow [Thu, 3 Nov 2011 20:29:03 +0000 (21:29 +0100)]
alsa: fixed latency range handling for udev-detect
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.
Frédéric Dalleau [Tue, 4 Oct 2011 07:37:27 +0000 (09:37 +0200)]
bluetooth: Remove match for org.bluez.MediaTransport.PropertyChanged
Frédéric Dalleau [Tue, 4 Oct 2011 07:37:26 +0000 (09:37 +0200)]
bluetooth: Use static string in DBUS signal handler description
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.
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.
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.
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.
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.
Arun Raghavan [Wed, 2 Nov 2011 14:10:15 +0000 (19:40 +0530)]
doc: Fix some old 0pointer.de references
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.
Maarten Bosmans [Tue, 4 Oct 2011 12:08:05 +0000 (14:08 +0200)]
tests: Rename voltest to volume-test
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.
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.
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.
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.
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.
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.
Johan Hedberg [Thu, 20 Oct 2011 12:47:49 +0000 (15:47 +0300)]
bluetooth: sbc: Reduce for-loop induced indentation in sbc_unpack_frame
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
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.
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.
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.
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>
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.
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.
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.
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
Colin Guthrie [Thu, 20 Oct 2011 13:11:53 +0000 (14:11 +0100)]
conf: Use .nofail when loading module-jackdbus-detect
When starting via a console login, PA will likely not have a session DBus
to play with. As there is no X11 environment, libdbus will be unable
to launch a session DBus for us and thus the module will fail to load
which in turn prevents PA from loading.
If the user subsequently logs into X11 this it will still not be possible
to load the module as the server will be ignorant of the X11 and DBus
environment variables so a longer term solution for handling this should
be found.
Arun Raghavan [Thu, 20 Oct 2011 09:16:23 +0000 (14:46 +0530)]
solaris: Use real_volume for set/get volume
This got missed when other bits were updated. Patch submitted by
Brian Cameron <brian.cameron@oracle.com>.
Arun Raghavan [Thu, 20 Oct 2011 09:14:22 +0000 (14:44 +0530)]
native: Fix Solaris build
tcpwrappers has some Solaris-specific quirks that need to be dealt with.
Patch submitted by Brian Cameron <brian.cameron@oracle.com>.
Colin Guthrie [Thu, 20 Oct 2011 09:04:49 +0000 (10:04 +0100)]
Update LICENSE.
Some of the license wording was less than clear. Try to clarify the
different GPL 'downgrade' scenarios but also be generic to ensure that
those packagers where GPL is a problem check thoroughly before they ship.
Inspired by comments from Brian Cameron @ Oracle via fdo#41822
Tanu Kaskinen [Mon, 3 Oct 2011 15:11:47 +0000 (18:11 +0300)]
alsa: Handle the "profile" modarg in module-alsa-card
Daniel Mack [Mon, 17 Oct 2011 09:33:27 +0000 (11:33 +0200)]
osx: module_bonjour_publish needs to be linked against libprotocol-native.la
Colin Guthrie [Tue, 11 Oct 2011 19:42:42 +0000 (20:42 +0100)]
build-sys: Provide a simple CMake Config setup (similar to pkgconfig)
I'd rather not have to do this, as I don't really see the point in
duplicating what is done in pkgconfig, but this is likely the
easiest way to avoid nasty hacks.
Arun Raghavan [Tue, 18 Oct 2011 04:23:20 +0000 (09:53 +0530)]
sink,source: Account for corked streams in update_rate()
pa_sink/source_used_by() ignores corked/monitor streams, but we need to
make sure there aren't any of these while updating rate (at least for
now -- this is a restriction that would be nice to get rid of).
Pierre-Louis Bossart [Mon, 17 Oct 2011 19:43:50 +0000 (14:43 -0500)]
alsa: fix list of sampling rates
add all standard audio rates
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Arun Raghavan [Mon, 17 Oct 2011 17:16:06 +0000 (22:46 +0530)]
alsa: Probe sink/source sample rates
This probes sink and source sample rates and uses this information to
validate rate changes and check incoming passthrough formats.