Commit graph

9552 commits

Author SHA1 Message Date
Arun Raghavan
28f646fd87 doc: Add some contributor guidelines
Document some things that should be helpful to at least new
contributors. Since we don't have a way to show this when people are
creating MRs, also copy over the next to a merge request template so
that creates a dropdown that folks might look at when creating an MR.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/444>
2021-01-04 15:30:38 +00:00
Igor V. Kovalenko
b76d835e59 ladspa-sink: do not call pa_sink_suspend if PA_SINK_IS_LINKED is false
While module-ladspa-sink is still being loaded and before pa_sink_put() is
called there may be an attempt to reconfigure master sink when avoid-resampling
is true. This breaks attempting to suspend ladspa-sink which is still in INIT
state.

Fix this by skipping pa_sink_suspend if PA_SINK_IS_LINKED is false.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/445>
2021-01-04 12:19:07 +00:00
Georg Chini
81ebd8ba3f message-params: Fix array reading functions
The array read functions need the state pointer as an additional argument because the
array may be in the middle of a parameter list and the state pointer must be advanced
to the element after the array.

Additionally fixes some compiler warnings.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/450>
2021-01-01 20:43:07 +00:00
Tanu Kaskinen
21a531041a alsa-mixer: Add support for the Headphone,1 element
This is seen at least on HP EliteDesk 800 DM and HP EliteDesk 800 SFF.

This is used by the analog-output-headphones-2 path, but all other paths
on the same sink need to handle the element too. The existing
configuration is inconsistent between files regarding whether headphone
outputs should be muted or not when not using them. I chose to be
consistent within files, which means that Headphone,1 handling is
inconsistent between files in the same way that the existing Headphone
and Headphone2 handling is. (My opinion is that unused paths should be
always muted, but I didn't want to do that policy change in this patch.)

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/272>
2020-12-30 15:49:09 +00:00
Tanu Kaskinen
0c14f89b84 alsa-mixer: Move HP EliteDesk 800 SFF/DM second headphone output to path analog-output-headphones-2
The two headphone outputs should be handled in separate paths so that
volume control can be implemented properly for both outputs.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/272>
2020-12-30 15:49:09 +00:00
Tanu Kaskinen
d51870d4f0 alsa-mixer: Use unambiguous descriptions with dual headphone outputs
Previously both paths had description "Headphones", which I assume can
cause confusion with users who see two ports with identical names. I
don't have this kind of hardware myself nor have I heard complaints from
users, this is just something I noticed while reading the configuration
files.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/272>
2020-12-30 15:49:09 +00:00
Kai-Heng Feng
2a0fa78d18 alsa-mixer: Support dual Front Headphone Jack
There are dual Front Headphone Jacks with different indices or with
different names, they can be found on HP EliteDesk 800 SFF and HP
EliteDesk 800 DM, respectively.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/272>
2020-12-30 15:49:09 +00:00
Kai-Heng Feng
aad2fca0c9 alsa-mixer: Handle the index for ALSA mixer jack identifiers
Some systems have two jacks with same name but different index, we need
to take index into consideration to use both jacks.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/272>
2020-12-30 15:49:09 +00:00
Igor V. Kovalenko
3ecea410d7 context: add property to forcefully disable shared memory channels
If application wants last bits of virtual memory, allow it to forcefully disable
shared memory communication channels via PA_PROP_CONTEXT_FORCE_DISABLE_SHM=yes

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/448>
2020-12-30 08:35:03 +00:00
Igor V. Kovalenko
4874f8a607 bluetooth: align max renderable block size to frame size
When bluez5 device I/O thread detects it is too slow sending data, allow it to
skip up to max rendered block size bytes which must be aligned to frame size.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/449>
2020-12-30 01:18:41 +03:00
morrishoresh
dd7593b836 bluetooth: correct possible segmentation fault
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/443>
2020-12-25 10:36:02 -05:00
Hui Wang
8f6029077a switch-on-port-available: Switch to headset or mic on unknown avail
On some Dell AIO machines, there is no internal mic, only a multi
function audio jack, so the only input devices are headphone-mic and
headset-mic, and they share the Jack with headphone.

When there is no headset plugged in that Jack, the headphone-mic
and headset-mic are off. And since there is no available port under
the analog input source, this source is unlinked (if there is
internal mic, the source will not be unlinked). so the only pa-source
left in the PA is analog-stereo-monitor.

After the headset is plugged, we need to let switch_to_port() handle
headset-mic and headphone-mic conditionally, this will guarantee the
source will be created if it is unlinked before plugging, and then the
input profile could be selected correctly.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/390>
2020-12-22 13:50:01 +00:00
Jaroslav Kysela
b530aa4681 alsa: mixer - add support up 8 mixer channels
We have at least one USB hardware which supports the 8
channels in one mixer element:

  https://github.com/alsa-project/alsa-ucm-conf/pull/25

POSITION_MASK_CHANNELS define was added for the future extensions.

The override_map variable was changed from bool to mask (unsigned int).
The channel map override settings is handled for channels up to eight now.

Also added missing override-map.3 .. override-map.8 to the configuration
parser array.

The driver channel position was added to the override mask arguments
(syntax is driver:pulseaudio like left:all-left). If ommited, the ALSA's
channel positions are guessed by index.

Link: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/292

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/389>
2020-12-21 17:41:37 +00:00
Jaroslav Kysela
e67af95830 alsa: mixer - use safe dB range values when the override mask is unset
Use safe values for the min_dB and max_dB fields when the position mask
is unset to avoid breakage for the upper levels.

If the range is incorrect, the volume range shown in pavucontrol shows
strange values.

(Thanks to Wim Taymans for the idea.)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/389>
2020-12-21 17:41:37 +00:00
David
ee1391860f Capitalize jack in module-jack-sink.c
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/439>
2020-12-20 11:35:30 +00:00
David
e4e507802c Capitalize jack in module-jack-source.c
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/439>
2020-12-20 11:32:02 +00:00
Edward Lee
b892e327a9 win32: Fix meson build system for Windows.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/360>
2020-12-16 11:05:28 -05:00
Edward Lee
7bc559fe26 win32: Change linkage of lt_preloaded_symbols to match definition in libtool in daemon/main.c.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/360>
2020-12-16 11:05:28 -05:00
Edward Lee
3c51930b61 win32: Add support for Unix sockets in autoconf build.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/360>
2020-12-16 11:05:28 -05:00
Edward Lee
4b3cc2df8d win32: (Temporarily) Add sockaddr_un definition from <afunix.h>
This is a temporary addition, until <afunix.h> ships with the
MinGW toolchain.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/360>
2020-12-16 11:05:28 -05:00
Edward Lee
4e5786ffdd win32: Check WSAGetLastError() in pa_is_unix_socket_stale.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/360>
2020-12-16 11:05:28 -05:00
Edward Lee
68cb06b5fd win32: Fix (interim) esound paths in module-protocol-stub.c
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/360>
2020-12-16 11:05:28 -05:00
Edward Lee
9c774c6295 win32: Handle (WSA)EWOULDBLOCK as EAGAIN.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/360>
2020-12-16 11:05:28 -05:00
Sebastian Krzyszkowiak
4552fe15b3 filter-apply: Look for filter parameters also in device properties
Some filters take parameters that effectively describe the hardware
they're being applied to (like echo-cancel allowing to specify the
mic array parameters for better noise filtering). This allows system
integrators to set default parameters for such modules per-device,
which will get used when the stream doesn't specify their own.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/400>
2020-12-14 21:01:16 +00:00
Tanu Kaskinen
c0779b28b8 sink: Increase JACK device priority
The JACK sink and source priority was 0, but I believe the common case
is that when a JACK sink or source is loaded, the user wants to make it
the default device.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/983
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/369>
2020-12-14 20:55:10 +00:00
Igor V. Kovalenko
d285b00a16 build-sys: meson: change oss-output boolean to Meson feature
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/437>
2020-12-14 19:48:06 +00:00
Tanu Kaskinen
e3f2c25fac alsa-mixer: Pick at most one fallback mapping
The old behaviour was such that if none of the normal mappings worked,
we would probe ALL fallbacks. I don't think that makes sense, and it
caused concrete issues: let's say we have a regular stereo mic device,
but there's no "front" PCM defined for it. In this situation we would
probe the stereo-fallback mapping (which uses "hw" instead of "front"),
and it would work, but then we'd also probe the "multichannel-input"
mapping, which would also work, so we end up with two mappings that
don't have any difference in behaviour.

I think it's better to simply pick the first working fallback and ignore
the rest.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/901
(issue is marked as confidential due to unreleased hardware)

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/304>
2020-12-14 19:31:28 +00:00
SimonP
9b0ae8327d alsa-mixer: Respect XDG base directory spec when loading path configs
Try $XDG_DATA_HOME, then $XDG_DATA_DIRS, and finally fall back to old
behaviour (prefix-defined directory).

core-util: Ignore non-absolute XDG base dirs

These are invalid per the spec.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/862
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/293>
2020-12-14 19:25:12 +00:00
Samuel Thibault
cb91d7a12e alsa-sink: increase watermark when there is nothing to rewind
If we do not manage to rewind at all because there is nothing to rewind
any more, it means the latency is too small, and we let audio escape our
control. We should thus increase the watermark to fix this.

Fixes #871

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/287>
2020-12-14 19:18:25 +00:00
Igor V. Kovalenko
d15b31d751 module-alsa-card: handle udev PULSE_MODARGS
Allow adding module arguments using udev PULSE_MODARGS environment variable and
fail module loading if there is a problem with PULSE_MODARGS

This helps setting e.g. 'tsched=0' for specific devices without a need to create
full load module entry in default.pa.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/436>
2020-12-14 15:12:31 +03:00
Hui Wang
19e34d8d5b alsa-mixer: disable the Auto-Mute once the system has speaker
With the Auto-Mute enabled, if the headphone jack is plugged, the
alsa hda driver will mute the speaker and set pinctl of the speaker
to Hi-Z state, after this happens, even the pulseaudio unmute the
speaker, the speaker still couldn't output sound because the pinctl
is in Hi-Z state.

We found this issue on a Dell machine which has multi-function audio
jack, after the headphone is plugged in, the speaker's availability is
still unknown, users could select speaker from gnome-sound-setting,
but even the speaker is selected to be the active device, it couldn't
output sound.

The Auto-Mute is not useful if the pulseaudio is running since pa
could mute/unmute devices according to active port change, the ucm
for sof+hda already disabled the Auto-Mute, let us disable it for
hda audio if the machine has the internal speaker.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/433>
2020-12-10 17:01:19 +00:00
Mattias Jernberg
836ba89c4a alsa-mixer: Enable volume control of SteelSeries Arctis stereo output
Since there is now support for specifying the index of an Element, add the
same config as is used for the output-mono variant, as they behave the same:
One volume control with no support for adjustments to the left and right
channels.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/274>
2020-12-10 16:54:59 +00:00
Tanu Kaskinen
6b04e2a89e sink: Reduce chat sink priority
Some gaming sound cards have custom profiles with analog-game and
analog-chat mappings that exist simultaneously. The game sink should
have higher priority than the chat sink, but currently there's no way to
affect the sink priorities from the profile-set configuration (the
mapping priority is not propagated to the sink priority).

I first thought about adding the mapping priority to the sink priority,
but that could mess up the prioritization system in
pa_device_init_priority(). I ended up checking for the intended roles
property to reduce the chat sink priority. I also reduced the iec958
priority so that the chat and iec958 sinks don't end up with the same
priority.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/818
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/266>
2020-12-10 16:43:17 +00:00
Tanu Kaskinen
3afb7f8c08 pstream: Log "Cannot send block reference..." only once per pstream
Despite the ratelimiting, this error gets logged too much.

I fixed a typo (Fallig -> Falling) while at it.

Related: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/824
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/265>
2020-12-10 16:31:13 +00:00
Patrick McLean
7ec6ee4725 alsa-mixer: add support for Sennheiser GSX 1000 gaming DAC
This same profile should also work for the GSX 1200, but I don't know the USB id
for that.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/257>
2020-12-09 16:51:16 +00:00
Pierre Ossman
a8cb4edf75 tunnel-sink-new: log buffer events
Aids in tracking down exactly where in the chain underruns are
happening.

Signed-off-by: Pierre Ossman <ossman@cendio.se>
2020-12-09 11:54:37 +00:00
Tanu Kaskinen
dc79f304dd build-sys: Add an option for enabling/disabling Valgrind
In OpenEmbedded the PulseAudio recipe currently disables Valgrind
support by passing "ac_cv_header_valgrind_memcheck_h=no" to the
configure script (this was added to make it deterministic whether
Valgrdind support gets enabled or not). I'm converting the PulseAudio
recipe to use Meson, and I needed an option to disable Valgrind.
2020-12-09 11:07:09 +00:00
Tanu Kaskinen
e43ca00d52 module: Check version before loading a module
Since there's no stable API for modules, all modules need to be compiled
together with the server. This version check tries to ensure that if
a version mismatch happens, there will be an informative error message
rather than a random crash.
2020-12-09 10:34:49 +00:00
Frédéric Danis
05f3e8bf9a core, modules: Remove useless EINTR tests
Since commit ad447d1468 (in 2009) pa_read and pa_write take care of
handling EINTR error.
So, pa_read, pa_write, pa_iochannel_read and pa_iochannel_write can not
exit with errno set to EINTR, and testing it is useless.
2020-12-09 10:28:15 +00:00
Ben Buchwald
8342c12339 jackdbus-detect: Passthrough more arguments to sink and source
module-jackdbus-detect now accepts sink_name, sink_properties,
sink_client_name, sink_channel_map, source_name, source_properties,
source_client_name, and source_channel_map arguments that will be passed
through to module-jack-source and module-jack-sink (without the sink and
source prefixes, except where needed).
2020-12-09 08:43:24 +00:00
Jaechul Lee
a17d00c3d2 null-source: Fix max_latency_msec argument is not changed
This module uses 2 seconds for default max latency. If max_latency_msec
is set, max_latency value will be changed.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/431>
2020-12-09 03:17:28 +00:00
Tanu Kaskinen
6bf178d794 i18n: Update pulseaudio.pot
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/432>
2020-12-08 13:52:39 +02:00
Dusan Kazik
bbac2e6e2b Translated using Weblate (Slovak)
Currently translated at 76.0% (400 of 526 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/sk/
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/432>
2020-12-08 13:50:59 +02:00
Sanchayan Maity
ea69288b76 module-match: Allow loading module more than once
As long as modules use different keys, multiple loading of this module
should be safe. Even in case of same keys, either the pa_proplist_update
should correctly update the property list based on the mode or for the
volume writable case, the last rule should win.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/942
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/332>
2020-12-07 21:38:05 +05:30
Laurențiu Nicola
71aa4720a4 alsa-mixer: Add OnePlus Bullets udev rule 2020-12-07 14:06:01 +02:00
Jason Nader
afc1a0e45b man: clarify pactl command arguments 2020-12-07 11:47:56 +00:00
Jaechul Lee
bd8ef73b91 null-source: Add max_latency_msec argument
It takes much time when starting to capture because max latency is set
to 2 seconds as a initial value. null-source latency need to be set a
lower value than initial value to improve latency.
2020-12-07 13:37:53 +02:00
Igor V. Kovalenko
c1ac76014e message-params: consume array enclosing {} by array read methods
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/51>
2020-12-03 14:41:39 +00:00
Igor V. Kovalenko
818a87deb2 message-params: add read length param reference to array read methods
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/51>
2020-12-03 14:41:39 +00:00
Tanu Kaskinen
fe162e0bbd core-util-test: Test pa_atou64() and pa_atoi64()
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/51>
2020-12-03 14:41:39 +00:00