Commit graph

7162 commits

Author SHA1 Message Date
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
2135b2b34f sink-input: Make sure the process_underrun callback is cleared
Otherwise sink unlinking could cause a segfault.

Reported-by: heftig
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-03-21 18:25:09 +01:00
Tanu Kaskinen
a560cf3b67 pacat: Fix mode detection for parecord
Due to the missing "else", parecord was interpreted as parec, causing
the raw flag to be set when it shouldn't have been set.
2013-03-21 12:35:07 +02:00
David Henningsson
c0d1b1e75f tests: Move ipacl-tests to TESTS_norun
ipacl-test fails if there is no SSH server running on your machine.
Since it is not a PulseAudio error not to have an SSH server running,
this test should not be run as part of the "make check" test suite.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-03-20 12:08:23 +01: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
poljar (Damir Jelić)
ada92732f0 zsh-completion: Fix pacat completion.
pacat --format needs = (--format=).
Also pacat should complete files firstly and command line arguments
secondly.
2013-03-18 21:28:21 +02:00
poljar (Damir Jelić)
d127e801dc zsh-completion: Add support for the new pactl commands.
This adds support for set-(sink|source)-default completion and adds
toggle to the supported arguments for the mute command.
2013-03-18 21:25:59 +02:00
poljar (Damir Jelić)
993e756e13 zsh-completion: Add support for remote servers.
This patch adds support for completion of remote PulseAudio server
arguments it also suppresses error messages when unable to connect to
PulseAudio (only for the completion function).
2013-03-18 21:25:56 +02: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
Marc-Antoine Perennou
874bceb84d port to gtk+-3.0
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2013-03-13 18:22:28 +02:00
Tanu Kaskinen
7e1ebf9455 pulse: Document the operation state behavior on context disconnection. 2013-03-13 16:10:16 +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
Tanu Kaskinen
9849a21587 man: Remove reference to the .verbose CLI command
The .verbose metacommand was removed in commit
73eabece33 (in 2004!).

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=62270
2013-03-13 13:19:22 +02:00
Akihiro Tsukada
a3d1816f68 Bump the native protocol version
The previous AAC pass-through patch (commit: 53807e4a) introduced
a new encoding format type: PA_ENCODING_MPEG2_AAC_IEC61937,
which is mostly used in pa_format_info, but forgot to increment the
protocol version number. The version needs to be incremented, because
clients need some way of checking whether the server supports the new
encoding.
2013-03-13 12:56:37 +02:00
Tanu Kaskinen
dc68fcb33f ltdl-bind-now: Log an error in case of failures 2013-03-12 19:12:31 +02:00
Tanu Kaskinen
cfb609d4f6 module: Don't use lt_dlerror(), it's useless 2013-03-12 19:12:23 +02:00
David Henningsson
135afa28e7 bluetooth: Never allow microphone output ports
If we find a microphone output port, it is probably something else
than a microphone. Therefore label it "Bluetooth output" instead of
"Microphone".

Same goes for Headphones and Speakers, but in the other direction.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-03-08 18:23:41 +01:00
Mikel Astiz
0a280ceed7 bluetooth: Use form factor to set port name and description
Use the information provided by the form factor to decide which name and
description should be used during port creation.
2013-03-08 18:22:17 +01:00
Mikel Astiz
b394743fb3 bluetooth: Add specific form factor for phones
When a phone is paired, use PA_BT_FORM_FACTOR_PHONE to properly specify
its form factor.
2013-03-08 18:22:14 +01:00
Mikel Astiz
11d7a2d197 bluetooth: Use enum to represent form factors
Avoid using strings only to represent form factors in the bluetooth-util
API and instead use a new dedicated enum type: pa_bt_form_factor_t.
2013-03-08 18:22:11 +01:00
Stefan Huber
278ceb453f modules: Remove obsolete may_move_to callbacks
Some modules have source_output_may_move_to_cb() and
sink_input_may_move_to_cb() implemented that duplicate the default behavior.
Remove them.
2013-03-06 16:32:12 +02:00
Stefan Huber
1489c43acc modules: remove obsolete comment on PA_SOURCE_OUTPUT_DONT_INHIBIT_AUTO_SUSPEND 2013-03-06 01:42:07 +02:00
Stefan Huber
83a64ff7b4 virtual-source: remove redundant checks and callbacks
- do not check pa_xnew0()'s return value
- remove redundant source_output_process_msg_cb()
2013-03-06 01:41:19 +02:00
Stefan Huber
b5226992d4 modules: add module-remap-source 2013-03-05 23:20:13 +02:00
David Henningsson
544d01721e default.pa: Load module-jackdbus-detect with channels=2 by default
There was a recent thread on Linux Audio Users mailinglist about
whether to do so or not, and it looks like most people would prefer
having a stereo default (but even better would have been a
module-jack-card where you can easily set channels/profiles on the fly).

Reference:
http://lists.linuxaudio.org/pipermail/linux-audio-user/2013-February/091068.html

Reported-by: Kaj Ailomaa <zequence@mousike.me>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-03-01 13:01:33 +01:00
Tanu Kaskinen
773ca81dea format: Add #defines for enum values 2013-02-22 14:25:36 +02:00
David Henningsson
fd3a4e588c alsa-card: Make ELD monitor name a port property
If there is a proper monitor name, we expose this as a device.product.name
property on the port. This can be useful for UIs who might want to show
this name.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-02-19 20:45:38 +02:00
David Henningsson
bf487f0ffa alsa-mixer: Add possibility to configure ELD device
The alsa mixer kcontrol has "device index" 3, 7, 8, and 9.
We need to configure this properly.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-02-19 20:14:40 +02:00
David Henningsson
eaa893d7d1 alsa-util: Add a function to read ELD info
Currently, this function only reads the monitor name, but could
be extended to read e g supported formats as well.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-02-19 20:10:16 +02:00
Mikel Astiz
a40d83a472 card: Set initial profile availability state
Commit afd33da56a introduces this new
flag but the default initial value is missing, considering that
pa_xmalloc is used to allocate the memory.
2013-02-19 19:31:54 +02:00
Mikel Astiz
2f0f07a755 bluetooth: Fix assertion failure if BlueZ crashes during GetProperties
If BlueZ crashes exactly while PulseAudio waits for the GetProperties reply, the
device has already been removed from the hashmap and therefore an assertion
failure is experienced.

The solution consists of ignoring the reply in these cases.

The problem can be observed in the following traces:

D: [pulseaudio] bluetooth-util.c: Bluetooth daemon appeared.
D: [pulseaudio] bluetooth-util.c: dbus: interface=org.bluez.Manager, path=/, member=AdapterAdded
D: [pulseaudio] bluetooth-util.c: Adapter /org/bluez/497/hci1 created
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/HFPAG on adapter /org/bluez/497/hci1.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/HFPHS on adapter /org/bluez/497/hci1.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/A2DPSource on adapter /org/bluez/497/hci1.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/A2DPSink on adapter /org/bluez/497/hci1.
D: [pulseaudio] bluetooth-util.c: dbus: interface=org.bluez.Adapter, path=/org/bluez/497/hci1, member=DeviceCreated
D: [pulseaudio] bluetooth-util.c: Device /org/bluez/497/hci1/dev_90_84_0D_B2_C7_04 created
D: [pulseaudio] bluetooth-util.c: dbus: interface=org.freedesktop.DBus, path=/org/freedesktop/DBus, member=NameOwnerChanged
D: [pulseaudio] bluetooth-util.c: Bluetooth daemon disappeared.
E: [pulseaudio] bluetooth-util.c: Assertion 'p->call_data == d' failed at modules/bluetooth/bluetooth-util.c:685, function get_properties_reply(). Aborting.
2013-02-19 19:30:17 +02:00
Mikel Astiz
90ae777500 bluetooth: Fix possible adapter duplicates
The D-Bus signal AdapterAdded can be received during our call to
GetProperties(), before the reply is received. In this case, the adapter
will be listed twice and thus the endpoint registration will fail with
"AlreadyExists" as follows:

D: [pulseaudio] bluetooth-util.c: dbus: interface=org.bluez.Manager, path=/, member=AdapterAdded
D: [pulseaudio] bluetooth-util.c: Adapter /org/bluez/21220/hci0 created
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/HFPAG on adapter /org/bluez/21220/hci0.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/HFPHS on adapter /org/bluez/21220/hci0.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/A2DPSource on adapter /org/bluez/21220/hci0.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/A2DPSink on adapter /org/bluez/21220/hci0.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/HFPAG on adapter /org/bluez/21220/hci0.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/HFPHS on adapter /org/bluez/21220/hci0.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/A2DPSource on adapter /org/bluez/21220/hci0.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/A2DPSink on adapter /org/bluez/21220/hci0.
E: [pulseaudio] bluetooth-util.c: RegisterEndpoint() failed: org.bluez.Error.AlreadyExists: Already Exists
E: [pulseaudio] bluetooth-util.c: RegisterEndpoint() failed: org.bluez.Error.AlreadyExists: Already Exists
E: [pulseaudio] bluetooth-util.c: RegisterEndpoint() failed: org.bluez.Error.AlreadyExists: Already Exists
E: [pulseaudio] bluetooth-util.c: RegisterEndpoint() failed: org.bluez.Error.AlreadyExists: Already Exists
2013-02-18 19:50:37 +02:00
Stefan Huber
163430f05b echo-cancel: Enable different sample specs for rec and out stream
Enable advanced AEC methods to use different specs (i.e., number of
channels) for rec and out stream. A typical application is beam forming
resp. multi-channel AEC, which takes multiple record channels to produce
an echo-canceled output stream.
This commit alters the EC API as follows: the EC's init() used to get
source and sink's sample spec/channel map. The new interface renamed
source to rec and sink to play and additionally passes sample spec and
channel map of the out stream. The new parameter names of init()
{rec,play,out}_{ss,map} are more intuitive and also resemble to the
parameter names known from run(). Both rec_{ss,map} and out_{ss,map} are
initialized as we knew it from source_{ss,map} before being passed to
init(). The previous EC implementations only require trivial changes,
i.e., setting rec_{ss,map} to out_{ss,map} at the end of init() in case
that out_{ss,map} is modified in init().
2013-02-18 19:16:40 +02:00
Mikel Astiz
17b3cb954b bluetooth: Merge all ports into "bluetooth-input" and "bluetooth-output"
The card profile availability flag already provides all the necessary
information and therefore all Bluetooth ports can be merged, leaving
the two generic ones only: "bluetooth-input" and "bluetooth-output". The
availability of these port now represents whether the device is
streaming audio, with the following mapping:
- PA_AVAILABLE_UNKNOWN: some profile connected but not streaming
- PA_AVAILABLE_NO: no profiles connected
- PA_AVAILABLE_YES: some profile streaming (regardless of which)

Each port's flag represents the profiles with the corresponding I/O
capabilities (pa_direction_t).
2013-02-18 18:39:12 +02:00
Mikel Astiz
d776416709 bluetooth: Use profile availability to auto-switch profiles
Use the card profile availability flag instead of port availability in
order to automatically switch profiles, for example when a paired phone
starts streaming A2DP audio.
2013-02-18 18:02:39 +02:00
Mikel Astiz
966a827d77 bluetooth: Expose card profile availability
Use the transport's state to not only update the ports availability, but
also to update the card profile availability flag. The interpretation is
as follows:
- PA_AVAILABLE_UNKNOWN: BT profile is connected but no audio streaming
- PA_AVAILABLE_NO: BT profile disconnected
- PA_AVAILABLE_YES: BT profile connected and audio streaming
2013-02-18 17:48:43 +02:00
Mikel Astiz
cfa79a84fc cli: Show card profile availability status
Expose the newly added card profile availability in pacmd.
2013-02-18 17:40:24 +02:00
Mikel Astiz
afd33da56a card: Add card profile availability
Some cards are capable to announce if a specific profile is available or
not, effectively predicting whether a profile switch would fail or would
likely succeed. This can for example be useful for a UI that would gray
out any unavailable profile.

In addition, this information can be useful for internal modules
implementing automatic profile-switching policies, such as
module-switch-on-port-available or module-bluetooth-policy.

In particular, this information is essential when a port is associated
to multiple card profiles and therefore the port availability flag does
not provide enough information. The port "bluetooth-output" falls into
this category, for example, since it doesn't distinguish HSP/HFP from
A2DP.
2013-02-18 17:36:17 +02:00
Mikel Astiz
8851644a3c core: Internally deprecate pa_port_available_t to use pa_available_t
Generalize the availability flag in order to be used beyond the scope of
ports.

However, pa_port_availability_t is left unchanged to avoid modifying the
protocol and the client API. This should be replaced by pa_available_t
after a validation phase of this new generic enum type.
2013-02-18 17:25:53 +02:00
Stefan Huber
3aefdd995c echo-cancel: Do not bypass EC implementation when play stream is empty
When the play stream from the EC sink has not enough data available then
the EC implementation is currently bypassed by directly forwarding the
record bytes to the EC source. Since EC implementations maintain their
own buffers and cause certain latencies, a bypass leads to glitches as
the out stream stream jumps forth and back in time. Furthermore, some
EC implementations may also apply noise reduction or other sound
enhancing techniques, which are therefore bypassed, too.

Fix this by passing silence bytes to the EC implementation if the play
stream runs empty. Hence, this patch keeps the EC implementation running
even if the play stream has no data available.
2013-02-18 16:26:39 +02:00
Stefan Huber
9b6dced2cb echo-cancel-test: When fopen() fails tell which file failed 2013-02-16 21:46:27 +02:00
Stefan Huber
7eff884848 echo-cancel-test: Pass aec_args with module args
The echo canceller module can pass arguments to the EC implementation
via the module parameter aec_args. However, the echo-cancel-test passes
EC arguments via a separate argv[] option, which is inconsistent. Fix
this.
2013-02-16 21:45:26 +02:00
Stefan Huber
8aa30049ec echo-cancel-test: Enable debug log level 2013-02-16 21:39:33 +02:00
Akihiro Tsukada
53807e4a28 add support for MPEG-2 AAC pass-through
Some S/PDIF receivers have AAC decoder.
Only MPEG2 AAC is added,
as I don't have MPEG-4 AAC decoder and cannot test it.
2013-02-16 21:36:39 +02:00
David Henningsson
0785165e5c module: Unload modules in reverse order
Unloading modules in the reverse order is the "more logical" thing
to do, and speeds up shutdown somewhat, e g by not loading
module-null-sink at shutdown.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-02-16 21:03:46 +02:00
Tanu Kaskinen
77b3ba514c bluetooth: Fix thread teardown code ordering
thread_mq.outq may contain some unprocessed messages, which should be
dispatched before unreffing the sink and source. If the sink and
source are unreffed before all messages to them have been dispatched,
the unreffing won't free the sink and source, and that in turn will
likely cause problems with things getting freed in a wrong order.
2013-02-16 20:48:55 +02:00
Mikel Astiz
5d4b7c4a89 bluetooth: Fix premature acquire attempts
A transport should be considered connected only after the connection
procedure is complete, as expressed in audio_state_to_transport_state().

module-bluetooth-device should be loaded only after at least one
transport is not only created (during configuration), but also
connected.

This fixes the issue of premature acquire attempts sometimes experienced
when a headset is connected (issue not present in v3.0 though).
2013-02-16 16:53:42 +02:00