]> code.delx.au - pulseaudio/log
pulseaudio
10 years agoformat: Simplify pa_format_info_to_sample_spec()
Tanu Kaskinen [Tue, 3 Dec 2013 14:45:45 +0000 (16:45 +0200)]
format: Simplify pa_format_info_to_sample_spec()

10 years agocore-format: Add pa_format_info_get_channel_map()
Tanu Kaskinen [Mon, 25 Nov 2013 12:59:44 +0000 (14:59 +0200)]
core-format: Add pa_format_info_get_channel_map()

10 years agocore-format: Add pa_format_info_get_channels()
Tanu Kaskinen [Mon, 25 Nov 2013 12:51:37 +0000 (14:51 +0200)]
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().

10 years agocore-format: Add pa_format_info_get_rate()
Tanu Kaskinen [Mon, 25 Nov 2013 12:34:58 +0000 (14:34 +0200)]
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().

10 years agocore-format: Add pa_format_info_get_sample_format()
Tanu Kaskinen [Mon, 25 Nov 2013 14:15:54 +0000 (16:15 +0200)]
core-format: Add pa_format_info_get_sample_format()

10 years agoMove pa_format_info_to_sample_spec_fake() to core-format
Tanu Kaskinen [Mon, 18 Nov 2013 17:43:48 +0000 (19:43 +0200)]
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.

10 years agovolume-test: Increase the allowed number of rouding errors
Tanu Kaskinen [Sat, 14 Dec 2013 07:21:22 +0000 (09:21 +0200)]
volume-test: Increase the allowed number of rouding errors

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=72374
10 years agomodule-rtp-recv: Add an argument for latency
Laurentiu Nicola [Thu, 26 Dec 2013 13:46:50 +0000 (15:46 +0200)]
module-rtp-recv: Add an argument for latency

10 years agocaps: Remove the FreeBSD implementation of pa_drop_caps()
Tanu Kaskinen [Fri, 3 Jan 2014 11:31:29 +0000 (13:31 +0200)]
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

10 years agoalsa-mixer: Free the description key in alsa_path_free().
poljar (Damir Jelić) [Tue, 24 Dec 2013 21:35:41 +0000 (22:35 +0100)]
alsa-mixer: Free the description key in alsa_path_free().

10 years agobluez5-util: Free the adapter_path in device_free().
poljar (Damir Jelić) [Tue, 24 Dec 2013 21:35:40 +0000 (22:35 +0100)]
bluez5-util: Free the adapter_path in device_free().

10 years agoDocumentation of known misuse of PulseAudio API
Alexander E. Patrakov [Mon, 21 Oct 2013 23:19:27 +0000 (00:19 +0100)]
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

10 years agocaps: Fix platform checking
Tanu Kaskinen [Mon, 30 Dec 2013 12:31:33 +0000 (14:31 +0200)]
caps: Fix platform checking

The "#elif __FreeBSD__" line caused a warning, because __FreeBSD__ was
not defined.

10 years agocaps: Improve log message
Tanu Kaskinen [Fri, 20 Dec 2013 19:54:22 +0000 (21:54 +0200)]
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".

10 years agoAdd support for FreeBSD <sys/capability.h>
Ryan Lortie [Tue, 10 Dec 2013 21:47:53 +0000 (16:47 -0500)]
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

10 years agosink-input: Fix volume_factor_sink initialization
Tanu Kaskinen [Fri, 20 Dec 2013 14:10:53 +0000 (16:10 +0200)]
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
10 years agolog: Add support for the systemd journal
poljar (Damir Jelić) [Tue, 3 Dec 2013 00:09:56 +0000 (01:09 +0100)]
log: Add support for the systemd journal

The journal is a component of systemd, that captures Syslog messages,
Kernel log messages, initial RAM disk and early boot messages as well
as messages written to STDOUT/STDERR of all services, indexes them and
makes this available to the user.

It can be used in parallel, or in place of a traditional syslog daemon,
such as rsyslog or syslog-ng.

The journal offers a couple of improvements over traditional logging
facilities (e.g. advanced filtering capabilities).

This patch adds support for logging directly to the journal using its
native API.

10 years agomodules: Add assertion in equalizer-sink
Peter Meerwald [Wed, 18 Dec 2013 16:35:08 +0000 (17:35 +0100)]
modules: Add assertion in equalizer-sink

discovered by coverity

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agocore: Fix check for io->output_event in enable_events()
Peter Meerwald [Wed, 18 Dec 2013 16:27:47 +0000 (17:27 +0100)]
core: Fix check for io->output_event in enable_events()

copy-pase error discovered by coverity

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agocore: Remove dead code in pa_mainloop_run()
Peter Meerwald [Wed, 18 Dec 2013 16:20:03 +0000 (17:20 +0100)]
core: Remove dead code in pa_mainloop_run()

    while ((r = pa_mainloop_iterate(m, 1, retval)) >= 0)
        ;

     if (r == -2)
         return 1;
     else if (r < 0)
        return -1;
     else
        return 0;

the last else is never reached, discovered by coverity

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agomodules: Remove dead code in position-event-sounds
Peter Meerwald [Wed, 18 Dec 2013 16:12:25 +0000 (17:12 +0100)]
modules: Remove dead code in position-event-sounds

ma is always NULL in fail path, discovered by coverity

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agocore: Use after free in pa_sink_input_new_data_set_formats() and pa_source_output_new...
Peter Meerwald [Mon, 16 Dec 2013 23:27:35 +0000 (00:27 +0100)]
core: Use after free in pa_sink_input_new_data_set_formats() and pa_source_output_new_data_set_formats()

intention is to free old data_req->formats before assigning
new formats, discovered by coverity

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agotests: Fix resource leak in sigbus-test
Peter Meerwald [Mon, 16 Dec 2013 22:54:13 +0000 (23:54 +0100)]
tests: Fix resource leak in sigbus-test

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agomodules: Remove redundant code in virtual-surround-sink
Peter Meerwald [Mon, 16 Dec 2013 17:10:36 +0000 (18:10 +0100)]
modules: Remove redundant code in virtual-surround-sink

https://scan7.coverity.com:8443/reports.htm#v10206/p10016/fileInstanceId=8788&defectInstanceId=3710&mergedDefectId=591297

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agocore: Fix asserting command in protocol-native
Peter Meerwald [Mon, 16 Dec 2013 17:01:37 +0000 (18:01 +0100)]
core: Fix asserting command in protocol-native

https://scan7.coverity.com:8443/reports.htm#v10206/p10016/fileInstanceId=8690&defectInstanceId=3688&mergedDefectId=591259

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agomodules: Fix uninit value in rtp-send
Peter Meerwald [Mon, 16 Dec 2013 16:22:10 +0000 (17:22 +0100)]
modules: Fix uninit value in rtp-send

https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8803&defectInstanceId=3705&mergedDefectId=591292&eventIds=3705-36&eventId=3705-36

see http://silviocesare.wordpress.com/2007/10/22/setting-sin_zero-to-0-in-struct-sockaddr_in/

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agocore: Fix uninit pointer read in protocol-native
Peter Meerwald [Mon, 16 Dec 2013 16:11:07 +0000 (17:11 +0100)]
core: Fix uninit pointer read in protocol-native

https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8690&defectInstanceId=3703&mergedDefectId=591290&eventIds=3703-7&eventId=3703-7

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agomodules: Fix resource leak in card-restore
Peter Meerwald [Mon, 16 Dec 2013 16:00:24 +0000 (17:00 +0100)]
modules: Fix resource leak in card-restore

https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8728&defectInstanceId=3737&mergedDefectId=591274

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agomodules: Fix resource leak in raop_client
Peter Meerwald [Mon, 16 Dec 2013 15:44:28 +0000 (16:44 +0100)]
modules: Fix resource leak in raop_client

https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8899&defectInstanceId=3735&mergedDefectId=591272

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agomodules: Fix resource leak in tunnel-sink-new
Peter Meerwald [Mon, 16 Dec 2013 15:40:03 +0000 (16:40 +0100)]
modules: Fix resource leak in tunnel-sink-new

https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8770&defectInstanceId=3733&mergedDefectId=591270

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agocore: Fix resource leak in core-util
Peter Meerwald [Mon, 16 Dec 2013 15:35:50 +0000 (16:35 +0100)]
core: Fix resource leak in core-util

https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8477&defectInstanceId=3693&mergedDefectId=591269

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agomodules: Fix resource leak in oss
Peter Meerwald [Mon, 16 Dec 2013 15:31:20 +0000 (16:31 +0100)]
modules: Fix resource leak in oss

https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8824&defectInstanceId=3731&mergedDefectId=591267

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agomodules: Fix resource leak in alsa-ucm
Peter Meerwald [Mon, 16 Dec 2013 15:25:44 +0000 (16:25 +0100)]
modules: Fix resource leak in alsa-ucm

https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8833&defectInstanceId=3732&mergedDefectId=591268

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agomodules: Fix resource leak in device-restore
Peter Meerwald [Mon, 16 Dec 2013 15:15:09 +0000 (16:15 +0100)]
modules: Fix resource leak in device-restore

https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8724&defectInstanceId=3728&mergedDefectId=591265

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agomodules: Fix resource leak in alsa-card
Peter Meerwald [Mon, 16 Dec 2013 15:03:10 +0000 (16:03 +0100)]
modules: Fix resource leak in alsa-card

https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8851&defectInstanceId=3725&mergedDefectId=591261

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agomodules: Fix resource leak in stream-restore
Peter Meerwald [Mon, 16 Dec 2013 14:54:29 +0000 (15:54 +0100)]
modules: Fix resource leak in stream-restore

https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8726&defectInstanceId=3724&mergedDefectId=591260

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agothread-mq: Initialize thread_mainloop to NULL if not in use
Jan Alexander Steffens (heftig) [Mon, 16 Dec 2013 23:07:11 +0000 (00:07 +0100)]
thread-mq: Initialize thread_mainloop to NULL if not in use

Fixes a crash when unloading module-zeroconf-publish.

Signed-off-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
10 years agosimple: Enable pa_simple_flush() on record streams and amend documentation
Peter Meerwald [Mon, 16 Dec 2013 13:18:17 +0000 (14:18 +0100)]
simple: Enable pa_simple_flush() on record streams and amend documentation

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agodoc: Document that pa_stream_flush() is applicable to playback and record streams
Peter Meerwald [Mon, 16 Dec 2013 13:18:16 +0000 (14:18 +0100)]
doc: Document that pa_stream_flush() is applicable to playback and record streams

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agodoc: Document that pa_simple_get_latency() can be used on record streams as well
Peter Meerwald [Mon, 16 Dec 2013 13:18:15 +0000 (14:18 +0100)]
doc: Document that pa_simple_get_latency() can be used on record streams as well

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agodoc: Refer to seek parameter of pa_stream_write() in description of pa_stream_flush()
Peter Meerwald [Mon, 16 Dec 2013 13:18:14 +0000 (14:18 +0100)]
doc: Refer to seek parameter of pa_stream_write() in description of pa_stream_flush()

pa_stream_write() has no delta parameter, but a seek parameter

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agodoc: Fix reference to pa_threaded_mainloop
Peter Meerwald [Mon, 16 Dec 2013 13:18:13 +0000 (14:18 +0100)]
doc: Fix reference to pa_threaded_mainloop

Generating docs for file mainloop-api.h...
/home/pmeerw/src/pa-missing/src/pulse/mainloop-api.h:118: warning: Found unknown command `\pa_threaded_mainloop'

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoAdd pa_channels_valid()
Tanu Kaskinen [Wed, 4 Dec 2013 07:50:11 +0000 (09:50 +0200)]
Add pa_channels_valid()

I think this makes the code a bit nicer to read and write. This also
reduces the chances of off-by-one errors when checking the bounds of
channel count values.

10 years agoAdd pa_sample_rate_valid()
Tanu Kaskinen [Wed, 4 Dec 2013 07:50:10 +0000 (09:50 +0200)]
Add pa_sample_rate_valid()

I think this makes the code a bit nicer to read and write. This also
reduces the chances of off-by-one errors when checking the bounds of
sample rate values.

10 years agoAdd pa_sample_format_valid()
Tanu Kaskinen [Wed, 4 Dec 2013 07:50:09 +0000 (09:50 +0200)]
Add pa_sample_format_valid()

I think this makes the code a bit nicer to read and write. This also
reduces the chances of off-by-one errors when checking the bounds of
the sample format value.

10 years agobluetooth: Fix profile priority comparison
Tanu Kaskinen [Sat, 14 Dec 2013 07:29:24 +0000 (09:29 +0200)]
bluetooth: Fix profile priority comparison

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=72414
10 years agocore-util: set_scheduler: check for RLIMIT_RTTIME
Ryan Lortie [Tue, 10 Dec 2013 18:27:52 +0000 (13:27 -0500)]
core-util: set_scheduler: check for RLIMIT_RTTIME

set_scheduler() assumes that if sys/resource.h was found then we will
find RLIMIT_RTTIME there, but this is a non-POSIX extension on Linux.

Change the check to ensure that RLIMIT_RTTIME is actually defined.
Linux indeed defines this as a macro, and POSIX specifies that the other
RLIMIT_ constants must be macros, so having this as an #ifdef seems
correct.

10 years agobootstrap.sh: use /usr/bin/env to find bash
Ryan Lortie [Tue, 10 Dec 2013 18:26:17 +0000 (13:26 -0500)]
bootstrap.sh: use /usr/bin/env to find bash

bootstrap.sh uses some non-POSIX features of bash, so we can't use
/bin/sh.  Unlike /bin/sh, bash can be installed anywhere in the path, so
we should use /usr/bin/env to find it.

This helps systems that have bash in /usr/local/bin, for example.

10 years agomodargs: Do not modify alternate_rate in pa_modargs_get_alternate_sample_rate() on...
Peter Meerwald [Wed, 11 Dec 2013 16:07:04 +0000 (17:07 +0100)]
modargs: Do not modify alternate_rate in pa_modargs_get_alternate_sample_rate() on failure

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agomodargs: Fix pa_modargs_get_sample_rate() if no "rate" is present in the modargs
Peter Meerwald [Wed, 11 Dec 2013 16:07:03 +0000 (17:07 +0100)]
modargs: Fix pa_modargs_get_sample_rate() if no "rate" is present in the modargs

see http://lists.freedesktop.org/archives/pulseaudio-discuss/2013-December/019471.html

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Reported-by: "poljar (Damir Jelić)" <poljarinho@gmail.com>
10 years agoalsa: Log some output if we disable tsched for BATCH devices
Arun Raghavan [Fri, 6 Dec 2013 14:00:15 +0000 (06:00 -0800)]
alsa: Log some output if we disable tsched for BATCH devices

10 years agocore-util: Check that we actually have regexec before we use it
Peter Meerwald [Fri, 29 Nov 2013 14:58:42 +0000 (15:58 +0100)]
core-util: Check that we actually have regexec before we use it

Thanks to Pierre Ossman for reporting the bug and providing an initial
fix on which this patch is based.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=69708
10 years agoalsa: Disable timer-scheduling for PCMs with the BATCH flag
Lars-Peter Clausen [Sat, 30 Nov 2013 17:07:24 +0000 (18:07 +0100)]
alsa: Disable timer-scheduling for PCMs with the BATCH flag

PCM Devices which have the BATCH flag set update the PCM pointer only with
period size granularity. Using timer based scheduling does not have any
advantage in this mode. For one devices which have that flag set usually update
the position pointer in software after getting the period interrupt. So
disabling the period interrupt is not possible for this kind of devices.
Furthermore writing to or reading from the buffer slice for the current period
is not possible since the position inside the buffer is not known. On the other
hand the tsched algorithm seems to get easily confused for this kind of
hardware, which results in garbled audio output. This typically means that timer
based scheduling needs to be manually disabled on systems with such devices.
Auto disabling tsched in this case allows these systems to run with the default
configuration.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
10 years agocard: Move pa_card_add_profile() implementation to a more logical place
Tanu Kaskinen [Thu, 5 Dec 2013 16:56:39 +0000 (18:56 +0200)]
card: Move pa_card_add_profile() implementation to a more logical place

The old place was in the middle of pa_card_new_data functions, which
made no sense.

10 years agobonjour-publish: Return ports in network byteorder
Kenneth Perry [Thu, 5 Dec 2013 09:19:08 +0000 (11:19 +0200)]
bonjour-publish: Return ports in network byteorder

For DNS-SD (Bonjour) discovery, all ports should be set in network
byteorder instead of host byteorder. Without this, all ports on
little-endian systems (intel) are incorrect.

Documentation:
https://developer.apple.com/library/mac/documentation/networking/Reference/DNSServiceDiscovery_CRef/Reference/reference.html#//apple_ref/c/func/DNSServiceRegister

10 years agomodule-remap-source: Add resample_method argument
Peter Meerwald [Fri, 29 Nov 2013 14:32:44 +0000 (15:32 +0100)]
module-remap-source: Add resample_method argument

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
10 years agomodule-remap-sink: Add resample_method argument
Peter Meerwald [Fri, 29 Nov 2013 14:32:43 +0000 (15:32 +0100)]
module-remap-sink: Add resample_method argument

the main intent is to make testing different sample rate resampling
implementations easier; so far there is only global control via
resample-method (command line argument and /etc/pulse/daemon.conf)

module-remap-*'s only purpose is resampling (comprising format conversion,
channel remapping, sample rate adjustment), it can easily be introduced
into any audio pipeline

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
10 years agomodule-sine: Add rate argument
Peter Meerwald [Fri, 29 Nov 2013 14:32:42 +0000 (15:32 +0100)]
module-sine: Add rate argument

useful for testing resampling

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
10 years agomodules: Make use of new function pa_modargs_get_sample_rate()
Peter Meerwald [Fri, 29 Nov 2013 14:32:41 +0000 (15:32 +0100)]
modules: Make use of new function pa_modargs_get_sample_rate()

by using pa_modargs_get_sample_rate() we avoid inconsistant validity
checking of the sample rate in various places

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoresampler: Clean up ffmpeg resampler buffering
Peter Meerwald [Fri, 29 Nov 2013 14:33:25 +0000 (15:33 +0100)]
resampler: Clean up ffmpeg resampler buffering

buf in struct ffmpeg_data is reset() initially and freed, but never
actually used

when a new block is allocated ffmpeg_data->buf[c].length is used
(which is always 0) to compute the new block size

so, drop buf

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
10 years agoPass the profile object instead of the profile name to pa_card_set_profile()
Tanu Kaskinen [Wed, 20 Nov 2013 13:42:26 +0000 (15:42 +0200)]
Pass the profile object instead of the profile name to pa_card_set_profile()

When setting attribute foo, or in this case the card profile, in my
opinion the thing passed to the set_foo() function should be of the
type of foo, not a string identifier that can be used to search for
the actual foo in set_foo().

This is mostly a question of taste, but there's at least some small
benefit from passing the actual object: often the profile object is
already available when calling pa_card_set_profile(), so passing the
card name would cause unnecessary searching when pa_card_set_profile()
needs to look up the profile from the hashmap.

10 years agoucm: Add a FIXME comment about bad error handling
Tanu Kaskinen [Mon, 18 Nov 2013 16:48:05 +0000 (18:48 +0200)]
ucm: Add a FIXME comment about bad error handling

10 years agoidxset: Allow deep copying with pa_idxset_copy()
Tanu Kaskinen [Sun, 17 Nov 2013 20:47:59 +0000 (22:47 +0200)]
idxset: Allow deep copying with pa_idxset_copy()

10 years agosink, source: Add a TODO comment about removing get_formats()
Tanu Kaskinen [Sun, 17 Nov 2013 19:22:20 +0000 (21:22 +0200)]
sink, source: Add a TODO comment about removing get_formats()

10 years agoprotocol-native: Remove written differently but functionally redundant check.
Scott Reeves [Thu, 21 Nov 2013 21:43:51 +0000 (14:43 -0700)]
protocol-native: Remove written differently but functionally redundant check.

10 years agosource-output: Log the format negotiation result
Tanu Kaskinen [Thu, 14 Nov 2013 09:01:17 +0000 (11:01 +0200)]
source-output: Log the format negotiation result

This makes the source output code match the sink input code.

10 years agobluetooth: Fix crash in pa_bluetooth_discovery_get_device_by_address()
João Paulo Rechi Vita [Wed, 20 Nov 2013 21:21:36 +0000 (18:21 -0300)]
bluetooth: Fix crash in pa_bluetooth_discovery_get_device_by_address()

We need to check if the device information is valid first, so we don't
pass invalid strings to pa_streq().

10 years agobluetooth: Check adapter address to set device_info_valid
João Paulo Rechi Vita [Wed, 20 Nov 2013 21:21:35 +0000 (18:21 -0300)]
bluetooth: Check adapter address to set device_info_valid

If the adapter object has no address information the device information
should be marked as invalid.

10 years agoFix undefined behaviour in pulseaudio --start.
Stefan Sperling [Thu, 21 Nov 2013 17:47:42 +0000 (18:47 +0100)]
Fix undefined behaviour in pulseaudio --start.

Don't call pthread_join() to join a thread from a different
process than the thread was created in. Doing so can lead to
undefined behaviour.

On OpenBSD, the symptom was a pulseaudio process with a single
thread waiting forever for other threads to join. Since that
process also held the autospawn lock, starting new pulseaudio
processes with --start kept failing. The problem was analyzed
with help from Philip Guenther.

This patch adds a pa_thread_free_nojoin() function which can
be used to free resources for a thread without a join, as
suggested by Tanu Kaskinen.

See https://bugs.freedesktop.org/show_bug.cgi?id=71738

10 years agosink/source: When picking the initial ports, prefer ones that are not unavailable.
Colin Guthrie [Fri, 15 Nov 2013 08:33:39 +0000 (09:33 +0100)]
sink/source: When picking the initial ports, prefer ones that are not unavailable.

This does for sinks/source ports what f434087e42b did for card profiles.

10 years agocard: Ensure we still pick a profile even if it's unavailable.
Colin Guthrie [Fri, 15 Nov 2013 08:33:37 +0000 (09:33 +0100)]
card: Ensure we still pick a profile even if it's unavailable.

f434087e42b introduced the potential to not select a card profile if
all the profiles were marked as unavailable.

While this is very unlikely, it's a theoretical posibility, so if the
initial choice of a profile fails, try harder.

10 years agobluetooth: Set device_info_valid to -1 when the device's adapter disappears
Tanu Kaskinen [Fri, 15 Nov 2013 14:29:41 +0000 (16:29 +0200)]
bluetooth: Set device_info_valid to -1 when the device's adapter disappears

When parsing device properties, missing adapter will result in
device_info_valid being set to -1. It is then logical that if the
adapter goes missing at a later point, device_info_valid gets set to
-1 also in that situation.

10 years agobluetooth: Remove device_remove_all()
Tanu Kaskinen [Fri, 15 Nov 2013 14:29:40 +0000 (16:29 +0200)]
bluetooth: Remove device_remove_all()

The function did two things: set device_info_valid to -1 and called
device_free() for each device in the hashmap. Setting
device_info_valid to -1 was unnecessary. The main purpose of that was
to fire DEVICE_CONNECTION_CHANGED as a side effect, but that hook is
fired anyway in device_free(), as a side effect of removing all
transports. Calling device_free() can be delegated to pa_hashmap, when
freeing or emptying it.

10 years agobluetooth: Fire DEVICE_CONNECTION_CHANGED in set_device_info_valid()
Tanu Kaskinen [Fri, 15 Nov 2013 14:29:39 +0000 (16:29 +0200)]
bluetooth: Fire DEVICE_CONNECTION_CHANGED in set_device_info_valid()

Normally DEVICE_CONNECTION_CHANGED is fired when the first transport
becomes connected, but it may happen that the first transport becomes
connected already before the device properties have been received. In
that case the hook should be fired at the time the device properties
are received. This patch makes the hook to be fired at the right time.

10 years agobluetooth: Don't mark device valid before it has an adapter
Tanu Kaskinen [Fri, 15 Nov 2013 14:29:38 +0000 (16:29 +0200)]
bluetooth: Don't mark device valid before it has an adapter

At this point this doesn't make any other practical difference than
making the code more logical, but in the next patch I'll fire the
DEVICE_CONNECTION_CHANGED hook in set_device_info_valid(), and at that
point it's important that the device isn't marked valid too early,
because otherwise external code would see "valid" devices that however
don't have the adapter set.

10 years agobluetooth: Use a helper function for setting device_info_valid
Tanu Kaskinen [Fri, 15 Nov 2013 14:29:37 +0000 (16:29 +0200)]
bluetooth: Use a helper function for setting device_info_valid

The helper function doesn't yet bring much benefits in this form, but
I'll add more functionality later.

10 years agoprotocol-native: Express XOR asserts more concisely
Parin Porecha [Tue, 19 Nov 2013 20:59:39 +0000 (11:59 -0900)]
protocol-native: Express XOR asserts more concisely

7 instances of the roundabout asserts were found,
All of them have been replaced with appropriate XOR asserts.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=47493
10 years agobluetooth: Remove a redundant variable
Tanu Kaskinen [Fri, 15 Nov 2013 12:23:27 +0000 (14:23 +0200)]
bluetooth: Remove a redundant variable

10 years agoRevert "core: Transparently handle non-blocking sockets on Windows"
Pierre Ossman [Fri, 20 Sep 2013 08:13:41 +0000 (10:13 +0200)]
Revert "core: Transparently handle non-blocking sockets on Windows"

This reverts commit c327850d9e4479a0572b7baaf8dafd737586e5a1 as
the workaround in that commit is no longer needed after the real
bug has been fixed.

Conflicts:
src/pulsecore/core-util.c

10 years agocore: make sure win32 sockets remain blocking
Pierre Ossman [Fri, 20 Sep 2013 08:10:50 +0000 (10:10 +0200)]
core: make sure win32 sockets remain blocking

Commit 7e344b5 hade the side effect of forcing every socket to
be non-blocking on Windows. This is because of a (documented)
side effect of WSAEventSelect(). So we need to make sure to restore
blocking behaviour afterwards for relevant sockets.

10 years agotunnel-new: add cookie module argument
Alexander Couzens [Mon, 16 Sep 2013 12:08:14 +0000 (14:08 +0200)]
tunnel-new: add cookie module argument

When connecting to a remote server your local generated authentication
cookie is used. If remote server's cookie is different from your local
one you aren't allowed to connect. You can use the cookie argument
or define a wider acl in remote server configuration for
module-native-protocol.

10 years agosink-input, source-output: Don't assume that proplist has been initialized in free()
Tanu Kaskinen [Thu, 14 Nov 2013 08:53:44 +0000 (10:53 +0200)]
sink-input, source-output: Don't assume that proplist has been initialized in free()

It's bad form to assume in free() that any member of the struct has
been initialized. I ran into problems with this when I reordered
things in pa_sink_input_new() and pa_source_output_new().

10 years agoresampler: Cleanup, index of memchunks is not used
Peter Meerwald [Sun, 21 Jul 2013 21:14:45 +0000 (23:14 +0200)]
resampler: Cleanup, index of memchunks is not used

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoresampler: Prepare to have leftover data in different output buffers
Peter Meerwald [Sun, 21 Jul 2013 21:14:44 +0000 (23:14 +0200)]
resampler: Prepare to have leftover data in different output buffers

leftover_buf points to the output buffer of a stage containing leftover
data; similar for leftover_buf_size and have_leftover

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoresampler: Add fit_buf() helper funtion for buffer allocation
Peter Meerwald [Sun, 21 Jul 2013 21:14:43 +0000 (23:14 +0200)]
resampler: Add fit_buf() helper funtion for buffer allocation

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoresampler: Cleanup, rename xxxx_buf_samples to xxxx_buf_size
Peter Meerwald [Sun, 21 Jul 2013 21:14:42 +0000 (23:14 +0200)]
resampler: Cleanup, rename xxxx_buf_samples to xxxx_buf_size

we measure the capacity of a buffer in bytes, not samples

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoresampler: Handle leftover samples, use new return value
Peter Meerwald [Sun, 21 Jul 2013 21:14:41 +0000 (23:14 +0200)]
resampler: Handle leftover samples, use new return value

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoresampler: Change interface, resampler may return the number of leftover frames
Peter Meerwald [Sun, 21 Jul 2013 21:14:40 +0000 (23:14 +0200)]
resampler: Change interface, resampler may return the number of leftover frames

some resampler implementations (e.g. libsamplerate and ffmpeg) do not consume
the entire input buffer; the impl_resample() function now has a return value
returning the number of frames in the input buffer not processed

these frames must be saved in appropriate buffer and presented together with
new input data

also change the parameter names from in_samples, out_samples to in_n_frames,
out_n_frames, respectively (n_frames = samples / channels)

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agoresampler: Introduce work_channels
Peter Meerwald [Sun, 21 Jul 2013 21:14:39 +0000 (23:14 +0200)]
resampler: Introduce work_channels

work_channels is the number of channels in the resampler stage

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
10 years agoresampler: Introduce work frame size (w_fz)
Peter Meerwald [Sun, 21 Jul 2013 21:14:38 +0000 (23:14 +0200)]
resampler: Introduce work frame size (w_fz)

w_fz represents the number of bytes per frame in the resampler stage

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
10 years agocard: Only set active_profile with available profile
Luiz Augusto von Dentz [Sun, 3 Nov 2013 13:05:34 +0000 (15:05 +0200)]
card: Only set active_profile with available profile

When a card is being created and no profile has been assigned
pa_card_new will attempt to select one from the list but it does that
without checking the available flag which can lead to select profiles
not available.

10 years agointrospect: Fix ABI break introduced by b98a2e1
Luiz Augusto von Dentz [Mon, 4 Nov 2013 17:41:22 +0000 (19:41 +0200)]
introspect: Fix ABI break introduced by b98a2e1

The size of pa_card_profile_info cannot change even if it just a field
appended to end because each entry is appended to a contiguous memory
and accessed by offset this may lead clients to access invalid data.

To fix a new struct called pa_card_profile_info2 is introduced and shall
be used for now on while pa_card_profile_info shall be considered
deprecated but it is still mantained for backward compatibility.

A new field called profiles2 is introduced to pa_card_info, this new field
is an array of pointers to pa_card_profile_info2 so it should be possible
to append new fields to the end of the pa_card_profile_info2 without
breaking binary compatibility as the entries are not accessed by offset.

10 years agoalsa-mixer: Add internal surround speaker elements
David Henningsson [Mon, 14 Oct 2013 14:06:45 +0000 (16:06 +0200)]
alsa-mixer: Add internal surround speaker elements

These kcontrol names have started to show up lately, in
combination with surround internal speakers.

BugLink: https://bugs.launchpad.net/bugs/1236965
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
10 years agoconsole-kit: Remove logging of every message on the bus
João Paulo Rechi Vita [Tue, 29 Oct 2013 20:50:43 +0000 (17:50 -0300)]
console-kit: Remove logging of every message on the bus

10 years agotests: Extract PA_CPU_TEST* macros to separate header
Peter Meerwald [Tue, 16 Jul 2013 20:00:35 +0000 (22:00 +0200)]
tests: Extract PA_CPU_TEST* macros to separate header

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
10 years agodaemon conf: "high-priority" setting isn't respected
Pierre Ossman [Fri, 1 Nov 2013 13:50:51 +0000 (14:50 +0100)]
daemon conf: "high-priority" setting isn't respected

The code got removed by accident during the cleanup in commit 9c438bcac671. So
this patch is needed to bring it back and make things work like documented.

10 years agozsh-completion: Add --monitor-stream completion to pacat
poljar (Damir Jelić) [Thu, 15 Aug 2013 12:08:44 +0000 (14:08 +0200)]
zsh-completion: Add --monitor-stream completion to pacat

10 years agosimple: Improve pa_simple_read() documentation
Tanu Kaskinen [Fri, 4 Oct 2013 10:39:40 +0000 (13:39 +0300)]
simple: Improve pa_simple_read() documentation

There was a question in IRC about whether pa_simple_read() blocks or
not. It's already documented on the simple API overview page, but it's
good to say it also in the function reference. As a bonus, I added
some additional details to the documentation too.

10 years agobluetooth: Fix variable constness
Tanu Kaskinen [Sun, 29 Sep 2013 15:49:23 +0000 (18:49 +0300)]
bluetooth: Fix variable constness

The string points to memory inside a DBusMessage, so we don't own the string.

10 years agobluetooth: Remove adapter_remove_all()
Tanu Kaskinen [Sun, 29 Sep 2013 15:49:22 +0000 (18:49 +0300)]
bluetooth: Remove adapter_remove_all()

The function was redundant, because all it did was call adapter_free()
for each adapter in the hashmap, and that can be delegated to
pa_hashmap when freeing or emptying it.