Commit graph

6481 commits

Author SHA1 Message Date
Arun Raghavan
8b01695a0e glib: Stop using g_source_get_current_time()
This function is now marked as deprecated. It is functionally identical
to g_get_current_time(), so we use that instead. The GLib API docs
suggest g_source_get_time(), but that does not provide wallclock time
(which is what the pa_time_event API expects), so we don't use it.
2012-06-28 20:00:00 +05:30
Tanu Kaskinen
0c8fdf30d1 sink, source: Fix setting the latency offset when the sink/source is unlinked. 2012-06-28 16:34:56 +03:00
poljar (Damir Jelić)
bf4091dcf8 device-port: Change the latency offset type to a signed int.
The latency offset type should be signed (int64_t) so we can also add
a negative latency offset.

This also includes changing the type of the sink/source
offsets and updating pacmd so it handles negative numbers.
2012-06-28 16:33:14 +03:00
Ismo Puustinen
f6e4bfbbc5 ladspa: Added a python script for testing.
The python script uses the ladspa D-Bus interface for IPC testing.
2012-06-28 15:05:31 +03:00
Ismo Puustinen
fdf358beed ladspa: D-Bus interface for setting algorithm parameters on-the-fly.
A new external D-Bus interface is registered and LADSPA algorithm
control parameters are exposed as a D-Bus property with setter and
getter support.
2012-06-28 14:59:36 +03:00
Deng Zhengrong
e8c5f24b47 xen: add the HAVE_CONFIG_H macro guard 2012-06-28 16:41:04 +05:30
Deng Zhengrong
a72544589d pacmd: add help info for 'set-log-target' 2012-06-28 16:40:36 +05:30
Deng Zhengrong
faba854de7 build: Add gcov coverage support 2012-06-28 16:36:49 +05:30
Arun Raghavan
062a104247 pactl: Print sink-input/source-output corked status
Sending this out for review before committing since it changes pactl output.
2012-06-28 13:42:44 +03:00
poljar
7688e64739 pacmd: Add functions to handle the latency offset
pacmd was extended so it can handle the new latency offset.

A new function was added so we can set the latency also the list
commands were extended to print the latency offset on the ports.
2012-06-27 14:24:56 +03:00
poljar
eebdda456b sink, source: Add a latency offset which is inherited from the port
A latency offset variable was added to the sink/source struct.

Also a function was introduced to update the latency offset of the
sink/source and a new message type was introduced so we can send the latency
offset to the IO thread.

The latency offset is automatically populated with the latency from the
currently active port.
2012-06-25 20:07:13 +03:00
poljar
bc03487896 device-port: Add a latency variable to the port struct
A latency offset variable was added to the port struct and a function to
set the latency offset.

The latency offset does nothing for now, but it will be later added to
the sink/source latency.
2012-06-25 19:49:54 +03:00
Mihai Moldovan
56ce2c67c2 core-util: use the generic PATH_MAX variant of pa_realpath on Mac OS X
realpath() on OS X behaves GNUish and accepts NULL for resolved_name
only on 10.6 and higher. Older versions will crash, if resolved_name is
NULL.

All versions define PATH_MAX, though. Better play it safe and use the
generic PATH_MAX version of pa_realpath on Mac OS X systems.

Signed-off-by: Mihai Moldovan <ionic@ionic.de>
2012-06-16 10:34:41 +05:30
Frédéric Danis
017e1c4dda bluetooth: Fix bluetooth.nrec property not updated
PropertyChanged signal of org.BlueZ.MediaTransport is processed in
pa_bluetooth_transport_parse_property() which updates t->nrec.
This is called by :
- First by filter_cb() of bluetooth-util.c
- Then by filter_cb() of module-bluetooth-device.c which retrieve value
  of t->nrec before calling parse function, then it checks if t->nrec
  has changed before updating bluetooth.nrec property.
  As t->nrec has alreday been changed during first process, property
  update is never performed.

This patch creates a new hook in pa_bluetooth_transport called
PA_BLUETOOTH_TRANSPORT_HOOK_NREC_CHANGED.
The hook is fired by bluetooth-util.c when the transport's NREC
property changes.
module-bluetooth-device.c won't listen the PropertyChanged signal of
MediaTransport anymore. Instead, it will use the hook in
pa_bluetooth_transport to get a notification when the NREC property
changes, and update the sink or source proplist accordingly.

const qualifier for returned pointer of
pa_bluetooth_discovery_get_transport() is removed.
2012-06-15 21:06:01 +03:00
Arun Raghavan
a91359956f auth: Create cookie directory if it doesn't exist
Makes sure the cookie directory exists before trying to create the
cookie. This might be the case on freshly installed headless systems.
2012-06-13 16:37:21 +05:30
Arun Raghavan
59968f8e2c core-util: Make pa_make_secure_dir() act like mkdir -p
This makes pa_make_secure_dir() create any missing parent directories in
the given path as well. This is useful, for example, on a pristine
system with a clean $HOME that needs ~/.config/pulse/ to be created when
~/.config does not exist.
2012-06-13 16:37:20 +05:30
Arun Raghavan
b942af65fe core-util: Add a pa_split_in_place() string utility function
For specialised uses of pa_split() such as finding substrings for
comparison, this avoids the need to repeatedly allocate and deallocate
memory.
2012-06-13 16:37:20 +05:30
Arun Raghavan
51c8d5a477 role-cork: Fix a minor leak 2012-06-13 16:37:20 +05:30
Tanu Kaskinen
9b4332eca4 native: Don't save device, volume or mute of new streams.
Specifying the volume when creating a new stream is not an
equivalent act as setting the volume with a volume control
application. When creating a new stream, stream-restore
shouldn't save the volume, but when changing the volume,
then saving it is ok. For example, when I say
"paplay --volume=10000 somefile.wav", I mean that I want the
new stream to have volume 10000. I don't mean that also
future paplay invocations (without the --volume option)
should have that same volume.

This patch effectively reverts
546bcf3f2f.
2012-06-11 12:32:44 +03:00
Arti Trivedi Bora
8fb63dd6e4 daemon: use pa_streq instead of strcmp 2012-06-09 16:23:18 +03:00
Arti Trivedi Bora
41ee562140 tests: use pa_streq instead of strcmp 2012-06-09 16:22:39 +03:00
Arti Trivedi Bora
96a52257a9 pulsecore: Use pa_streq instead of strcmp. 2012-06-09 16:22:13 +03:00
Arti Trivedi Bora
e5954aca8e modules: Use pa_streq instead of strcmp. 2012-06-09 16:21:41 +03:00
Tanu Kaskinen
e0c16af551 device-port: Remove an out-of-date comment. 2012-06-08 19:00:14 +03:00
poljar
e7b077681b bluetooth: Add ports to the bluetooth sink/source
The bluetooth device should have ports so we can attach a latency to
the ports.

Every profile (a2dp, hsp...) has his own set of ports depending on the
number of sinks and sources it provides.
2012-06-08 16:30:01 +03:00
Tanu Kaskinen
de95e1c0c8 device-port: Create the profiles hashmap at initialization.
I doesn't make sense to require all callers of
pa_device_port_new() to create the hashmap themselves. There
are and there will be no cases where a port without any
profiles would be desired.
2012-06-08 16:28:22 +03:00
Deng Zhengrong
866b2c9a57 x11: fix the wrong parameter sequence in pax11publish 2012-06-08 16:44:22 +05:30
poljar
23432d39ee pacmd: Add unloading modules by name.
pacmd should allow unloading modules by name.
The command_unload() function was expanded to handle names while
unloading modules.

If there are multiple modules with the same name all
of them will be unloaded.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=48289
2012-06-04 19:02:53 +03:00
poljar
48f4c8ab8f pactl: Add unloading modules by name.
pactl should allow unloading modules by name.

If there are multiple modules with the same name all
of them will be unloaded.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=48289
2012-06-04 18:31:42 +03:00
Eero Nurkkala
fdfea553fd 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-05-31 14:25:27 +02:00
Eero Nurkkala
79c0d52a39 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-05-31 14:25:23 +02:00
Harsh Prateek Bora
13c7a55599 pulsecore: Use PA_IDXSET_FOREACH wherever applicable.
Signed-off-by: Harsh Prateek Bora <harsh.bora@linaro.org>
2012-05-31 14:12:36 +02:00
Harsh Prateek Bora
f38c1e9bf9 modules: Use PA_IDXSET_FOREACH wherever applicable.
Signed-off-by: Harsh Prateek Bora <harsh.bora@linaro.org>
2012-05-31 14:12:33 +02:00
Jarkko Suontausta
0236977408 bluetooth: Release transport when the pa_rtpoll_run loop finishes.
Based on a patch by Marko Ollonen.
2012-05-29 09:24:27 +05:30
Marc-Antoine Perennou
54718450df 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-05-29 09:17:18 +05:30
Peter Meerwald
77e73be925 pipe: check return value of mkfifo() 2012-05-29 09:03:15 +05:30
Peter Meerwald
c87fd823ea pipe: whitespace and log output cleanup 2012-05-29 09:03:11 +05:30
Deng Zhengrong
9be176f403 daemon: use pa_streq instead of plain strcmp
Just noticed that in daemon-conf.c, it uses plain strcmp(),
while in PulseAudio, it should be better to use pa_streq().
2012-05-29 08:47:40 +05:30
Deng Zhengrong
9d40957c79 cli: Add set-log-target command for pacmd 2012-05-29 08:35:58 +05:30
David Henningsson
1ba655560d 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-05-25 10:50:37 +02:00
poljar
4c65e58325 native: Use foreach to iterate trough modules.
The PA_IDXSET_FOREACH is easier to read than the standard for loop.
Also pa_streq() should be used for checking string equality.
2012-05-23 06:34:25 +03:00
Frédéric Danis
21b1d92b79 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-05-16 06:26:00 +03:00
Lennart Poettering
1a6c9dc0a4 gnome: start PA early in the gnome session 2012-05-16 01:06:17 +02:00
Lennart Poettering
87ae830705 auth: move cookie file to ~/.config/pulse/cookie
In order to follow XDG basedir, read the cookie file from
~/.config/pulse/cookie if possible, but fall back to the old file.
if it doesn't exist.
2012-05-15 23:59:33 +02:00
Lennart Poettering
9ab510a692 core-util: when searching for configuration files, honour XDG basedir spec 2012-05-15 23:25:00 +02:00
Lennart Poettering
4bc865ad6e man: update man pages to only refer to the new place for the configuration files 2012-05-15 23:24:28 +02:00
Lennart Poettering
4c195bcc9d core-util: move configuration home directory from ~/,pulse to ~/.config/pulse to follow XDG basedir spec
If ~/.pulse/ already exists we stick to it in order not to lose
configuration and so that pulse configuration may still be shared across
the network with different PA versions.
2012-05-15 23:13:28 +02:00
Lennart Poettering
7fad67c461 util: hook up pa_get_runtime_dir() with XDG_RUNTIME_DIR 2012-05-15 19:06:53 +02:00
Lennart Poettering
3e9cd3cfcf context: get rid of really old runtime dir logic, i.e. break compat with >4y-old PA 2012-05-15 16:24:22 +02:00
Lennart Poettering
c50cffc016 rtkit: update drop-in files 2012-05-15 16:08:40 +02:00