Commit graph

6874 commits

Author SHA1 Message Date
Tanu Kaskinen
3d81bdd04a build-sys: Add check-daemon target to the top-level Makefile.am. 2013-02-06 14:14:46 +02:00
Tanu Kaskinen
4963db8dc0 udev: Add use_ucm module argument 2013-02-06 14:11:40 +02:00
David Henningsson
83d44139d3 alsa-ucm: Fallback to stereo duplex
If 'PlaybackChannels' and 'CaptureChannels' are absent in the UCM
file for a device, assume the device is stereo duplex.

Reported-by: Luke Yelavich <luke.yelavich@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-02-06 13:49:57 +02:00
Tanu Kaskinen
4ffb6fd617 dbus: Fix cleanup when removing signal listeners 2013-02-06 12:34:06 +02:00
Tanu Kaskinen
10262197d0 dbus: Fix connection cleanup when killing clients 2013-02-06 12:31:33 +02:00
Jyri Sarha
a3b8b6a07e combine: Stop rate adjustments if sink is supended 2013-02-06 12:22:16 +02:00
David Henningsson
163a7dbe8b alsa-sink/source: Better thread names
Now you can actually see *which* sink/source that sends a specific
message to the log, which is quite useful if you have more than
one sound card.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-02-05 08:40:40 +02:00
Tanu Kaskinen
8cb34c6960 pacat: Handle holes in recording streams.
pa_silence_memory() pulls sample-util as a dependency, so it had to
be moved from libpulsecore to libpulsecommon. sample-util in turn
pulls some more stuff.
2013-02-04 12:07:39 +02:00
Tanu Kaskinen
94ac039b87 padsp: Handle holes in recording streams. 2013-02-04 12:07:36 +02:00
Tanu Kaskinen
dbb94daa0b simple: Handle holes in recording streams. 2013-02-04 12:07:33 +02:00
Peter Meerwald
e66e846418 sconv: Change/fix conversion to/from float32
use (1<<15) instead of 0x7fff as a factor when converting from s16 to float32
use (1<<31) instead of 0x7fffffff as a factor when converting from s32 to float32

the change is motivated by the following desireable properties:
* s16_from_f32(f32_from_s16(x)) == x for all possible s16 values
* x / (1.0f << 15) == x * (1.0f / (1 << 15)) for all x in s16

above changes enable easier optimization while guaranteeing bit-exact results

further, other audio sample conversion code (libavresample) does it the same way

v3 (comments Tanu):
* fix saturation in pa_sconv_s16le_from_f32ne_neon(), use vqrshrn
v2 (comments Tanu):
* fix comments in ARM NEON code
* use llrintf() in pa_sconv_s32le_from_float32ne()

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Cc: Tanu Kaskinen <tanuk@iki.fi>
2013-02-04 12:07:14 +02:00
David Henningsson
596d9aa740 pactl: Document @DEFAULT_SINK@, @DEFAULT_SOURCE@ and @DEFAULT_MONITOR@
I went to implement the possibility to use the default sink/source
but found that it was already working. So I figured I'd update
the help text instead.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-02-04 10:01:57 +01:00
Peter Meerwald
3a3c4eb462 resampler: Improve s16<-->s32 conversion, use s16 work format if input or output is s16
Problem: s16 to s32 conversion is performed as s16->float->s32 (via work
format float) for resamplers TRIVIAL, COPY, PEAKS.
Precision and efficiency suffers: e.g. 0x9fff results in 0x9ffe4001 (instead
of 0x9fff0000) and there are two sample format conversions instead of one
conversion.

Solution: If input or output format is s16, then choose the work format
to be s16 as well.

If remapping is to be performed, we could stick to work format float32ne for
precision reseans. This is debateable.

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-02-01 10:10:30 +02:00
Peter Meerwald
4b3de4422e resampler: Drop redundant assignment in convert_from_work_format()
r->from_work_format_buf.length is set twice

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-02-01 10:08:57 +02:00
Peter Meerwald
34c631c0ae tests: Fix sconv sample correctness in cpu-test
do allow up to one sample difference
cleanup output of signed shorts (use 0xhx)

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-02-01 10:06:03 +02:00
Peter Meerwald
db41a4832d sconv: Check for SSE flag before initializing code
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-02-01 09:10:44 +02:00
Tanu Kaskinen
e8f1cfd9a5 tests: Fix function argument wrapping style in cpu-test.c. 2013-02-01 09:06:18 +02:00
Peter Meerwald
01a7c6b4e6 tests: Add remap test code to cpu-test
v2 (comments by Paul Menzel):
* generate test samples from -1..1, -0x8000..0x7fff
* check all output samples (not just half of them)

the idea is to compare the output of the C (reference) implementation
against the output of the optimized code path; currently, there are MMX
and SSE implementation for the mono-to-stereo remapper for s16 and float
sample formats

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Cc: Paul Menzel <paulepanter@users.sourceforge.net>
2013-02-01 08:30:28 +02:00
Peter Meerwald
60aeb3dd23 tests: Test both, SSE and SSE2, sconv in cpu-test
SSE sconv was not tested before, only SSE2 was (on CPUs supporting both
instruction sets)

now both code path are tested on CPUs supporting both

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-02-01 07:30:06 +02:00
Peter Meerwald
2c5d3d79ad remap_sse: More specific logging: SSE -> SSE2
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-02-01 07:26:16 +02:00
Peter Meerwald
2dc51f3371 tests: Fix potential out-of-bound access violation in svolume cpu-test
nsamples should be forced to be a multiple of channels; do so correctly
and don't make nsamples larger than it actually is

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-02-01 07:23:16 +02:00
Peter Meerwald
3a942fc191 tests: Fix conversion typo in cpu-test
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-02-01 07:23:00 +02:00
poljar (Damir Jelić)
831cae16d4 pactl: Add a command for setting the default sink/source.
This adds two new commands to pactl:
    set-default-sink
    set-default-source

This command has been part of the native protocol for a long time,
no reason not to expose it in pactl.
2013-02-01 07:16:20 +02:00
poljar (Damir Jelić)
a5af95f83d bash-completion: Don't complete devices in the list commands
This fixes some wrong completion for the list commands for example:
    pactl list sinks _sink_name_
2013-02-01 07:11:15 +02:00
Mikel Astiz
58def1fd1d reserve: Fix leaking NameLost signals after release+acquire
The use of the pseudo-blocking D-Bus calls leads to the problem that
NameLost signals are received after the reply to ReleaseName().

The problem with this is that a later acquisition of the same audio
device can potentially receive the NameLost signal corresponding to
the previous instance, due to the fact that the signal hasn't been
popped from the D-Bus message queue.

The simplest approach to solve this problem is to poll the actual name
owner from the D-Bus daemon, in order to make sure that we did really
lose the name.

The proposal uses a blocking call to GetNameOwner to avoid incosistent
states in the internal APIs: it would otherwise be possible to have a
"busy" device before the reservation has been lost, in the unlikely
case if some other process acquires the name before we got the
confirmation that the NameLost was actually true.
2013-01-31 14:04:45 +02:00
Mikel Astiz
cb0f3d2878 reserve: Move get_name_owner() to the public rd_device API
The function is interesting for both rd_device and rd_monitor so make
it part of the rd_device public API to avoid duplicated code.

The decision to move the function to reserve.c is motivated by the fact
that other projects (i.e. jack) use reserve.c only. Therefore, adding a
reserve->reserve-monitor dependency should be avoided.
2013-01-31 13:56:25 +02:00
Tanu Kaskinen
849161f086 bluetooth: Fail if BlueZ tries to give duplicate device addresses. 2013-01-31 09:38:40 +02:00
Mikel Astiz
cd23fbf947 bluetooth: Detect changes in constant properties
The D-Bus API should guarantee that some properties remain constant and
therefore treat changes in such properties as errors.
2013-01-31 09:31:59 +02:00
Mikel Astiz
b531422218 bluetooth: Propagate to property parsers if it is initial value
Add a parameter so that property parsing functions distinguish the
initial case from property changes received later.
2013-01-31 09:31:55 +02:00
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