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>
David Henningsson [Wed, 5 Dec 2012 13:08:30 +0000 (14:08 +0100)]
alsa udev quirks: Add some more Dell devices to speaker whitelist
Added Dell Inspiron 3420, 3520 and Vostro 2420, 2520.
Note that this is only necessary for kernels 3.3 to 3.5, as 3.6
has phantom jack support.
BugLink: https://bugs.launchpad.net/bugs/1076840
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Arun Raghavan [Mon, 3 Dec 2012 05:57:27 +0000 (11:27 +0530)]
alsa: Try to support non-standard rates in alsa-sink/source
We inadvertantly stopped supporting non-standard rates when the
passthrough work was done. This makes sure that if no standard rates are
supported, we try to fallback to whatever ALSA gives us.
Mikel Astiz [Wed, 28 Nov 2012 18:20:58 +0000 (19:20 +0100)]
bluetooth: Fix unacquired transports during sink resume
The sink can be resumed while the source is still in PA_SOURCE_INIT.
This is the case if a module such as module-stream-restore routes the
audio to the sink during pa_sink_put(), leading to an inconsistent
state: the sink stays RUNNING but the transport is not actually
acquired.
Mikel Astiz [Mon, 3 Dec 2012 10:03:59 +0000 (11:03 +0100)]
bluetooth: Request headset audio during profile switch
When a headset is having a profile switch, we can either leave the
SCO state unmodified (as it was before this patch) or we can
alternatively request it (as older versions of PA).
This patch tries to avoid a potential regression in case a module
such as module-suspend-on-idle is not present, due to the provided
resume-on-running policy. Without this patch, and without such a policy,
the sink and sources would stay suspended until the user manually
performed another profile switch (i.e. hsp->off->hsp).
There are several other solutions currently being discussed as a longer
term solution, some of which require extendind the core. This patch is
therefore proposed as a short-term workaround to avoid the regression.
Mikel Astiz [Mon, 3 Dec 2012 10:03:58 +0000 (11:03 +0100)]
bluetooth: Do not setup stream before thread starts
bt_transport_acquire() might get called from the main thread, in case
the IO thread hasn't been started yet. In this case, we should not call
setup_stream() since this is going to be called in the beginning of
thread_func().
Mikel Astiz [Mon, 3 Dec 2012 10:03:57 +0000 (11:03 +0100)]
bluetooth: Trivially refactor to call setup_stream() directly
If the transport is already acquired and the stream needs to be started,
call setup_stream() directly instead of bt_transport_acquire(u, TRUE).
Both calls are identical in these conditions, with the exception of the
log trace which has now been moved to setup_stream().
Mikel Astiz [Mon, 26 Nov 2012 17:32:09 +0000 (18:32 +0100)]
conf: Load bluetooth-policy module by default
Headset use-cases shouldn't get affected by this module and the support
for A2DP source is interesting, therefore load the module by default.
Mikel Astiz [Mon, 26 Nov 2012 17:32:08 +0000 (18:32 +0100)]
bluetooth: Disable profile auto-switch policy for headsets
Given that headsets have just one single port exposing whether the
audio is streaming (playing) or not, it's not possible that
module-bluetooth-policy would distinguish A2DP/HSP cases, and thus
the automatic selection of the card profile is not deterministic.
For this reason, disable the policy entirely for headsets and focus
only on HFGW and A2DP source profiles.
Mikel Astiz [Mon, 26 Nov 2012 17:32:07 +0000 (18:32 +0100)]
bluetooth: Merge headset ports into one
Merge the former "hsp-output" and "a2dp-output" ports into one single
port, in order to fix the regression of having several independent
entries in the UI.
Niels Ole Salscheider [Sat, 24 Nov 2012 11:32:51 +0000 (12:32 +0100)]
virtual-surround: check if resampled memblock is not equal to input
Since commit
e32a408b3cdd46857fdf12210c1bf5bdbf3a96f8, we silence the
input memblock in order to give the resampler enough input samples, if
necessary.
But if there is no need to resample the hrir, the resampled memblock is
actually the same as the input memblock. Thus, we have to make sure that
we do not silence it in this case.
Tanu Kaskinen [Thu, 22 Nov 2012 14:20:28 +0000 (15:20 +0100)]
bluetooth: Unload device module when no audio profiles connected
Without this patch, device modules will be left around after the
device has been disconnected and when they are reconnected, the
discovery module will load duplicate device module instances.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=57239
Mikel Astiz [Thu, 22 Nov 2012 14:20:27 +0000 (15:20 +0100)]
bluetooth: Run the discovery hook only when necessary
This is a minor optimization too, but the main benefit is that it's
makes the code easier to understand (I hope), since run_callback()
won't be called at times when it's not needed.
Tanu Kaskinen [Thu, 22 Nov 2012 14:20:26 +0000 (15:20 +0100)]
bluetooth: Add helper pa_bluetooth_device_any_audio_connected()
The new helper function makes it easier to check whether any audio
profiles are connected. That information is needed by the discovery
module for deciding whether a new device module should be loaded. The
device module should use this information too to unload itself at the
right time, but that's currently not implemented.
Mikel Astiz [Thu, 22 Nov 2012 14:20:25 +0000 (15:20 +0100)]
bluetooth: Rename former device_is_audio()
Use a more accurate name for the function since it doesn't just check
if it is an audio device (which can be detected quite early), but it
also checks if the most relevant properties (device info, etc.) have
been received.
Besides, add the const qualifier to the pointer since it's not going to
be modified.
Tanu Kaskinen [Thu, 22 Nov 2012 14:20:24 +0000 (15:20 +0100)]
bluetooth: Ignore Device.Connected
The Device.Connected was only used for tracking whether a device module
should be loaded, but that information is already included in the
individual profile state properties. The property can therefore be
completely ignored without any loss in functionality.
Tanu Kaskinen [Tue, 20 Nov 2012 12:51:27 +0000 (14:51 +0200)]
bluetooth: Add a pa_bluetooth_discovery pointer to pa_bluetooth_device.
This simplifies some function argument lists.
Juho Hämäläinen [Tue, 20 Nov 2012 06:30:22 +0000 (08:30 +0200)]
stream-restore: Add missing method handler argument.
Stream-restore DBus API method argument list is missing last boolean
argument apply_immediately, causing assert to fail in AddEntry handling.
Signed-off-by: Juho Hämäläinen <jusa@hilvi.org>
Arun Raghavan [Mon, 19 Nov 2012 15:58:22 +0000 (21:28 +0530)]
core: Remove bad free() call
The string created when trying to use XDG_RUNTIME_DIR is freed before it
is used in a debug message, and is freed again.
https://bugs.freedesktop.org/show_bug.cgi?id=57280
Arun Raghavan [Mon, 19 Nov 2012 07:22:28 +0000 (12:52 +0530)]
sink-input, source-output: Check rate update success for passthrough
This makes sure we don't try to plug in a passthrough stream if the
final sink/source sample spec doesn't match what we want. In the future,
we might want to change rate updates to try a full sample spec update
for passthrough streams.
https://bugs.freedesktop.org/show_bug.cgi?id=50951
Arun Raghavan [Mon, 19 Nov 2012 07:03:25 +0000 (12:33 +0530)]
source-output: Fix volume fixup for rate update
The could that should have been after the rate update ended up being
before, which is incorrect.
Arun Raghavan [Sat, 17 Nov 2012 05:25:05 +0000 (10:55 +0530)]
build-sys: Drop ChangeLog generation
This drops ChangeLog generation from git. It does not make sense to
distribute 500 kB of ChangeLog given how easy it is these days to browse
history with git.
We might replace this with a release-annoucement-esque high-level
summary of changes.
Arun Raghavan [Sat, 17 Nov 2012 05:24:16 +0000 (10:54 +0530)]
build-sys: Bump soname
Arun Raghavan [Fri, 16 Nov 2012 17:43:26 +0000 (23:13 +0530)]
build-sys: Bump BlueZ dependency to 4.99
Since the old UNIX fd IPC mechanism was removed and we rely on the D-Bus
based API, this is the oldest version that is known to reliably work.
Arun Raghavan [Fri, 16 Nov 2012 17:39:15 +0000 (23:09 +0530)]
modules: Micro-optimisation for rewind_requested paths
Since some devices can be chatty with regards to how often they return
from poll(), this adds a PA_UNLIKELY() to all the the rewind_requested
checks in our sink modules to make the general case (no rewind was
requested) the fast path.
Tanu Kaskinen [Thu, 30 Aug 2012 13:50:13 +0000 (16:50 +0300)]
sink: Process rewind requests also when suspended.
When a rewind is requested on a sink input, the request parameters are
stored in the pa_sink_input struct. The parameters are reset during
rewind processing, and if the sink decides to ignore the rewind
request due to being suspended, stale parameters are left in
pa_sink_input. It's particularly problematic if the rewrite_bytes
parameter is left at -1, because that will prevent all future rewind
processing on that sink input. So, in order to avoid stale parameters,
every rewind request needs to be processed, even if the sink is
suspended.
Reported-by: Uoti Urpala
Arun Raghavan [Thu, 15 Nov 2012 10:21:52 +0000 (15:51 +0530)]
sink, source: Prevent unnecessary rate update attempts
We don't need to try a rate update if the desired sample rate is the
same as the one the sink or source is already using.
David Henningsson [Fri, 16 Nov 2012 12:16:04 +0000 (13:16 +0100)]
alsa-mixer: Prefer "Digital Input Source:Digital Mic 1"
...over "Digital Input Source:Analog Input". It makes life a little
easier for users of Dell xps m1330.
Just an old Ubuntu delta I never upstreamed until now.
The patch was originally written by Daniel T Chen <crimsun@ubuntu.com>.
BugLink: https://bugs.launchpad.net/bugs/453966
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Tanu Kaskinen [Mon, 2 Apr 2012 12:01:05 +0000 (15:01 +0300)]
mainloop: Don't care about the mainloop state variable when waking up the mainloop.
If the mainloop is just about to enter polling, but m->state
is not POLLING yet when some other thread calls
pa_mainloop_wakeup(), the mainloop will not be woken up.
It's safe to write to the wakeup pipe at any time, so let's
just remove the check.
Tanu Kaskinen [Mon, 2 Apr 2012 12:01:02 +0000 (15:01 +0300)]
mainloop: Change wakeup_requested type from pa_bool_t to pa_atomic_t.
The variable is accessed from multiple threads, so it should
be atomic.
David Henningsson [Fri, 9 Nov 2012 06:10:24 +0000 (07:10 +0100)]
alsa-mixer: Add "CLFE" and "Bass Speaker" names
These are sometimes being used in the HDA driver and we should
support them.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Arun Raghavan [Mon, 12 Nov 2012 16:54:52 +0000 (22:24 +0530)]
man: Correction for how sample rate switching is disabled
Setting to 0 in the parser causes daemon startup to fail.
Sjoerd Simons [Sat, 10 Nov 2012 16:41:27 +0000 (16:41 +0000)]
build-sys: Correct bluez support error if sbc is missing
David Henningsson [Fri, 9 Nov 2012 11:14:18 +0000 (12:14 +0100)]
alsa-mixer: Add a few more machines to internal mic whitelist
Based on feedback in the bug below (comments 128, 129, 131).
BugLink: https://bugs.launchpad.net/bugs/946232
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Tanu Kaskinen [Wed, 7 Nov 2012 14:52:37 +0000 (16:52 +0200)]
pulse: Fix hole handling in pa_stream_peek().
Previously, if there was a hole in a recording stream,
pa_stream_peek() would crash. Holes could be handled silently inside
pa_stream_peek() by generating silence (wouldn't work for compressed
streams, though) or by skipping any holes. However, I think it's
better to let the caller decide how the holes should be handled, so
in case of holes, pa_stream_peek() will return NULL data pointer and
the length of the hole in the nbytes argument.
This change is technically an interface break, because previously the
documentation didn't mention the possibility of holes that need
special handling. However, since holes caused crashing anyway in the
past, it's not a regression if applications keep misbehaving due to
not handing holes properly.
Some words about when holes can appear in recording streams: I think
it would be reasonable behavior if overruns due to the application
reading data too slowly would cause holes. Currently that's not the
case - overruns will just cause audio to be skipped. But the point is
that this might change some day. I'm not sure how holes can occur
with the current code, but as the linked bug shows, they can happen.
It's most likely due to recording from a monitor source where the
thing being monitored has holes in its playback stream.
BugLink: http://bugs.launchpad.net/bugs/1058200
Arun Raghavan [Thu, 8 Nov 2012 09:23:55 +0000 (14:53 +0530)]
introspect: Minor documentation fix
s/pa_latency_info/pa_timing_info
Pierre-Louis Bossart [Mon, 30 Jul 2012 00:46:59 +0000 (19:46 -0500)]
alsa: get avail, delay, timestamps in a single kernel call
Refactor code to fetch avail, delay and timestamp values
in a single call to snd_pcm_status().
The information reported is exactly the same as before,
however it is extracted in a more atomic manner to
improve timer-based scheduling.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Arun Raghavan [Mon, 5 Nov 2012 12:11:53 +0000 (17:41 +0530)]
Revert "tests: modify alsa-time-test to use 'check' framework"
This reverts commit
1569601864af375c3788fbce429b6773bd48072e.
Rethinking this, it makes more sense to not add this to the check
framework. This is mostly useful for exposing ALSA driver issues, and
it's handy to be able to build this as a standalone executable.
Arun Raghavan [Mon, 5 Nov 2012 12:11:19 +0000 (17:41 +0530)]
alsa: Drop verbosity on UCM message
We don't need to log an error-level message for missing UCM config.
Deng Zhengrong [Thu, 19 Jul 2012 08:41:31 +0000 (16:41 +0800)]
build: fix Mac OS X configure process
The original header file doesn't exist on Lion (10.7.4).
Frédéric Dalleau [Wed, 22 Aug 2012 13:42:16 +0000 (15:42 +0200)]
resampler: Fix crash if 'auto' resampler chooses ffmpeg with variable rate
To reproduce, add resampler-method = ffmpeg in daemon.conf
then start PA, and load module-loopback
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb2f1db40 (LWP 23047)]
0x00000000 in ?? ()
(gdb) bt
0 0x00000000 in ?? ()
1 0xb7c463cb in pa_resampler_set_input_rate (r=0x80e9438, rate=44011) at pulsecore/resampler.c:365
2 0xb7c6321d in pa_sink_input_process_msg (o=0x80e87a0, code=3, userdata=0xabeb, offset=0, chunk=0x0)
at pulsecore/sink-input.c:1833
3 0xb7e9840b in sink_input_process_msg_cb (obj=0x80e87a0, code=3, data=0xabeb, offset=0, chunk=0x0)
at modules/module-loopback.c:538
4 0xb7c2709b in pa_asyncmsgq_dispatch (object=0x80e87a0, code=3, userdata=0xabeb, offset=0, memchunk=0xb2f1d17c)
at pulsecore/asyncmsgq.c:322
5 0xb7c4c6e3 in asyncmsgq_read_work (i=0x80dd580) at pulsecore/rtpoll.c:564
6 0xb7c4b34a in pa_rtpoll_run (p=0x80fb7e0, wait_op=true) at pulsecore/rtpoll.c:238
7 0xb7dd90af in thread_func (userdata=0x80afe88) at modules/alsa/alsa-sink.c:1785
8 0xb7bf3291 in internal_thread_func (userdata=0x8095d08) at pulsecore/thread-posix.c:83
9 0xb7ab9d4c in start_thread (arg=0xb2f1db40) at pthread_create.c:308
10 0xb79f3ace in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
Tanu Kaskinen [Sat, 6 Oct 2012 11:42:46 +0000 (14:42 +0300)]
build: Add PROTOCOL to EXTRA_DIST.
It's useful documentation, no reason to leave it out of the tarball.
Tanu Kaskinen [Tue, 23 Oct 2012 15:55:42 +0000 (18:55 +0300)]
device-restore: When restoring volume, print the restored volume to the log.
Tanu Kaskinen [Sat, 6 Oct 2012 12:05:08 +0000 (15:05 +0300)]
build: Add .gitignore files to EXTRA_DIST.
As a packager, I want to be able to do "git format-patch
v3.0..origin/master" and I want the generated patches to apply cleanly
against the 3.0 tarball. The patches don't currently apply cleanly if
there are any changes to the .gitignore files, because the .gitignore
files are not shipped in the tarball. This patch fixes that problem.