Tanu Kaskinen [Mon, 6 Aug 2012 12:07:57 +0000 (15:07 +0300)]
build-sys: Link utf8-test to libpulsecommon.
Fixes this:
/usr/bin/ld: utf8_test-utf8-test.o: undefined reference to symbol 'pa_log_set_level'
/usr/bin/ld: note: 'pa_log_set_level' is defined in DSO /home/takaskin/dev/pulseaudio/src/.libs/libpulsecommon-2.98.so so try adding it to the linker command line
/home/takaskin/dev/pulseaudio/src/.libs/libpulsecommon-2.98.so: could not read symbols: Invalid operation
Mikel Astiz [Thu, 26 Jul 2012 10:36:33 +0000 (12:36 +0200)]
bluetooth: Remove minor unnecessary check
The return value of dbus_message_iter_next() doesn't need to be checked
since the while condition will be false anyway (arg type will be
DBUS_TYPE_INVALID).
Mikel Astiz [Thu, 26 Jul 2012 10:36:32 +0000 (12:36 +0200)]
bluetooth: Replace deprecated ListDevices()
The method ListDevices() in org.bluez.Adapter was deprecated in BlueZ
4.61, and is going to be removed in future releases. Instead, a property
was introduced for this purpose in BlueZ 4.7.
Mikel Astiz [Thu, 26 Jul 2012 10:36:31 +0000 (12:36 +0200)]
bluetooth: Replace deprecated ListAdapters()
The method ListAdapters() in org.bluez.Manager was deprecated in BlueZ
4.61, and is going to be removed in future releases. Instead, a property
was introduced for this purpose in BlueZ 4.22.
The module module-bluetooth-device should never be given parameter
'profile' twice, even if both HFGW and A2DP are playing. This patch
proposed to consider HFGW first.
Mikel Astiz [Fri, 6 Jul 2012 09:19:52 +0000 (11:19 +0200)]
bluetooth: Don't use the old socket IPC mechanism with BlueZ
This simplifies the code a lot, in favour of the D-Bus Media interface
in BlueZ. The old socket-based IPC mechanism has been deprecated and is
about to be removed soon.
Without -avoid-version, libtool creates a libwebrtc-util.so.0 and
libwebrtc-util.so.0.0.0 which are not cleaned up by make uninstall,
which in turn causes make distcheck to fail.
alsa: Catch role matched streams to enable/disable modifier
In UCM basic functions, we only assign intended roles from modifier
to sink/source, but we don't have a chance to set the ucm modifiers.
Here we amend the functions so that when roled stream starts or
stops, we have the following results:
1. stream will be routed to sink/source specified in modifier by
module-intended-roles
2. After that, modifier will be enabled or disabled.
3. when multiple streams with matched roles of modifier start, only
the first one will enable the modifier, and when they end, the
last one will disable the modifier.
build: Avoid libstdc++ dep for module-echo-cancel if possible
This moves out the webrtc bits into a small helper library to shield the
rest of module-echo-cancel from being linked with a C++ linker. This is
required because automake will _always_ link module-echo-cancel in C++
mode if any of its deps (even conditional ones) are in C++.
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.
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.
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.
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.
David Henningsson [Thu, 28 Jun 2012 14:03:17 +0000 (16:03 +0200)]
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.
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.
Jarkko Nikula [Thu, 22 Mar 2012 09:29:12 +0000 (11:29 +0200)]
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.]
Jarkko Nikula [Thu, 22 Mar 2012 09:29:11 +0000 (11:29 +0200)]
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.
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.
Frédéric Dalleau [Wed, 20 Jun 2012 15:33:35 +0000 (17:33 +0200)]
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.
David Henningsson [Tue, 3 Jul 2012 08:31:30 +0000 (10:31 +0200)]
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>
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.
David Henningsson [Mon, 2 Jul 2012 10:09:06 +0000 (12:09 +0200)]
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>
David Henningsson [Thu, 28 Jun 2012 13:40:17 +0000 (15:40 +0200)]
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>
David Henningsson [Thu, 28 Jun 2012 13:35:38 +0000 (15:35 +0200)]
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>
David Henningsson [Thu, 3 May 2012 13:39:18 +0000 (15:39 +0200)]
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.
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.
Tanu Kaskinen [Fri, 8 Jun 2012 18:49:10 +0000 (21:49 +0300)]
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.
Tanu Kaskinen [Fri, 8 Jun 2012 16:36:45 +0000 (19:36 +0300)]
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.
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.
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.
Arun Raghavan [Thu, 28 Jun 2012 14:01:37 +0000 (19:31 +0530)]
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.