Commit graph

9068 commits

Author SHA1 Message Date
Tanu Kaskinen
2f6a46ca1a build-sys: Fix the Meson build
The recent bluetooth patches didn't update the Meson build system.
2019-04-12 16:05:51 +03:00
Pali Rohár
1b6e5b8554 bluetooth: Set correct endianity of audio samples for SBC codec
Pulseaudio SBC codec defines that audio samples are in PA_SAMPLE_S16LE
format which is little endian. But libsbc library expects audio samples by
default in host endianity which is big endian on big endian system. So SBC
support on big endian system is broken. To fix this problem tell libsbc
library that audio samples are in little endian to match PA_SIMPLE_S16LE
sample format.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=91359
2019-04-12 15:09:49 +03:00
Pali Rohár
63add82c82 bluetooth: Clean up SBC bitpool calculation
Remove dead code and replace numeric bitpool values by macro definitions.

Maximal bitpool value in fill_capabilities() was reduced from 64 to 53
(SBC_BITPOOL_HQ_JOINT_STEREO_44100) because default_bitpool() already set
maximal value to 53.

This patch does not change SBC behavior as maximal bitpool was already
limited to 53. So it is just clean up.
2019-04-12 15:09:33 +03:00
Pali Rohár
745c161cc0 bluetooth: Add missing validations for SBC codec parameters 2019-04-12 15:09:16 +03:00
Pali Rohár
106aa91477 bluetooth: Modular API for A2DP codecs
This patch introduce new modular API for bluetooth A2DP codecs. Its
benefits are:

* bluez5-util and module-bluez5-device does not contain any codec specific
  code, they are codec independent.

* For adding new A2DP codec it is needed just to adjust one table in
  a2dp-codec-util.c file. All codec specific functions are in separate
  codec file.

* Support for backchannel (microphone voice). Some A2DP codecs (like
  FastStream or aptX Low Latency) are bi-directional and can be used for
  both music playback and audio call.

* Support for more configurations per codec. This allows to implement low
  quality mode of some codec together with high quality.

Current SBC codec implementation was moved from bluez5-util and
module-bluez5-device to its own file and converted to this new A2DP API.
2019-04-12 15:09:08 +03:00
Pali Rohár
e8c4638f79 bluetooth: Update a2dp-codecs.h from upstream bluez project 2019-04-12 13:56:28 +03:00
Pali Rohár
e81e7a2ca5 bluetooth: policy: Remove BlueZ 4 related code 2019-04-12 13:56:25 +03:00
Moo
f08443e186 l10n: Update lt.po 2019-04-10 17:15:06 +00:00
David Heidelberg
44c15e6001 meson: when avahi is disabled, do not build it's code
Signed-off-by: David Heidelberg <david@ixit.cz>
2019-04-10 17:09:40 +00:00
David Heidelberg
f5f474dc67 meson: fix build with simple
Signed-off-by: David Heidelberg <david@ixit.cz>
2019-04-10 17:09:40 +00:00
Arun Raghavan
363b1ae69c thread-mainloop: Add API for running a callback unlocked
This adds API to allow clients to schedule a callback in the mainloop
thread without the mainloop lock being held. This is meant for a case
where the client might be dealing with locking its own objects in
addition to the mainloop thread itself. In this case, it might need ton
control the locking order of the two, to match the order in other
threads, as it might not always be able to allow for its objects to be
locked after the mainloop thread lock.
2019-03-31 09:18:37 +00:00
Georg Chini
824e685ac0 null-source: fix multiple bugs
The current null-source implementation has several bugs:

1) The latency reported is the negative of the correct latency.
2) The memchunk passed to pa_source_post() is not initialized
with silence.
3) In PA_SOURCE_MESSAGE_SET_STATE the timestamp is always set
when the source transitions to RUNNING state. This should only
happen when the source transitions from SUSPENDED to RUNNING
but also if it changes from SUSPENDED to IDLE.
4) The timing of the thread function is incorrect. It always
uses u->latency_time, regardless of the specified source
latency.
5) The latency_time argument seems pointless because the source
is defined with dynamic latency.

This patch fixes the issues by
1) inverting the sign of the reported latency,
2) initializing the memchunk with silence,
3) changing the logic in PA_SOURCE_MESSAGE_SET_STATE so that
the timestamp is set when needed,
4) using u->block_usec instead of u->latency_time for setting
the rtpoll timer and checking if the timer has elapsed,
5) removing the latency_time option.
2019-03-29 06:11:06 +00:00
Sascha Silbe
034b77823a remap: support S32NE work format
So far PulseAudio only supported two different work formats: S16NE if
it's sufficient to represent the input and output formats without loss
of precision and FLOAT32NE in all other cases. For systems that use
S32NE exclusively, this results in unnecessary conversions from S32NE to
FLOAT32NE and back again.

Add S32NE remap operations and make use of them (for the COPY and
TRIVIAL resamplers) if both input and output format are S32NE. This
avoids the back and forth conversions between S32NE and FLOAT32NE,
significantly improving performance for those cases.
2019-03-29 06:04:28 +00:00
Sascha Silbe
1e4fb61436 tests: test NEON 2-channel->4-channel rearrange
We have optimised 2-channel->4-channel rearrange remap functions. Test
them.
2019-03-29 06:04:28 +00:00
Sascha Silbe
ac4a50268f tests: fix possible segfault in cpu-remap-test
pa_init_remap_func() takes care to initialise pa_remap_t.do_remap to
NULL before calling init_remap_func (the CPU-specific remap init
function) and invokes init_remap_c if init_remap_func did not set
pa_remap_t.do_remap to non-NULL. remap_init_test_channels() calls
init_remap_func() directly so it must make sure pa_remap_t.do_remap is
set to NULL. Otherwise we'll end up with a random value in
pa_remap_t.do_remap if there is no CPU-optimised remap function for the
current operation.
2019-03-29 06:04:28 +00:00
Olaf Hering
993d3fd89e alsa: Use correct header path
Consumers are expected to use <alsa/asoundlib.h> instead of
<asoundlib.h>.

This is in preparation of an change to pkgconfig(alsa) to
not pollute CFLAGS with -I/usr/include/alsa anymore.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
2019-03-27 08:41:55 +00:00
Alexander Potashev
129357f206 i18n: Update Russian translation
Translated in sync with the guidelines at
http://l10n.lrn.ru/wiki/Pulseaudio
2019-03-27 09:54:50 +05:30
Sangchul Lee
a56c8a14d6 stream-interaction: Remove useless condition
Signed-off-by: Sangchul Lee
2019-03-26 14:54:15 +00:00
Sangchul Lee
65cc86f609 role-ducking, role-cork: Add use_source_trigger argument
This is added to keep backward compatibility. The default value of
this new argument is false. Therefore, triggering by source-output
will be activated only if it is set to true explicitly.

Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
2019-03-26 14:54:15 +00:00
Sangchul Lee
5540f728e5 stream-interaction: Use PA_IDXSET_FOREACH macro to iterate idxset
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
2019-03-26 14:54:15 +00:00
Sangchul Lee
0f4f109a3c stream-interaction: Support for triggering ducking/cork by source-output
Previously, media.role property of only sink-input is used to
determine to trigger and apply ducking or cork to sink-inputs.

On the other hand, some use cases require that source-output
also need to trigger the effect to sink-inputs. Therefore this
patch adds logic to retrieve source-ouputs to find trigger role
by checking media.role property and apply ducking/cork to sink-
inputs that meet conditions.

Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
2019-03-26 14:54:15 +00:00
scootergrisen
899b176f39 i18n: Update Danish translation 2019-03-25 16:44:05 +00:00
scootergrisen
54e7373042 i18n: Add danish translation 2019-03-25 13:47:34 +01:00
Georg Chini
d537e1a8ee ladspa-sink: Suspend virtual sink when master is suspended
Currently, the ladspa-sink is not suspended when the master sink is suspended.

With this patch, the ladspa-sink will be suspended with suspend cause
PA_SUSPEND_UNAVAILABLE when the master sink is suspended for other reasons
than PA_SUSPEND_IDLE. This fixes issue #15.
2019-03-25 05:16:15 +00:00
Georg Chini
acb02d9e88 sink, source: Call sink input suspend callback also on suspend cause change
Currently, virtual sinks and sources are not suspended when the master sink
or source is suspended. To implement this, the slave must be able to track
the suspend cause of the master.

With this patch, the sink input suspend callback will not only be called
when the sink or source is changing state, but also when the suspend cause
changes. Similar to the set_state_in_*_thread_cb() functions, the suspend
callback receives a state and a suspend cause as additional arguments.
Because the new state and suspend cause of the sink or source have already
been set, the old values are passed to the callback.
2019-03-25 05:16:15 +00:00
Georg Chini
f7b3537bbf alsa: Improve resume logic after alsa suspend
Currently, when a system is waking up from suspend, the resume process of the
ALSA sink and source is unstable. Sometimes the device needs to be restarted
multiple times and when the system was suspended between snd_pcm_mmap_begin()
and snd_pcm_mmap_commit(), pulseaudio crashes on resume.
Additionally, variables are not reset after the resume, so that sink/source
report wrong latencies.
This patch fixes the issues by closing and re-opening the PCM if recovery
from an error condition is not possible. Additionally, the variables are
reset, so that latencies are reported correctly.
2019-03-25 05:02:29 +00:00
Georg Chini
e794d0a21a loopback: Add option fast_adjust_threshold_msec
After a suspend/resume cycle of a system, it may be possible that module-loopback
accumulates several seconds of audio in the memblockq before the alsa sink becomes
active again. Also it may be possible for other reasons that the actual loopback
latency is too different from the target latency to be adjusted in a reasonable
time by the normal rate controller.
This patch adds the option fast_adjust_threshold_msec to module-loopback. If set,
the latency will be forcefully adjusted to the target latency by dropping or
inserting samples if the actual latency differs more than fast_adjust_threshold_msec
from the target latency.
Also the calculation of the real adjust time would fail when the system was
suspended because that case was not considered. Now the real adjust time
calculation is skipped if the time passed between two calls of adjust_rates()
appears significantly too long.
2019-03-25 04:46:07 +00:00
Piotr Drąg
4254d233ee Remove bad characters from Malayalam translation 2019-03-25 04:38:25 +00:00
Milo Casagrande
66b7379729 i18n: update Italian translation
Signed-off-by: Milo Casagrande <milo@milo.name>
2019-03-25 04:32:10 +00:00
Sangchul Lee
eec27ec686 core-util: Use size_t for out parameter of pa_split_*in_place()
pa_split_in_place() and pa_split_spaces_in_place() are modifed
to use size_t type instead of integer type.

alsa-ucm.c is revised according to this change.

Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
2019-03-19 11:42:19 +09:00
Tanu Kaskinen
c235acd787 build-sys: Lower the minimum gettext version
The old minimum version was set in commit 57e3ccaf51 based on what the
commit author happened to have installed at the time. Russell Treleaven
now confirmed that Debian 8's gettext version, 0.19.3, works fine too,
or at least PulseAudio builds without errors. There might be room to
lower the required version even further, but that requires someone to
test older gettext versions.
2019-03-14 21:23:30 +02:00
Tanu Kaskinen
904dd38003 alsa-mixer: improve a comment in udev rules
The word "identical" was being used in a weird way that could make the
comment a bit difficult to undertand.
2019-03-02 19:46:22 +02:00
Takashi Sakamoto
0d67e36655 alsa-mixer: distinguish Focusrite Saffire Pro 10 i/o from Liquid Saffire 56
In a former commit 37358e42c4 ("alsa: Suppress udev detection of sound
card for some units on IEEE 1394 bus"), PulseAudio has udev rules to
suppress handling some units on IEEE 1394 bus for a below issue:

Bug 199365 - repeating bus resets on Firewire bus with Focusrite Saffaire 26/io
https://bugzilla.kernel.org/show_bug.cgi?id=199365

However, I found that the rules match another model; Focusrite Liquid
Saffire 56. For detail, refer to below patch for Linux sound subsystem:

[alsa-devel] [PATCH] ALSA: bebob: use more identical mod_alias for
Saffire Pro 10 I/O against Liquid Saffire 56
https://mailman.alsa-project.org/pipermail/alsa-devel/2019-February/146003.html

For PulseAudio, the udev rule should be improved, because Liquid Saffire 56
(an application of TCAT TCD2200 ASIC, a.k.a Dice Jr.) can be handled by
pulseaudio without the issue.

This commit changes udev rule with model name instead of model_id from
configuration ROM. Below is data on udevd for Liquid Saffire 56, for
your information:

$ udevadm info -q all -p /sys/bus/firewire/devices/fw1.0/sound/card2/
P: /devices/pci0000:00/0000:00:01.2/0000:03:00.2/0000:04:07.0/0000:0a:00.0/0000:0b:00.0/fw1/fw1.0/sound/card2
E: DEVPATH=/devices/pci0000:00/0000:00:01.2/0000:03:00.2/0000:04:07.0/0000:0a:00.0/0000:0b:00.0/fw1/fw1.0/sound/card2
E: ID_BUS=firewire
E: ID_FOR_SEAT=sound-pci-0000_0b_00_0
E: ID_ID=firewire-0x00130e04018001e9
E: ID_MODEL=LIQUID_SAFFIRE_56
E: ID_MODEL_FROM_DATABASE=XIO2213A/B/XIO2221 IEEE-1394b OHCI Controller [Cheetah Express]
E: ID_MODEL_ID=0x000006
E: ID_PATH=pci-0000:0b:00.0
E: ID_PATH_TAG=pci-0000_0b_00_0
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_PCI_INTERFACE_FROM_DATABASE=OHCI
E: ID_PCI_SUBCLASS_FROM_DATABASE=FireWire (IEEE 1394)
E: ID_SERIAL=0x00130e04018001e9
E: ID_SERIAL_SHORT=0x00130e04018001e9
E: ID_VENDOR=Focusrite
E: ID_VENDOR_FROM_DATABASE=Texas Instruments
E: ID_VENDOR_ID=0x00130e
E: SOUND_INITIALIZED=1
E: SUBSYSTEM=sound
E: SYSTEMD_WANTS=sound.target
E: TAGS=💺systemd:
E: USEC_INITIALIZED=9802422583

Fixes: 37358e42c4 ("alsa: Suppress udev detection of sound card for some units on IEEE 1394 bus")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2019-03-02 19:19:34 +02:00
Arun Raghavan
db788229c6 source: Fix a bad condition that made source events not be emitted
This broke during a refactor of sink/source state-change.
2019-02-19 09:30:34 +05:30
scootergrisen
86074557a2 Replace "!" to "." so string is identical with other string. 2019-02-16 11:31:24 +00:00
scootergrisen
4f8200a283 Change "!" to "." to match other identical string. 2019-02-16 11:23:06 +00:00
scootergrisen
a4264de3a8 channel/s to channel(s) 2019-02-16 11:11:58 +00:00
scootergrisen
dee7674c7f Remove space in "Digital Passthrough (IEC958)" 2019-02-16 11:03:45 +00:00
scootergrisen
8b6006c0c6 "e g " to "e.g." 2019-02-16 10:49:53 +00:00
scootergrisen
b1c82bbd31 Remove "module" from "module user requested module" 2019-02-16 10:19:36 +00:00
scootergrisen
108f4ab09b Add missing space 2019-02-16 10:08:49 +00:00
Georg Chini
a53b371a4f virtual-source: Fix crash in combination with module-loopback
Similar to module-tunnel-sink-new, module-virtual-source did not create
a rtpoll for the uplink sink. This lead to a crash when the uplink sink
was used by module loopback, because module-loopback relies on the sink
to provide a rtpoll. Additionally, the sink was not unlinked when the
module was unloaded.

This patch fixes both issues. The rtpoll created is never run by the sink,
so the patch is no real fix but just a workaround to make module-loopback
happy.
2019-02-15 19:33:24 +00:00
Russell Treleaven
7525cc8215 give users a template that encourages complete bug reports 2019-02-13 15:11:42 +00:00
João Paulo Rechi Vita
334ae350b4 card: Only fire the profile available changed hook for linked cards
pa_card_profile_set_available needs to check if the card is linked
before firing PA_CORE_HOOK_CARD_PROFILE_AVAILABLE_CHANGED, so callbacks
connected to it receive a fully initialized card object.

This fixes a crash introduced by commit 30a551bbc
"switch-on-port-available: Check if we need to change the active
profile".
2019-01-23 15:18:22 +00:00
Arun Raghavan
a5f25af043 protocol-native: Fix format ownership while creating record streams 2019-01-18 16:34:33 +00:00
Tanu Kaskinen
ff17374ffa bluez5-device: use correct RTP payload type
If one device tries to use PulseAudio to send audio over A2DP to another
device with bluez-alsa, that doesn't work because PulseAudio uses an
incorrect RTP payload type and bluez-alsa checks that the RTP payload
type is correct. According to the A2DP spec, the payload type should be
set to a number between 96 and 127.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/591
2019-01-17 14:43:39 +02:00
Arun Raghavan
9e0aa31f0a pactl: Fix some corner cases when setting sink formats
Mostly deals with failure more gracefully, and NULL-initialises the
format array for safety.
2019-01-16 09:39:24 +05:30
Arun Raghavan
24c389c8aa tests: Shorten how long daemon tests take to run
We split out some of the check-daemon tests that take a long time to
run, and also reduce how long we wait for the daemon to start up. This
should make the CI process quicker.
2019-01-16 09:39:24 +05:30
Arun Raghavan
39bc380c12 build-sys: Add the ability to disable maintainer mode
This allows us to disable automatically updating build system files in
case things change. This is desirable in the common case, but not
necessarily for CI, where we want the ability to take a build directory
as an artifact from one stage to the next (i.e. into a fresh checkout).
2019-01-16 09:39:24 +05:30
Diego Viola
2e755f012e memblockq: fix typo: yepp -> yep 2019-01-13 17:02:59 +00:00