Commit graph

6481 commits

Author SHA1 Message Date
Peter Meerwald
b3d210eb83 build: Fix static linking
fixes bug #52038:

gcc -static  x.c `PKG_CONFIG_PATH=/usr/local/lib/pkgconfig pkg-config --static
--libs libpulse-simple`

/usr/bin/ld: error: cannot find -lpulsecommon-2.98
pulse/simple.c:373: error: undefined reference to 'pa_log_level_meta'
pulse/simple.c:374: error: undefined reference to 'pa_log_level_meta'

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2012-07-17 11:05:34 +05:30
Frédéric Dalleau
ccf909ebf0 pacmd: Display inputs and outputs PASSTHROUGH flag 2012-07-17 11:03:54 +05:30
Arun Raghavan
5c12ce5985 alsa: Add separate sinks/sources for UCM modifiers if needed
Modifiers may have their own PlaybackPCM/CapturePCM and for these, we
create separate sinks/sources. These are marked with the
device.intended_roles property to let role-based routing take care if
streams are tagged appropriately.
2012-07-16 19:41:45 +05:30
Arun Raghavan
a08c85d299 alsa: Add a proplist to mappings
The proplist isn't used by the conventional alsa-mixer code path, but
can be used by UCM to transfer properties from UCM data to the
sinks/sources corresponding to a mapping. These properties could be used
later in policy, etc.

The specific use for which I'm writing this now is for UCM modifiers
that have their own PlaybackPCM/CapturePCM field. These will be
translated to a separate sink/source corresponding to the modifier by
adding an additional mapping per sink/source. These mappings' proplist
will be populated with the name of the modifier and corresponding
"device.intended_role" property. The latter will be used in the usual
routing-by-role way, and the former will be used during sink/source
activation and deactivation to know what UCM modifier is to be enabled
or disabled.
2012-07-16 18:51:51 +05:30
Arun Raghavan
89024f6f12 alsa: Allow channel count probe on open by mapping
This allows opening a PCM given a mapping to work even if we don't have
a channel count for the device up-front.
2012-07-16 17:08:28 +05:30
Feng Wei
dae4b83dd0 alsa: Add UCM jack detection
Jack in UCM is decided by UCM device name, although in fact
not all UCM devices have "jacks". Because port is also mapped
to UCM device, we can always find target port when some jack
event happens.

Signed-off-by: Feng Wei <wei.feng@freescale.com>
2012-07-16 17:08:28 +05:30
Feng Wei
c19d108219 alsa: Integrate UCM basic functions
UCM basic functions will provide another way to handle the alsa mixer
and controls. That means alsa card module will make use of alsa ucm
configurations provided by various audio systems instead of mixer and
paths configurations provided by PA. PA profiles come from UCM verb, PA
sinks/sources and ports come from UCM devices.

In case the proper UCM configurations are found, ucm branches are
activated, or we will still fall through to the original way.

Signed-off-by: Feng Wei <wei.feng@freescale.com>
2012-07-16 17:08:28 +05:30
David Henningsson
7369a53ab5 alsa-mixer: Add "Headphone Mic" support for 3-pin ASUS netbooks
Some ASUS netbooks, such as the 1015 CX, have only one 3.5 mm jack,
but it can be used either as a headphone or as a mic (but not both
simultaneously).

This patch adds support for the "Headphone Mic" path that is used
on these devices, so that we can use the jack as an external mic, and
doing so without muting the speaker.

BugLink: https://bugs.launchpad.net/bugs/1018262
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-07-13 11:29:48 +02:00
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