Commit graph

6481 commits

Author SHA1 Message Date
David Henningsson
2577cc81b3 alsa-mixer: Show HDMI ports for older Nvidia cards
Some older cards do not have jack detection. This patch makes the
port still show up.
An implementation detail: the "required = ignore" line has in itself
no effect, but we have to write *something* there, or else the entire
jack detection section will be ignored by the parser.

BugLink: https://bugs.launchpad.net/bugs/961286
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-26 10:31:47 +02:00
Tanu Kaskinen
e9d82afdea dbus: Check method call signatures.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=45815
2012-03-25 08:40:56 +03:00
Deng Zhenrong
737a6180d4 fix compilation warning via PRI prefix
modules/alsa/alsa-mixer.c:3110:21:
    warning: format '%lx' expects argument of type 'long unsigned int', but argument 7 has type 'pa_channel_position_mask_t' [-Wformat]
modules/alsa/alsa-mixer.c:3110:21:
    warning: format '%lx' expects argument of type 'long unsigned int', but argument 8 has type 'pa_channel_position_mask_t' [-Wformat]

pa_channel_position_mask_t is type defined to uint64_t, and to display
uint64_t, it's better to use PRIx64 primitives.

Signed-off-by: Deng Zhenrong <dzrongg@gmail.com>
2012-03-23 10:37:23 +01:00
Tanu Kaskinen
4502d7cb28 bluetooth: Remove unused variable. 2012-03-22 19:39:46 +02:00
David Henningsson
208a49a483 build-sys: padsp target should not be phony
Prevent rebuilding padsp when it's not needed.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-21 12:30:45 +01:00
David Henningsson
70eb40705d pactl: show availability information for "list cards"
Now that the client API exposes availability information for ports
on cards, we can make output consistent with "list sinks" and
"list sources".

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-21 12:17:47 +01:00
David Henningsson
1f97db720b module-switch-on-port-available: Do not switch profile if current port is available
For switching profiles, we are a little more cautious, only switch
from an unavailable port to an available one. Profile switching is
mainly used for HDMI/DisplayPort, and this is to avoid switching from
analog to HDMI/DP when it becomes available.

See http://lists.freedesktop.org/archives/pulseaudio-discuss/2012-March/012991.html
and replies for more information.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-21 10:35:09 +01:00
David Henningsson
00c3a4958e module-loopback: Never call adjust_rates after teardown
Calling adjust_rates after teardown results in segfault, and
judging from the Ubuntu bug report, this can happen.
Actively prevent this by destroying the time event, and by
setting adjust_time to 0, we also prevent this routine being
called on max request update.

BugLink: https://bugs.launchpad.net/bugs/946400
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-20 11:44:15 +01:00
Arun Raghavan
13d388b4ce protocol-native: Remove redundant asserts
As David points out, the previous commit made a couple of asserts
redundant (the XOR covers all cases that were previous tested for).
Remove these redundant commits now.
2012-03-19 14:29:59 +05:30
Arun Raghavan
fd637e8765 protocol-native: Reinstate assert that was incorrectly removed
Commit 54cddc6ddf removed an assert that
looked redundant but was not. This commit reinstates it in a slightly
modified form. It is not stated as (a ^ b) instead of (!a || !b) in
order to make the condition more obvious.
2012-03-19 14:16:04 +05:30
David Henningsson
54cddc6ddf protocol-native: Protect against clients trying to set a NULL port
For some reason, a badly behaving client was trying to set a NULL
port, which caused PulseAudio to crash. Add safeguards on two levels
just to be protected. (Also remove a redundant check.)

BugLink: https://bugs.launchpad.net/bugs/951273
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-19 09:01:29 +01:00
Lennart Poettering
860d1cf3a7 systemd: complement module-console-kit with module-systemd-login
ConsoleKit has been deprecated and replaced by systemd's logind daemon,
hence provide the same functionality of module-console-kit in
module-systemd-login. This also makes sure that the CK module becomes a
NOP if the system is booted with systemd, resp. that the systemd module
becomes a NOP if the system is booted without systemd, thus being nice
to OSes such as Debian which want to support multiple init systems.
2012-03-17 01:52:41 +01:00
Arun Raghavan
e83ebabc68 build-sys: Bump soname 2012-03-15 18:16:49 +05:30
Piotr Drąg
d492032feb i18n: Update Polish translation 2012-03-14 00:11:45 +00:00
Yuri Chornoivan
bf20fc26a1 Update Ukrainian translation. 2012-03-14 00:03:54 +00:00
David Henningsson
961a83a3fa daemon: Initialize dbus to use thread-safe mode by default
In most cases, we use dbus from more than one thread, as we
e.g. enable real-time scheduling from the ALSA threads.
Therefore set dbus to thread-safe mode by default, as recommended
in https://bugs.freedesktop.org/show_bug.cgi?id=47060#c5

This fixes a bug where PulseAudio could crash in two parallel
calls to pa_make_realtime.

BugLink: https://bugs.launchpad.net/bugs/937933
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-13 16:16:32 +02:00
David Henningsson
fa80315b2c alsa-mixer: Don't remove paths if jacks state.(un)plugged differ
If the jack state differs, they are not the same path, so don't
remove them.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-12 10:49:50 +00:00
Tanu Kaskinen
bbc600aae9 Revert "build-sys: Remove the public API stuff from libpulsecommon."
This reverts commit 24ff719675.

If these files aren't compiled in both libpulse and
libpulsecommon, some things will try use non-public
functions from libpulse. Therefore those internal functions
have to be included directly in libpulsecommon.

This problem appears to be only visible with --as-needed,
which is why the problem wasn't noticed immediately. The
problem has existed also earlier, and it was fixed by
Maarten Bosmans in commit 2de2c735. The commit that is
now reverted basically reverted Maarten's commit (I didn't
know that when I wrote the bad patch).
2012-03-12 09:05:52 +02:00
Giorgos Boutsioukis
50a7bf1175 xen: Add Xen paravirtualized sink support.
A part of Xen's paravirtualized audio driver has been developed as a
pulseaudio module. This module acts as a tunnel over Xen's shared memory
mechanism and allows a domU guest to send audio data to a dom0 backend.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=43503
2012-03-11 21:15:14 +00:00
David Henningsson
e02cb7fb2e alsa-mixer: Make speaker get available=no when headphones are plugged in
While developing the new UI we had to ask ourselves the question of whether
"speakers" should be considered available when headphones are plugged in.
In most cases, they are not available and therefore we should list them
as such.

OTOH, we don't want unplugging the headphones to be considered an act of
wanting to use the speakers (the user might prefer HDMI), and there might
be line-outs that keeps the speakers from unmuting anyway. So, at this point,
I think the most reasonable would be to make the speakers have
PA_PORT_AVAILABLE_NO when headphones are plugged in and
PA_PORT_AVAILABLE_UNKNOWN when they are not. But we might want to revisit
this decision once we have the priority lists up and running.

The same reasoning applies for "Internal Mic", which should become unavailable
when any other mic is plugged in.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-11 12:23:46 +05:30
David Henningsson
793f46320e introspect: Expose port info per card to clients
For volume control UIs to be able to show ports in inactive profiles,
expose all ports together with the card info. This includes updating
the protocol and the client API to show the connection between ports
and for which profiles the ports are relevant.

Update protocol to 26.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-11 12:23:46 +05:30
David Henningsson
752ae7285e conf: Load switch-on-port-available module by default
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-11 12:23:46 +05:30
David Henningsson
d1ce4c0aea Add a new module switch-on-port-available that acts on port changes
This module tries to switch to a port when availability changes to
"YES", and tries to switch away when availability changes to "NO".

Once there is a priority list infrastructure in place and ready,
this functionality might be redundant, but this will do as an
interim solution.
2012-03-11 12:23:46 +05:30
David Henningsson
56018683b1 alsa: Add port information to HDMI profiles
For Nvidia and Intel, support probing of up to four HDMI devices.
Also add port information to all HDMI profiles.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-11 12:23:46 +05:30
David Henningsson
dedf1340c6 alsa: Jack detection kcontrol implementation
Support the new jack detection interface implemented in Linux 3.3
(and Ubuntu's 3.2 kernel).

Jacks are probed and detected using the snd_hctl_* commands, which
means we need to listen to them using fdlists. As this detection
needs to be active even if there is currently no sink for the jack,
so this polling is done on the card level.

Also add configuration support in paths, like this:
[Jack Headphone]
required-any = any

...where 'Jack Headphone' should match 'Headphone Jack' as given by
ALSA (as seen in e g 'amixer controls').
"Required", "required-any" and "required-absent" is supported. Using
required-any, one can have several ports even though there is no
other indication in the mixer that this path exists.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-11 12:23:46 +05:30
Tanu Kaskinen
74e01ad616 i18n: Fix POTFILES. 2012-03-10 12:54:29 +02:00
Tanu Kaskinen
24ff719675 build-sys: Remove the public API stuff from libpulsecommon.
That stuff is already in libpulse, so those files got
compiled twice.
2012-03-09 09:20:47 +02:00
Tanu Kaskinen
d6755696b4 proplist: Match pa_proplist_copy argument name between header and implementation. 2012-03-09 09:20:47 +02:00
Tanu Kaskinen
6f9e651e4e proplist: Constify the pa_proplist_copy and _update input pointers. 2012-03-09 09:09:59 +02:00
Niels Ole Salscheider
6a9caff9dd Add module-virtual-surround-sink.
It provides a virtual surround sound effect.

v2: Normalize hrir to avoid clipping, some cleanups
v3: use fabs, not abs
v4: implement changes proposed by Tanu Kaskinen
v5: likewise
v6: use channel map from hrir file
v7: remove hrir_ss and hrir_map form userdata
v8: update naming of sink
2012-03-09 07:20:13 +02:00
Tanu Kaskinen
25c73a00c4 flist: Make name non-const to avoid casting with pa_xfree(). 2012-03-07 09:39:18 +02:00
David Henningsson
641103314a flist: Avoid the ABA problem
Our flist implementation suffers from the ABA problem
(see http://en.wikipedia.org/wiki/ABA_problem), causing PulseAudio
to crash very rarely, usually inside memblock operations.
By turning stored pointers into stored table indices, we have some
extra bits that we can use to store tag bits, which is a known
workaround for the ABA problem.

Buglink: https://bugs.launchpad.net/bugs/924416
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-07 09:34:56 +02:00
Tanu Kaskinen
66f04c3bdc dbus: Use correct free function. 2012-03-06 08:41:10 +02:00
Arun Raghavan
a0706e7c84 format: Allow format->sample spec conversion for compressed formats
This allows clients to get a "fake" sample space for compressed formats
that we can support. This should make size/time conversion for things
like calculating buffer attributes simpler.
2012-03-05 20:30:33 +05:30
Arun Raghavan
8baf8e90c2 format: Add API to query a property's type
Since a given property can be single-valued, an array or (in the case of
ints) a range, clients need an API to figure out what type of value a
property holds. This adds such an API. The actual property type
enumeration is kept in the PA_PROP_* namespace and not the
PA_FORMAT_INFO* namespace so that it can later be reused for properties
generically if required.
2012-03-05 20:00:31 +05:30
Arun Raghavan
8f850403c0 format: Trivial reorganisation
Moves all the property setters together
2012-03-05 20:00:31 +05:30
Arun Raghavan
d9cdaffefe format: Update map-file
Adding property getters manually for now.
2012-03-05 20:00:31 +05:30
Arun Raghavan
59af940dd5 format: Add more property getters
This adds integer range/array and string array property getters to the
pa_format_info API. Corresponding tests added as well to ensure the code
is valgrind-clean.

The corresponding functions are added to map-file manually for now.
2012-03-05 20:00:31 +05:30
Arun Raghavan
c60f698f1e format: Expose pa_format_info<->pa_sample_spec conversion functions
These utility functions could be handy to clients.
pa_format_info_to_sample_spec_fake() isn't made public, but the return
value is changed to keep in sync with pa_format_info_to_sample_spec().
2012-03-05 20:00:31 +05:30
Arun Raghavan
63429b67c7 format: Don't assert on errors in getters
This makes handling errors in getter functions more graceful, rather
than triggering warnings/asserts. Better to be less trigger-happy about
these things since this is now public-facing API.
2012-03-05 20:00:31 +05:30
Arun Raghavan
6f20d39a1c format: Export pa_format_info int and string property getters
We currently only have setters and clients need to be able to query
these values as well. The return types for these functions needed to be
changed to int since this is public API now.
2012-03-05 20:00:31 +05:30
Colin Guthrie
3927b4b607 bluetooth: Run update-sbc
This is primarily for the bluez commit 03bb9d3 by Siamashka Siamashka
which fixes a compilation error with gcc 4.7
2012-02-24 21:22:41 +00:00
Alexander E. Patrakov
0b421f0d93 alsa: add DTS profile
Hi. Could you please apply the attached trivial patch so that I could drop
the corresponding instructions from dcaenc's README file in the future? It
adds a profile for on-the-fly DTS encoding, similar to the existing AC3
profile.

--
Alexander E. Patrakov
>From 22310a1c28385acc7ce883e020b9eb2e5b0813b7 Mon Sep 17 00:00:00 2001
From: "Alexander E. Patrakov" <patrakov@gmail.com>
Date: Sun, 12 Feb 2012 17:19:48 +0600
Subject: [PATCH] alsa: add DTS profile

This requires dcaenc from http://aepatrakov.narod.ru/dcaenc/
2012-02-21 08:52:13 +05:30
Luiz Augusto von Dentz
014511310a bluetooth: Fix calling many times Audio.GetProperties for the same device
Audio.GetProperties is been called for as many times as there are UUIDs
instead of just once when the UUIDs are discovered.
2012-02-21 08:36:21 +05:30
Arun Raghavan
d9cd26f676 build: Fix out-of-tree build
Previous commits broke the out-of-tree build on padsp.
2012-02-20 19:23:47 +05:30
Sjoerd Simons
5710d6deeb .gitignore: Add padsp to gitignore 2012-02-20 14:39:52 +05:30
Sjoerd Simons
9087f1f6ac build: Force order of library installation
libtools causing relinking on installation, to make this succeed
libpulsecommon needs to be installed before the other libraries and the
padsp libraries needs to be installed afterwards.

Unfortunately autotools doesn't consider dependencies when running the
install target, thus we have to enforce the ordering ourselves
2012-02-20 14:39:52 +05:30
Michael Biebl
a96390d865 padsp: Move the padsp helper lib into a private library
libpulsedsp is only used as a LD_PRELOAD library
for the padsp wrapper. So no need to have it in
a public library
2012-02-20 14:39:52 +05:30
Michael Biebl
cea6e16516 build: Move libpulsecommon into $pkglib
libpulsecommon is a private library only for use within pulseaudio, so
lets move it into a private directory

[ed: from discussion on IRC, while it looks redundant to have modules in
lib/pulse-$VER and private libraries in $pkglibdir, this is actually
desirable. For example, a multi-architecture libpulse would have a
$pkgdir per architecture (/usr/lib/<arch>/pulseaudio) whereas you'd
still want the server-specific modules in /usr/lib/pulse...) -- Arun]
2012-02-20 14:37:33 +05:30
David Henningsson
811235d14c tunnel: fixup create_record_stream
The tunnel source has been broken since protocol v22 (PA 1.0),
and connecting fails with a protocol error. Fix.

BugLink: https://bugs.launchpad.net/bugs/923661
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-02-20 14:29:15 +05:30