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:51:00 +0000 (12:51 +0200)]
sink, source: Support creating suspended sinks and sources
The initial state of a sink or source might not necessarily be IDLE,
because sometimes it might be suspended from the very beginning.
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.
Mikel Astiz [Fri, 31 Aug 2012 10:50:56 +0000 (12:50 +0200)]
bluetooth: Refactor parsing of signal PropertyChanged
Wrap the code parsing the PropertyChanged signal into a helper function
that will return the new state of the interface.
Mikel Astiz [Fri, 31 Aug 2012 10:50:54 +0000 (12:50 +0200)]
bluetooth: Remove return value of setup_stream()
The function setup_stream() never fails so the code can be simplified by
just removing the return value.
Mikel Astiz [Fri, 31 Aug 2012 10:50:53 +0000 (12:50 +0200)]
bluetooth: Remove return value of bt_transport_config()
The function bt_transport_config() never fails so the code can be
simplified by just removing the return value.
Tanu Kaskinen [Thu, 6 Sep 2012 12:47:17 +0000 (15:47 +0300)]
bluetooth: Remove commented out code.
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.
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.
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".
Mikel Astiz [Thu, 16 Aug 2012 11:08:28 +0000 (13:08 +0200)]
bluetooth: Minor style fix
Else clause should be in the same line as the closing brace.
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.
Mikel Astiz [Fri, 27 Jul 2012 14:41:22 +0000 (16:41 +0200)]
bluetooth: Avoid duplicating profile argument twice
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, 27 Jul 2012 14:41:21 +0000 (16:41 +0200)]
bluetooth: Consider different input and output MTU
Previous implementation assumes these values are equal, but this doesn't
necessarily have to be so.
Mikel Astiz [Fri, 27 Jul 2012 14:41:20 +0000 (16:41 +0200)]
bluetooth: Minor style fixes
Fix some minor style fixes to be consistent with the project coding
style.
Mikel Astiz [Wed, 25 Jul 2012 14:29:52 +0000 (16:29 +0200)]
bluetooth: Refactor property parsing code
Use a separate method to perform the common checks when a property needs
to be parsed.
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.
Frédéric Danis [Tue, 12 Jun 2012 13:49:50 +0000 (15:49 +0200)]
bluetooth: Fix bluetooth.nrec property not updated
PropertyChanged signal of org.BlueZ.MediaTransport is processed in
pa_bluetooth_transport_parse_property() which updates t->nrec.
This is called by :
- First by filter_cb() of bluetooth-util.c
- Then by filter_cb() of module-bluetooth-device.c which retrieve value
of t->nrec before calling parse function, then it checks if t->nrec
has changed before updating bluetooth.nrec property.
As t->nrec has alreday been changed during first process, property
update is never performed.
This patch creates a new hook in pa_bluetooth_transport called
PA_BLUETOOTH_TRANSPORT_HOOK_NREC_CHANGED.
The hook is fired by bluetooth-util.c when the transport's NREC
property changes.
module-bluetooth-device.c won't listen the PropertyChanged signal of
MediaTransport anymore. Instead, it will use the hook in
pa_bluetooth_transport to get a notification when the NREC property
changes, and update the sink or source proplist accordingly.
const qualifier for returned pointer of
pa_bluetooth_discovery_get_transport() is removed.
Arti Trivedi Bora [Tue, 5 Jun 2012 19:58:13 +0000 (01:28 +0530)]
modules: Use pa_streq instead of strcmp.
poljar [Mon, 4 Jun 2012 17:35:41 +0000 (19:35 +0200)]
bluetooth: Add ports to the bluetooth sink/source
The bluetooth device should have ports so we can attach a latency to
the ports.
Every profile (a2dp, hsp...) has his own set of ports depending on the
number of sinks and sources it provides.
Arun Raghavan [Thu, 19 Jul 2012 11:25:03 +0000 (16:55 +0530)]
build: Fix distcheck failure on libwebrtc-util
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.
Arun Raghavan [Wed, 18 Jul 2012 06:53:17 +0000 (12:23 +0530)]
build: Bump soname
Arun Raghavan [Tue, 17 Jul 2012 07:38:20 +0000 (13:08 +0530)]
build: Avoid libstdc++ dep for module-echo-cancel if possible
This moves out the webrtc bits into a small helper library to shield the
rest of module-echo-cancel from being linked with a C++ linker. This is
required because automake will _always_ link module-echo-cancel in C++
mode if any of its deps (even conditional ones) are in C++.
David Henningsson [Tue, 3 Jul 2012 08:31:30 +0000 (10:31 +0200)]
alsa-mixer: Add "Front Headphone Jack" (fixup)
I forgot half of the front headphone patch, i e, to hide the
speaker output when the front headphone is connected. Thanks to
Shih-Yuan Lee for noticing.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Conflicts:
src/modules/alsa/mixer/paths/analog-output-speaker.conf
David Henningsson [Mon, 2 Jul 2012 10:09:06 +0000 (12:09 +0200)]
alsa-mixer: Add "Front Headphone" jack
Many desktops have headphone on the front and line outs on the back.
Sometimes this means that the headphone is labelled "Front Headphone Jack",
but the volume controls are only "Headphone Playback Volume", i e,
without the "Front" prefix.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
David Henningsson [Thu, 28 Jun 2012 13:40:17 +0000 (15:40 +0200)]
alsa-mixer: Always turn "Inverted Internal Mic" off
Some devices have inverted right channel, so when you add left and right,
the result is silence, or very faint sound. In recent kernels (3.5,
perhaps also 3.4) these are starting to be marked with a special
"Inverted Internal Mic" capture switch.
While we might want to add some reverse summing mechanism in the
future, for now, we just turn the thing off to avoid the problem of
recording silence.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
David Henningsson [Thu, 3 May 2012 13:39:18 +0000 (15:39 +0200)]
alsa-mixer: Add special profiles for some laptops missing speaker and/or internal mic
Several laptops have speaker ports, and/or internal mic ports, but we have
no way of detecting that. So we make the port(s) always show up for these
devices.
BugLink: https://bugs.launchpad.net/bugs/946232
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Arun Raghavan [Tue, 3 Jul 2012 12:41:54 +0000 (18:11 +0530)]
role-cork: Fix another minor leak
Credit to David for finding this one.
Arun Raghavan [Tue, 3 Jul 2012 12:22:36 +0000 (17:52 +0530)]
role-cork: Fix incorrect check at deinitialisation time
Arun Raghavan [Wed, 13 Jun 2012 10:59:35 +0000 (16:29 +0530)]
role-cork: Fix a minor leak
Deng Zhengrong [Sat, 23 Jun 2012 11:16:26 +0000 (19:16 +0800)]
xen: add the HAVE_CONFIG_H macro guard
Eero Nurkkala [Thu, 31 May 2012 07:44:23 +0000 (10:44 +0300)]
alsa-source: add missing header 'signal.h'
Compilation with -DDEBUG_TIMING fails due to a missing header:
modules/alsa/alsa-source.c: In function 'check_left_to_record':
modules/alsa/alsa-source.c:426:9: warning: implicit declaration of function 'raise' [-Wimplicit-function-declaration]
modules/alsa/alsa-source.c:426:9: error: 'SIGTRAP' undeclared (first use in this function)
Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
Eero Nurkkala [Thu, 31 May 2012 07:44:22 +0000 (10:44 +0300)]
alsa-sink: add missing header 'signal.h'
Compilation with -DDEBUG_TIMING fails due to a missing header:
modules/alsa/alsa-sink.c: In function 'check_left_to_play':
modules/alsa/alsa-sink.c:453:9: warning: implicit declaration of function 'raise' [-Wimplicit-function-declaration]
modules/alsa/alsa-sink.c:453:9: error: 'SIGTRAP' undeclared (first use in this function)
Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
Jarkko Suontausta [Tue, 22 May 2012 12:58:33 +0000 (15:58 +0300)]
bluetooth: Release transport when the pa_rtpoll_run loop finishes.
Based on a patch by Marko Ollonen.
Marc-Antoine Perennou [Thu, 17 May 2012 20:50:22 +0000 (22:50 +0200)]
udev: Don't use deprecated udev_get_*_path() functions
[These symbols were removed in libudev.so.1.0.0. Replace them with
hardcoded strings. -- heftig]
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
David Henningsson [Fri, 18 May 2012 20:29:41 +0000 (22:29 +0200)]
once: Fix race causing pa_once to sometimes run twice
There was a race in the existing code that could cause the pa_once code
to be run twice, see:
http://lists.freedesktop.org/archives/pulseaudio-discuss/2012-April/013354.html
Therefore the existing implementation was rewritten to instead look like
the reference implementation here:
http://www.hpl.hp.com/research/linux/atomic_ops/example.php4
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Frédéric Danis [Tue, 15 May 2012 13:55:36 +0000 (15:55 +0200)]
bluetooth: Fix crash on disconnection
When a Bluetooth headset is connected only to HFP profile (not connected
to A2DP) and host streams to it, a crash occurs if host disconnects.
When HFP disconnects, audio thread will fail on POLLHUP then generate
a message to set PA profile to Off before ending.
If this message is managed before PA unload bluetooth device module,
all works fine.
But, if this message is managed during module unload, this finish by
re-entrance in release code (stop_thread) and a crash.
This fix prevents to process profile change when module is unloading.
Lennart Poettering [Tue, 15 May 2012 12:12:38 +0000 (14:12 +0200)]
util: use the return value of gethosid() as fallback, not the address of the function
Yikes!
Arun Raghavan [Mon, 14 May 2012 06:51:45 +0000 (12:21 +0530)]
sink-input,source-output: Avoid unneccessary rate updates
This makes sure we only call sink/source update_rate() if the stream
being woken up has a sample spec that doesn't match the corresponding
device'.
https://bugs.freedesktop.org/show_bug.cgi?id=49875
poljar [Sun, 6 May 2012 14:10:51 +0000 (16:10 +0200)]
pacmd: Added --help and --version descriptions to the man page.
The pacmd man page should show the available options. A simple
description for the --version and --help option was added.
Arun Raghavan [Fri, 11 May 2012 13:20:11 +0000 (18:50 +0530)]
build-sys: Bump soname
Double-bump since v1.99.2 got a bump but the commit never landed.
Paul Menzel [Tue, 24 Apr 2012 21:31:32 +0000 (23:31 +0200)]
Correct spelling of PulseAudio
• s,Pulseaudio,PulseAudio,
• One last occurence of this “error” is in the French translation.
Arun Raghavan [Fri, 11 May 2012 12:02:20 +0000 (17:32 +0530)]
bluetooth: Fix crash due to usage of pa_bool_t instead of dbus_bool_t
pa_bool_t and dbus_bool_t cannot be used interchangably since their size
might (and do) vary. This caused a crash on some systems which was
reported and root caused by: Aidan Thornton <makosoft@googlemail.com>.
Ref: https://bugs.gentoo.org/show_bug.cgi?id=398097
Tanu Kaskinen [Tue, 1 May 2012 17:09:12 +0000 (20:09 +0300)]
alsa: Add support for sound cards with 4-channel input.
Changes in v2:
- Call the mapping a generic 4-channel input mapping
instead of a 4-channel mic array mapping. The mapping
will be used also by sound cards that have two stereo
input jacks, so in those cases talking about mic arrays
is wrong.
- Added a comment about using the "hw" device name.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=45813
Tanu Kaskinen [Thu, 10 May 2012 06:19:23 +0000 (09:19 +0300)]
resampler: Add support for resamplers that consume less data than asked.
libsamplerate_resample() assumed that src_process() would
always consume the whole input buffer. That was an invalid
assumption leading to crashes.
This patch adds a leftover memchunk for storing any
non-consumed input. When pa_resampler_run() is called next
time, the leftover is prepended to the new input.
Changes in v3:
- Make the calculations in pa_resampler_result() and
pa_resampler_max_block_size() more readable and more
correct.
- Rework the leftover storing: instead of using a dedicated
buffer for it, store it in the beginning of remap_buf.
This can avoid some memory copying. (The idea was
suggested by Wang Xingchao.)
- Use a generic save_leftover() function instead of doing
the leftover copying in the resampler implementation.
- Use the leftover logic also with the speex and ffmpeg
resamplers.
[ed: dropped the speex bit since the API guarantees that
it will consume everything -- Arun]
Changes in v2:
- If add_leftover() is called with zero-length input while
the leftover length is non-zero, we don't try to acquire
the input memblock.
- Instead of taking a reference to the original input in
libsamplerate_resample(), we copy the leftover data to a
new memblock. This is done, because otherwise, if the
input is one of the internal buffers, the data can get
overwritten before reading it in add_leftover().
- Store add_leftover_buf size in bytes instead of samples
(more convenient, but less consistent with other code).
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=47156
Tanu Kaskinen [Thu, 10 May 2012 06:19:22 +0000 (09:19 +0300)]
resampler: Use more descriptive buffer names.
Tanu Kaskinen [Thu, 10 May 2012 06:19:21 +0000 (09:19 +0300)]
resampler: Use pa_xnew0() to avoid manual zeroing.
poljar [Tue, 1 May 2012 21:17:22 +0000 (23:17 +0200)]
pacmd: Added --help and --version options.
All utilities should have the --help and --version command line options.
These two were added to pacmd, also the goto label was changed from fail
to quit like in the other utilities.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=45030
Tanu Kaskinen [Wed, 25 Apr 2012 08:25:16 +0000 (11:25 +0300)]
echo-cancel: Clarify function call contexts.
Tanu Kaskinen [Wed, 25 Apr 2012 07:51:38 +0000 (10:51 +0300)]
echo-cancel: Fix memblockq length check.
In addition to changing "plen > u->blocksize" to "plen >=
u->blocksize", I also removed one of the duplicated ifs.
Tanu Kaskinen [Wed, 25 Apr 2012 06:49:08 +0000 (09:49 +0300)]
echo-cancel: Drop the correct amount of samples when skipping.
Paul Menzel [Tue, 24 Apr 2012 21:36:07 +0000 (23:36 +0200)]
doc: Add entry for correct spelling
Due to the formatting of `README` the only occurence of PulseAudio in a
text is capitalized. People reading `README` should at least see the
correct spelling once.
In contrast to reformat just add a spelling section as an easy solution.
Since it is not that important the last place in the ordering might
suffice.
David Henningsson [Wed, 18 Apr 2012 09:41:48 +0000 (11:41 +0200)]
sink/source.h: Clarify set_port comment
State which thread calls set_port in which scenario.
Reported-by: Jyri Sasha <oku@iki.fi>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Peter Meerwald [Fri, 6 Apr 2012 13:06:29 +0000 (15:06 +0200)]
pulse: Fix warning in introspect.h; minor rewording and punctuation.
Peter Meerwald [Fri, 6 Apr 2012 13:06:28 +0000 (15:06 +0200)]
pulse: Clarify proplist doxygen documentation.
Peter Meerwald [Fri, 6 Apr 2012 13:06:27 +0000 (15:06 +0200)]
core: Fix comments.
Peter Meerwald [Fri, 6 Apr 2012 13:06:26 +0000 (15:06 +0200)]
echo-cancel: Upper/lowercase in comment.
Peter Meerwald [Fri, 6 Apr 2012 13:06:25 +0000 (15:06 +0200)]
build: Fix spelling in src/Makefile.am.
Peter Meerwald [Fri, 6 Apr 2012 09:44:57 +0000 (11:44 +0200)]
dbus: Fix dbus argument type in iface-stream.c handle_move().
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=48376
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Colin Guthrie [Sun, 15 Apr 2012 12:39:29 +0000 (13:39 +0100)]
alsa: Add the DTS/DCA mapping to extra-hdmi.conf too.
This is needed for 0b421f on Intel/NVidia hardware.
David Henningsson [Wed, 4 Apr 2012 15:07:13 +0000 (17:07 +0200)]
alsa-sink/source: Make sure volumes are synchronised after fast user switching
Log in as user A, fast user switch to user B, let user B change
port, volume or mute status, then switch back to user A.
At this point we must make sure that the ALSA and PA volumes are
synchronised by writing to the ALSA mixer when the ALSA device
becomes available.
BugLink: https://bugs.launchpad.net/bugs/915035
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Colin Guthrie [Thu, 5 Apr 2012 10:52:24 +0000 (11:52 +0100)]
cli: Allow source-output volumes/mute to be set via CLI
This should have been done a long time ago but it brings symmetry to the API
Colin Guthrie [Thu, 5 Apr 2012 10:41:18 +0000 (11:41 +0100)]
man: Document the cli inteface a little.
This just documents the cli interface syntax. Mostly a lift from
http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/CLI
with some minor editing and bringing up to date.
Also document a few undocumented commands.
Shuffle around the order in 'pacmd help' output to match the order
in the new docs for consistency.
https://bugs.freedesktop.org/show_bug.cgi?id=45029
David Henningsson [Tue, 3 Apr 2012 19:35:07 +0000 (21:35 +0200)]
alsa-sink/source: Really set volumes on port change
If deferred volumes were activated, set_volume does not really set
the volume, and is probably only meant to be called from the main
thread.
As we're currently really setting the port and the mute here (i e
modifying ALSA), we should really modify the volume as well.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
David Henningsson [Tue, 3 Apr 2012 16:56:21 +0000 (18:56 +0200)]
module-loopback: Reset process_msg callbacks in teardown
Make sure we can't be called into by remaining references to
sink-inputs and source-outputs after we have unloaded, as
that will likely lead to segfaults.
Thanks to Tanu for providing valuable input on this patch.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Frédéric Dalleau [Mon, 2 Apr 2012 09:16:03 +0000 (11:16 +0200)]
loopback: Fix crash on error during init
If an error during pa__init() causes a jump to fail: u->asyncmsgq is not
initialized.
Tanu Kaskinen [Wed, 28 Mar 2012 11:47:20 +0000 (14:47 +0300)]
dbus: Add assertions to get rid of warnings from Coverity.
Coverity thinks that expected_method_sig can be NULL when
it's dereferenced by pa_streq(). Adding assertions doesn't
hurt here (in my opinion), and that should get rid of the
warnings.
Tanu Kaskinen [Wed, 28 Mar 2012 09:27:26 +0000 (12:27 +0300)]
device-manager: Add an assertion to get rid of a warning from Coverity.
Coverity thinks that device_name can be NULL when it's
dereferenced by strcmp. Adding an assertion doesn't hurt
here (in my opinion), and that should get rid of the
warning.
Tanu Kaskinen [Mon, 26 Mar 2012 11:52:27 +0000 (14:52 +0300)]
dbus: Add an assertion to get rid of a warning from Coverity.
Coverity thinks that sample can be NULL when it's
dereferenced after this line. Adding an assertion doesn't
hurt here (in my opinion), and that should get rid of the
warning.
Tanu Kaskinen [Mon, 26 Mar 2012 11:35:30 +0000 (14:35 +0300)]
alsa: Fix SND_MIXER_SCHN_LAST related stuff.
Valid channel id range is from 0 to SND_MIXER_SCHN_LAST,
inclusive, so the size of the masks array in pa_alsa_element
has to be SND_MIXER_SCHN_LAST + 1. Similar "too small"
arrays were also in alsa-sink's and alsa-source's userdata,
but actually those arrays were not used at all so they were
removed.
element_is_subset() in alsa-mixer.c skipped the last channel
id when iterating the element masks array; that's now fixed
as well.
Thanks to David Henningsson for spotting the too small
arrays in alsa-sink and alsa-source and the
element_is_subset() problem.
Tanu Kaskinen [Fri, 23 Mar 2012 09:36:39 +0000 (11:36 +0200)]
device-manager: Fix a memory leak.
Tanu Kaskinen [Fri, 23 Mar 2012 09:01:22 +0000 (11:01 +0200)]
sample-util: Remove redundant check from pa_volume_memchunk.
Add also an assertion for the sample spec validity. The
existing code already does crash in case of an invalid
sample spec, but the error would not be as obvious: the
crash would happen due to a divide-by-zero operation in
pa_frame_aligned().
Tanu Kaskinen [Fri, 23 Mar 2012 08:11:21 +0000 (10:11 +0200)]
padsp: Fix a double-free bug.
Tanu Kaskinen [Fri, 23 Mar 2012 07:59:17 +0000 (09:59 +0200)]
dbus: Fix device latency querying.
David Henningsson [Fri, 23 Mar 2012 12:06:27 +0000 (13:06 +0100)]
sink-input/source-output: Prevent filter sink/source cycles
Misbehaving clients can try to set a filter sink to output to
itself, leading to crashes later on. This patch protects us from that.
Thanks to Roman Beslik for testing and finding an error in the first
version of this patch.
Tested-by: Roman Beslik <rabeslik@gmail.com>
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=44397
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Maarten Lankhorst [Mon, 26 Mar 2012 21:12:24 +0000 (23:12 +0200)]
module-jack-sink/source: Set fixed latency correctly on creation
Changes since v1:
Use max value of jack_port_get_latency_range to calculate the latency
and squash compiler warnings cased by using jack_port_get_total_latency
Modifying latency only works inside a callback, and for hardware the
latency is generally fixed on jack, so just take the max value.
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
David Henningsson [Mon, 19 Mar 2012 10:54:12 +0000 (11:54 +0100)]
Fix input device for M-audio fasttrack pro
Some M-audio fasttrack pro devices, the input device is at index 1 instead of index 0.
According to
http://mailman.alsa-project.org/pipermail/alsa-devel/2012-March/050701.html
the reason for this is probably that the device has mutually exclusive
analog and digital input. With this patch we can catch the input regardless
of state.
BugLink: https://bugs.launchpad.net/bugs/569932
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Pino Toscano [Mon, 19 Mar 2012 12:42:15 +0000 (12:42 +0000)]
libpulse: Cope with systems not implementing SA_NOCLDWAIT
Even though SA_NOCLDWAIT is a POSIX mandatory flag the Hurd doesn't
implement it. So let's only check for it if it's defined.
Colin Guthrie [Fri, 23 Mar 2012 09:24:48 +0000 (09:24 +0000)]
Revert "resamplers: Optimize trivial resampler"
This causes problems with 24kHz audio (results in echoing)
when upscaling to 44.1kHz or 48kHz.
It can be reapplied when the optimisation works for all cases.
This reverts commit
8539fe9765e5713f9863ab15d0c5b42189f98ae2.
Colin Guthrie [Wed, 14 Mar 2012 01:41:48 +0000 (01:41 +0000)]
core-util: Attempt to make runtime paths smaller to avoid 108 char limit.
When the runtime path gets long (which can happen on some NFS
mounts where $HOME is not just /home/$USER), it can grow
longer the 108 char limit imposed by sockaddr_un.sun_path.
This just calls realpath which should ultimately point into
/tmp in most cases and result in a much smaller path.
Only do this when we are adding on a name component to the
runtime path so creating the actual symlink will still get
the original, long name, but this shouldn't be a problem
as it never goes into the sockaddr_un.sun_path.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=44680
Arun Raghavan [Tue, 27 Mar 2012 19:31:32 +0000 (01:01 +0530)]
stream: Fix sample spec initialisation for extended API
This fixes pa_sample_spec init to use the correct API. Not doing so
triggers a valgrind warning as we call pa_sample_spec_valid() on this
later on, which checks the rate and channels fields. Thanks to Rémi
Denis-Courmont for reporting this.
David Henningsson [Mon, 26 Mar 2012 08:45:52 +0000 (10:45 +0200)]
alsa-mixer: Fix a small issue when detecting required-any
If somebody writes the line "required-any=ignore", that shouldn't
mean a required-any element needs to be present for the path to
succeed probing.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
David Henningsson [Mon, 26 Mar 2012 08:31:47 +0000 (10:31 +0200)]
alsa-mixer: Show HDMI ports for older Nvidia cards
Some older cards do not have jack detection. This patch makes the
port still show up.
An implementation detail: the "required = ignore" line has in itself
no effect, but we have to write *something* there, or else the entire
jack detection section will be ignored by the parser.
BugLink: https://bugs.launchpad.net/bugs/961286
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Tanu Kaskinen [Sun, 25 Mar 2012 05:40:56 +0000 (08:40 +0300)]
Deng Zhenrong [Thu, 22 Mar 2012 13:52:12 +0000 (21:52 +0800)]
fix compilation warning via PRI prefix
modules/alsa/alsa-mixer.c:3110:21:
warning: format '%lx' expects argument of type 'long unsigned int', but argument 7 has type 'pa_channel_position_mask_t' [-Wformat]
modules/alsa/alsa-mixer.c:3110:21:
warning: format '%lx' expects argument of type 'long unsigned int', but argument 8 has type 'pa_channel_position_mask_t' [-Wformat]
pa_channel_position_mask_t is type defined to uint64_t, and to display
uint64_t, it's better to use PRIx64 primitives.
Signed-off-by: Deng Zhenrong <dzrongg@gmail.com>
Tanu Kaskinen [Thu, 22 Mar 2012 17:39:46 +0000 (19:39 +0200)]
bluetooth: Remove unused variable.
David Henningsson [Wed, 21 Mar 2012 10:24:42 +0000 (11:24 +0100)]
build-sys: padsp target should not be phony
Prevent rebuilding padsp when it's not needed.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
David Henningsson [Wed, 21 Mar 2012 11:17:47 +0000 (12:17 +0100)]
pactl: show availability information for "list cards"
Now that the client API exposes availability information for ports
on cards, we can make output consistent with "list sinks" and
"list sources".
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
David Henningsson [Mon, 19 Mar 2012 15:42:10 +0000 (16:42 +0100)]
module-switch-on-port-available: Do not switch profile if current port is available
For switching profiles, we are a little more cautious, only switch
from an unavailable port to an available one. Profile switching is
mainly used for HDMI/DisplayPort, and this is to avoid switching from
analog to HDMI/DP when it becomes available.
See http://lists.freedesktop.org/archives/pulseaudio-discuss/2012-March/012991.html
and replies for more information.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
David Henningsson [Tue, 20 Mar 2012 10:44:15 +0000 (11:44 +0100)]
module-loopback: Never call adjust_rates after teardown
Calling adjust_rates after teardown results in segfault, and
judging from the Ubuntu bug report, this can happen.
Actively prevent this by destroying the time event, and by
setting adjust_time to 0, we also prevent this routine being
called on max request update.
BugLink: https://bugs.launchpad.net/bugs/946400
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Arun Raghavan [Mon, 19 Mar 2012 08:59:59 +0000 (14:29 +0530)]
protocol-native: Remove redundant asserts
As David points out, the previous commit made a couple of asserts
redundant (the XOR covers all cases that were previous tested for).
Remove these redundant commits now.
Arun Raghavan [Mon, 19 Mar 2012 08:46:04 +0000 (14:16 +0530)]
protocol-native: Reinstate assert that was incorrectly removed
Commit
54cddc6ddf075b6248b0b8521120b2bd86049978 removed an assert that
looked redundant but was not. This commit reinstates it in a slightly
modified form. It is not stated as (a ^ b) instead of (!a || !b) in
order to make the condition more obvious.
David Henningsson [Fri, 16 Mar 2012 13:38:38 +0000 (14:38 +0100)]
protocol-native: Protect against clients trying to set a NULL port
For some reason, a badly behaving client was trying to set a NULL
port, which caused PulseAudio to crash. Add safeguards on two levels
just to be protected. (Also remove a redundant check.)
BugLink: https://bugs.launchpad.net/bugs/951273
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Lennart Poettering [Sat, 17 Mar 2012 00:52:41 +0000 (01:52 +0100)]
systemd: complement module-console-kit with module-systemd-login
ConsoleKit has been deprecated and replaced by systemd's logind daemon,
hence provide the same functionality of module-console-kit in
module-systemd-login. This also makes sure that the CK module becomes a
NOP if the system is booted with systemd, resp. that the systemd module
becomes a NOP if the system is booted without systemd, thus being nice
to OSes such as Debian which want to support multiple init systems.