Commit graph

7914 commits

Author SHA1 Message Date
Arun Raghavan
2e754b1e78 pulse: Initalise pa_threaded_mainloop with zeroes 2014-10-17 10:56:01 +02:00
Felipe Sateler
93c698c9fc util: Try finding out application name using dladdr if available
This fixes getting the binary name in the Hurd, or any other port using
the GNU C library, but only in the case where the library is directly
linked to. Opening with dlopen will not work.

Change in v3: reorder header includes and definitions
Change in v2: use a weak reference to main, so that we
don't crash when main cannot be found.
2014-10-16 15:57:21 +02:00
David Henningsson
c45c0b1490 connect-stress-test: Fix number of streams per sink to "20"
This test broke when PA_MAX_INPUTS_PER_SINK was increased from 32 to 256.
Because we currently don't have time to figure out why, let's just set
NSTREAMS to 20 in the meantime.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-10-16 12:25:49 +02:00
Tanu Kaskinen
9c135b998c tunnel-sink-new: Limit the maximum latency to 200 ms
The default maximum latency is 10 seconds, which is not good,
especially since the tunnel sink doesn't support rewinding. Due to the
lack of rewinding, e.g. volume changes take a long time with large
latencies.
2014-10-09 15:45:07 +03:00
Ricardo Salveti de Araujo
9dd4e8df3e module-stream-restore: use entry_write when filling up the database
It seems at some point the code migrated to use the entry_write calls,
but fill_db is still using the old syntax, causing the entry to be
invalid.

The crash happens when clean_up_db gets called, which then calls
entry_read, causing the crash.

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
2014-10-06 15:50:03 +02:00
Tanu Kaskinen
8fb5e7c32a switch-on-connect: Initialize userdata contents to zero
This fixes userdata.only_from_unavailable being uninitialized in case
the user doesn't give the value in modargs.
2014-10-06 13:30:35 +03:00
Dušan Kazik
f460676ee0 i18n: Update the Slovak translation 2014-10-06 13:21:34 +03:00
David Henningsson
8bfd38d6ca module-mmkbd-evdev: Don't crash on failure to close fd
If the keyboard is unplugged, it looks like the kernel is reporting
back -ENODEV when trying to close the fd. This is probably a kernel
error, but still, it's better to complain than to crash.

Buglink: https://bugs.freedesktop.org/show_bug.cgi?id=80867
Reported-by: Stelios Bounanos
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-10-03 14:23:59 +02:00
Tanu Kaskinen
f04e31dc5e core-util: Add pa_unset_env()
Since we already have pa_set_env(), it's nice to also have a
corresponding function for unsetting environment variables.
2014-10-02 12:14:09 +03:00
Hui Wang
0e44b127d0 module-switch-on-port-available: make the output more accurate
It is possible that the chosen active_port doesn't equal
new_data->active_port, using p->name is more accurate.

Please refer to sink_new_hook_callback()

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2014-09-28 13:55:20 +03:00
Pali Rohár
380a7fc240 bluetooth: bluez4: Add profile name to sinks and sources
Now a2dp and hsp sinks and sources will have different names which means that
applications and other modules can use sink/source to distinguish selected
profile.

Module module-device-restore uses sink/source name and port name as identifier,
so if different profiles have different names module-device-restore can store
volume settings for each profile.

So with this patch it is possible to configure different volume settings for
a2dp and hsp profiles.

This patch does not change port names so gnome applications will be happy.

Note that similar patch is needed also for bluez5, but I'm not using bluez5
so I cannot write or test it.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
2014-09-28 13:34:27 +03:00
Hui Wang
1ff4f1b67a module-switch-on-connect: add an argument for conditionally connecting
On a machine without fixed connecting audio devices like internal
microphone or internal speaker, and when there is no external audio
devices plugging in, the default source/sink is alsa_input/alsa_output
and there is no input devices/output devices listed in the gnome
sound-setting.

Under this situation, if we connect a bluetooth headset, the gnome
sound-setting will list bluez input/output devices, but they are not
active devices by default. This looks very weird that sound-setting
lists only one input device and one output device, but they are not
active. To change this situation, we add an argument, the policy is
if a new source/sink is connected and current default source/sink's
active_port is AVAILABLE_NO, we let the new added one switch to
default one.

BugLink: http://bugs.launchpad.net/bugs/1369476
Signed-off-by: Hui Wang <hui.wang@canonical.com>
2014-09-22 13:26:32 +02:00
Tanu Kaskinen
84ce398ea8 Add a Valgrind suppression file 2014-09-21 11:00:51 +03:00
David Henningsson
e521d38787 srbchannel: Defer reading when setting up read callback
Calling the callback while setting it up can make things
complicated for clients, as the callback can do arbitrarily
things.

In this case, a protocol error caused the srbchannel to be
owned by both the pstream and the native connection.

Now the read callback is deferred, making sure the callback
is called from a cleaner context where errors are handled
appropriately.

Reported-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-09-18 12:07:37 +02:00
David Henningsson
f8aa823998 alsa-time-test: Make constants for channels and rate
Hard-coding constants on several places is bad coding practice.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-09-18 11:51:47 +02:00
David Henningsson
c9e8c0703f alsa-time-test: Do not use Lennart's card by default
Lennart probably had a card with a specific name. It is not a
common name anymore.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-09-18 11:51:42 +02:00
David Henningsson
d303489ef0 alsa-time-test: Add fillrate parameter
As a third parameter, add the number of samples to read/write in
every iteration. This will help slow CPUs.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-09-18 11:51:37 +02:00
Luiz Augusto von Dentz
eb108b3539 bluetooth: Allow policy module to pick 'off' profile
This allow 'off' profile to be choosen when no other profile is available
which is considered better since it requires less resources than other
profiles.
2014-09-18 10:54:23 +03:00
João Paulo Rechi Vita
7fac520d89 bluetooth: Switch transport state to idle in case of HUP
In case the socket HUP the transport state should be set to idle which
will indicate the profile is no longer available.
2014-09-18 10:53:49 +03:00
João Paulo Rechi Vita
75bf00a507 bluetooth: Implement org.ofono.HandsfreeAudioAgent.NewConnection() 2014-09-16 14:46:40 +03:00
Dusan Kazik
7a44c9ee0f i18n: Add Slovak translation 2014-09-16 14:35:12 +03:00
David Henningsson
300a5e3ed7 alsa: Remove unnecessary hctl handles being passed around
Now that we have switched to using the mixer handle only,
there is no use for sending hctl handles around.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-09-16 09:33:04 +02:00
David Henningsson
f2120fc2b6 alsa-mixer/card: Move to use the new mixer interface
Use the new mixer API to get callbacks, instead of using the hctl
API. Using the hctl API caused a memory leak, because alsa-lib itself
used the hctl callbacks, which we were previously overriding.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-09-16 09:33:04 +02:00
David Henningsson
1fd8848e64 alsa-util: Add functions for accessing mixer elements through mixer class
Instead of using the hctl interface, we can find controls belonging
to other iface types than "mixer". We do this by introducing a new
mixer class "SND_MIXER_ELEM_PULSEAUDIO" and create snd_mixer_elem's
for all PCM and CARD iface types (as Jacks are of the CARD type and
ELD controls are of the PCM type).

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-09-16 09:33:04 +02:00
João Paulo Rechi Vita
f7c7cd1825 bluetooth: Implement org.ofono.HandsfreeAudioAgent.Release() 2014-09-11 14:00:15 +03:00
João Paulo Rechi Vita
b1a09ebf7e bluetooth: Handle CardRemoved signal 2014-09-11 14:00:15 +03:00
João Paulo Rechi Vita
8f838b1f31 bluetooth: Handle CardAdded signal 2014-09-11 14:00:15 +03:00
João Paulo Rechi Vita
0e7f303256 bluetooth: Track oFono service 2014-09-11 14:00:15 +03:00
João Paulo Rechi Vita
c4c4de532d bluetooth: Implement transport release for hf_audio_agent transports 2014-09-11 14:00:15 +03:00
João Paulo Rechi Vita
8dd4aa1f00 bluetooth: Implement transport acquire for hf_audio_agent transports 2014-09-11 14:00:15 +03:00
João Paulo Rechi Vita
c098665820 bluetooth: Parse HandsfreeAudioCard properties 2014-09-11 14:00:15 +03:00
João Paulo Rechi Vita
a5a0506c4e bluetooth: List HandsfreeAudioCard objects from oFono 2014-09-11 14:00:15 +03:00
João Paulo Rechi Vita
374c28a40e bluetooth: Register/Unregister Handsfree Audio Agent with oFono
Register as a HandsfreeAudioAgent with oFono during backend
initialization and unregiter during backend finalization. This commit
also adds a check when receiving method calls or signals to make sure
the sender matches with the D-Bus service we're registered with.
2014-09-11 14:00:15 +03:00
João Paulo Rechi Vita
d7a8ccce89 bluetooth: Create hf_dbus_send_and_add_to_pending() for oFono backend 2014-09-11 14:00:15 +03:00
João Paulo Rechi Vita
98d3d85705 bluetooth: Monitor D-Bus signals 2014-09-11 14:00:15 +03:00
Peter Meerwald
eed6d95f49 tests: Remove mix-special-test
code has been moved to cpu-mix-test

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 17:56:03 +02:00
Peter Meerwald
f8fe25e8df tests: Use float constants in cpu-sconv-test
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 17:56:03 +02:00
Peter Meerwald
ce9318fb72 tests: Add ARM NEON test code to cpu-remap-test
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 17:56:03 +02:00
Peter Meerwald
d8be5cbf8b tests: Add rearrange remapping test cases to cpu-remap-test
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 17:55:59 +02:00
Peter Meerwald
c68c9f3aa2 tests: Add to remapping special case code tests to cpu-remap-test
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 17:54:51 +02:00
Peter Meerwald
7ae700941c tests: Reorganize cpu-remap-test program
Make run_remap_test() support up to 8 input and output channels.

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 17:54:39 +02:00
Peter Meerwald
8f4897e162 tests: Use remap function passed in remap struct
Cleanup and add function to setup remap struct

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 16:34:12 +02:00
Peter Meerwald
173649e4f7 tests: Add ARM NEON test code to cpu-mix-test
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 16:34:12 +02:00
Peter Meerwald
d58446963f tests: Add tests for mix special-case code
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 16:34:12 +02:00
Peter Meerwald
9576ba2d9e tests: Use single-line #ifdef for ARM NEON code
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 16:34:11 +02:00
Peter Meerwald
4ca3216ee3 tests: Split cpu tests in separate files
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 16:34:11 +02:00
Peter Meerwald
f4ab8bd835 cpu: Add force_generic_code flag to cpu_info struct
The remapper and channel mixing code have (faster) specialized and (slower)
generic code certain code path. The flag force_generic_code can be set to
force the generic code path which is useful for testing. Code duplication
(such as in mix-special-test) can be avoided, cleanup patches follow.

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 16:34:11 +02:00
Peter Meerwald
61c888dc93 cpu: Don't check for both x86 and ARM code
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 16:01:57 +02:00
Peter Meerwald
380591eb18 core: Add pa_cpu_init() / cpu.c
move code dealing with CPU specific code path initialization
from daemon/main.c to pulsecore/cpu.c

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-09-10 16:01:14 +02:00
Luiz Augusto von Dentz
f508b34b8b bluetooth: Add discovery to pa_bluetooth_backend_new 2014-09-10 13:25:36 +03:00