Commit graph

7456 commits

Author SHA1 Message Date
Peter Meerwald
5ad310f4f6 resampler: Extend fit_buf() helper to copy leftover data to new buffer
the patch changes the interface of the (internal) fit_buf() function:
fit_buf() manages the memblock of the buf chunk, it reallocates the memblock
if the requested number of bytes ('len') if larger than the memblock's size ('size')
and optionally preserves 'copy' bytes

the code should be in line with the comment now

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-01-28 22:41:16 +02:00
Tanu Kaskinen
eab0544f23 module: Replace rindex() with strrchr()
rindex() appears to be "non-standard" to an extent, and it caused a
build failure on mingw32.

From the man page of rindex(): "POSIX.1-2008 removes the
specifications of index() and rindex(), recommending strchr(3) and
strrchr(3) instead."
2014-01-27 21:00:58 +02:00
Tanu Kaskinen
588af08d25 device-manager: Don't try to use unlinked devices
This fixes an assertion crash:

[pulseaudio] source.c: Assertion 'PA_SOURCE_IS_LINKED(s->state)' failed at pulsecore/source.c:734, function pa_source_update_status(). Aborting.

The crash happened when a Bluetooth headset profile was changed from
a2dp to hsp. During the profile change three devices are created:
a sink, a monitor source for the sink, and a regular source. First
pa_sink/source_new() are called for each device, and that puts the
devices to u->core->sinks/sources. Then, pa_sink_put() is called for
the sink, and that in turn calls pa_source_put() for the source. At
that point module-device-manager decides to reroute all source
outputs. The non-monitor source that the Bluetooth card created hasn't
been linked yet at this stage, because it will only be linked after
the sink and the monitor source have been linked. So,
module-device-manager should take into account during the rerouting
that not all sinks and sources are necessarily linked. This patch does
that.

Reported-By: Iskren Hadzhinedev <i.hadzhinedev@gmail.com>
2014-01-26 21:20:31 +02:00
Tanu Kaskinen
97c27202ca caps: Don't require --without-caps on FreeBSD
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=72580
2014-01-26 16:41:29 +02:00
Wim Taymans
6ac599c1f4 daemon: Remove deprecated Encoding from .desktop files
Encoding is deprecated according to
http://standards.freedesktop.org/desktop-entry-spec/latest/apc.html
2014-01-26 16:20:14 +02:00
Dominique Leuenberger
a360b29a0a build-sys: Move ORC_SOURCE definitions outside of "if HAVE_ORC"
Not having ORC_SOURCE defined results in different tarballs depending on
whether the dev issuing 'make dist' has orc support enabled or disabled.

Specifying ORC_SOURCE unconditionally addresses that, without causing
negative effects on users not having orc in the end.
2014-01-24 22:56:27 +02:00
Tanu Kaskinen
0779caf3e8 build-sys: Add tests/runtime-test-util.h to the tarball
The file is used by three test binaries, but none of them mentioned
it in Makefile.am, which caused the file to be left out of the
tarball.
2014-01-23 20:34:58 +02:00
Tanu Kaskinen
041f22ae13 build-sys: Bump sonames
The bigger than usual bump in libpulse-simple was warranted by the
change in pa_simple_flush() that allows also record streams to be
flushed. There are no changes to the function signature, but it's in
practice a change in the ABI anyway, because new clients using the new
possibility won't work with older versions of the library.

libpulse-mainloop-glib got a bug fix in commit
68156d3f79.
2014-01-23 12:12:59 +02:00
Tanu Kaskinen
9839ad492f introspect, thread-mainloop: Fix Doxygen "since" tags 2014-01-23 11:21:58 +02:00
Daniel Albers
6b82c6122b combine-sink: fix segfault 2014-01-17 12:21:39 +02:00
Alexander Potashev
7e53f902cc Update Russian translation
Translated in sync with the guidelines at http://l10n.lrn.ru/wiki/Pulseaudio
2014-01-17 12:10:53 +02:00
Yuri Chornoivan
fbb779cf63 Update Ukrainian translation 2014-01-17 12:05:46 +02:00
Tanu Kaskinen
c1c19e4d78 sink, source: Remove useless attach/detach stuff
The removed stuff wasn't used anywhere.
2014-01-15 18:59:18 +02:00
Tanu Kaskinen
7fd14b6f58 Revert "ladspa-sink: Handle empty chunks in sink_input_pop_cb"
This reverts commit dbe66b0b5e.

I accidentally pushed this patch that was superseded by
e96785c1c3.
2014-01-15 14:24:25 +02:00
Ben Brewer
e96785c1c3 ladspa-sink: Set a silence memchunk for the memblockq
A crash was observed that was caused by pa_memblockq_peek() returning
a NULL memblock in sink_input_pop_cb(). The scenario where this was
happening was

1. Delete 2 rtp-recv's connected to a ladspa-sink
2. Delete ladspa-sink
3. Delete alsa-sink
4. Create alsa-sink
5. Create ladspa-sink
6. Create 2 rtp-recv's connected to the ladspa-sink

The crash was probably caused by a rewind that made the read index go
negative while the write index was at least zero, causing there to be
a gap in the memblockq. The problematic rewind might have been caused
by adding the rtp-recv stream to the ladspa-sink. That has not been
proven, but this looks very similar to the bug that was fixed in
module-virtual-sink in commit 6bd34156b1.
2014-01-15 13:50:11 +02:00
Ben Brewer
dbe66b0b5e ladspa-sink: Handle empty chunks in sink_input_pop_cb 2014-01-15 12:34:13 +02:00
Héctor Martín
4e5051db72 zeroconf-discover: Specify the interface when connecting to a link-local IPv6 address
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=40785
2014-01-15 12:20:27 +02:00
Tanu Kaskinen
a0f73b74eb alsa: Mute "Bass Speaker" when using headphones or lineout
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=73604
2014-01-15 11:37:26 +02:00
Ben Brewer
298ffffd1a rtp-send: Remove "don't inhibit auto-suspend" flag
A source is no longer considered idle in pa_source_check_suspend when
module-rtp-send is consuming data from it.
2014-01-14 14:57:10 +02:00
Tanu Kaskinen
56a1d3613d build-sys: Fix building with --as-needed
pulsecore/core-format.c was recently added to libpulsecommon, and
core-format.c depends on functions in libpulse, which libpulsecommon
doesn't link to. That broke building with --as-needed. This patch adds
pulse/format.c to libpulsecommon, so that core-format.c doesn't need
to depend on libpulse any more. format.c pulls in also the dependency
to json-c.

Reported-By: Jan Steffens <jan.steffens@gmail.com>
2014-01-11 16:47:56 +02:00
Laurentiu Nicola
88abd6c49e rtp-recv: Only try adding the group membership for multicast addresses 2014-01-10 13:02:50 +02:00
Tanu Kaskinen
25b7b39367 caps: Use standard macro when checking for Linux
linux and __linux are non-standard, according to
http://sourceforge.net/p/predef/wiki/OperatingSystems/

Reported-By: Damir Jelić <poljarinho@gmail.com>
2014-01-10 12:41:00 +02:00
Peter Meerwald
56e578c310 alsa-card: Don't free the modargs in pa__init
The modargs are in both cases (a succesfull as well as a failed module
initialization) freed already in pa__done().

To avoid leaking modargs memory before they are assigned to u->modargs, the
code is reorganized to first allocate userdata, and then allocate the modargs.
Local variable ma is not needed anymore.

discussion here
http://lists.freedesktop.org/archives/pulseaudio-discuss/2013-December/019661.html

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Reported-by: poljar (Damir Jelić) <poljarinho@gmail.com>
2014-01-10 12:32:36 +02:00
Tanu Kaskinen
56e007ebfb format: Add some error logging 2014-01-08 21:32:02 +02:00
Tanu Kaskinen
fdf72d3d21 stream: Mention pa_stream_new_extended() in the high-level stream creation documentation 2014-01-08 21:32:02 +02:00
Tanu Kaskinen
a36bf31cae stream: Improve pa_stream_connect_playback() documentation 2014-01-08 21:32:02 +02:00
Tanu Kaskinen
77ebb6567f def, format: Document how to leave PCM parameters to be decided by the server 2014-01-08 21:32:02 +02:00
Tanu Kaskinen
f41650a550 sink-input, source-output: Interpret missing PCM parameters in format info as a request to decide those parameters at the server end
The "fix flags" (PA_SINK_INPUT_FIX_FORMAT etc.) don't work properly
with the pa_stream_new_extended() interface. This patch fixes it so
that the same effect can be achieved by leaving some of the PCM
parameters unspecified in format info objects. Also, when converting
a sample spec to a format info when using the old pa_stream_new()
interface, the "fix flags" are taken into account in that conversion.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=68952
2014-01-08 21:26:40 +02:00
Tanu Kaskinen
d27a650cd5 stream: Remove a volume channel validity check
The check is done for clients that use pa_stream_new() but not for
clients that use pa_stream_new_extended(). This is inconsistent. We
could check that the volume channels match the channels set in the
format info struct that is passed to pa_stream_new_extended(), but
that doesn't work if the format info doesn't contain the channel
information (that can happen if the client wants the server to choose
the channel count for the stream). And it should also be possible to
pass a mono volume for a multi-channel stream. The check could be
extended to handle all these cases, but I don't see much point in
wasting time on that. The server will anyway validate the stream
parameters, it's not particularly important to fail already when the
stream is being created at the client side.
2014-01-08 21:26:40 +02:00
Tanu Kaskinen
6cdb569b83 stream-util: Add pa_stream_get_volume_channel_map()
The new function isn't used yet, but it soon will.
2014-01-08 21:26:40 +02:00
Tanu Kaskinen
a3a795ef3d format, core-format: Constify some function parameters 2014-01-08 21:26:40 +02:00
Tanu Kaskinen
71816ecb7f sink-input, source-output: Do routing related validity checks immediately after routing
It's more logical that way.
2014-01-08 21:26:40 +02:00
Tanu Kaskinen
d78d8246b4 core-format: Add pa_format_info_from_sample_spec2()
The function will be used in pa_sink_input_new() and
pa_source_output_new() to convert the sample spec given by the client
to a format info object. The set_format, set_rate and set_channels
will be set according to the stream flags (PA_SINK_INPUT_FIX_FORMAT
etc.).
2014-01-08 21:26:39 +02:00
Tanu Kaskinen
30a32d35c8 core-format: Add pa_format_info_to_sample_spec2()
The function will be used in pa_sink_input_new() and
pa_source_output_new(). The fallback parameters are used to merge the
data in the format info with the sink/source sample spec and channel
map, when the format info is lacking some information.
2014-01-08 21:26:39 +02:00
Tanu Kaskinen
dfa3c50700 format: Simplify pa_format_info_to_sample_spec() 2014-01-08 21:26:39 +02:00
Tanu Kaskinen
3a5a0f6652 core-format: Add pa_format_info_get_channel_map() 2014-01-08 21:26:39 +02:00
Tanu Kaskinen
066dd942aa core-format: Add pa_format_info_get_channels()
This also fixes an issue in pa_format_info_to_sample_spec(): it did
no validation for the channels value. Now the validation is taken care
of in pa_format_info_get_channels().
2014-01-08 21:26:39 +02:00
Tanu Kaskinen
85a3f560d1 core-format: Add pa_format_info_get_rate()
This also fixes an issue in pa_format_info_to_sample_spec(): it did
no validation for the rate value. Now the validation is taken care of
in pa_format_info_get_rate().
2014-01-08 21:26:39 +02:00
Tanu Kaskinen
eae16f41a4 core-format: Add pa_format_info_get_sample_format() 2014-01-08 21:26:39 +02:00
Tanu Kaskinen
d2c9b46aca Move pa_format_info_to_sample_spec_fake() to core-format
I will need to use the function from outside libpulse.

I added the channel map argument, because the function will be called
from another function that is expected to initialize the channel map.
I don't know if it's in practice necessary, but it shouldn't do any
harm either.
2014-01-08 21:26:38 +02:00
Tanu Kaskinen
27e47c72a2 volume-test: Increase the allowed number of rouding errors
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=72374
2014-01-03 14:15:31 +02:00
Laurentiu Nicola
bef191be82 module-rtp-recv: Add an argument for latency 2014-01-03 13:39:27 +02:00
Tanu Kaskinen
11e71e3990 caps: Remove the FreeBSD implementation of pa_drop_caps()
Quoting Ryan Lortie from [1]:

I assumed from my reading of the Linux code ("cap_clear()...") that it
was clearing all capabilities of the process when in fact it is only
clearing the "special to root" capabilities.

The FreeBSD version of the code indeed clears _all_ capabilities beyond
ones that the process already has (ie: cannot open any new files, create
sockets, etc.)

This has a pretty obvious adverse effect on pulseaudio's ability to do
what it needs to do -- indeed, it bombs out pretty quickly due to an
inability to read its own config file.

[1] https://bugs.freedesktop.org/show_bug.cgi?id=72580#c11
2014-01-03 13:31:29 +02:00
poljar (Damir Jelić)
c307093cf0 alsa-mixer: Free the description key in alsa_path_free(). 2014-01-03 13:17:08 +02:00
poljar (Damir Jelić)
f7afaa2644 bluez5-util: Free the adapter_path in device_free(). 2014-01-03 13:16:07 +02:00
Alexander E. Patrakov
3535fd7a07 Documentation of known misuse of PulseAudio API
Hello.

Over time, I became aware of several instances of tempting but
semantically incorrect usage of PulseAudio API (one from my own bad
proposal of "improving" Wine, one from Parole media player and one
from Webkit-GTK). I want to document these gotchas so that other
developers don't fall for that. See the attached patch.

I have checked that the rendered HTML is correct, but need someone to
confirm the factual accuracy of the proposed changes and, possibly, to
improve the wording.

--
Alexander E. Patrakov
2014-01-03 12:53:07 +02:00
Tanu Kaskinen
4c5ec015a4 caps: Fix platform checking
The "#elif __FreeBSD__" line caused a warning, because __FreeBSD__ was
not defined.
2013-12-30 14:31:33 +02:00
Tanu Kaskinen
337ad25b17 caps: Improve log message
I don't like the expression "this Pulseaudio" (even though that's
originally written by me), just "PulseAudio" is enough. Also, on
FreeBSD there's no libcap, so let's refer only to "capabilities".
2013-12-20 21:54:22 +02:00
Ryan Lortie
1da34e99b2 Add support for FreeBSD <sys/capability.h>
cap_init() and friends are Linux-specific, so only use them if we're on
Linux.

Add support for FreeBSD capabilities if we find <sys/capability.h> to be
available there.

Add an #else (not Linux or FreeBSD) case with an #error requesting
contributions for other platforms.

This patch keeps the cap_init check in configure.ac but removes the
error if it fails.  This will ensure we link to -lcap if needed, but
won't fail for the case that capabilities are part of the core system
(as on FreeBSD).

We do however, modify the header check to ensure we fail if there is no
<sys/capability.h> at all and we are on a system where it could be
installed.  The logic here is that it is better to give the user the
chance to install it than it is to proceed silently with a disabled
security feature on a system where it could easily be supported.
--without-caps remains an option if the user wants to force it.

https://bugs.freedesktop.org/show_bug.cgi?id=72580
2013-12-20 21:48:50 +02:00
Tanu Kaskinen
5d2d9e5700 sink-input: Fix volume_factor_sink initialization
Source outputs handle volume_factor_source in a bit different way,
which is why this bug doesn't affect source outputs.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=72879
2013-12-20 16:10:53 +02:00