Commit graph

6945 commits

Author SHA1 Message Date
Tanu Kaskinen
f99e1ff2f2 build-sys: Use dist_vapi_DATA instead of listing the files in EXTRA_DIST. 2013-01-31 07:09:47 +02:00
Tanu Kaskinen
e5d411b728 build-sys: Install the bash completion script. 2013-01-31 06:25:02 +02:00
poljar (Damir Jelić)
dfa7a6fff1 build: Add bash completion
This patch adds bash completion for pulseaudio and all of the utilities.
Channel maps and properties are not yet completed.

This should make mostly pactl/pacmd more useful for bash users.

Thanks to Denis Kasak for the awk magic (fetching ports and profiles
from the card info).
2013-01-31 05:19:48 +02:00
Tanu Kaskinen
4ee84730bc .gitignore: Add pulse-daemon.log.
The file is created by test-daemon.sh.
2013-01-29 17:32:10 +02:00
Mikel Astiz
19be6a4748 bluetooth: Fix potential assertion failure due to unaligned packet size
While reading from the SCO socket, there is no guarantee regarding the
resulting packet size. In some rare cases, it might not even match the
alignment expected in pa_source_post(), resulting in an assertion
failure inside pa_volume_memchunk():

I: [alsa-sink] module-loopback.c: Could not peek into queue
I: [alsa-sink] module-loopback.c: Could not peek into queue
I: [alsa-sink] module-loopback.c: Could not peek into queue
E: [bluetooth] sample-util.c: Assertion 'pa_frame_aligned(c->length, spec)' failed at pulsecore/sample-util.c:725, function pa_volume_memchunk(). Aborting.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffda98f700 (LWP 8058)]
0x00007ffff6177935 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install alsa-lib-1.0.26-1.fc17.x86_64 dbus-libs-1.4.10-7.fc17.x86_64 flac-1.2.1-9.fc17.x86_64 glibc-2.15-58.fc17.x86_64 gsm-1.0.13-6.fc17.x86_64 json-c-0.10-2.fc17.x86_64 libICE-1.0.8-1.fc17.x86_64 libSM-1.2.1-1.fc17.x86_64 libX11-1.5.0-2.fc17.x86_64 libXau-1.0.6-3.fc17.x86_64 libXext-1.3.1-1.fc17.x86_64 libXi-1.6.1-1.fc17.x86_64 libXtst-1.2.0-3.fc17.x86_64 libogg-1.3.0-1.fc17.x86_64 libsndfile-1.0.25-2.fc17.x86_64 libtool-ltdl-2.4.2-3.1.fc17.x86_64 libudev-182-3.fc17.x86_64 libuuid-2.21.2-3.fc17.x86_64 libvorbis-1.3.3-1.fc17.x86_64 libxcb-1.9-1.fc17.x86_64 speex-1.2-0.14.rc1.fc17.x86_64
2013-01-29 06:59:31 +02:00
poljar (Damir Jelić)
b877021845 build: Add zsh completion
This patch adds zsh completion for pulseaudio and all of the utilities.
Channel maps and properties are not yet completed.

This should make mostly pactl/pacmd more usefull for zsh users.
2013-01-28 15:31:34 +02:00
poljar (Damir Jelić)
9779aa4985 pactl: Add the ability to toggle mute state.
This patch adds the ability to toggle mute for sink/sources and
sink-inputs and source outputs.

All mute commands now accept 1|0|toggle as an argument.
2013-01-27 18:11:54 +02:00
Tanu Kaskinen
32b6b4df64 ladspa: Fix a couple of minor memory leaks. 2013-01-27 04:51:55 +02:00
Mikel Astiz
80406eba43 bluetooth: Fix sending D-Bus reply before internal callback
Make sure the reply to SetConfiguration() is sent before the internal
hook is fired. This is important because the hook could have side
effects including D-Bus interfactions (i.e. transport Acquire() being
called during module startup).
2013-01-25 01:27:08 +02:00
Mikel Astiz
132814f114 bluetooth: Fix potential assertion failure if MTU changes
The assertion in hsp_process_render() assumes that, if a memory block is
already set by the time the function is reached, its size matches
write_block_size.

This can however fail if a transport has been released and acquired
back, in the unlikely case where the MTU has changed in the meantime,
assuming the memory block wasn't released.
2013-01-24 15:55:31 +02:00
Tanu Kaskinen
707af43daa build-sys: Fix an outdated D-Bus version in an error message. 2013-01-24 11:05:37 +02:00
Tanu Kaskinen
ec9474d55e build-sys: Bump D-Bus dependency version to 1.4.12.
We use DBUS_TIMEOUT_USE_DEFAULT, which was introduced in 1.4.12.
2013-01-24 10:48:43 +02:00
Tanu Kaskinen
dd6c8ae38f card: Remove some unnecessary checks. 2013-01-22 08:54:57 +02:00
Tanu Kaskinen
78df02dba6 device-port: Return early from pa_device_port_set_latency_offset() if the offset doesn't change.
This avoids sending change notifications when nothing changes.
2013-01-22 08:48:02 +02:00
Tanu Kaskinen
f26bcae28e jack: Don't fail module-jackdbus-detect loading if the channels argument is not given.
The u->channels <= 0 check failed if the channels argument was not
given at all, making the whole module loading fail. I don't think the
check is necessary at all - negative values are not possible, and if
someone gives 0 as the argument, it's probably ok if we act as if
there was no channels argument at all.
2013-01-22 08:42:27 +02:00
poljar (Damir Jelić)
a1a0ad1af2 card-restore: Only use hooks for the events.
Notification events can be error prone, this patch removes the use of
notification events from card-restore and replaces them with hooks.
2013-01-21 08:48:16 +02:00
poljar (Damir Jelić)
477d6b71b6 device-port: Fire a hook when the latency offset changes.
This change adds a new hook type: PA_CORE_HOOK_PORT_LATENCY_OFFSET_CHANGED
And it is fired when the port latency offset changes.
2013-01-20 11:51:12 +02:00
poljar (Damir Jelić)
56a3561803 device-port: Cleanup of the sink/source subscription events.
Since it's now decided that we deprecated port info for sinks and
sources this isn't needed anymore.
2013-01-20 09:37:06 +02:00
poljar (Damir Jelić)
f8f3690ae9 device-port: Access the cards directly.
Since the ports now know which card owns them we don't need to iterate
through all of them anymore.
2013-01-20 09:33:17 +02:00
poljar (Damir Jelić)
9d6eb21c7e device-port: Add a card pointer to the ports.
This way we can directly access the card that owns the port instead of
iterating over all cards.
2013-01-20 09:27:05 +02:00
Piotr Drąg
ed6f30c79a i18n: Update Polish translation 2013-01-18 09:50:00 +02:00
Tanu Kaskinen
6be6766b58 Initialize monitor's busy status to false if we own the device.
Bug found by David Henningsson.
2013-01-17 11:14:39 +01:00
Tanu Kaskinen
dd7cf7ad5e 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.
2013-01-17 11:12:44 +01:00
Tanu Kaskinen
7ab0885795 pulse: Initialize pa_operation objects to all-zero.
state_callback and state_userdata fields were not initialized.
2013-01-13 03:15:23 +02:00
Piotr Drąg
6155af11d9 i18n: Update Polish translation 2013-01-12 20:59:40 +02:00
Paul Meng
a255c29344 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
2013-01-12 17:55:07 +02:00
Tanu Kaskinen
b1e47df72c bluetooth: Convert booleans to stdbool. 2013-01-11 22:11:04 +02:00
Mikel Astiz
a0cc0136ea 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.
2013-01-11 21:54:05 +02:00
Mikel Astiz
241059de70 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.
2013-01-11 21:51:10 +02:00
Mikel Astiz
8eb3d14b13 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.
2013-01-11 21:47:57 +02:00
Mikel Astiz
93e19c884b bluetooth: Use stdbool for pa_bool_t
Use lowercase true/false instead of TRUE/FALSE for pa_bool_t.
2013-01-11 21:44:36 +02:00
Mikel Astiz
4e93d8711b bluetooth: Check message signature for SetConfiguration
Make sure inside endpoint_set_configuration() that the received D-Bus
message matches the expected signature.
2013-01-11 21:39:22 +02:00
Mikel Astiz
e2bee0e27b 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.
2013-01-11 21:35:09 +02:00
Mikel Astiz
1c8fe4ad2f bluetooth: Fix incorrect error messages
err.message doesn't contain anything useful in these error cases so
fix the mistake and avoid misleading messages.
2013-01-11 21:29:51 +02:00
Peter Meerwald
00b5a0eb9f echo-cancel: Fix error cleanup of pa_speex_ec_init()
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-01-11 21:24:24 +02:00
Tanu Kaskinen
e05972ff13 pulse: Fix endianness definition on Sparc.
Patch by Brian Cameron <brian.cameron@oracle.com>.
2013-01-04 17:21:25 +02:00
Tanu Kaskinen
c3207d4080 solaris: When suspending, flush the device instead of draining it.
Patch by Brian Cameron <brian.cameron@oracle.com>.
2013-01-04 17:13:32 +02:00
Tanu Kaskinen
e530feb62c solaris: Fix get_playback_buffered_bytes() return value.
Based on a patch by Brian Cameron <brian.cameron@oracle.com>.
2013-01-04 16:49:52 +02:00
Tanu Kaskinen
54c9fa97bd shm: Support Solaris shm file paths.
Patch by Brian Cameron <brian.cameron@oracle.com>
2013-01-04 16:31:57 +02:00
Peter Meerwald
c5514d65e1 tests: Fix allowed sample formats in resampler-test usage text
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-01-04 15:51:11 +02:00
Peter Nelson
c1f3634729 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>
2012-12-30 11:54:34 +02:00
Tanu Kaskinen
baa62fb615 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.
2012-12-20 13:01:00 +02:00
Stefan Huber
de73a3ed98 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>
2012-12-20 12:58:45 +02:00
Stefan Huber
3a92be3c5c 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>
2012-12-20 12:56:01 +02:00
Stefan Huber
84e4584322 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>
2012-12-20 10:24:43 +02:00
Stefan Huber
fc9ad93bb4 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>
2012-12-20 10:16:13 +02:00
Stefan Huber
a99e31fb6b 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>
2012-12-20 10:13:56 +02:00
Tanu Kaskinen
68d2bcccd7 build: Don't enable BlueZ if libbluetooth is not found.
Previously, if libsbc was available but libbluetooth was not, BlueZ
would get incorrectly enabled.
2012-12-20 08:24:47 +02:00
Tanu Kaskinen
af0c45386f 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.
2012-12-19 12:31:50 +02:00
Tanu Kaskinen
6f1c3df37b man: Update log-target documentation. 2012-12-19 12:31:50 +02:00