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.
Mikel Astiz [Fri, 31 Aug 2012 10:51:13 +0000 (12:51 +0200)]
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.
Mikel Astiz [Fri, 31 Aug 2012 10:51:12 +0000 (12:51 +0200)]
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.
Mikel Astiz [Fri, 31 Aug 2012 10:51:08 +0000 (12:51 +0200)]
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.
Mikel Astiz [Fri, 31 Aug 2012 10:51:07 +0000 (12:51 +0200)]
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.
Mikel Astiz [Fri, 31 Aug 2012 10:51:05 +0000 (12:51 +0200)]
bluetooth: Do not acquire transport during profile change
Until today, setting the card to some profile resulted in a transport
acquisition, leading to audio stream setup. This is generally not very
interesting and even undesireable for HFGW use-cases, where the
Gateway role (the remote end) would typically request the SCO link.
Nevertheless, there is no safe way to implement such check without race
conditions, since the BlueZ's state can change between the state report
and the call to Acquire(). The chances for this to reproduce are quite
low though, since interface state changes are relatively slow.
This race condition requires that BlueZ's API is extended in order to
perform the operation atomically, which has already been discussed and
ack-ed in the BlueZ mailing list.
Note that this patch does not introduce a new race condition, since it
already existed before (the PropertyChanged->Acquire race condition,
affecting HFGW use-cases). It is just more explicit now.
Mikel Astiz [Fri, 31 Aug 2012 10:51:04 +0000 (12:51 +0200)]
bluetooth: Set profile even if transport not acquired
If the acquisition of the transport fails, the profile should still be
set. In this case the audio is not actually streaming, so the sink and
source will be created but left suspended.
If the transport needs to be acquired later, for example because the
user wants to route the audio the remote device, the suspend flag should
have to be changed.
Mikel Astiz [Fri, 31 Aug 2012 10:51:02 +0000 (12:51 +0200)]
bluetooth: Support port availability flag
Use the port availability flag to expose whether a certain profile is
connected and whether it's doing actual audio streaming.
The proposed mapping is the following:
- Profile disconnected: port is unavailable
- Profile is connected (but not streaming/playing): availability unknown
- Profile is streaming/playing: port is available
The availability-unknown is specially interesting: it involves that if
the sink/source exists (corresponding card profile set), it is currently
in suspended state.
For example, for SCO cases (HFGW or HSP), this means the SCO is down. A
policy module would typically not change this, unless someone is really
trying to use the sink/source. This situation would be nicely handled by
module-suspend-on-idle, which would automatically connect SCO.
On the other hand, if the user wants to control the status of the SCO,
it will still be possible by resuming the sink or source (suspend=0).
This works out-of-the-box since most UIs would show to the user ports
whose availability is unknown.
Mikel Astiz [Fri, 31 Aug 2012 10:51:03 +0000 (12:51 +0200)]
bluetooth: Config MTU transport after acquire
The configuration of the transport that depends on the MTU should be
performed every time the transport has been acquired, since the
parameters depend on what the Media API provides. This requires to
update the parameters of the sinks and sources as well.
This patch moves this code into a new function that will be called
when the stream is starting (setup_stream), from the IO thread.
This makes the code more robust, since the existing multiple calls to
bt_transport_acquire() do not rely on setup_bt() being able to acquire
the transport.
Mikel Astiz [Fri, 31 Aug 2012 10:51:01 +0000 (12:51 +0200)]
bluetooth: Provide dummy set_port callbacks
There should be one port per sink/source so a dummy set_port callback
will be enough.
Adding this callback avoid the "operation not implemented" error
message and additionally makes the module work nicely with
module-switch-on-port-available.
Mikel Astiz [Fri, 31 Aug 2012 10:50:59 +0000 (12:50 +0200)]
bluetooth: Fix check if transport exists before acquire
The transport might have disapeared exactly before acquiring, so we
should avoid an assertion failure, in this case inside the function
pa_bluetooth_discovery_get_by_path().
Mikel Astiz [Fri, 31 Aug 2012 10:50:57 +0000 (12:50 +0200)]
bluetooth: Fix wrongly set "phone" role for HFGW
The HFGW source should be consistent with the sink by not setting the
"phone" intended role.
Even though setting this role seems to make sense strictly speaking, the
rest of the codebase doesn't handle this well. Therefore, the audio
coming from a Bluetooth phone can be routed back to the same device.
Mikel Astiz [Fri, 31 Aug 2012 10:50:55 +0000 (12:50 +0200)]
bluetooth: Refactor code to helper function
Make code more readable by introducing the helper function
bt_transport_is_acquired(). This also adds assertions to check whether
the internal state is consistent.
equalizer: Don't cleanup u->sink in sink_input_kill_cb yet
Previously, sink_input_kill_cb would cleanup u->sink an then unload the
module. However, during module unload, both save_state and dbus_done
tried to use u->sink, causing a segfault or assertion failure.
The segfault is easy to reproduce: Load module-equalizer-sink and then
press ctrl-C to terminate pulseaudio.
This commit removes the u->sink cleanup in sink_input_kill_cb, since
u->sink will be cleaned up by the module's pa__done as well (after it
has been used).
David Henningsson [Thu, 19 Apr 2012 08:54:08 +0000 (10:54 +0200)]
flist: Increase default list size to 256
Nowadays, we are using more hashmaps and other things, than we did
before. Therefore, I often get the "flist is full (don't worry)"
message. This change should avoid that message. I was unable to find
any significance in increase of memory footprint from this change.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This check was valid before we introduced per-source-output volumes, so
dropping it now. Thanks to Alban Browaeys <prahal@yahoo.com> for
catching this.
During initialization, the approach avoids having a needless short
period of corked state in case the sink is suspended, by always creating
the source-output corked and uncorking it immediately afterwards when
the sink is not suspended.
During initialization, the approach avoids having a needless short
period of corked state in case the source is suspended, by always
creating the sink-input corked and uncorking it immediately afterwards
when the source is not suspended.
Revert "build: Merge bluez pkg-config checks into one"
Keeping the SBC check separate means we can keep the SBC_LIBS/CFLAGS
separate, which is cleaner. Thanks to Jan Steffens for pointing out that
this was broken (SBC_* wasn't actually changed to match the configure
change).
Luiz Augusto von Dentz [Fri, 17 Aug 2012 14:21:52 +0000 (17:21 +0300)]
bluetooth: Don't force any profile on discovery module
Let device module figure out the priority based on the state of the
profiles.
Note that most likely all profiles will be in PA_BT_AUDIO_STATE_CONNECTED
state so 'Off' will be the initial profile then it is up to the policy
module to switch to the most suitable profile.
sink-input: Fix underrun_for calculation when resampling.
pa_sink_input_seek() calculates output lenth (slength) and
corresponding input length (ilength). During an underrun, the function
generates slength bytes of silence and adds ilength to the
underrun_for value. However, the ilength value may be shortened to
match resampler limits, and there's no corresponding adjustment to
slength. Thus, the length of the generated silence is longer than
resampler output would have been, and underrun_for should be increased
by more than the limited ilength. This error makes the user-visible
since_underrun field in struct pa_timing_info too small. Fix by using
the original value calculated before limiting in this case.
Tanu Kaskinen [Fri, 24 Aug 2012 13:16:43 +0000 (16:16 +0300)]
sink: Remove an incorrect FIXME comment.
The problem that the comment mentions doesn't actually
exist, because when the sink latency is changed to a smaller
value, the sink implementor will request the required
rewind.
Mikel Astiz [Wed, 22 Aug 2012 07:04:21 +0000 (09:04 +0200)]
bluetooth: Generalize module-bluetooth-policy
Instead of focusing on a2dp_source only, prepare the module to support
several profiles. It will be possible to enable/disable each of them
using module arguments.
Mikel Astiz [Wed, 22 Aug 2012 07:04:19 +0000 (09:04 +0200)]
bluetooth: Fix bluetooth.protocol property
Property bluetooth.protocol did make a distinction between A2DP sink and
source roles but on the contrary did not separate HFP roles (headset vs
gateway). For consistency, they should both behave similarly.
This automatically fixes another incosistency: the HFGW (or HSP) sink
was set to bluetooth.protocol="sco", while the source was set to "hsp".
There is no use for this distinction, since the protocol (including the
role) is the same.
Tanu Kaskinen [Tue, 14 Aug 2012 14:08:37 +0000 (17:08 +0300)]
object: Get rid of "warning: cast increases required alignment of target type"
On ARM, pa_object has less strict alignment requirements
than e.g. pa_sink and pa_source, so when pa_object is cast
to pa_sink, the compiler thinks that it's unsafe. In this
case, however, the pointer given to pa_sink_ref() was a
pa_sink pointer to begin with, so casting it first to
pa_object and then back to pa_sink is entirely safe.
This particular source of warnings is extremely annoying,
because this message is printed for any compilation unit
that includes sink.h, source.h or any other header that
defines a class, and the message tends to get printed
multiple times for one compilation unit:
In file included from ./pulsecore/source-output.h:37:0,
from ./pulsecore/source.h:49,
from ./pulsecore/sink.h:40,
from ./pulsecore/core.h:50,
from daemon/daemon-conf.h:31,
from daemon/cmdline.h:25,
from daemon/cmdline.c:38:
./pulsecore/sink-input.h: In function 'pa_sink_input_ref':
./pulsecore/sink-input.h:245:1: warning: cast increases required alignment of target type [-Wcast-align]
Mikel Astiz [Thu, 16 Aug 2012 11:08:29 +0000 (13:08 +0200)]
bluetooth: Fix missing state checks for a2dp_source
Profile a2dp_source, just like any other card profile, should have
state guards when the profile is being changed. If the BlueZ interface
is not connected, the profile should be set to "off".
Tanu Kaskinen [Mon, 6 Aug 2012 12:07:57 +0000 (15:07 +0300)]
build-sys: Link utf8-test to libpulsecommon.
Fixes this:
/usr/bin/ld: utf8_test-utf8-test.o: undefined reference to symbol 'pa_log_set_level'
/usr/bin/ld: note: 'pa_log_set_level' is defined in DSO /home/takaskin/dev/pulseaudio/src/.libs/libpulsecommon-2.98.so so try adding it to the linker command line
/home/takaskin/dev/pulseaudio/src/.libs/libpulsecommon-2.98.so: could not read symbols: Invalid operation
Mikel Astiz [Thu, 26 Jul 2012 10:36:33 +0000 (12:36 +0200)]
bluetooth: Remove minor unnecessary check
The return value of dbus_message_iter_next() doesn't need to be checked
since the while condition will be false anyway (arg type will be
DBUS_TYPE_INVALID).
Mikel Astiz [Thu, 26 Jul 2012 10:36:32 +0000 (12:36 +0200)]
bluetooth: Replace deprecated ListDevices()
The method ListDevices() in org.bluez.Adapter was deprecated in BlueZ
4.61, and is going to be removed in future releases. Instead, a property
was introduced for this purpose in BlueZ 4.7.
Mikel Astiz [Thu, 26 Jul 2012 10:36:31 +0000 (12:36 +0200)]
bluetooth: Replace deprecated ListAdapters()
The method ListAdapters() in org.bluez.Manager was deprecated in BlueZ
4.61, and is going to be removed in future releases. Instead, a property
was introduced for this purpose in BlueZ 4.22.
The module module-bluetooth-device should never be given parameter
'profile' twice, even if both HFGW and A2DP are playing. This patch
proposed to consider HFGW first.
Mikel Astiz [Fri, 6 Jul 2012 09:19:52 +0000 (11:19 +0200)]
bluetooth: Don't use the old socket IPC mechanism with BlueZ
This simplifies the code a lot, in favour of the D-Bus Media interface
in BlueZ. The old socket-based IPC mechanism has been deprecated and is
about to be removed soon.
Without -avoid-version, libtool creates a libwebrtc-util.so.0 and
libwebrtc-util.so.0.0.0 which are not cleaned up by make uninstall,
which in turn causes make distcheck to fail.