Commit graph

6397 commits

Author SHA1 Message Date
Tanu Kaskinen
afbc9dbe49 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
2012-12-18 06:25:49 +02:00
Arun Raghavan
4636f56090 Merge commit 'v2.1' into stable-2.x
v2.1 is identical to 8c34ed7e3b which was
HEAD at the time of the 2.1 release, but with the top 2 commits in
reverse order.
2012-09-25 02:31:59 +08:00
Arun Raghavan
8c34ed7e3b build: Bump soname 2012-07-19 17:07:57 +05:30
Arun Raghavan
cd96e2c4e9 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.
2012-07-19 17:07:57 +05:30
Arun Raghavan
40713647e7 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.
2012-07-19 16:59:43 +05:30
Arun Raghavan
c4655d10c6 build: Bump soname 2012-07-18 12:23:17 +05:30
Arun Raghavan
7af7c98756 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++.
2012-07-18 12:17:50 +05:30
David Henningsson
ee619d98a3 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
2012-07-05 09:13:43 +02:00
David Henningsson
e610bd3d1a 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>
2012-07-05 09:12:53 +02:00
David Henningsson
1104a108f0 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>
2012-07-05 09:12:42 +02:00
David Henningsson
c201c5fdd1 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>
2012-07-05 09:12:33 +02:00
Arun Raghavan
dd4c6bc45c role-cork: Fix another minor leak
Credit to David for finding this one.
2012-07-03 18:19:20 +05:30
Arun Raghavan
700b86814b role-cork: Fix incorrect check at deinitialisation time 2012-07-03 18:19:16 +05:30
Arun Raghavan
8b7d613813 role-cork: Fix a minor leak 2012-07-03 18:19:08 +05:30
Deng Zhengrong
ea99b0fd2a xen: add the HAVE_CONFIG_H macro guard 2012-07-03 17:42:51 +05:30
Eero Nurkkala
f231859ca9 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>
2012-07-03 17:21:07 +05:30
Eero Nurkkala
322d4a6bfb 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>
2012-07-03 17:21:00 +05:30
Jarkko Suontausta
1a9a4076a2 bluetooth: Release transport when the pa_rtpoll_run loop finishes.
Based on a patch by Marko Ollonen.
2012-07-03 17:18:56 +05:30
Marc-Antoine Perennou
2e64edbd3e 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>
2012-07-03 17:18:39 +05:30
David Henningsson
ac1a466f21 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>
2012-07-03 17:18:24 +05:30
Frédéric Danis
1c055d70b0 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.
2012-07-03 17:18:13 +05:30
Lennart Poettering
3643966f67 util: use the return value of gethosid() as fallback, not the address of the function
Yikes!
2012-07-03 17:16:33 +05:30
Arun Raghavan
3de505708a 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
2012-07-03 17:15:23 +05:30
poljar
3821f83f15 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.
2012-07-03 17:15:14 +05:30
Arun Raghavan
ed85ad64cf build-sys: Bump soname
Double-bump since v1.99.2 got a bump but the commit never landed.
2012-05-11 18:51:37 +05:30
Paul Menzel
e54b0fa6c9 Correct spelling of PulseAudio
• s,Pulseaudio,PulseAudio,
• One last occurence of this “error” is in the French translation.
2012-05-11 18:25:36 +05:30
Arun Raghavan
ec316b04ac 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
2012-05-11 17:32:20 +05:30
Tanu Kaskinen
7bb8442c11 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
2012-05-11 16:55:29 +05:30
Tanu Kaskinen
1eb7c4a465 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
2012-05-11 16:29:20 +05:30
Tanu Kaskinen
1a75e1c297 resampler: Use more descriptive buffer names. 2012-05-11 16:26:42 +05:30
Tanu Kaskinen
7921a851eb resampler: Use pa_xnew0() to avoid manual zeroing. 2012-05-11 16:26:38 +05:30
poljar
a6394b1cb0 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
2012-05-05 13:35:18 +03:00
Tanu Kaskinen
a0879ac3f6 echo-cancel: Clarify function call contexts. 2012-04-27 11:37:39 +03:00
Tanu Kaskinen
aca1c4001d 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.
2012-04-27 11:37:26 +03:00
Tanu Kaskinen
af78613b70 echo-cancel: Drop the correct amount of samples when skipping. 2012-04-27 11:36:56 +03:00
Paul Menzel
fed2d8d4e8 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.
2012-04-27 13:13:23 +05:30
David Henningsson
38b24e40fc 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>
2012-04-18 11:41:48 +02:00
Peter Meerwald
9e55b29c28 pulse: Fix warning in introspect.h; minor rewording and punctuation. 2012-04-17 18:15:42 +03:00
Peter Meerwald
a3513e7c9d pulse: Clarify proplist doxygen documentation. 2012-04-17 18:15:29 +03:00
Peter Meerwald
92fbb294b7 core: Fix comments. 2012-04-17 18:15:21 +03:00
Peter Meerwald
202b7e3abb echo-cancel: Upper/lowercase in comment. 2012-04-17 18:15:03 +03:00
Peter Meerwald
e724bcdb73 build: Fix spelling in src/Makefile.am. 2012-04-17 18:14:50 +03:00
Peter Meerwald
0033509019 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>
2012-04-17 18:14:27 +03:00
Colin Guthrie
e1d551f364 alsa: Add the DTS/DCA mapping to extra-hdmi.conf too.
This is needed for 0b421f on Intel/NVidia hardware.
2012-04-15 13:43:14 +01:00
David Henningsson
6961d3e1c7 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>
2012-04-12 00:13:11 +02:00
Colin Guthrie
29e4b187a3 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
2012-04-10 09:49:27 +01:00
Colin Guthrie
aa19646d34 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
2012-04-10 09:49:27 +01:00
David Henningsson
87edc1ccb0 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>
2012-04-04 14:36:43 +02:00
David Henningsson
e815a1f81a 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>
2012-04-04 09:04:12 +02:00
Frédéric Dalleau
b762f4eef1 loopback: Fix crash on error during init
If an error during pa__init() causes a jump to fail: u->asyncmsgq is not
initialized.
2012-04-02 17:47:04 +03:00