Commit graph

6635 commits

Author SHA1 Message Date
Arun Raghavan
3f44eb0559 tests: Factor out core sconv test code in cpu-test
This will let us add tests for non-SSE sconv tests.
2012-10-24 10:12:06 +05:30
Arun Raghavan
0d2bef6c78 tests: Add a copyright header to cpu-test 2012-10-24 10:12:05 +05:30
Tanu Kaskinen
82e44a9f45 rtp: Fix rtp_port reading.
pa_atou() return value was not checked, and the cast of a
16-bit variable pointer to a 32-bit variable pointer could
corrupt cseq.
2012-10-23 13:29:59 +03:00
Thomas Martitz
b1303e6d92 gccmacro: Disable printf-like format checking on mingw32 compilers.
Am 23.10.2012 08:25, schrieb Arun Raghavan:
> On Tue, 2012-08-21 at 13:32 +0200, Thomas Martitz wrote:
>> Am 21.08.2012 08:51, schrieb Rémi Denis-Courmont:
>>> Le mardi 21 août 2012 00:50:34 Thomas Martitz, vous avez écrit :
>>>> There are tons of warnings, most of them because the function is not
>>>> recognized as printf-like.
>>> Removing checks looks very fishy.
>>>
>>> To use C99 and/or GNU format specifiers on MingW, you need to use the
>>> gnuprintf attribute instead of printf. With printf, the format string is
>>> validated according to the antiquated MSVC rules.
>>>
>> Interesting, I didn't know about gnuprintf. FWIW, what are those
>> antiquated MSVC rules? I assumed the return value which isn't int for
>> some affected functions?
> Is this one going to be respun?
>

Yes, here you go.

>From c5f15eec69bf95c9a1261e0d82abbd039156e75e Mon Sep 17 00:00:00 2001
From: Thomas Martitz <kuge@rockbox.org>
Date: Wed, 8 Aug 2012 17:38:04 +0200
Subject: [PATCH 1/3] gccmacro: Work around warnings due to printf redirection
 by libintl.

Libintl defines printf as libintl_printf, which breaks the format
attribue. Unfortunately the workaround around provided by libintl
is only enabled for cygwin, but not for mingw builds. Therefore
install the workaround manually.
2012-10-23 15:50:23 +05:30
Mikel Astiz
bb038f76af bluetooth: Refactor code to create profile ports
Put the created ports in a hashmap, but not necessarily inside a struct
pa_card_new_data.
2012-10-23 11:56:13 +03:00
Mikel Astiz
e3d3a232e3 bluetooth: Refactor code to create card profiles
Use a helper function to create the card profiles, given an UUID.
2012-10-23 11:43:19 +03:00
Peter Meerwald
2070ec97d3 echo-cancel: Fix false warning in webrtc AEC.
CXX      libwebrtc_util_la-webrtc.lo
modules/echo-cancel/webrtc.cc: In function 'pa_bool_t pa_webrtc_ec_init(pa_core*, pa_echo_canceller*, pa_sample_spec*, pa_channel_map*, pa_sample_spec*, pa_channel_map*, uint32_t*, const char*)':
modules/echo-cancel/webrtc.cc:196:9: warning: 'rm' may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2012-10-23 11:10:58 +03:00
Peter Meerwald
baa15bd17b svolume_arm: Fix a const warning.
CC       libpulsecore_2.98_la-svolume_arm.lo
pulsecore/svolume_arm.c: In function 'pa_volume_s16ne_arm':
pulsecore/svolume_arm.c:50:8: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2012-10-23 10:59:44 +03:00
Thomas Martitz
9f3bba8bd4 core: Slightly more helpful pa_cstrerror for unknown errors
On Windows, strerror can actually return "Unknown Error"
(e.g. for large errnums). The code assumes the return value to be helpful.
Make it slightly more helpful by catching the message and appending the
errnum.
2012-10-23 12:16:50 +05:30
Thomas Martitz
b342daded9 pacat: Replace read(), write() with pa_* equivalent.
Calling pa_read() and pa_write() seems more appropriate since they deal better
with platform specific issues. This doesn't actually fix any open issue since
only stdio is affected but it seems more future proof.
2012-10-23 12:12:37 +05:30
Thomas Martitz
c327850d9e core: Transparently handle non-blocking sockets on Windows
On Windows, fdsem.c:flush() fails because sockets are set to non-blocking
mode, since pa_read() returns -1 (and errno == EWOULDBLOCK). I guess pa_read()
is expected to block in this case so make it actually block by calling poll().
2012-10-23 12:12:02 +05:30
Thomas Martitz
c1637652ea pacat: Enable binary mode on Windows.
Without this reading from stdin will eventually end with EOF (if there happens
to be a newline sign in the stream), because read() returns 0.

This patch fixes raw data input and piping to pacat on Windows.
2012-10-23 11:57:08 +05:30
Mikel Astiz
0b72a87c26 bluetooth: Hold device pointer while module loaded
Instead of repeatedly asking the discovery API to find a device given
our device path, let's hold a pointer to the device and make sure we
remove the reference when the hook is fired reporting that the device
has been removed. This makes the code easier to follow and slightly
more efficient.
2012-10-22 19:01:42 +03:00
Mikel Astiz
ea45f2c795 bluetooth: Self unload module-bluetooth-device
If the device has been removed, unload the module without depending on
module-bluetooth-discovery.
2012-10-22 18:51:19 +03:00
Mikel Astiz
97bdeaaacd bluetooth: Add hook to tell device was removed
Add a hook to report that the device was removed, and thus references to
it should be released.
2012-10-22 18:44:54 +03:00
Mikel Astiz
24c1892a1f bluetooth: Remove const qualifier for device
The internal API in bluetooth-util should not use the const qualifier
for operations involving a device object. After all, the structure
contains many pointers and thus the const qualifier provides no real
protection.
2012-10-22 18:37:35 +03:00
David Henningsson
3bb0b88beb alsa-sink/source: Warn for scheduling delays
Sometimes the kernel does not schedule us in due time, thus causing
an underrun. Adding a detection and a debug message will be a helpful
step in determining the cause of an underrun.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-10-22 18:08:23 +03:00
Peter Meerwald
2219a775c4 daemon: Fix redundant redeclaration warning
CC     pulseaudio-dumpmodules.o
daemon/dumpmodules.c:93:27: warning: redundant redeclaration of ‘lt__PROGRAM__LTX_preloaded_symbols’ [-Wredundant-decls]
/usr/include/ltdl.h:106:36: note: previous declaration of ‘lt__PROGRAM__LTX_preloaded_symbols’ was here

the declaration is provided by ltld.h of libtool since version 2.4, require the 2.4 instead of 2.2

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2012-10-22 17:56:10 +03:00
Flavio Ceolin
ffe6e28ea7 modargs: New function: pa_modargs_get_value_double(). 2012-10-19 20:00:53 +03:00
Mikel Astiz
1b83e3fe5f bluetooth: Hold transport pointer while profile set
Instead of repeatedly asking the discovery API to find a transport given
our transport path, let's hold a pointer to the transport and make sure
we remove the reference when the hook is fired reporting that the
transport has been removed. This makes the code easier to follow and
slightly more efficient.
2012-10-19 18:36:48 +03:00
Mikel Astiz
3ddff2f3e5 bluetooth: Set to off instead of failing module load
If the profile setup fails during module load, the fallback should be
setting the profile to off, exactly as it is done in card_set_profile().
2012-10-19 18:32:24 +03:00
Mikel Astiz
9b9e53d144 bluetooth: Set to off if transport removed
The recently added hook can be used to detect that the transport being
used has been removed. In this case, the profile needs to be set to off.

Additionally, the change fixes a significant problem: without this
transition, the transport could be destroyed while the hook slots (i.e.
nrec_changed_slot) were still set. This led to a double free of these
objects in stop_thread().
2012-10-19 18:31:01 +03:00
Mikel Astiz
6e5f78e0af bluetooth: Add hook to tell transport was removed
Add a hook to report that the transport was removed from D-Bus, and thus
references to it should be released.
2012-10-19 18:27:04 +03:00
Mikel Astiz
640038cc28 bluetooth: Remove const qualifier for transports
The internal API in bluetooth-util should not use the const qualifier
for operations modifying the transport object. This is specially useful
in order to use the available hooks.
2012-10-19 18:24:22 +03:00
Mikel Astiz
e68712acb4 bluetooth: Check return value of start_thread()
The function can return an error, so in that case the profile change
should fail.
2012-10-19 18:22:51 +03:00
Mikel Astiz
fcfc0e536a bluetooth: Check return value of init_profile()
If profile could not be successfully initialized, the card should be
set to PROFILE_OFF automatically. If sinks or sources exist, they need
to be destroyed, therefore stop_thread() is called.
2012-10-19 18:21:18 +03:00
Mikel Astiz
8b1236531e bluetooth: Use assertions when setting off profile
Setting the card profile to off cannot fail, therefore assertions can be
used when calling pa_card_set_profile().
2012-10-19 18:18:51 +03:00
Arun Raghavan
97f2d6b347 core: Fix a litte-endian bug in ARM svolume code
The old code seems to be written for big-endian code.
2012-10-19 19:44:10 +05:30
Arun Raghavan
600e3daa56 core: Document ARM-optimised svolume code a bit 2012-10-19 19:44:10 +05:30
Arun Raghavan
b87067a007 tests: Minor cpu-test reorganisation
Make volume and conversion tests separate test cases.
2012-10-19 19:44:10 +05:30
Arun Raghavan
f8017bb19d tests: Factor out ARM svolume test into cpu-test
This allows us to run the testing code separately from the PulseAudio
daemon, which makes developing / regression testing this code a lot
easier.
2012-10-19 19:43:30 +05:30
Arun Raghavan
60660a1aec core: Separate ARM CPU detection from initialisation
This separate the ARM CPU feature detection code from the initialisation
so that we can reuse it in tests, like we did for x86 a while back.
2012-10-19 19:01:16 +05:30
Mikel Astiz
2e303b8600 bluetooth: Remove stream moving code
Remove stream moving policies from module-bluetooth-device. It is not
clear if such policies are needed at all and in case yes, they should be
implemented in module-bluetooth-policy.
2012-10-18 20:01:52 +03:00
David Henningsson
9e1627e2a3 cli: Output asterisk when default sink/source is found
These days we don't set core->default_sink/source as soon as somebody
asks for it. To retain consistent behaviour (i e the asterisk),
we need to call pa_namereg_get_default_sink/source.

Reported-by: Daniel Manrique <daniel.manrique@canonical.com>
Reported-by: Brendan Donegan <brendan.donegan@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-10-16 16:10:13 +02:00
Mikel Astiz
fcaef8285a bluetooth: Unlink sink-sources in stop_thread()
Avoid duplicated code by moving the unlinking of sinks and sources to
stop_thread(). After all, they need to be unlinked when the thread is
stopped.
2012-10-14 19:31:43 +03:00
Mikel Astiz
8560b495bd bluetooth: Release transport in stop_thread()
Avoid duplicated code by releasing the transport inside stop_thread(),
along with the rest of the thread-related cleanup.
2012-10-14 19:31:40 +03:00
Mikel Astiz
0c5054e04a bluetooth: Don't find device if set profile is off
If the card is being set to off profile, it is not necessary to check
if the device exists. This could potentially happen during shutdown,
immediately before the module is unloaded.
2012-10-14 19:25:29 +03:00
Mikel Astiz
b76ee00873 bluetooth: Fix potential assertion failure
It might happen that a PropertyChanged signal is received but the
corresponding card profile has not been created, leading to an assertion
failure in filter_cb() due to inexistent ports. This can happen if BlueZ
misbehaves, or also if the UUIDs are reported later on (i.e. during
pairing discovery). In any case, the signal should just be ignored.
2012-10-14 19:20:58 +03:00
Mikel Astiz
94dbf25e81 bluetooth: Trivial function rename
Former setup_bt() was just setting up the transport, so it's easier to
follow if the function name makes this more explicit.
2012-10-14 19:17:01 +03:00
Mikel Astiz
67c0090556 bluetooth: Ignore Device.DisconnectRequested
Handling the signal DisconnectRequested should be unnecessary since the
profile-specific interfaces will be later disconnected, leading to
module unload.

Additionally, the signal is problematic: if an interface (i.e.
A2DP AudioSource) is playing at the time DisconnectRequested is
signaled, the following sequence can occur:

1. AudioSource is playing
2. DisconnectRequested is received
3. Module is unloaded due to DisconnectRequested
4. AudioSource state changes from playing to connected
5. module-bluetooth-discover loads the module
6. AudioSource state changes from connected to disconnected

Therefore the module is unnecessarily loaded, to be unloaded immediately
afterwards. This can easily be reproduced if a device is unpaired while
the audio is streaming.

The simplest solution to this consists of removing step 3, by just
ignoring the DisconnectRequested signal. This reverts commit
8169a6a6c9.
2012-10-14 19:16:21 +03:00
Chan-yeol Park
f0432ce6ae bluetooth: Remove ipc.[ch] files in the bluetooth module
These files are remove in the bluez project.
In case of definitions in the ipc files
we could use defintions in the a2dp-codecs.h
2012-10-06 14:38:59 +03:00
Deng Zhengrong
67602d8743 tests: make 'check' optional 2012-10-04 16:49:00 +03:00
David Henningsson
ba0203c4c0 alsa-mixer: Remove analog-output-lfe-on-mono
Upstreamed from Debian: "Although in principle Ac '97 hardware has a
separate mono LFE pin nothing seems to use it. To make matters worse
it does confuse PulseAudio's port selection slightly which causes
audio in virtualbox not to work out of the box."

Credit: Sjoerd Simons <sjoerd@debian.org>
Credit: Martin-Éric Racine <martin-eric.racine@iki.fi>
BugLink: https://bugs.launchpad.net/bugs/1016969
BugLink: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=673847
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-10-04 13:32:35 +02:00
David Henningsson
2caafa7741 alsa-mixer: Cache failure to open inputs/output mappings
I was hoping this would improve bootup speed, but it doesn't seem
to do so here, at least not much. But at least it reduces the logs
a little.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-10-03 00:15:45 +03:00
Colin Walters
f16a532e88 git-version-gen: Honor GIT_DESCRIBE_FOR_BUILD environment variable
The GNOME-OSTree build system currently creates chroots and bind
mounts to the source tree outside the root; this means that we can't
necessarily run git inside the root, because in the case of git
submodules, the .git repository will point to outside root.

Also, error out fatally if we fail to determine the version; it
makes no sense to put UNKNOWN in e.g. the pkg-config files
since this will just cause errors later on.
2012-09-27 15:22:10 +03:00
Mikel Astiz
bf0a640cfd bluetooth: Add port availability transition policies
Handle availability changes in Bluetooth ports inside
module-bluetooth-policy. The implemented behavior is similar to how
module-switch-on-port-available behaves, but the conditions are more
relaxed and thus more profile changes are triggered.
2012-09-26 19:52:10 +08:00
Mikel Astiz
d84e36563c bluetooth: Let suspend-on-idle request audio in headset
When PA is doing gateway role, let module-suspend-on-idle resume the
audio stream automatically. This will work until the user (or the remote
side, which we also consider user-initiated) suspend the stream
manually.
2012-09-26 19:52:10 +08:00
Mikel Astiz
e492f2912e bluetooth: Do not switch to HFGW automatically
Card profile hfgw should be no different from the rest, and thus no
internal policy inside module-bluetooth-device should decide to switch
to its profile automatically.

This should be handled by policy modules.
2012-09-26 19:27:15 +08:00
Mikel Astiz
cb2a6d34f6 bluetooth: Release transport when not available
Handle the Playing->Connected transition gracefully by releasing the
transport and setting the sink and sources as suspended. This is
necessary since the IO thread might not encounter a HUP always.
2012-09-26 19:27:15 +08:00
Mikel Astiz
ebadda816d bluetooth: Acquire transport when becomes available
Try to acquire the transport as soon as the audio stream is started,
along with the availability flag update.
2012-09-26 19:27:14 +08:00