Commit graph

6623 commits

Author SHA1 Message Date
Sjors Gielen
d3cd82d411 osx: Add a single "On" profile to coreaudio devices. Fixes crash on OS X.
Since commit 12af302a last month, cards always have at least one
profile, so there is also always an active_profile (this makes the code
more simple). However, module-coreaudio-device did not create a profile
yet, causing a crash of PulseAudio when used on OS X. This patch fixes
this crash, by adding a single "On" profile. I've also added a TODO for
adding an "Off" profile which removes all sinks and sources -- I can
work on resolving this TODO later on.
2012-07-09 10:29:04 +03:00
Jarkko Nikula
079569753e alsa: Merge pa_alsa_setting_select with pa_alsa_path_select
As these functions are called together and are related, we might merge
them and call setting_select from pa_alsa_path_select by passing
optional pa_alsa_setting argument.

Make also the setting_select static as it is not called outside of
alsa-mixer.c after this change.

[Additional note from Tanu Kaskinen: this change improves the
mute-during-activation feature, because now the mixer changes related
to selecting the setting happen while the hw is muted.]
2012-07-06 20:38:10 +03:00
Jarkko Nikula
fbb13a0dc6 alsa: move pa_alsa_setting_select close to pa_alsa_path_select
Move pa_alsa_setting_select call just after the pa_alsa_path_select in
[sink | source]_set_port_cb functions as there is no dependency to volume
calculations that are done between these two calls. Idea here is to make
possible to merge these two functions since they are called together from
other places too.
2012-07-06 20:38:10 +03:00
Tanu Kaskinen
8417cac4f6 alsa-mixer: Implement a new path option: "mute-during-activation". 2012-07-06 20:38:03 +03:00
Peter Meerwald
ea064162a5 memblock: Fix typos. 2012-07-06 17:08:37 +03:00
Tanu Kaskinen
cec6b153b7 card-restore: Handle reading NULL profile name from the database.
It's assumed in a couple of places that entry_read()
initializes entry->profile to a non-NULL string. This patch
makes those assumptions hold.

Tested-by: Mikel Astiz <mikel.astiz.oss@gmail.com>
2012-07-06 12:47:48 +03:00
poljar (Damir Jelić)
758e5bc28e card-restore: Add the ability to save and restore the latency offset.
module-card-restore now saves the latency offsets.

This change includes a entry version bump.

The entry now consists of a port count and a port name and offset for
every port that belongs to the relevant card.
2012-07-05 11:12:01 +03:00
Frédéric Dalleau
f6d5476e7a bluetooth: module-bluetooth-policy initial commit
This is a basic module for enabling loopback as soon as a new bluetooth A2DP
source is created. The module is given a source and a media role using command
line. This allows module-intended-roles or module-device-manager to choose a
target sink for the stream.
2012-07-04 19:25:29 +03:00
Frédéric Dalleau
c6d8d1d7c1 loopback: Enable routing on loopback streams
At module-loopback load, if no sink is given, the default sink is used. If the
stream has a media.role property, the property cannot be used because a the
source or sink is forced to default. Both module-intended-roles and
module-device-manager are affected. The same apply to sources.

With this patch, if sink or source is missing, routing modules can be used.
2012-07-04 14:54:57 +03:00
Arun Raghavan
750a5c187a role-cork: Fix another minor leak
Credit to David for finding this one.
2012-07-03 18:16:38 +05:30
Arun Raghavan
ded196f93a Revert "Revert "role-cork: Fix a minor leak""
This reverts commit a2c4bf22e0.

As Tanu points out, I'm stupid. The pa_xstrdup(n) was unnecessary
because pa_split() allocates a new string for us.
2012-07-03 18:15:54 +05:30
Arun Raghavan
b7f7eb5657 role-cork: Fix incorrect check at deinitialisation time 2012-07-03 18:02:29 +05:30
Arun Raghavan
a2c4bf22e0 Revert "role-cork: Fix a minor leak"
This reverts commit 51c8d5a477.

As David points out, this was incorrect.
2012-07-03 18:00:36 +05:30
David Henningsson
47b31ce6ad alsa-mixer: Add "Front Headphone Jack" (fixup)
I forgot half of the front headphone patch, i e, to hide the
speaker output when the front headphone is connected. Thanks to
Shih-Yuan Lee for noticing.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-07-03 10:31:30 +02:00
Arun Raghavan
1ff604c298 core-util: Fix permissions handling while creating directories
This makes updating of permissions on existing directories optional with
pa_make_secure_dir() and pa_make_secure_parent_dir(). This makes sure
that the recursive directory creation doesn't end up modifying existing
directories, and also fixes a problem where creating an auth cookie
(specifically ~/.esd_auth) would end up modifying permissions on ~.
Thanks to Frédéric Danis for reporting this.
2012-07-03 08:49:26 +05:30
Deng Zhengrong
508ca489d2 add a new log target that enables to create new log file if it exists 2012-07-02 16:35:19 +02:00
David Henningsson
270b1a7d74 alsa-mixer: Document "state.plugged" and "state.unplugged"
Put explanation of state.plugged and state.unplugged in
analog-output.conf.common.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-07-02 12:22:49 +02:00
David Henningsson
12a53524b3 alsa-mixer: Add "Front Headphone" jack
Many desktops have headphone on the front and line outs on the back.
Sometimes this means that the headphone is labelled "Front Headphone Jack",
but the volume controls are only "Headphone Playback Volume", i e,
without the "Front" prefix.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-07-02 12:22:48 +02:00
David Henningsson
004934ecaf alsa-mixer: Always turn "Inverted Internal Mic" off
Some devices have inverted right channel, so when you add left and right,
the result is silence, or very faint sound. In recent kernels (3.5,
perhaps also 3.4) these are starting to be marked with a special
"Inverted Internal Mic" capture switch.

While we might want to add some reverse summing mechanism in the
future, for now, we just turn the thing off to avoid the problem of
recording silence.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-07-02 12:21:16 +02:00
David Henningsson
0621b1f99c alsa-mixer: Add Phantom Jack support
For kernel 3.6, "phantom jack" kctls have been added. They serve as
a marker that a particular port exist. They were made so we can detect
that there actually are speakers and internal mic on a laptop, even if
there are no other indications (volume controls etc).

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-07-02 12:21:16 +02:00
David Henningsson
16e4ef5df2 alsa-mixer: Add special profiles for some laptops missing speaker and/or internal mic
Several laptops have speaker ports, and/or internal mic ports, but we have
no way of detecting that. So we make the port(s) always show up for these
devices.

BugLink: https://bugs.launchpad.net/bugs/946232
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-07-02 12:21:16 +02:00
poljar (Damir Jelić)
5a57686e3e man: Add latency offset documentation to the cli syntax.
The new latency offset command is now documented in the
pulse-cli-syntax man page.
2012-06-30 15:04:43 +03:00
poljar (Damir Jelic)
dcf92db0c3 pactl: Add set-latency-offset command.
This introduces a new command to allow setting the latency offset.

Also the card list command now shows the latency offset on the ports.
2012-06-30 14:42:43 +03:00
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