Commit graph

6450 commits

Author SHA1 Message Date
poljar (Damir Jelic)
529a5949fb introspect: Add functions to handle the latency offset.
This includes updating the native protocol and the client API.
A new command was added to allow setting the latency offset.

Also the card list command now shows the latency offset if there
are ports available.

Update protocol to 27.
2012-06-30 14:41:08 +03:00
Paul Menzel
86996b4cc8 Fix spelling of separated: s, sepera, separa, g
The used command for fixing the script is the following.

    $ git grep sepera | cut --delimiter=: --fields=1 | xargs sed -i s,sepera,separa,g

This patch is motivated by a patch in Debian from Martin-Éric Racine [1].

[1] http://anonscm.debian.org/gitweb/?p=pkg-pulseaudio/pulseaudio.git;a=commitdiff;h=70e7261a615141908c0cf366fd49e0fc0f550fbf
2012-06-30 13:53:58 +03:00
poljar (Damir Jelić)
51e9104e36 device-port: Send a subscription event when the offset changes.
When the offset changes a subscription event should be sent to the
relevant card.
2012-06-30 13:49:29 +03:00
poljar (Damir Jelić)
e9fd829877 conf-parser: Initialize the state to zero immediately.
Set the state variable immediately to zero so if we fail to open the
configuration file we don't check an uninitialized pointer and free an
nonexistent proplist.
2012-06-30 10:53:15 +03:00
Tanu Kaskinen
8239fca09f Assume that the ports hashmap of cards is always non-NULL.
The hashmap is created in pa_card_new_data_init().
2012-06-29 14:47:35 +03:00
Tanu Kaskinen
d184b54d7c Assume that the profiles hashmap of ports is always non-NULL.
It's a valid assumption nowadays, because the hashmap is
created in pa_device_port_new().
2012-06-29 14:24:43 +03:00
Tanu Kaskinen
12af302ac7 card: Ensure that there's always at least one profile.
In practice there is always at least one profile, and I
don't think there will ever be cards without profiles.
Therefore, I added assertions to pa_card_new() stating that
the card new data must always contain at least one profile.
Now a lot of code can be simplified, because it's guaranteed
that the profiles hashmap and the active_profile field are
always non-NULL.
2012-06-29 14:24:43 +03:00
Tanu Kaskinen
1a6da64b16 sink, source: Always create a hashmap for ports.
Having the hashmap sometimes NULL requires a lot of checking
here and there, so ensuring that the hashmap is always
non-NULL simplifies the code.
2012-06-29 14:24:43 +03:00
Tanu Kaskinen
21c6c70438 card: Don't crash if someone gives NULL name to pa_card_set_profile().
In my opinion, pa_card_set_profile() should assert that name
is not NULL, and it would be the job of the client interface
to filter out NULLs from the client input, but this is done
this way also when setting sink and source ports, so for
consistency I'll do this this way for now.
2012-06-29 14:24:43 +03:00
Tanu Kaskinen
5f62cf8f40 pactl: Print card port properties with the "list" command. 2012-06-29 13:24:52 +03:00
Tanu Kaskinen
ed1085f82b native: Send the actual port proplists with card info. 2012-06-29 13:24:52 +03:00
Tanu Kaskinen
88052dbdb9 alsa-mixer: Add support for defining port property lists in the path configuration files. 2012-06-29 13:24:52 +03:00
Tanu Kaskinen
d3bced8bee conf-parser: Add support for parsing property lists. 2012-06-29 13:23:07 +03:00
Tanu Kaskinen
7449f6d9e5 conf-parser: Pass parser state in a struct also for parse callbacks.
As suggested by Maarten Bosmans:
http://article.gmane.org/gmane.comp.audio.pulseaudio.general/12079
2012-06-29 13:23:07 +03:00
Tanu Kaskinen
9a1647500c conf-parser: Pass parser state in a struct instead of function parameters.
I don't like long function parameter lists, and I plan to
add some more state data to the parser which would make the
parameter lists even longer without this refactoring.
2012-06-29 13:20:05 +03:00
Tanu Kaskinen
1edb4a470b tagstruct: Allow NULL proplist with pa_tagstruct_get_proplist().
module-tunnel doesn't care about the proplist contents, so
pa_tagstruct_get_proplist() is only used for removing the
data from the tagstruct buffer. In that case it's more
convenient to just pass NULL as the proplist argument.
2012-06-29 13:02:39 +03:00
Tanu Kaskinen
e17f18d89a proplist: Change proplist_name_valid() to be public function pa_proplist_key_valid().
I want to check the validity in pa_tagstruct_get_proplist(),
and I think also client applications might have use for this
function.
2012-06-29 12:58:44 +03:00
Tanu Kaskinen
9b3d5acbbc pulse: Use more intuitive indexing with port infos in introspect.c. 2012-06-29 12:45:52 +03:00
Tanu Kaskinen
7a0251eab2 Fix a copy-paste error in PROTOCOL. 2012-06-29 12:43:48 +03:00
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