Commit graph

5808 commits

Author SHA1 Message Date
Tanu Kaskinen
dcab6e1561 protocol-dbus: Fix some memory management bugs.
There were several memory leaks. In addition to those,
pa_dbus_protocol_add_interface() used a string from the
caller as a key to a hashmap, instead of a copy of the
string. This caused trouble when the caller freed the
string while the key was still in use in the hashmap.
2011-04-23 18:23:38 +01:00
Marc-André Lureau
15257b0ec3 match: Match rule earlier, in SINK_INPUT_NEW 2011-04-23 18:23:38 +01:00
Marc-André Lureau
9b58b7d6c2 match: Don't double free in case of missing table file 2011-04-23 18:23:37 +01:00
Daniel Mack
ff273b49d7 module-coreaudio-device: Fix two build warnings 2011-04-23 18:23:37 +01:00
Daniel Mack
e6003e8fc5 module-coreaudio-device: Set the thread name to device name
This makes gdb's "info threads" better understandable
2011-04-23 18:23:37 +01:00
Daniel Mack
cda8ebf8f1 module-coreaudio-device: Dispatch sink/source state messages from main loop
This fixes a long standing race condition when tearing down streams on
Mac OS X.
2011-04-23 18:23:37 +01:00
Daniel Mack
2411d9accd thread-posix: Use pthread_(get|set)name_np() if available
Newer generations of libpthread have functions to set and get the thread
names. If available, use them.
2011-04-23 18:23:37 +01:00
Daniel Mack
98f2209663 pulsecore:: Define _POSIX_C_SOURCE locally for rtclock on OSX
Defining this macro on a global level is disadvantageous for other APIs,
and as we need it for clock_gettime() only on Mac OS X, define it
locally in pulsecore/core-rtclock.c only.
2011-04-23 18:23:37 +01:00
Daniel Mack
7a3b3a3763 util: Implement pa_get_binary_name() for Mac OS X 2011-04-23 18:23:37 +01:00
Daniel Mack
2a44304bee module-coreaudio-detect: Add 'ioproc_frames' parameter
This value is passed on to the instances of module-coreaudio-device that
are loaded upon device detection. The value is purely optional, as the
device module will fall back to to its default if it's not given.
2011-04-23 17:41:33 +01:00
Lennart Poettering
575ba65714 memblockq: decode unset chunks as NULL chunks again
This fixes asserts beeing hit when see requests are posted via the
native protocol.
2011-04-21 21:05:58 +02:00
Arun Raghavan
e5f547fe70 filter-apply: Make housekeeping optional
Adds an autoclean option (defaults to TRUE) that controls whether
module-filter-apply cleans up unused modules or not. This is useful in
cases where you know that a filter will be used often and thus can avoid
overhead from repeated module load/unload.
2011-04-20 09:39:17 +01:00
Colin Guthrie
e727068956 filter: Move the proplist defines into the central place and document them. 2011-04-20 09:25:31 +01:00
Marc-André Lureau
c376ac5920 tests: improve resampler test 2011-04-19 12:20:19 +01:00
Marc-André Lureau
1f602ded57 interpol-test: remove unused include getopt.h 2011-04-19 12:00:33 +02:00
Alexander Kurtz
67ba3734ea vala: More vala fixes
1. Remove the "has_destroy_function=false" attribute. It was only
necessary because of a bug in vala which is fixed in 0.12. [1]

2. Add sizes to all fixed-size arrays to make vala recognize them as
such. Using symbolic constants for this is not yet supported. [2]

3. CardInfo struct: Move the brackets in the list of available profiles
to the type to make it clear that this is a dynamically-sized array. [3]

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=622773
[2] https://bugzilla.gnome.org/show_bug.cgi?id=647788
[3] http://0pointer.de/lennart/projects/pulseaudio/doxygen/structpa__card__info.html
2011-04-18 10:31:51 +02:00
Arun Raghavan
0b2457432a volume: Get more data from volume tests
This makes the volume tests run in two loops and print the minimum,
maximum and standard deviation of readings from the inner loop. This
makes it easier to reason out performance drops (i.e. algorithmic
problems vs. other system issues such as processor contention).
2011-04-18 10:31:51 +02:00
Arun Raghavan
837e0a9606 stream-restore: Check for readability before reading volume
This avoids an assert in pa_sink_input_get_volume() when connecting a
passthrough stream.
2011-04-18 10:31:51 +02:00
Daniel Mack
a44092d39d pa_poll(): Simplify detection of invalid fds in select() emulation mode
For systems which have a fcntl() implementation, we can simplify the
code which determines whether a file selector is valid in pa_poll().

The old code, which is harder to read and more expensive, stays around
for all platforms we need to emulate poll() for using select(), and
which don't provide fcntl(). IOW, for Windows.

On Mac OS X, however, the detection for bad fds via more select() calls
doesn't work, resulting in hung main loops, so the patch fixes a real
bug there.
2011-04-18 10:31:51 +02:00
Tanu Kaskinen
a2581e6688 sink-input: Check flat volume with pa_sink_flat_volume_enabled().
Checking just the flag doesn't work if the sink uses volume sharing, because
such sinks never have PA_SINK_FLAT_VOLUME set.
2011-04-18 10:31:51 +02:00
Colin Guthrie
0e60a80afa filter-heuristics: New module that applies some basic heuristics regarding filters.
At present the only heuristic is one to apply the echo-cancel filter
when dealing with phone streams.
2011-04-18 10:31:51 +02:00
Colin Guthrie
9a2a045d7c filter-apply: New module to automatically load filter sinks (and move streams) based on sink-input property hints.
This module does not yet deal with modules that need matched inputs/outputs
(i.e. echo-cancel) but this will be added in due course.
2011-04-18 10:31:51 +02:00
Colin Guthrie
34658927a3 equalizer: Use sink_master as the module argument rather than just master.
This brings more uniformity to arguments to match module-echo-cancel
(which needs both sink and source masters, hence the disambiguation).

This will allow other modules to load filters in a more uniform way
in the future without kludges to deal with variation in arguments.
2011-04-18 10:31:51 +02:00
Juho Hämäläinen
aaab340d4e bluetooth-device: fix rounding errors caused by few bt volume steps
When volume changes in bluetooth device PulseAudio volume is rounded
one too low, so if bluetooth headset changes volume and that volume
is immediately set again for bluetooth device, bluetooth step drifts
lower all the time. Volume is incremented by one in the conversion so
that we get right bluetooth step when re-applying volume.

Signed-off-by: Juho Hämäläinen <ext-juho.hamalainen@nokia.com>
2011-04-05 11:24:12 +01:00
Harri Mähönen
1bbafdbb0a stream-restore: add version to new entry. 2011-04-05 11:18:04 +01:00
Colin Guthrie
1020065df7 doc: Fix typo 2011-04-05 09:53:16 +01:00
Tanu Kaskinen
b14f0d79f6 alsa: Fix log output to inform about positive base volumes correctly.
This fix was done for _set_port_cb() already, but the first fix didn't fix
setup_mixer(). Now that's done too.
2011-04-04 13:34:18 +01:00
Marc-André Lureau
5d43aba3d5 bluetooth: drop data every 500ms on oor condition 2011-04-04 13:33:56 +01:00
Michael Terry
6ed3a7dcc9 switch-on-connect: Add a new module to allow for hotplugged devices to be used by default.
This module implements a simply policy decision that any newly plugged
in devices should be used.

This is a reasonable approach and paprefs will be updated to allow for
this option to be turned on or off.

This is more or less a stop-gap solution. When priority lists are
implemented in the core, then policy modules may ultimately be
re-engineered to adjust the priority lists rather than doing any of
their own routing per-se.
2011-04-03 13:42:44 +01:00
Daniel Mack
c083259464 tests: add a connection stress test
This test is based on a threaded main loop and was written to hunt an
evil race condition.
2011-04-01 14:15:01 +01:00
Tanu Kaskinen
35c93f711d bluetooth: Fix HSP volume handling.
Previously the userdata for the volume callbacks was saved to
pa_core.shared only once when loading module-bluetooth-device, and only when
the SCO over PCM feature was used. That breaks volume handling in cases where
the HSP profile is used without the SCO over PCM setup. Now the userdata is
set always when a sink or source is created, and removed when a sink or source
is removed.
2011-04-01 13:33:50 +01:00
Marc-André Lureau
ccbf7a3006 bluetooth: restore original sco_{sink, src}->set_volume when unloading 2011-04-01 13:33:08 +01:00
Marc-André Lureau
2386471e10 bluetooth: fix set_volume_cb on sco over pcm
The current implementation is totally bogus, it cast the over_sink
userdata to the bluetooth-device userdata... It was failing nicely
because the previous code had a gentle safe-guard in u->profile ==
PROFILE_HSP, and u->profile was just random.

There is no easy way to associate additional data to a sink or
source. Two solutions seems possible: looking up loaded modules and
check which one was handling the sink/source, or using pa_shared. I
went for the second solution.
2011-04-01 13:32:11 +01:00
Marc-André Lureau
209b7b781d bluetooth: use sco_sink/source to start with right state
Note from Tanu Kaskinen: I resolved some conflicts with newer upstream code, so
if this patch is broken, blame me..
2011-04-01 13:30:50 +01:00
Tanu Kaskinen
13849f153c bluetooth: Drop all "#ifdef NOKIA" directives.
The #ifdefs only added clutter. I don't see any reason to not compile the
SCO over PCM support in all the time.
2011-04-01 13:29:38 +01:00
Sean McNamara
13d1928f3e vala: ChannelMap has no destroy function. 2011-03-31 11:08:47 +01:00
Arun Raghavan
62f181aa28 bluetooth: Pull a2dp-codecs.h from BlueZ
This pulls a2dp-codecs.h from BlueZ which contains the capabilities
structures for SBC and MPEG. We currently have these manually added to
ipc.h, so pulling this header makes our files identical to upstream.
2011-03-31 11:04:39 +01:00
Tanu Kaskinen
fce93eb625 alsa-mixer: Check that the kernel driver returns consistent limits with both snd_mixer_selem_get_*_dB_range() and _ask_*_vol_dB().
The check is inspired by a driver that returned higher dB limit from
snd_mixer_selem_get_playback_dB_range() than what _ask_playback_vol_dB()
returned at maximum integer volume.
2011-03-30 09:23:15 +01:00
Tanu Kaskinen
44623a347d alsa-mixer: Make sure that SND_MIXER_SCHN_UNKNOWN isn't used when indexing e->masks.
SND_MIXER_SCHN_UNKNOWN is defined as -1, so that's not a good array index...
2011-03-30 09:21:58 +01:00
Tanu Kaskinen
5270785238 alsa-mixer: Make probing elements with more than two volume channels fail.
This is just a quick hack to prevent array overflow. Correct fix would be to
implement support for more channels.
2011-03-30 09:20:56 +01:00
Maarten Bosmans
9501504859 pactl: Add short output format for list action 2011-03-29 21:24:46 +01:00
Maarten Bosmans
8f25f8dc7d pactl: Separate stat and info actions 2011-03-29 21:23:56 +01:00
Maarten Bosmans
67760e3193 pactl: Add subcommands to the list command 2011-03-29 21:21:52 +01:00
Maarten Bosmans
f07505998e pactl: Accept more volume specification formats
With this you can specify the volume with 6554, 10%, 0.001 or -60dB,
all resulting in the same volume change.
2011-03-29 21:20:22 +01:00
Tanu Kaskinen
e72e75570c sink-input: Add volume_writable to pa_sink_input.
This is pretty cosmetic change; there's no actual functionality added.
Previously the volume_writable information was available through the
pa_sink_input_is_volume_writable() function, but I find it cleaner to have a
real variable.

The sink input introspection variable name was also changed from
read_only_volume to volume_writable for consistency.
2011-03-29 21:18:06 +01:00
Paul Menzel
b358f1c71d .gitignore: add .tarball-version
`.tarball-version` is created by `.git-version-gen`.

Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
2011-03-29 21:15:02 +01:00
Paul Menzel
0bed5caf3b bluetooth: run make update-sbc to pull in build fix for thumb mode
This update pulls in commit c495077c [1] to fix a build error.

        commit c495077cf8a8c37afd90875ec5a5b16b294be15e
        Author: Siarhei Siamashka <siarhei.siamashka@nokia.com>
        Date:   Tue Mar 29 01:57:39 2011 +0300

            sbc: better compatibility with ARM thumb/thumb2

            ARM assembly optimizations fail to compile in thumb mode, but are fine
            for thumb2. Update ifdefs in the code to make use of ARM assembly only
            when it is safe and also make sure that no optimizations are missed
            when compiling for thumb2.

            The problem was reported by Paul Menzel:
            https://tango.0pointer.de/pipermail/pulseaudio-discuss/2011-February/009022.html

This patch is tested with OpenEmbedded using `minimal-uclibc` for `MACHINE = "at91sam9260ek"`.

Note that changes to ipc.h from 8f3ef04b had to be manually reapplied.

[1] http://git.kernel.org/?p=bluetooth/bluez.git;a=commit;h=c495077cf8a8c37afd90875ec5a5b16b294be15e
2011-03-29 21:12:17 +01:00
David Henningsson
6041fc7042 module-jack-sink/source: protect against null return in jack_get_ports
Just picking up a crash report from Ubuntu, here's the result.

--
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic

From 934c52c79bb6faed56a64d6e15f9b285f687afee Mon Sep 17 00:00:00 2001
From: David Henningsson <david.henningsson@canonical.com>
Date: Mon, 28 Mar 2011 14:30:44 +0200
Subject: [PATCH] module-jack-sink/source: protect against null return in jack_get_ports

According to jack_get_ports documentation, it seems like returning NULL
is valid, and that it should be freed using jack_free.

Reported-by: Grayson Peddie
BugLink: http://bugs.launchpad.net/bugs/733424
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-03-28 14:25:50 +01:00
Arun Raghavan
628137a628 cork-on-phone: Handle sink-inputs with NULL sinks
It's possible that by the time we receive the unlink hook, the given
sink-input's sink is set to NULL. Handle this gracefully.
2011-03-28 13:21:23 +01:00
Tanu Kaskinen
77da2c4bcf alsa-mixer: Get rid of a compiler warning.
On 64-bit systems LONG_MAX is greater than the largest possible value of a
uint32_t variable, which caused the compiler to warn about a comparison that is
always false. On 32-bit systems pa_atou() can return a value that will overflow
when assigned to e->volume_limit, which has type long, so the comparison was
necessary.

This dilemma is resolved by using pa_atol() instead of pa_atou().
2011-03-28 09:52:55 +01:00