Tanu Kaskinen [Wed, 16 Jan 2013 01:36:04 +0000 (03:36 +0200)]
Initialize monitor's busy status to false if we own the device.
Bug found by David Henningsson.
Tanu Kaskinen [Wed, 16 Jan 2013 01:36:03 +0000 (03:36 +0200)]
Call change_cb() only when there's an actual change.
Calling change_cb() whenever anything happens in the ownership of the
bus name caused trouble in PulseAudio in this scenario:
1. PulseAudio is using a device and owns the corresponding service
name.
2. Another application requests device release.
3. PulseAudio releases the device.
4. Change in the bus name ownership: PulseAudio gives up the
ownership, and nobody owns the name.
5. reserve-monitor notices that, and notifies PulseAudio.
6. Since reserve-monitor reports the device as "not busy", PulseAudio
decides to reserve the bus name immediately back to itself and
opens the device again.
The other application will forcibly take the bus name to itself, as
it should according to the protocol, but the other application may
have trouble opening the device if it tries to do that before
PulseAudio has had time to react to the NameLost signal.
This can be solved by not calling change_cb() if there are no changes
in the device busy status. In this scenario the device is considered
"not busy" while PulseAudio is owning the bus name, so PulseAudio gets
no notification when the ownership changes from PulseAudio to nobody.
Tanu Kaskinen [Sun, 13 Jan 2013 01:15:23 +0000 (03:15 +0200)]
pulse: Initialize pa_operation objects to all-zero.
state_callback and state_userdata fields were not initialized.
Piotr Drąg [Thu, 10 May 2012 17:39:53 +0000 (19:39 +0200)]
i18n: Update Polish translation
Paul Meng [Mon, 7 Jan 2013 13:41:26 +0000 (21:41 +0800)]
pulse: Add pa_operation_set_state_callback() API
[The original commit message didn't have any explanation why this
change is made, so I'll add that information here myself.
--Tanu Kaskinen]
This change is from the developers of a Haskell binding[1]. According
to them, this change isn't strictly necessary, but their code gets
significantly cleaner if they can register an operation callback that
is called when the operation is cancelled due to the context getting
disconnected.
[1] https://github.com/favonia/pulse
Tanu Kaskinen [Fri, 11 Jan 2013 20:11:04 +0000 (22:11 +0200)]
bluetooth: Convert booleans to stdbool.
Mikel Astiz [Fri, 11 Jan 2013 10:07:49 +0000 (11:07 +0100)]
bluetooth: Simplify redundant error check
As pointed out by Tanu, checking both error conditions is redundant and
raises the question whether it's possible that one of the conditions is
true while the other is false.
Therefore, simplify the condition by just checking one part of the
disjunction.
Mikel Astiz [Fri, 11 Jan 2013 10:07:48 +0000 (11:07 +0100)]
bluetooth: Remove device_is_audio_ready()
The function was used to check whether the basic properties of the
Bluetooth device have been received. This can be simplified by just
checking d->device_info_valid, since the state of the audio interface
is only relevant inside pa_bluetooth_device_any_audio_connected(), which
is used to trigger the discovery callback.
While checking device_info_valid, special care must be taken with all
three possible values: when set to -1, it means some error was triggered
while getting the device properties. Therefore, these devices can also
be ignored outside bluetooth-util.
Besides that, the patch slightly modifies the behavior of the internal
API affecting pa_bluetooth_discovery_get_by_address() and
pa_bluetooth_discovery_get_by_path(), since they will return the device
no matter the state of the audio interface. This however makes sense and
should have no influence in the current codebase given that the modules
make use of devices only after the discovery hook has been triggered.
Mikel Astiz [Fri, 11 Jan 2013 10:07:47 +0000 (11:07 +0100)]
bluetooth: Do not check profile states is device_audio_is_ready()
The function is used to make sure some basic information has already
been gathered before the device is being used. At this point profile
states can be ignored, since their initial value will be
PA_BT_AUDIO_STATE_INVALID and thus effectively similar to
PA_BT_AUDIO_STATE_DISCONNECTED due to audio_state_to_transport_state().
The change should make no difference given that the behavior of
pa_bluetooth_device_any_audio_connected() doesn't change: by the time
TRUE is returned, a transport needs to exist. This means a profile
will exist in CONNECTING or CONNECTED state and thus the old
implementation of device_audio_is_ready() would also have returned TRUE.
Mikel Astiz [Fri, 11 Jan 2013 10:07:46 +0000 (11:07 +0100)]
bluetooth: Use stdbool for pa_bool_t
Use lowercase true/false instead of TRUE/FALSE for pa_bool_t.
Mikel Astiz [Fri, 11 Jan 2013 10:07:45 +0000 (11:07 +0100)]
bluetooth: Check message signature for SetConfiguration
Make sure inside endpoint_set_configuration() that the received D-Bus
message matches the expected signature.
Mikel Astiz [Fri, 11 Jan 2013 10:07:44 +0000 (11:07 +0100)]
bluetooth: Fix minor style issues
Trivially fix some style issues affecting line wrap (128 chars max with
the exception of multi-line comments, which are limited to 80),
indentation and unnecessary parentheses.
Mikel Astiz [Fri, 11 Jan 2013 10:07:43 +0000 (11:07 +0100)]
bluetooth: Fix incorrect error messages
err.message doesn't contain anything useful in these error cases so
fix the mistake and avoid misleading messages.
Peter Meerwald [Fri, 11 Jan 2013 14:59:27 +0000 (15:59 +0100)]
echo-cancel: Fix error cleanup of pa_speex_ec_init()
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Tanu Kaskinen [Fri, 4 Jan 2013 15:21:25 +0000 (17:21 +0200)]
pulse: Fix endianness definition on Sparc.
Patch by Brian Cameron <brian.cameron@oracle.com>.
Tanu Kaskinen [Fri, 4 Jan 2013 14:57:48 +0000 (16:57 +0200)]
solaris: When suspending, flush the device instead of draining it.
Patch by Brian Cameron <brian.cameron@oracle.com>.
Tanu Kaskinen [Fri, 4 Jan 2013 14:49:52 +0000 (16:49 +0200)]
solaris: Fix get_playback_buffered_bytes() return value.
Based on a patch by Brian Cameron <brian.cameron@oracle.com>.
Tanu Kaskinen [Fri, 4 Jan 2013 14:31:57 +0000 (16:31 +0200)]
shm: Support Solaris shm file paths.
Patch by Brian Cameron <brian.cameron@oracle.com>
Peter Meerwald [Thu, 3 Jan 2013 15:38:48 +0000 (16:38 +0100)]
tests: Fix allowed sample formats in resampler-test usage text
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Peter Nelson [Sat, 22 Dec 2012 22:18:52 +0000 (22:18 +0000)]
jackdbus-detect: Add channel count override.
Allow configuration of number of channels when using module-jackdbus-detect
to load jack-sink and jack-source. This is useful when the default channel
count doesn't match the logical channel count desired, e.g. with multi-
channel audio interfaces.
Signed-off-by: Peter Nelson <peter@fuzzle.org>
Tanu Kaskinen [Mon, 17 Dec 2012 07:01:03 +0000 (09:01 +0200)]
bluetooth: Remove pa_bluetooth_discovery_sync().
pa_bluetooth_discovery_sync() waited until all pending method calls
had completed. I don't understand what the benefit of that could be,
so I removed the function. We should avoid blocking as much as
possible, and the code that used pa_bluetooth_discovery_sync() didn't
look like it really needed to wait for anything.
Stefan Huber [Thu, 20 Dec 2012 10:33:05 +0000 (11:33 +0100)]
echo-cancel: Extend null implementation to arbitary sample specs
The new null implementation works with arbitrary sample specs for source
and sink. In particular, it handles a different number of channels for
source and sink.
Signed-off-by: Stefan Huber <s.huber@bct-electronic.com>
Acked-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Stefan Huber [Thu, 20 Dec 2012 10:33:04 +0000 (11:33 +0100)]
echo-cancel: Enable different blocksizes for sink and source
In order to support different blocksizes for source and sink (e.g, for
4-to-1 beamforming/echo canceling which involves 4 record channels and 1
playback channel) the AEC API is altered:
The blocksize for source and sink may differ (due to different sample
specs) but the number of frames that are processed in one invokation of
the AEC implementation's run() function is the same for the playback and
the record stream. Consequently, the AEC implementation's init()
function initalizes 'nframes' instead of 'blocksize' and the source's
and sink's blocksizes are derived from 'nframes'. The old API also
caused code duplication in each AEC implementation's init function for
the compution of the blocksize, which is eliminated by the new API.
Signed-off-by: Stefan Huber <s.huber@bct-electronic.com>
Acked-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Stefan Huber [Tue, 18 Dec 2012 12:52:32 +0000 (13:52 +0100)]
echo-cancel: Fix calc_diff for asymmetric sample specs
In case that source and sink use different sample specs (e.g., different
number of channels) the computation of the latency difference fails.
To fix this, we obtain the corresponding latencies in terms of time using
the respective sample specs instead of buffer sizes.
Signed-off-by: Stefan Huber <s.huber@bct-electronic.com>
Acked-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Stefan Huber [Tue, 18 Dec 2012 12:52:31 +0000 (13:52 +0100)]
echo-cancel: Fix missing setup of sink_ss in echo-cancel-test.
In main() of echo-cancel-test it is wrongly assumed that the EC
implementation's init() function properly initializes sink_ss. In
contrast, pa__init() sets sink_ss by default to
sink_master->sample_spec. Fix this by setting sink_ss to default
parameters and let EC implementation's init() override these settings.
Signed-off-by: Stefan Huber <s.huber@bct-electronic.com>
Acked-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Stefan Huber [Tue, 18 Dec 2012 12:52:30 +0000 (13:52 +0100)]
echo-cancel: Fix echo-cancel-test's argument number checking
Argument argv[5] is accessed when argc>4, which leads to an invalid
access for argc==5. Fix this.
Signed-off-by: Stefan Huber <s.huber@bct-electronic.com>
Acked-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Tanu Kaskinen [Sat, 22 Sep 2012 15:16:24 +0000 (18:16 +0300)]
build: Don't enable BlueZ if libbluetooth is not found.
Previously, if libsbc was available but libbluetooth was not, BlueZ
would get incorrectly enabled.
Tanu Kaskinen [Tue, 18 Dec 2012 06:47:58 +0000 (08:47 +0200)]
bluetooth: Don't access a transport after it's freed.
In addition to moving the freeing a bit later, unnecessary checks for
t->device are removed. t->device is initialized to a non-NULL value
when the transport is created, and it's never changed.
Tanu Kaskinen [Mon, 17 Dec 2012 05:46:04 +0000 (07:46 +0200)]
man: Update log-target documentation.
Tanu Kaskinen [Wed, 9 May 2012 03:04:52 +0000 (06:04 +0300)]
modargs: Don't fail needlessly in pa_modargs_get_sample_spec_and_channel_map().
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=49664
Wang Xingchao [Mon, 7 May 2012 08:52:18 +0000 (16:52 +0800)]
sndfile-util: reduce useless loop
it's useless to get the same SF_FORMAT_INFO three times, just compare the
name/extention in the same loop.
Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Tanu Kaskinen [Sat, 28 Apr 2012 15:54:10 +0000 (18:54 +0300)]
memblockq: Use pa_xnew0() to avoid manual zeroing.
Christoph Gysin [Wed, 11 Apr 2012 20:05:54 +0000 (23:05 +0300)]
doc: Generate API documentation for ext-device-manager and ext-device-restore.
I noticed that the doxygen API (http://freedesktop.org/software/pulseaudio/doxygen)
does not include ext-device-manager.h. The following patch adds ext-device-manager.h
and ext-device-restore.h to the list of files processed by doxygen.
Tanu Kaskinen [Tue, 10 Apr 2012 11:36:04 +0000 (14:36 +0300)]
device-restore: Fix empty argument list declaration.
Ștefan Săftescu [Fri, 6 Apr 2012 21:57:43 +0000 (00:57 +0300)]
virtual-sink: Removed the option to specify sample format.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=46529
Tanu Kaskinen [Tue, 3 Apr 2012 07:18:55 +0000 (10:18 +0300)]
cpulimit: Explicitly ignore pa_read() return value.
It doesn't matter if the function fails (I'm not sure if
it's even possible), because the read data isn't used for
anything and the daemon will terminate in any case. The
void cast should get rid of a Coverity warning.
Removing the whole pa_read() call should be ok too, but I
guess it's nice to clean up the pipe before terminating...
Tanu Kaskinen [Mon, 2 Apr 2012 13:13:54 +0000 (16:13 +0300)]
oss: Check pa_read() return value.
Tanu Kaskinen [Fri, 30 Mar 2012 08:04:33 +0000 (11:04 +0300)]
mainloop-signal: Explicitly ignore pa_write() return value.
Coverity warned about an ignored return value. I'm not sure
if there's something that should be done if writing fails;
at least I couldn't think of anything. Would logging an
error be acceptable here?
Tanu Kaskinen [Fri, 30 Mar 2012 07:31:48 +0000 (10:31 +0300)]
smoother-test: Fix array overflow.
Tanu Kaskinen [Thu, 29 Mar 2012 12:24:02 +0000 (15:24 +0300)]
Fix pa_parse_boolean() return value checking.
pa_parse_boolean() return value shouldn't be stored in
pa_bool_t, because 1 and -1 need to be distinguished.
Tanu Kaskinen [Thu, 29 Mar 2012 09:18:32 +0000 (12:18 +0300)]
pasuspender: Check pa_context_connect() return value.
Tanu Kaskinen [Thu, 22 Mar 2012 10:23:13 +0000 (12:23 +0200)]
bluetooth: Don't free read_smoother in pa__done().
pa__done() calls stop_thread(), and stop_thread() already
frees the smoother. The duplicate freeing is not strictly
a bug, but static analyzers (in this case Coverity) may
complain about double-freeing, because when pa__done()
"frees" the smoother (which doesn't actually ever happen),
the pointer is not nulled. pa__done() then calls
bt_transport_release(), which will also free the smoother
if it's not NULL.
The analyzer complaint could be silenced also by nulling
the pointer in pa__done(), but since this is clearly
redundant code, I chose to remove it.
Matěj Laitl [Mon, 19 Mar 2012 21:44:30 +0000 (22:44 +0100)]
qpaeq: Try to load equalizer module before failing, better error messages
This fixes bug 38728 [1]. When equalizer features are unavailable in running
pulseaudio daemon, try to load relevant module. If this fails, following error
is printed on stderr instead of a confusing traceback:
It seems that running pulseaudio does not support equalizer features and
loading module-equalizer-sink module failed. Exiting...
[1] https://bugs.freedesktop.org/show_bug.cgi?id=38728
Signed-off-by: Matěj Laitl <matej@laitl.cz>
Tanu Kaskinen [Sun, 16 Dec 2012 05:03:00 +0000 (07:03 +0200)]
bluetooth: Make pa_bt_audio_state_from_string() private.
Tanu Kaskinen [Sun, 16 Dec 2012 04:57:22 +0000 (06:57 +0200)]
bluetooth: Improve transport state change log message.
Mikel Astiz [Fri, 14 Dec 2012 14:14:40 +0000 (15:14 +0100)]
bluetooth: Replace acquire param 'start' with 'optional'
Make the internal function bt_transport_acquire() consistent with the
API in bluetooth-util by replacing the old 'start' parameter with
exactly the opposite: 'optional'.
Therefore, all calls to the function need to negate the second
parameter.
Note also that the name is more accurate now that setup_stream() is not
called inside bt_transport_acquire().
Mikel Astiz [Fri, 14 Dec 2012 14:14:39 +0000 (15:14 +0100)]
bluetooth: Call setup_stream() manually
Do not call setup_stream() automatically inside bt_transport_acquire().
Instead, the caller is responsible to use both functions as necessary.
As a first trivial step, setup_stream() is now called manually after
all calls to bt_transport_acquire(u, TRUE), with the exception of
setup_transport() where the thread is still about to start and thus
setup_stream() will be called later on from thread_func().
Mikel Astiz [Fri, 14 Dec 2012 14:14:38 +0000 (15:14 +0100)]
bluetooth: Remove D-Bus dependency in module-bluetooth-device
All D-Bus infrastructure is now unused after bluetooth-util has covered
the pieces that were pending. Therefore, all D-Bus related code in
module-bluetooth-device can be safely removed.
Mikel Astiz [Fri, 14 Dec 2012 14:14:37 +0000 (15:14 +0100)]
bluetooth: Use transport state instead of profile states
The transport state also reflects the state of the audio interface. The
state redundancy can thus be minimized by always using the first one,
and avoiding the use of profile-specific states with the exception of
finding out the initial state of a transport.
Mikel Astiz [Fri, 14 Dec 2012 14:14:36 +0000 (15:14 +0100)]
bluetooth: Refactor dependency to org.bluez.Audio
The state of this interface is needed for one single reason: we need to
wait until all profiles have been connected (or more precisely, until
are connection attempts are finished). This can be made more explicit in
the code by just checking the CONNECTING state (and not loading
module-bluetooth-device during that state), but otherwise treating all
transport types equally.
Ideally, audio_state should be completely removed but it's left there to
avoid an issue with module-card-restore, as documented in the source
code's comments.
Mikel Astiz [Fri, 14 Dec 2012 14:14:35 +0000 (15:14 +0100)]
bluetooth: Trivially remove bt_transport_is_acquired()
The function body is now trivial and can thus be inlined.
Mikel Astiz [Fri, 14 Dec 2012 14:14:34 +0000 (15:14 +0100)]
bluetooth: Abstract transport access types inside bluetooth-util
Transports can be acquired with different access rights, but in practice
"rw" was always used inside module-bluetooth-device. In addition, this
feature is removed in BlueZ 5.0 and therefore it is convenient to
abstract all this inside bluetooth-util.
Mikel Astiz [Fri, 14 Dec 2012 14:14:33 +0000 (15:14 +0100)]
bluetooth: Use transport state to update port availability
Use transport state to calculate the corresponding port availability,
and while doing so use bluetooth-util to receive profile state updates
instead of directly parsing D-Bus PropertyChanged signals.
Mikel Astiz [Fri, 14 Dec 2012 14:14:32 +0000 (15:14 +0100)]
bluetooth: Refactor parsing of profile state changes
Split filter_cb() to separate the parsing of the D-Bus message from
the internal logic handling the new state.
Mikel Astiz [Fri, 14 Dec 2012 14:14:31 +0000 (15:14 +0100)]
bluetooth: Move profile_to_string() to bluetooth-util
Move the function to the utility library where the enum is defined. At
same time avoid using the default clause in order to make sure the
compiler will complain if the enum type gets extended.
Mikel Astiz [Fri, 14 Dec 2012 14:14:30 +0000 (15:14 +0100)]
bluetooth: Use bluetooth-util for mic/speaker gain control
Use the new abstraction in bluetooth-util to both receive volume updates
and request them.
Mikel Astiz [Fri, 14 Dec 2012 14:14:29 +0000 (15:14 +0100)]
bluetooth: Abstract speaker gain in transport
Similarly to the microphone gain, the speaker gain can be abstracted
inside the transport object, even though the actual D-Bus interface in
BlueZ differs.
Mikel Astiz [Fri, 14 Dec 2012 14:14:28 +0000 (15:14 +0100)]
bluetooth: Abstract microphone gain in transport
The microphone gain represents the volume of the incoming audio stream
from the headset. This can be nicely abstracted inside the transport
object in bluetooth-util, so the modules don't have to take care about
the D-Bus details.
Stefan Huber [Tue, 4 Dec 2012 13:55:01 +0000 (14:55 +0100)]
echo-cancel: Fix null implementation to setup one channel
memcpy() of the null implementation's run() copied data for only one
channel. Set the number of channels to 1 in init() in order to guarantee
this.
Signed-off-by: Stefan Huber <s.huber@bct-electronic.com>
Acked-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Stefan Huber [Tue, 4 Dec 2012 13:54:58 +0000 (14:54 +0100)]
echo-cancel: Fix apply_diff_time() to use correct sample spec
apply_diff_time() fails when dropping bytes from the playback stream
and the sample spec of sink and source differ as source's sample spec is
used. Fix this by using sink's sample spec.
Signed-off-by: Stefan Huber <s.huber@bct-electronic.com>
Acked-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Flavio Ceolin [Thu, 13 Dec 2012 19:00:55 +0000 (17:00 -0200)]
role-ducking: Apply a ducking effect based on streams roles
This module works pretty similar to the module-role-cork.
It should be used as an alternative to that module. Basically
it decreases the volume of the streams specified in ducking_roles
in the presence of at least one stream specified in trigger_roles.
Also, it's possible to choice the volume that will be used in the
ducking streams and if it should operates in all devices or not.
For basic reference: http://en.wikipedia.org/wiki/Ducking
Tanu Kaskinen [Fri, 14 Dec 2012 07:11:01 +0000 (09:11 +0200)]
man: Document the possiblity of unloading modules by name in pulse-cli-syntax.
Tanu Kaskinen [Thu, 13 Dec 2012 06:26:05 +0000 (08:26 +0200)]
core-util: Improve get_path() documentation
Mikel Astiz [Tue, 11 Dec 2012 13:40:24 +0000 (14:40 +0100)]
bluetooth: Connect all hooks during module load/unload
Move the connection of sink/source-related hooks to module
initialization and shutdown, to group all of them together. There is
no need to connect them every time the card profile is changed.
Tanu Kaskinen [Tue, 11 Dec 2012 05:18:29 +0000 (07:18 +0200)]
bluetooth: Remove prefixing from static functions.
Mikel Astiz [Mon, 10 Dec 2012 07:30:42 +0000 (08:30 +0100)]
bluetooth: Remove deprecated transport hooks
All code has migrated to the new centralized hooks listed in
pa_bluetooth_hook_t so the old transport-specific hooks can be removed.
Mikel Astiz [Mon, 10 Dec 2012 07:30:41 +0000 (08:30 +0100)]
bluetooth: Avoid PA_BLUETOOTH_TRANSPORT_HOOK_NREC_CHANGED
The hook has been recently moved to pa_bluetooth_hook_t, so make use
of the new version.
Mikel Astiz [Mon, 10 Dec 2012 07:30:40 +0000 (08:30 +0100)]
bluetooth: Avoid PA_BLUETOOTH_TRANSPORT_HOOK_REMOVED
The hook is now deprecated so avoid using it and instead use the
recently introduced PA_BLUETOOTH_HOOK_TRANSPORT_STATE_CHANGED which also
reports the disconnection event.
Mikel Astiz [Mon, 10 Dec 2012 07:30:39 +0000 (08:30 +0100)]
bluetooth: Add transport hooks into pa_bluetooth_hook_t
Add the transport-handling hooks to the centralized list of hooks in
pa_bluetooth_hook_t. These are intended to replace the now deprecated
transport-specific hook list in pa_bluetooth_transport_hook_t.
Mikel Astiz [Mon, 10 Dec 2012 07:30:38 +0000 (08:30 +0100)]
bluetooth: Add state to transport objects
Transport objects have an associated state even though it's not
explicitly exposed in BlueZ's D-Bus API (prior to 5.0). Instead, the
state is implicitly represented in the profile-specific D-Bus interface
(i.e. org.bluez.Headset, org.bluez.AudioSink, etc.) but it can be
convenient that bluetooth-util would abstract this separation.
Mikel Astiz [Mon, 10 Dec 2012 07:30:37 +0000 (08:30 +0100)]
bluetooth: Refactor parse_audio_property() to support more properties
The old implementation is limited to parsing the profile state, but
the D-Bus API actually exposes many more properties that are currently
not being considered, specially within org.bluez.Headset.
Mikel Astiz [Thu, 6 Dec 2012 14:55:29 +0000 (15:55 +0100)]
bluetooth: Use array to store profile states
Refactor the code to use an array of states instead of independent
member fields, avoiding duplicated code and improving readability.
Mikel Astiz [Thu, 6 Dec 2012 14:55:28 +0000 (15:55 +0100)]
bluetooth: Move device hooks into pa_bluetooth_hook_t
Centralize the Bluetooth hooks in one single place, starting with
the device hooks, while removing the duplicated ones (in this case
PA_BLUETOOTH_DEVICE_HOOK_REMOVED).
Mikel Astiz [Thu, 6 Dec 2012 14:55:27 +0000 (15:55 +0100)]
bluetooth: Extend discovery to support multiple hooks
Add the infrastructure to support several hooks inside
pa_bluetooth_discovery, while using hook names that describe more
accurately their purpose.
Mikel Astiz [Thu, 6 Dec 2012 14:55:26 +0000 (15:55 +0100)]
bluetooth: Avoid PA_BLUETOOTH_DEVICE_HOOK_REMOVED
The hook PA_BLUETOOTH_HOOK_DEVICE_CONNECTION_CHANGED gets fired also
when a device is being removed, so there is actually no need to have
this duplicated hook.
Tanu Kaskinen [Thu, 6 Dec 2012 04:49:22 +0000 (06:49 +0200)]
bluetooth: Check if BlueZ tries to set the configuration twice for the same transport.
Mikel Astiz [Thu, 6 Dec 2012 09:35:20 +0000 (10:35 +0100)]
bluetooth: Remove pa_bluetooth_device_get_transport()
With the use of an array to represent a device's transpors, the function
becomes trivial and thus can be removed.
Mikel Astiz [Thu, 6 Dec 2012 09:35:19 +0000 (10:35 +0100)]
bluetooth: Use transport array instead of hashmap for devices
Devices will have zero or one transports per profile, and besides the
typical lookup is also profile-based. Therefore, replace the old hashmap
(which used the transport path as key) with a simple array which holds
a transport pointer per profile.
Mikel Astiz [Thu, 6 Dec 2012 09:35:18 +0000 (10:35 +0100)]
bluetooth: Add transport hashmap to discovery
Path-based transport lookups are required in a discovery basis, before
the associated device is known. Therefore, it makes more sense to
maintain a hashmap in the discovery structure itself, instead of
iterating all devices.
Mikel Astiz [Thu, 6 Dec 2012 09:35:17 +0000 (10:35 +0100)]
bluetooth: Use round() to convert PA<->BT volumes
The code can be simplified since it's just trying to round the result of
the division. Note that the resulting behavior is slightly different,
specially when the volume is 0. In this case, it will remain at 0,
instead of being set to 1.
Mikel Astiz [Wed, 5 Dec 2012 16:23:15 +0000 (17:23 +0100)]
bluetooth: Add device pointer to transport
Transports always have an associated device, so add the pointer as a
member to the structure, and remove the discovery pointer since it
already exists in the device object.
Mikel Astiz [Wed, 5 Dec 2012 16:23:14 +0000 (17:23 +0100)]
bluetooth: Remove unused pa_bluetooth_discovery_get_transport()
The function is not used and it also exposes D-Bus-related information
in the internal API, which is in general undesired.
Mikel Astiz [Wed, 5 Dec 2012 16:23:12 +0000 (17:23 +0100)]
bluetooth: Make pa_bluetooth_transport_parse_property() private
The function is not being used outside bluetooth-util and thus can be
made private.
Mikel Astiz [Wed, 5 Dec 2012 16:23:11 +0000 (17:23 +0100)]
bluetooth: Fix condition to load module
d->hfgw_state is just another profile that should be considered exactly
as the rest inside device_audio_is_ready(), which is being used to
decide if the discovery hook gets triggered.
Therefore, there seems to be no reason to make an exception for this
profile and skip checking if the condition d->audio_state !=
PA_BT_AUDIO_STATE_INVALID holds true.
This change makes no practical difference but delaying the load of the
module also for HFGW until Audio.State is received. The benefit is
that the behavior and the code are more consistent across profiles.
Flavio Ceolin [Thu, 29 Nov 2012 13:04:12 +0000 (11:04 -0200)]
modargs: Adding pa_modargs_get_value_volume()
This function gets a pa_volume_t from a string.
Flavio Ceolin [Thu, 29 Nov 2012 13:04:11 +0000 (11:04 -0200)]
sink-input: New volume_factor system
Implement setting of more than one volume factor. The
real value of the volume_factor will be the multiplication of these
values.
Tanu Kaskinen [Mon, 19 Nov 2012 10:59:31 +0000 (12:59 +0200)]
card-restore: Log the restored profile name.
Tanu Kaskinen [Fri, 16 Nov 2012 16:24:34 +0000 (18:24 +0200)]
Log the reason for every suspend/resume.
I was looking at a log that showed that a suspend happened (at
a strange time), but the log didn't tell me why the suspend was done.
This patch tries to make sure that that won't happen again.
Tanu Kaskinen [Fri, 16 Nov 2012 16:03:55 +0000 (18:03 +0200)]
esound: Suspend/resume also sources on STANDBY/RESUME commands.
Tanu Kaskinen [Mon, 2 Apr 2012 12:01:06 +0000 (15:01 +0300)]
mainloop: Check pa_write() return value.
Tanu Kaskinen [Mon, 2 Apr 2012 12:01:04 +0000 (15:01 +0300)]
mainloop: Remove redundant wakeup_pipe validity checks.
The pipe is opened when creating the mainloop and closed
when freeing the mainloop. The pipe fds can never be less
than zero.
Luiz Augusto von Dentz [Mon, 12 Nov 2012 10:26:02 +0000 (12:26 +0200)]
bluetooth: Add support for transport created by external profile
With BlueZ 5 it is possible to have profile registered by a third party
process which does not share the same bus id as bluetoothd so it is
necessary to store the sender of the transport to be able to talk to it.
Note that this is backward compatible.
Mikel Astiz [Fri, 26 Oct 2012 06:23:51 +0000 (08:23 +0200)]
bluetooth: Handle UUIDs announced later
In some cases (typically during pairing) UUIDs might be reported by
BlueZ incrementally, that is, as soon as they have been discovered. At
this point module-bluetooth-device might already be loaded, so the late
UUID announcements need to be handled and additional card profiles
might need to be created accordingly.
Mikel Astiz [Fri, 26 Oct 2012 06:23:50 +0000 (08:23 +0200)]
dbus: Add signal org.PulseAudio.Core1.Card.NewProfile
Add a new D-Bus signal to report profiles that have been dynamically
created for already existing cards.
Mikel Astiz [Fri, 26 Oct 2012 06:23:49 +0000 (08:23 +0200)]
dbus: Support dynamically created card profiles
Use the recently added core hook to detect when new profiles are added
to a card, and update the D-Bus object accordingly.
David Henningsson [Wed, 19 Dec 2012 10:24:33 +0000 (11:24 +0100)]
alsa-mixer: Fix the analog-output-speaker-always path
A left over "required-any" made this path useless for most people.
While we're at it, also add "Front Headphone" like for the normal
speaker path.
Tested-by: Colin Guthrie <gmane@colin.guthr.ie>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Arun Raghavan [Mon, 17 Dec 2012 09:00:09 +0000 (14:30 +0530)]
build-sys: Bump soname
David Henningsson [Fri, 7 Dec 2012 15:37:23 +0000 (16:37 +0100)]
alsa-mixer: Add device.icon-name property for some common ports
If we expose this information, UIs can use this to make better
decisions about what icon to display.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Arun Raghavan [Wed, 5 Dec 2012 03:51:58 +0000 (09:21 +0530)]
build-sys: Bump soname
David Henningsson [Wed, 5 Dec 2012 13:34:54 +0000 (14:34 +0100)]
alsa-mixer: Add Dell Inspiron One 2020 to mic whitelist
BugLink: https://bugs.launchpad.net/bugs/1073420
Signed-off-by: David Henningsson <david.henningsson@canonical.com>