Commit graph

5938 commits

Author SHA1 Message Date
Lu Guanqun
5fe545de23 memblock: use built-in function
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
2011-08-15 09:41:56 +01:00
Lu Guanqun
ecbb4b4ef4 memblock: fix memory leak when pa_shm_create_rw fails
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
2011-08-15 09:41:56 +01:00
Maarten Bosmans
a1ce2426d8 Avoid read from freed memory
The order of freeing the hashmaps is important here, because otherwise a string used as key is freed before the hashmap
is freed.

Valgrind reports this as:
 Invalid read of size 1
    at 0x4107042: pa_idxset_string_hash_func (idxset.c:67)
    by 0x4106026: remove_entry (hashmap.c:93)
    by 0x41061BF: pa_hashmap_free (hashmap.c:110)
    by 0x71DD143: pa_dbusiface_core_free (iface-core.c:2105)
    by 0x71F2169: module_dbus_protocol_LTX_pa__done (module-dbus-protocol.c:595)
    by 0x406DC51: pa_module_free (module.c:162)
    by 0x406E01D: pa_module_unload_all (module.c:210)
    by 0x4068842: core_free (core.c:169)
    by 0x406FD5D: pa_object_unref (object.c:64)
    by 0x805224D: pa_core_unref (core.h:184)
    by 0x805560B: main (main.c:1159)
  Address 0x4d099c0 is 0 bytes inside a block of size 100 free'd
    at 0x4025BF0: free (vg_replace_malloc.c:366)
    by 0x40F128C: pa_xfree (xmalloc.c:131)
    by 0x71E4CEB: pa_dbusiface_device_free (iface-device.c:1293)
    by 0x71DCD7E: free_device_cb (iface-core.c:2062)
    by 0x41061D7: pa_hashmap_free (hashmap.c:113)
    by 0x71DD125: pa_dbusiface_core_free (iface-core.c:2104)
    by 0x71F2169: module_dbus_protocol_LTX_pa__done (module-dbus-protocol.c:595)
    by 0x406DC51: pa_module_free (module.c:162)
    by 0x406E01D: pa_module_unload_all (module.c:210)
    by 0x4068842: core_free (core.c:169)
    by 0x406FD5D: pa_object_unref (object.c:64)
    by 0x805224D: pa_core_unref (core.h:184)
2011-08-15 09:41:56 +01:00
Maarten Bosmans
92219b01b9 Initialise variables
These were detected using clang static analyzer.
2011-08-15 09:41:56 +01:00
Maarten Bosmans
3b76d8065f Plug some memory leaks
These were detected with valgrind.
2011-08-15 09:41:56 +01:00
Maarten Bosmans
1e4298be4d module-tunnel: Fix for new protocol versions
The commit 7ebc5033 resulted in segfaults, because format->plist was not allocated.
The solution is not to allocate pa_format_info on the stack, but to properly use pa_format_info_new().
Also a typo regarding pa_tagstruct_putu8 is corrected.
2011-08-15 09:41:56 +01:00
Tanu Kaskinen
0636f4e685 svolume: Make log messages more precise.
I was looking at a log, and noticed the following lines:

I  [pulseaudio] svolume_mmx.c: Initialising MMX optimized functions.
I  [pulseaudio] remap_mmx.c: Initialising MMX optimized remappers.
I  [pulseaudio] svolume_sse.c: Initialising SSE2 optimized functions.
I  [pulseaudio] remap_sse.c: Initialising SSE2 optimized remappers.
I  [pulseaudio] sconv_sse.c: Initialising SSE2 optimized conversions.

It seemed odd that some messages were somewhat precise in
what functionality was initialized, while the svolume
messages told me that they had initialized just "functions".
So I made the svolume log messages more precise to match the
sconv and remap messages.
2011-08-15 09:41:56 +01:00
Tanu Kaskinen
dccbefa394 daemon-conf: Don't make log files executable. 2011-08-15 09:41:56 +01:00
Wang Xingchao
2f55da5baa sink-input: Avoid fake rewind in corked state
sink_input_request_rewind() does nothing if we are in the corked state.
Thus do not set the new state untill we have issued the rewind request.
2011-08-15 09:41:55 +01:00
Arun Raghavan
50b420aebd device-restore: Log invalid sink index while setting formats
This makes it easier to catch errors when using 'pactl set-sink-formats'
2011-08-15 12:49:35 +05:30
Arun Raghavan
b9d517cd51 sink: Fix lazy commenting 2011-08-15 12:49:35 +05:30
Arun Raghavan
0f3be7b72b pactl: Add a set-sink-formats command
This uses the module-device-restore protocol extension to save formats
on sinks that support it.
2011-08-15 12:49:35 +05:30
Arun Raghavan
8bffbcde1b format: Add string to pa_format_info conversion function
This will help accept string formats from the command like (so we can
set formats using pactl).
2011-08-15 11:51:35 +05:30
Arun Raghavan
348c51bfcd format: Make pa_format_info_snprint() more parseable
Removes the comma as the proplist separator since that makes
pa_proplist_from_string() break and prints only the encoding if there
are no properties (instead of "<encoding>, (no properties)").
2011-08-15 11:51:35 +05:30
Arun Raghavan
248394c8bf device-restore: Set sink format when possible
This implements the actual setting of sink formats when a new sink is
added or when the set of available formats changes.
2011-08-15 11:51:35 +05:30
Arun Raghavan
ba163b8b23 device-restore: Make bools not be bit fields
This makes the pa_bool_t members of userdata not be a single bit field
since pa_bool_t can be an int, potentially causing signedness issues in
comparisons.
2011-08-15 11:51:35 +05:30
Arun Raghavan
51fcee8902 alsa: Implement get/set_formats()
This implements the sink get_formats() and set_formats() API in
alsa-sink. Modules can use this to allow users to specify what formats
their receivers support.
2011-08-15 11:51:34 +05:30
Arun Raghavan
485d4dd542 sink: Add a set_formats() API
This adds API to let external sources specify what formats a sink
supports. Sinks must opt-in to allow this, and can perform some
validation if required.
2011-08-15 11:51:34 +05:30
Maarten Bosmans
b430407f47 Plug some memory leaks and an invalid read
Note in protocol-dbus.c specifically, method_signatures needs to be freed
before method_handlers, because otherwise h->method_name is freed while it is
still in use as a key in the method_signatures hashmap.
2011-08-12 20:31:52 +02:00
Colin Guthrie
a8f20e8d95 sink-input: Drop redundant assert (PA_SINK_INPUT_IS_LINKED() checked already) 2011-08-12 20:31:52 +02:00
Arun Raghavan
c1cb0a6925 log: Add missing pulsecore/thread.h include 2011-08-12 20:04:15 +05:30
Lu Guanqun
6c2a1cceed i18n: po file fixes
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
2011-08-12 16:14:18 +05:30
Wang Xingchao
be3879e04e alsa: resets POLLOUT event
revents marked as POLLOUT|POLLERR|POLLWRNORM in "underrun" case that will
trigger unexpected log "ALSA woke us up to write new data to the device, but
there was acturally nothing to write...".

This patch avoids this log message.
2011-08-11 15:31:48 +02:00
Wang Xingchao
e564129b8f alsa: Update process_usec before going to sleep
During check_left_to_play/record(), the watermark may increase/decrease. So before
sleeping, update the actural sleep time based on latest watermark.
2011-08-11 15:30:27 +02:00
Maarten Bosmans
b4e938e194 Move i18n.[ch] to src/pulsecore
The header is used in files troughout the tree and is not included in the public api,
so it belongs in pulsecore, not in pulse.
2011-08-11 13:23:42 +02:00
Maarten Bosmans
464ddcdfea Add some missing format.h includes 2011-08-11 13:23:21 +02:00
Maarten Bosmans
f10da7683d Include config.h consistently in source files and not in headers 2011-08-11 13:21:31 +02:00
Lu Guanqun
625380d809 sample-util: use built-in function
use built-in function pa_frame_aligned().

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
2011-08-11 10:36:21 +02:00
Colin Guthrie
1824fc6d73 ext-device-restore: Include format.h 2011-08-11 10:36:21 +02:00
Colin Guthrie
6b1d9b8d6a alsa: Ensure that volumes are written to the h/w at startup.
If the device support SYNC_VOLUMES then we need to do an additional push
to get the actual change on to the h/w.
2011-08-11 10:36:11 +02:00
Colin Guthrie
0b5a181e1b alsa-mixer: Fix rounding direction on mixer initialisation 2011-08-10 10:28:50 +02:00
Colin Guthrie
8ace9185aa pactl: Make stat backwards compatible with previous versions.
This is not ideal but in order to aid people using it in scripts
etc, we will maintain backwards compatibiliy here.

Also add a 'short' mode and mention in the man page that this
will ultimately become the default at some point in the future.
2011-08-10 10:12:51 +02:00
Maarten Bosmans
49c20b3e3d pactl: Split help string up in shorter pieces for easier translation 2011-08-10 10:12:51 +02:00
Maarten Bosmans
3e14019c44 pactl: Short --help output a bit by consolidating sink/source commands 2011-08-10 10:12:51 +02:00
Maarten Bosmans
d36a899062 pactl: Update manpage 2011-08-10 10:12:50 +02:00
Lu Guanqun
6a03af769a log: add thread name
This patch displays thread name in the log, that would be more descriptive.
It improves Xingchao (xingchao.wang@intel.com)'s patch which shows thread id.

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
2011-08-09 15:06:01 +02:00
Colin Guthrie
fc0a6ee239 device-restore: Various fixes for the protocol extension.
* Fix extension API function export list.
 * Ensure we trigger a subscription event when things change.
 * Send the index with our subscription events.
 * Clear out any existing formats when saving.
 * Call the correct extension command for subscriptions.
2011-08-09 11:01:01 +02:00
Maarten Bosmans
738cea3cc3 Fix default.pa on non udev systems 2011-08-08 10:14:59 +02:00
Colin Guthrie
e8df86807e stream-restore: Save/restore source output volume/mute 2011-08-08 09:49:52 +02:00
Colin Guthrie
8c93d7dc80 source-output: Fix resampling.
When recording, we need to reverse the order of sample specs
(origin<->destination) from the sink code this was copied form.
2011-08-07 00:37:28 +02:00
David Henningsson
b60c570d90 Document PA_COMMAND_UNDERFLOW protocol change
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-08-04 17:24:23 +01:00
David Henningsson
5bfcb5d8a0 Fix crash in path subset elimination
As reported in http://kpaste.net/04f1f3f
it is possible to call enumeration_is_subset with null pointers.
Handle that case instead of crashing. (It is also possible that
Tanuk's pending element_is_subset patch solves the issue, but this
nevertheless gives some extra security.)

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-08-04 17:23:37 +01:00
Colin Guthrie
85291b1954 build-sys: bump soname 2011-08-02 16:19:53 +01:00
David Henningsson
1893234063 protocol-native: Allow clients to know at what index underrun occurred
This patch introduces some extra protocol information, so protocol
version is bumped. This functionality is primarily needed to solve
a long standing issue in alsa-plugins, which should ignore underruns
if and only if it is obsolete, i e, if more data has been written to
the pipe in the meantime (which will automatically end the underrun).

BugLink: http://bugs.launchpad.net/bugs/805940
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-08-02 13:59:00 +01:00
Daniel Schaal
00493a4ef0 man: add manpage for start-pulseaudio-kde and start-pulseaudio-x11 2011-08-01 10:19:12 +01:00
Maarten Bosmans
f35214e4f1 build-sys: Check for necessary programs in bootstrap.sh
Also use glib-gettextize instead of plain gettextize.
2011-07-28 10:51:09 +01:00
Arun Raghavan
4e8bb96975 doc: Document subscription events better
Add an explanation and some example code to make it easier for people
writing client-side code to figure out how subscription events work.
2011-07-27 21:52:32 +05:30
Jens Georg
441bd54bdc rygel: Fix introspection XML for MediaItem2 2011-07-22 21:57:55 +05:30
Jens Georg
ed061a3e73 rygel: Properly close {sv} iters for GetAll
This fixes browsing the PA Sink and Source container.
2011-07-22 21:35:23 +05:30
Tanu Kaskinen
1824f6de6a virtual: Fix volume callback setting.
We want to set the volume callbacks only if volume sharing
is not used. When volume sharing is used, we don't want to
mess with the stream volumes.

This was broken in 6c6b50
2011-07-21 20:38:57 +01:00