Commit graph

7122 commits

Author SHA1 Message Date
David Henningsson
ca4942e89c alsa-mixer: Switch to Headphone when Headphone mic jack is plugged in
When a "Headphone Mic" jack becomes available, we do not know if
a headphone or a mic has been plugged in. Therefore, setting both
paths to "unknown" is, in theory, the correct thing to do.
However, in practice, people are more likely to plug in a headphone
rather than a mic. Therefore, allow autoswitch to the headphone port
when the jack is plugged in.

A more advanced implementation would consider what was plugged in last
time depending on what port was selected on the input side at that
time, and set availability accordingly. However, such an implementation
will have to wait (probably at least until we have our fancy routing
system implementation).

Buglink: https://bugs.launchpad.net/bugs/1169143
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-04-24 12:18:23 +02:00
David Henningsson
068a3ec9d4 alsa-mixer: Allow input fallback port for devices with no gain control
I recently came across a device without any ALSA-level mixer controls,
everything was physical knobs on the hardware.

This patch enables that device to get a port too ("Analog Input").

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-04-24 10:59:42 +02:00
David Henningsson
2553757922 alsa: Fix ELD access warning on shutdown
The hdmi_eld_changed callback is called by alsa-lib at shutdown.
In that case, just exit instead of trying to access something with
already closed handles.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-04-24 10:57:47 +02:00
David Henningsson
d389e7d37c default.pa: Load switch-on-port-available before udev-detect
We need to pick the right port as early as possible, before the
first volume is picked up. Hence this module needs to be loaded
before the sound card modules are loaded.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-04-24 07:56:01 +02:00
David Henningsson
fe73f47828 module-switch-on-port-available: Handle hotplugged cards
If a card is hot-plugged (which all cards will be when we load
this module before module-*-detect), make sure we don't start up
a sink with an unavailable port selected.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-04-24 07:32:48 +02:00
David Henningsson
0b83787d4e alsa: Initialize ports before sinks/sources
This way port availability has been filled in when we create the
sink, which will later enable us to pick the right port directly.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-04-24 07:31:29 +02:00
Piotr Drąg
3556c820ee i18n: Update Polish translation 2013-04-23 18:40:09 +03:00
Arun Raghavan
4c23720ef1 pulsecore: Make run-from-build not readlink() on every call
Since this is no longer only defined in debug builds, let's make sure
that there is no impact if this is indavertently called repeatedly at
startup.
2013-04-20 10:12:34 +05:30
Arun Raghavan
3d7bc637c4 daemon: Fix dlsearchpath while running from build tree
It appears that, libltdl will find the .la file in the builddir and
figure out where the real .so is.

This also requires .ifexists to be fixed up to correspondingly search in
<dlsearchpath>/.libs.
2013-04-20 10:04:32 +05:30
Arun Raghavan
4cd7e6df1d rygel: Set DLNA profile on our MediaItems
We know we always serve up LPCM, and exposing this via D-Bus lets Rygel
set the appropriate metadata while presenting the raw (i.e.
non-transcoded) stream to clients.
2013-04-20 09:09:01 +05:30
Peter Meerwald
8946117ebf doc: Explain PULSE_SERVER string in pulseaudio.1
first attempt to document the "server string"
See https://bugs.freedesktop.org/show_bug.cgi?id=62444

quite a bit is missing: [hostname], defaults

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-04-17 08:22:07 +02:00
Peter Meerwald
8ccda50f51 doc: Document PULSE_COOKIE in pulseaudio.1
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-04-17 08:20:02 +02:00
João Paulo Rechi Vita
7a66dcda72 alsa-source: Fix log message
The log message when updating the source sample rate wrongly mentions
"Sink" instead of "Source". This was probably a copy and paste error.
2013-04-17 08:13:06 +02:00
Peter Meerwald
f771bbcfa9 doc: Some more nitpicking in pulse/def.h doxygen documentation
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-04-17 08:12:23 +02:00
Peter Meerwald
2cc23f2c4e doc: Mostly fixing up i.e. versus i.e.\ in doxygen documentation
same for e.g. versus e.g.\ and e.g. versus E.g.

this is ueber-nitpicking: will anybody ever notice?

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-04-17 08:08:42 +02:00
David Henningsson
50cf983194 alsa-mixer: Change profile-sets directory to PA_SRCDIR
A recent patch changed the path files from PA_BUILDDIR to PA_SRCDIR.
Do the same to the profile-set files for consistency (and to fix
out of tree builds).

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-04-16 14:44:05 +02:00
Yuri Chornoivan
168751dc66 Fix various typos in messages and comments 2013-04-16 12:42:50 +02:00
Arun Raghavan
ecd17d870a equalizer: Fix compiler warning due use of 'signal'
Changing uses of the symbol 'signal' as it redefines the signal-handling
libc function of the same name.
2013-04-16 11:38:23 +05:30
Arun Raghavan
1ffbb323c6 build-sys: Bump sonames
libpulse-simple changed this time as well (addition of hole-handling).
2013-04-15 23:33:53 +05:30
Arun Raghavan
11d8da83d4 alsa: Fix mixer path when running from build tree
The mixer paths are not available in ${builddir} - we need to look in
${srcdir}. This should fix running an in-tree build without make install
as well as alsa-mixer-path-test in make distcheck.

Since the most straightforward way to define PA_SRCDIR was in
Makefile.am, I'm moving PA_BUILDDIR there as well for consistency.
2013-04-14 11:27:41 +05:30
Arun Raghavan
ae559c0724 pulsecore: Don't conditionally inline pa_run_from_build_tree()
There's no good reason to assume an in-tree build will be debug-only.
This breaks alsa-mixer-path-test on make distcheck, for example.
2013-04-14 10:50:15 +05:30
David Henningsson
ff96c63a3e alsa-mixer: Add more jack detection for Headset mic path
On some machines which has a headset jack, the headset mic does not have its own
jack detection. Then we can look at the headphone jack to get some indication:
We know that if the headphone is unplugged, so is the headset mic. The opposite
is not guaranteed since the user might have plugged in a headphone, not a headset.

Also, there exist multi-function jacks which support both Headphone, Mic in headphone jack
and Headset Mic. In this case the jack name will be "Headphone Mic", not "Headphone", so
we need to include this name too.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-04-14 10:12:00 +05:30
Tanu Kaskinen
4096989ad6 sink, source: Send notifications when flags change
The hooks aren't currently used, but for example, the D-Bus protocol
could use them if it implemented flag change signals.
2013-04-10 16:30:03 +03:00
Tanu Kaskinen
ed51769a59 sink, source: Really set the fixed latency in set_fixed_latency_within_thread(), always.
The old assumption seemed to be that if a sink or source has the
DYNAMIC_LATENCY flag set, it can never change, so the fixed latency
will always be zero. This assumption doesn't hold with filter sinks
and sources that are moved around.

This fixes a crash with two module-virtual-sink instances on top of
each other, when the bottom one is moved from a sink without dynamic
latency to a sink with dynamic latency. What happened was that first
the bottom virtual sink "updated" (due to this bug nothing was
actually updated) its fixed latency to match the master sink (zero
fixed latency), and then the top virtual sink updated its fixed
latency to match the master sink. The master sink was the bottom
virtual sink, whose fixed latency should have been set to zero, but it
was not, so the pa_sink_set_fixed_latency_within_thread() failed in
the assertion "latency == 0".
2013-04-10 16:30:01 +03:00
Tanu Kaskinen
6745b1f970 sink, source: Propagate flag changes to filters
An example: let's say that there's an alsa sink and two filter sinks
on top of each other:

        alsa-sink <- filter1 <- filter2

With the old code, if filter1 gets moved to another sink, and the
new sink doesn't have the LATENCY and DYNAMIC_LATENCY flags set
(unlike alsa-sink), filter1's flags are updated fine in the moving()
callback, but filter2 is not notified at all about the flag changes.
With this patch, the flag changes are propagated to filter2 too.
2013-04-10 16:29:57 +03:00
Tanu Kaskinen
d646d931dc shm: Don't force the shm files to be read-only
Forcing the shm file to be read-only makes shm_unlink() fail on OS X.
Thanks to Albert Zeyer for reporting the bug and investigating the
root cause.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=62988
2013-04-10 14:31:54 +03:00
David Henningsson
b4342845db pstream: Optimise write of smaller packages
During a stream, most packets sent are either memblocks (with SHM info),
or requests for more data. These are only slightly bigger than the
header.

This patch makes it possible to write these packages in one write
instead of two: a memcpy of just a few bytes is worth saving extra
syscalls for write and poll.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-04-09 14:25:51 +02:00
Tanu Kaskinen
179cacfc66 mix: Mix the right number of streams
Passing channels instead of nstreams to pa_mix_ch2_s16ne() caused that
only the first two streams got mixed.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=63093
2013-04-09 14:56:18 +03:00
Albert Zeyer
473b31f9de semaphore-osx: posix implementation based on named semaphores
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=63014
2013-04-09 12:09:46 +03:00
David Henningsson
911dbe6736 socket-server: Make the new channel low-delay, not the listening one
I don't know if it matters a lot, but most certainly it must be
the new channel that's supposed to be made low-delay, not the existing
listening socket, right?

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-04-08 14:57:32 +02:00
David Henningsson
71f81294e8 pstream: Rename "do_something" function
Rename it to "do_pstream_read_write" that better describes what the
function does.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-04-08 14:57:20 +02:00
David Henningsson
a6bc3b8ca9 alsa-mixer: Add "Headset Playback|Capture" element
Found on Logitech B530 USB Headset / kernel 3.8. Because we don't
have different path for headset and headphone today, just add
Headset to the existing headphone path.

BugLink: https://bugs.launchpad.net/bugs/1159687
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-04-04 11:52:24 +02:00
Peter Meerwald
25d8de9f0b doc: Fix suggested dl-search-path in README
the README suggests to set the following dl-search-path: -p $(pwd)/src/.libs/

N: [lt-pulseaudio] daemon-conf.c: Detected that we are run from the build tree, fixing search path.
E: [lt-pulseaudio] ltdl-bind-now.c: Failed to open module /redacted/pulseaudio/src/.libs/.libs/module-device-restore.so: /home/pmeerw/src/pulseaudio/src/.libs/.libs/module-device-restore.so: cannot open shared object file: No such file or directory

the last part seems superfluous, so -p $(pwd)/src/

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-04-02 19:02:46 +03:00
Maarten Lankhorst
77347e1e91 alsa: skip eld initialization if hctl_handle is NULL
Due to a misconfiguration on my side my hdmi card didn't load with
snd-hda-codec-hdmi but through the fallback mechanism. Pulseaudio
would crash during early because hctl_handle was null, so skip
init_eld_ctls when hctl_handle is null to prevent a crash.

Thanks to David Henningsson for helping me find the underlying issue.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-04-02 18:55:53 +03:00
poljar (Damir Jelić)
a3f5eeadc8 systemd-login: Remove unused variable session. 2013-03-29 13:58:17 +02:00
Martin Pitt
ef199c8a81 console-kit, systemd-login: Check for logind, not for systemd
It is possible to build systemd without logind, in which case sd_booted() wo
succeed. Check for /run/systemd/seats to test for logind instead, as
recommended by systemd upstream.

For details, see:
<https://mail.gnome.org/archives/desktop-devel-list/2013-March/msg00092.html

Drop the now unnecessary linking against libsystemd-daemon, and stop linking
the consolekit module to any systemd library.

https://bugs.freedesktop.org/show_bug.cgi?id=62593
2013-03-29 13:33:18 +02:00
Peter Meerwald
578d2ce5c8 remap: fix check when to apply specialized code path
the specialized code path just duplicate samples, so are only
applicable if the volume in map_table is == 1.0 (or == 0x10000);
don't use them for volumes >= 1.0

compare the integer version of the volume stored in map_table;
comparing floats is ugly (als leads to compiler warnings)

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-03-29 10:48:26 +02:00
Tanu Kaskinen
1d045af0a2 sink: Fix flag name typo 2013-03-28 17:15:00 +02:00
Arun Raghavan
92bb9fb8b5 resample: Switch to speex-float-1 by default
This consumes less power, has low (no?) perceivable difference, and
allows the default configuration to work out of the box on low-end
systems (such as netbooks).
2013-03-28 10:54:07 +00:00
David Henningsson
6be21425cd alsa-mixer: It's valid to have zero elements in a path
It's valid for a path to have zero elements, e g if it contains
a single jack only. Earlier, this would cause an assertion failure
in pa_path_condense.

Also convert pa_bool_t to bool.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-03-27 11:36:46 +02:00
Mikel Astiz
3d65e9c49e Revert "card: Support adding ports dynamically"
This reverts commit a9c3f2fb0f.

It has been recently agreed that ports should somehow have some physical
meaning, leading to the port merge in module-bluetooth-device.

With this assumption in mind, it is very unlikely that a card would
add or remove ports dynamically. Therefore, the core can be simplified
by removing the support for this.

The revert affects the code added to module-card-restore in commit
a1a0ad1af2, which can now be partially
removed.

Conflicts:
	src/pulsecore/card.c
	src/pulsecore/core.h
2013-03-27 08:43:02 +02:00
Javier Jardón
e2cb872120 build-sys: Use AM_CPPFLAGS instead of AM_CFLAGS for preprocessor arguments
As the automake documentation says:

AM_CPPFLAGS: The contents of this variable are passed to every compilation
that invokes the C preprocessor; it is a list of arguments to the preprocessor.
For instance, -I and -D options should be listed here

AM_CFLAGS: This is the variable the Makefile.am author can use to pass in
additional C compiler flags.

http://www.gnu.org/software/automake/manual/html_node/Program-Variables.html
2013-03-25 17:00:48 +02:00
David Henningsson
feeec28de4 client API: Document buffer_attr.maxlength
Let's officially support that people use maxlength to put an upper
bound on playback latency.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-03-25 15:44:36 +02:00
David Henningsson
5f326b705d protocol-native: Lower default minreq in low-latency scenarios
If minreq is not explicitly specified, it was always initialized to
20 ms (DEFAULT_PROCESS_MSEC). However when the total latency is not
much higher than 20 ms, this is way too high. Instead use
tlength/4 as a measure: this will give a decent sink_usec in all
modes (both traditional, adjust latency and early request modes).

This greatly improves PulseAudio's ability to ask for data in time
in low-latency scenarios.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-03-25 15:44:34 +02:00
David Henningsson
2026c41be6 protocol-native: Ensure tlength is not set higher than maxlength
Tlength should never be set higher than maxlength. While this is
corrected by memblockq later, we still need a correct tlength for
the subsequent calculations.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-03-25 15:43:33 +02:00
Tanu Kaskinen
450747cf22 .gitignore: Add alsa-mixer-path-test 2013-03-25 15:43:07 +02:00
Arun Raghavan
15009b03f1 protocol-native: Fix some debug output
s->buffer_attr_req is what we want to be printing from since that holds
the actualy requested buffer attributes.
2013-03-25 09:47:04 +00:00
Arun Raghavan
3371528178 alsa: Minor debug log addition
It's helpful to know what kind of scheduling latency we're expecting in
that debug log.
2013-03-25 09:47:04 +00:00
Arun Raghavan
45f8ece06e stream: Make it easier to enable debug output
This is only useful while hacking on PulseAudio.
2013-03-25 09:47:04 +00:00
Arun Raghavan
994f8fac1f core: Fix up some debug logging
Replaces some debugging-only pa_log() calls with pa_log_debug() so we
only get spammed while debugging if we want to be.
2013-03-25 09:47:04 +00:00