Commit graph

2631 commits

Author SHA1 Message Date
poljar (Damir Jelić)
f8101279bb switch-on-port-available: Silence gcc warning.
This silences this gcc warning:
module-switch-on-port-available.c:111:12: warning:
    'good' may be used uninitialized in this function
2013-06-04 00:38:40 +05:30
Tanu Kaskinen
a7567b78e3 alsa: Don't use pa_strna() for port names
The name variable is never NULL, so there's no point in using
pa_strna().
2013-06-04 00:38:40 +05:30
poljar (Damir Jelić)
80b0e285a5 device-port: Introduce pa_device_port_new_data
Port creation is now slightly different. It is now similar to how
other objects are created (e.g. sinks/sources/cards).

This should become more useful in the future when we move more stuff to
the ports.

Functionally nothing has changed.
2013-06-04 00:38:39 +05:30
João Paulo Rechi Vita
3086d01dd7 bluetooth: Improve code and log readability
This commit makes the code cleaner, avoiding unnecessary line breaks. It
also changes the debug message elements order, to make it look more
natural ("path, interface, member" instead of "interface, path,
member").
2013-06-04 00:38:39 +05:30
João Paulo Rechi Vita
3ef024831c bluetooth: Remove unnecessary braces 2013-06-04 00:38:39 +05:30
Tanu Kaskinen
0bbef56976 device-port: Make it impossible to have dual-direction ports 2013-06-04 00:38:39 +05:30
Tanu Kaskinen
5ceb184e3e alsa-mixer: Remove the "name" option from the "General" section of path configuration files
This means that the path names will always correspond to the
path configuration file names, so they will automatically be
unique (in the scope of one card).
2013-06-04 00:38:39 +05:30
Tanu Kaskinen
3c1ca6d4b8 alsa-mixer: Introduce "description-key" option for paths
Previously the path description was looked up based on the
path name only. Since there can be multiple paths that use
the same description, it had to be possible to have multiple
paths with the same name.

Having the same name with multiple paths makes identifying
the paths more complex than necessary, so the plan is to
make it impossible to have paths with the same name. This
patch prepares for that by retaining the possibility to
still have the same description with multiple paths. Instead
of the path name, the path description is looked up by using
the "path description key" if it is set (path name is still
used as a fallback lookup key).
2013-06-04 00:38:39 +05:30
Tanu Kaskinen
66aeea7f72 switch-on-port-available: Fix error reporting style 2013-06-04 00:38:38 +05:30
Tanu Kaskinen
d4d319820d switch-on-port-available: Remove a redundant function argument 2013-06-04 00:38:38 +05:30
Tanu Kaskinen
7560314f36 switch-on-port-available: Prepare for dual-direction ports going away
As an extra, I broke try_to_switch_profile() into smaller
functions, because the two levels of loops with continue
statements inside both were a bit hard to follow.
2013-06-04 00:38:38 +05:30
Vadim Troshchinskiy
a0032eb7f9 osx: Fix latency querying
get_latency_us() used an uninitialized variable, and an incorrect
scope for some of the AudioObjectGetPropertyData() calls. As a result,
audio would randomly not work at all.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=65122
2013-05-29 14:08:23 +03:00
David Henningsson
19a7c6e49b rtp: Reset timestamp with correct size if not found
This fixes a compiler warning when building under Ubuntu.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-05-22 16:07:57 +02:00
David Henningsson
d396b76934 module-device-manager: Fix description restore
e->description is a pointer, not a fixed char array. Hence it
makes no sense to use strncmp.

This fixes a compiler warning when compiling under Ubuntu.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-05-22 16:07:57 +02:00
Mikel Astiz
b156325c68 bluetooth: Fix missing port->profile association
Commit 17b3cb954b merged Bluetooth ports
into two ports (one for input, one for output) but the association
between ports and profiles was lost.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=64713
2013-05-21 14:46:38 +02:00
Mikel Astiz
305f8c7af1 bluetooth: Create ports before card profiles
Both operations are currently independent and their order can therefore
be swapped.
2013-05-21 14:46:31 +02:00
David Henningsson
ef2810e1be alsa-mixer: Add "Line Out Jack" to analog-output.conf
A stationary computer usually has headphone jack(s) and line out jacks.
In some cases analog-output.conf will be a subset of
analog-output-headphones.conf, causing line outs to be unusable (because
headphones are unplugged).

This late in the cycle, this was the safest way I could think of to try
to fix this for a particular computer. In later versions of PulseAudio
we could consider making a dedicated line out path instead, and have
proper jack detection there.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-05-17 15:48:02 +02:00
David Henningsson
0a9a1d7488 alsa: Fix crash when profile_set == NULL
Better check if the pointer is NULL before dereferencing it, instead of
after!

BugLink: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1159853
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-05-14 11:05:24 +02:00
Peter Meerwald
8bca464394 echo-cancel: Fix send/recv_counter in calc_diff()
send_counter/recv_counter relate to the bytes (play stream) passed
through the queue, hence the same sample spec must be used

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Acked-by: Stefan Huber <shuber@sthu.org>
2013-05-13 10:32:25 +05:30
Tanu Kaskinen
9e4229cfe0 alsa-mixer: Don't use the mono path in the analog-stereo mapping.
As far as I can see, having a mono path in a stereo mapping doesn't
make any sense. It also causes breakage: if the Master Mono mixer
element has two volume channels, the analog-output path gets removed
due to being a subset of analog-output-mono, and that in turn causes
the Master element getting muted. Users generally don't like that.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=54673
2013-05-08 16:35:13 +03:00
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
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
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
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
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
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
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
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
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
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
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
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
Robin H. Johnson
088ed8a8d6 rtp: Introduce source IP configuration
On a multi-homed system, the user may wish RTP to be used only on
specific interfaces. The default binding of 0.0.0.0 for the source
address causes SAP multicast on all interfaces, which is not ideal.

Introduce a new module argument, that allows selection of the source IP,
and thus interface.

(changes in v2: s/srcip/source_ip)

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2013-03-25 09:47:04 +00:00
Robin H. Johnson
d18c3664b5 rtp: rename modarg destination to destination_ip
The module argument 'source' already has special meaning as the
pa_source, however, the argument 'destination' expects an IP address.

Prior to introducing a source IP modarg for the source IP address,
rename the 'destination' argument to 'destination_ip'. Include
compatibility support for old RTP users so they don't need to change
their module usage immediately.

(changes in v2: minor formatting fixes, s/dstip/destination_ip)

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2013-03-25 09:47:04 +00:00
Robin H. Johnson
ce0294ccf2 rtp: Cleanup variable naming.
Before introducing new functionality, clarify the variable names

dest -> dst_addr
sa[46] -> dst_sa[46]
sap_sa[46] -> dst_sap_sa[46]

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2013-03-25 09:47:04 +00:00
David Henningsson
1a3f800799 alsa-mixer: Support more phantom jacks
It's fairly uncommon, but it happens that jack detection is enabled
for some reason, e g hardware design. In that case, we cannot use
jack detection, but we can still use the hint to pick up that there
is a path.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-03-25 08:30:32 +01:00
David Henningsson
560ce5ece0 alsa-mixer: Add path for Headset Microphone
In kernel 3.10, some devices will have the "Headset Microphone" name
to indicate that the mic is part of a mic + headphone combo, i e, a headset.
2013-03-25 08:30:32 +01:00
Tanu Kaskinen
259be540e3 loopback: Flush asyncmsgq from the right context
u->asyncmsg is accessed from two IO threads. teardown() shouldn't
flush the queue from the main thread while both IO threads are still
potentially using the queue. This patch fixes that error by flushing
the queue from the sink input thread when the sink input is being
unlinked.

Flushing the queue in teardown() caused this assertion in
pa_asyncmsgq_get() to crash sometimes: pa_assert(!a->current)
2013-03-22 20:49:56 +02:00
Tanu Kaskinen
ee0a5d5014 filter-apply: Fix segfault with moving streams
process() may be called with a stream that doesn't have its sink/source set.
This can happen if the proplist change callback is called when the stream is
moving.
2013-03-22 20:49:47 +02:00
Tanu Kaskinen
f8b57af2c8 loopback: Fix segfault in may_move_to() callbacks
The sink input may_move_to() callbacks can be called while the source
output is not connected to any source (i.e. is currently moving too),
and vice versa.

Thanks to Frédéric Dalleau for reporting this bug.
2013-03-22 20:44:52 +02:00
David Henningsson
e87eb85474 core, alsa: Better drain reporting
Previously, a drain request was acknowledged up to two hw buffers
too late, causing unnecessary delays.

This implements a new chain of events called process_underrun
which triggers exactly when the sink input has finished playing,
so the drain can be acknowledged quicker.

It could later be improved to give better underrun reporting to
clients too.

Tested-by: Dmitri Paduchikh <dpaduchikh@gmail.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-03-20 11:55:42 +01:00
Tanu Kaskinen
f5f77a90cf alsa: Add configuration for NI Traktor Audio 2
Mostly written by Jaroslav Janukevic.
2013-03-14 14:04:41 +02:00
Tanu Kaskinen
759f82f17d ladspa: Use volume sharing.
The previous volume handling could cause ear damage: by default the
ladspa sink volume was 100%, and with flat volumes that would cause
the master sink volume to jump to 100% too.
2013-03-13 15:17:49 +02:00
Tanu Kaskinen
5619917207 udev: Add tsched_buffer_size module argument
This makes it easier to configure the buffer size.
2013-03-13 13:40:08 +02:00