platform/upstream/pulseaudio.git
3 years agooss: support 24-bit sample formats
Greg V [Thu, 2 Apr 2020 16:15:29 +0000 (19:15 +0300)]
oss: support 24-bit sample formats

This works perfectly fine and is required for bitperfect mode on
some soundcards, according to Romain Tartière <romain@FreeBSD.org>

ref: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198567#c6

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agooss: do not fall back to write() mode on FreeBSD
Greg V [Thu, 2 Apr 2020 16:13:58 +0000 (19:13 +0300)]
oss: do not fall back to write() mode on FreeBSD

This has been patched out in FreeBSD Ports for ages.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agodetect: fix/improve FreeBSD support
Greg V [Thu, 2 Apr 2020 15:56:53 +0000 (18:56 +0300)]
detect: fix/improve FreeBSD support

Apply patch from FreeBSD Ports.
Thanks to: Koop Mast <kwm@FreeBSD.org>, lightside <lightside@gmx.com>

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agoutil: implement pa_get_binary_name on FreeBSD without procfs requirement
Greg V [Thu, 2 Apr 2020 15:49:58 +0000 (18:49 +0300)]
util: implement pa_get_binary_name on FreeBSD without procfs requirement

procfs is not mounted by default, sysctl offers a bulletproof way
of requesting this information.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agopulsecore: remove ancient __FreeBSD_version < 600000 code
Greg V [Thu, 2 Apr 2020 15:42:59 +0000 (18:42 +0300)]
pulsecore: remove ancient __FreeBSD_version < 600000 code

None of this is relevant in the modern age

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agoiochannel: support credentials passing on FreeBSD
Greg V [Fri, 3 Apr 2020 16:52:04 +0000 (19:52 +0300)]
iochannel: support credentials passing on FreeBSD

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agobuild-sys: meson: support memfd without SYS_memfd_create (FreeBSD 13)
Greg V [Fri, 3 Apr 2020 16:05:22 +0000 (19:05 +0300)]
build-sys: meson: support memfd without SYS_memfd_create (FreeBSD 13)

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agobuild-sys: meson: add execinfo dependency for FreeBSD
Greg V [Thu, 2 Apr 2020 14:34:32 +0000 (17:34 +0300)]
build-sys: meson: add execinfo dependency for FreeBSD

For 'backtrace' and related symbols

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agoraop: add missing netinet include on FreeBSD
Greg V [Thu, 2 Apr 2020 14:33:17 +0000 (17:33 +0300)]
raop: add missing netinet include on FreeBSD

For 'struct sockaddr_in'

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agopadsp: fix build on FreeBSD (use same ioctl signature as glibc)
Greg V [Thu, 2 Apr 2020 14:32:37 +0000 (17:32 +0300)]
padsp: fix build on FreeBSD (use same ioctl signature as glibc)

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agobuild-sys: meson: add missing pthread dependency on alsa tests
Greg V [Thu, 2 Apr 2020 14:31:41 +0000 (17:31 +0300)]
build-sys: meson: add missing pthread dependency on alsa tests

For symbol 'pthread_setschedparam'

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agobuild-sys: meson: check for shm_open even if it's in libc (FreeBSD), not librt
Greg V [Thu, 2 Apr 2020 14:18:22 +0000 (17:18 +0300)]
build-sys: meson: check for shm_open even if it's in libc (FreeBSD), not librt

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agobuild-sys: meson: when libc iconv is used, tell libiconv header to pretend to be...
Greg V [Fri, 3 Apr 2020 15:51:59 +0000 (18:51 +0300)]
build-sys: meson: when libc iconv is used, tell libiconv header to pretend to be libc's iconv

The libiconv header on FreeBSD would be preferred by include path, but
we don't want to link to libiconv, so tell its header to act like
the system header.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agobuild-sys: meson: set HAVE_DLADDR even if it's in libc (FreeBSD), not libdl
Greg V [Thu, 2 Apr 2020 14:11:20 +0000 (17:11 +0300)]
build-sys: meson: set HAVE_DLADDR even if it's in libc (FreeBSD), not libdl

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

3 years agoalsa-mixer: Accept negative max_dB when using decibel fixes
Tanu Kaskinen [Mon, 18 Jan 2021 15:36:20 +0000 (17:36 +0200)]
alsa-mixer: Accept negative max_dB when using decibel fixes

Sometimes decibel fixes are used as a trick to set a maximum hardware
volume, and in these cases max_dB may be negative yet still valid.
Here's an example:
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/292#note_671300

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/447>

3 years agoalsa-mixer: disable has_dB if max_dB is negative
Benjamin Valentin [Mon, 28 Dec 2020 18:45:08 +0000 (19:45 +0100)]
alsa-mixer: disable has_dB if max_dB is negative

Volume scaling in dB mode is broken if max dB is negative.

I have a Nobsound USB amplifier (1908:2220) that reports a dB range
of -127.07 dB to -128 dB in Alsa.
While this is likely a driver/device bug, in my naive imagination
userspace wouldn't bother too much with the absolute values and just set

out_dB(percent) = min_dB + (max_dB - min_dB) * percent

However, this is not what PulseAudio is doing, instead max_dB is used
as base_volume with which the desired software volume is multiplied
while min_dB does not seem to be taken into account.

The result is that with this device only a tiny portion of the volume
slider is usable.
Setting it to 97% already reaches min_dB which effectively turns any
(software) audio knob to an on/off switch.

To work around this, simply set the has_dB flag to false if max_dB is
negative.
This falls back to using raw Alsa values (ranging from 0 - 255), now
the settings in pavucontrol perfectly mirror those in alsamixer.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/447>

3 years agodaemon: Rely on systemd unit file for X11 plugin initialization
Carlos Garnacho [Wed, 4 Nov 2020 10:16:27 +0000 (11:16 +0100)]
daemon: Rely on systemd unit file for X11 plugin initialization

For GNOME X11 sessions, avoid relying on xdg autostart desktop files
to initialize the X11 plugins. This is now handled via a systemd unit
file.

The xdg autostart is still installed, but has been made to instruct
GNOME to skip it with X-GNOME-HiddenUnderSystemd. This is still the
primary way to initialize X11 plugins for other DEs.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/467>

3 years agodaemon: Install start-pulseadio-x11 as a Xwayland-session.d script
Carlos Garnacho [Wed, 4 Nov 2020 10:11:57 +0000 (11:11 +0100)]
daemon: Install start-pulseadio-x11 as a Xwayland-session.d script

The scripts in this directory are loaded (in GNOME sessions thus far)
at the time of starting Xwayland for X11 clients (may happen on session
start, or on demand whenever X11 clients are started).

This will ensure the relevant X11 modules are loaded as long as there's
a Xwayland instance, thus X11 clients that might make use of them.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/467>

3 years agodaemon: Add "stop" argument to start-pulseaudio-x11 script
Carlos Garnacho [Wed, 4 Nov 2020 10:10:01 +0000 (11:10 +0100)]
daemon: Add "stop" argument to start-pulseaudio-x11 script

As contradicting as it sounds, seems better than changing the script
name. This "stop" argument makes it unload all X11 related modules,
as opposed to the default behavior.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/467>

3 years agoalsa-mixer: add support for SteelSeries Arctis 9
Igor V. Kovalenko [Mon, 11 Jan 2021 18:50:00 +0000 (21:50 +0300)]
alsa-mixer: add support for SteelSeries Arctis 9

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/462>

3 years agoi18n: Remove src/pulsecore/dllmain.c from POTFILES.in
Piotr Drąg [Sat, 16 Jan 2021 12:11:03 +0000 (13:11 +0100)]
i18n: Remove src/pulsecore/dllmain.c from POTFILES.in

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/469>

3 years agoalsa-card: add dynamic priority bonus base for alsa profiles
Hui Wang [Fri, 21 Aug 2020 09:34:25 +0000 (17:34 +0800)]
alsa-card: add dynamic priority bonus base for alsa profiles

After applying the commit 0d50e787 ("alsa-card: improve the profile
availability logic"), we met an new issue. when system selects the
initial profile, the profile off is selected instead of a profile with
a valid output device on it. That is the issue we met:

Profiles:
  HiFi: Default (sinks: 2, sources: 2, priority: 8000, available: no)
  off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
Active Profile: off
Ports:
  [Out] Headphones: Headphones (priority: 300, latency offset: 0 usec, not available)
   Part of profile(s): HiFi
  [Out] Speaker: Speaker (priority: 100, latency offset: 0 usec)
   Part of profile(s): HiFi
...

I know the commit 0d50e787 really fixed something, but we still need
to fix the new issue, to do so, this patch introduces a priority bonus
for alsa profiles and separate the alsa profiles to 3 groups:
group a (will be granted priority bonus dynamically):
a profile has only output ports and at least one port is not unavailable
a profile has only input ports and at least one port is not unavailable
a profile has both input and output ports, and at least one output and
one input ports are not unavailable

group b (will be marked unavailable)
a profile has only output ports and all ports are unavailable
a profile has only input ports and all ports are unavailable
a profile has both output and input ports, and all ports are unavailable

group c
the rest profiles, their priority and availability is not changed.

With this change, the profile HiFi will become avaialbe:yes, and will
not be granted priority bonus if no input port is plugged.

The priority bonus provides a higher priority base to profiles, this
guarantees this patch doesn't break the fix of 0d50e787.

https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/927

Signed-off-by: Hui Wang <hui.wang@canonical.com>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/355>

3 years agoUpdate NEWS
Tanu Kaskinen [Sat, 16 Jan 2021 17:31:30 +0000 (19:31 +0200)]
Update NEWS

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/471>

3 years agoUpdate NEWS
Arun Raghavan [Wed, 13 Jan 2021 02:43:40 +0000 (21:43 -0500)]
Update NEWS

Add notes for 14.1.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/471>

3 years agoswitch-on-port-available: Pass correct port_pointers to switch_to_port()
Tanu Kaskinen [Fri, 15 Jan 2021 16:16:59 +0000 (18:16 +0200)]
switch-on-port-available: Pass correct port_pointers to switch_to_port()

The pp variable contains information for the port that became
unavailable, but switch_to_port() needs the information for the port
that we're switching to.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1096
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/468>

3 years agowin32: Fix privlibdir for running on Windows
Patrick Gaskin [Sun, 3 Jan 2021 09:07:11 +0000 (04:07 -0500)]
win32: Fix privlibdir for running on Windows

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/458>

3 years agowin32: Fix format specifiers for DWORD values
Patrick Gaskin [Sun, 3 Jan 2021 09:07:09 +0000 (04:07 -0500)]
win32: Fix format specifiers for DWORD values

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/458>

3 years agowin32: Use __MINGW_PRINTF_FORMAT instead of __printf__ for MinGW builds
Patrick Gaskin [Sun, 3 Jan 2021 09:07:07 +0000 (04:07 -0500)]
win32: Use __MINGW_PRINTF_FORMAT instead of __printf__ for MinGW builds

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/458>

3 years agowin32: Fix duplicate definitions in arpa-inet.h, arpa-inet.c, and poll.h
Patrick Gaskin [Sun, 3 Jan 2021 09:07:05 +0000 (04:07 -0500)]
win32: Fix duplicate definitions in arpa-inet.h, arpa-inet.c, and poll.h

When _WIN32_WINNT >= 0x6000 (Vista), ws2tcpip.h provides inet_ntop and
inet_pton, and winsock2.h provides the equivalent of poll.h.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/458>

3 years agowin32: Fix WSAStartup issues
Patrick Gaskin [Sun, 3 Jan 2021 09:01:40 +0000 (04:01 -0500)]
win32: Fix WSAStartup issues

WSAStartup was not being called for pacat and pactl built with meson,
causing them to fail in pa_mainloop_new with "cannot create wakeup
pipe". This issue also affects other applications linking to libpulse
other than the pulseaudio daemon, which calls WSAStartup itself.

When built with autotools, WSAStartup would have been called in
DllMain, which is recommended against by the documentation [1].

To fix these issues, the WSAStartup/WSACleanup calls can be moved
into pa_mainloop_new/pa_mainloop_free.

[1] https://docs.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-wsastartup

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/456>

3 years agoclient: Make auto_connect_localhost respect HAVE_IPv6 and OS_IS_WIN32
Patrick Gaskin [Sun, 3 Jan 2021 08:41:36 +0000 (03:41 -0500)]
client: Make auto_connect_localhost respect HAVE_IPv6 and OS_IS_WIN32

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/455>

3 years agowaveout: Fix compile warnings
Patrick Gaskin [Sun, 3 Jan 2021 09:04:52 +0000 (04:04 -0500)]
waveout: Fix compile warnings

* Include pulse/util.h for pa_thread_make_realtime.
* Explicitly cast HWAVEOUT to UINT_PTR for waveOutGetDevCaps.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/457>

3 years agoUpdate NEWS
Arun Raghavan [Wed, 13 Jan 2021 02:36:01 +0000 (21:36 -0500)]
Update NEWS

Missed this in the 14.0 release.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/465>

3 years agoi18n: Update pulseaudio.pot
Tanu Kaskinen [Mon, 11 Jan 2021 19:25:08 +0000 (21:25 +0200)]
i18n: Update pulseaudio.pot

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/463>

3 years agoTranslated using Weblate (German)
Tobias Weise [Fri, 8 Jan 2021 10:47:09 +0000 (10:47 +0000)]
Translated using Weblate (German)

Currently translated at 100.0% (526 of 526 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/de/
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/463>

3 years agoTranslated using Weblate (Finnish)
Jan Kuparinen [Sun, 3 Jan 2021 18:04:52 +0000 (18:04 +0000)]
Translated using Weblate (Finnish)

Currently translated at 94.9% (471 of 496 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/fi/
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/463>

3 years agoTranslated using Weblate (French)
Julien Humbert [Sat, 12 Dec 2020 07:00:58 +0000 (07:00 +0000)]
Translated using Weblate (French)

Currently translated at 100.0% (517 of 517 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/fr/
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/463>

3 years agoTranslated using Weblate (German)
Fabian Affolter [Sat, 12 Dec 2020 16:44:16 +0000 (16:44 +0000)]
Translated using Weblate (German)

Currently translated at 100.0% (526 of 526 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/de/
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/463>

3 years agocli: Fix crash when using .include with an empty directory
Patrick Gaskin [Sun, 3 Jan 2021 08:29:35 +0000 (03:29 -0500)]
cli: Fix crash when using .include with an empty directory

This would previously fail the size > 0 assertion in pa_xmalloc.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/454>

3 years agodatabase: clean up remaining references to CANONICAL_HOST
Igor V. Kovalenko [Mon, 21 Dec 2020 16:55:00 +0000 (19:55 +0300)]
database: clean up remaining references to CANONICAL_HOST

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/425>

3 years agodatabase: pick old database file from any arch
Igor V. Kovalenko [Mon, 21 Dec 2020 16:27:53 +0000 (19:27 +0300)]
database: pick old database file from any arch

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/425>

3 years agodatabase: drop arch from newly created database file name
Igor V. Kovalenko [Sun, 20 Dec 2020 18:36:21 +0000 (21:36 +0300)]
database: drop arch from newly created database file name

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/425>

3 years agodatabase: use existing database matching same architecture prefix
Igor V. Kovalenko [Sun, 29 Nov 2020 12:16:26 +0000 (15:16 +0300)]
database: use existing database matching same architecture prefix

State database binary file format may depend on system architecture,
for instance gdbm binary format depends on architecture word size,
making x86 and x64 gdbm files incompatible.

If this is the case, it is handled by adding system architecture name to
database file name using automatically configured CANONICAL_HOST string.
Meson build define CANONICAL_HOST to be system architecture name, while
autotools build extends this with vendor and and operating system components.

Switch autotools build to use host_cpu for CANONICAL_HOST to match Meson
configuration. For backwards compatibility always use existing database file
matching CANONICAL_HOST prefix if it exists.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/425>

3 years agodatabase: extract common method to handle machine id and architecture
Igor V. Kovalenko [Sun, 29 Nov 2020 08:21:29 +0000 (11:21 +0300)]
database: extract common method to handle machine id and architecture

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/425>

3 years agoloopback: Fix sink latency calculation if source is alsa source with fixed latency
Georg Chini [Mon, 4 Jan 2021 20:08:05 +0000 (21:08 +0100)]
loopback: Fix sink latency calculation if source is alsa source with fixed latency

When an alsa source with fixed latency is used, the actual latency of the source
will only be one fragment size. This is not taken into account when the required
sink latency is calculated.

This patch fixes the issue.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/451>

3 years agodaemon: fix default daemon.conf when running from build tree
Igor V. Kovalenko [Sun, 27 Dec 2020 09:40:18 +0000 (12:40 +0300)]
daemon: fix default daemon.conf when running from build tree

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/446>

3 years agox11: gracefully handle ICE connection error
Igor V. Kovalenko [Wed, 23 Dec 2020 07:31:18 +0000 (10:31 +0300)]
x11: gracefully handle ICE connection error

Implementation is largely inspired by GNOME/mutter ICE session handling.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/441>

3 years agox11: gracefully handle X11 connection error
Igor V. Kovalenko [Tue, 22 Dec 2020 17:54:40 +0000 (20:54 +0300)]
x11: gracefully handle X11 connection error

Perform X11 connection recovery via XSetIOErrorExitHandler mechanism.

Implementation is largely inspired by this change to GNOME/mutter
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1447

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/441>

3 years agodoc: Add some contributor guidelines
Arun Raghavan [Fri, 25 Dec 2020 16:10:30 +0000 (11:10 -0500)]
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>

3 years agoladspa-sink: do not call pa_sink_suspend if PA_SINK_IS_LINKED is false
Igor V. Kovalenko [Sun, 27 Dec 2020 12:25:40 +0000 (15:25 +0300)]
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>

3 years agomessage-params: Fix array reading functions
Georg Chini [Fri, 1 Jan 2021 20:35:41 +0000 (21:35 +0100)]
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>

3 years agoalsa-mixer: Add support for the Headphone,1 element
Tanu Kaskinen [Sat, 26 Dec 2020 20:29:06 +0000 (22:29 +0200)]
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>

3 years agoalsa-mixer: Move HP EliteDesk 800 SFF/DM second headphone output to path analog-outpu...
Tanu Kaskinen [Sat, 26 Dec 2020 20:22:06 +0000 (22:22 +0200)]
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>

3 years agoalsa-mixer: Use unambiguous descriptions with dual headphone outputs
Tanu Kaskinen [Sat, 26 Dec 2020 20:15:20 +0000 (22:15 +0200)]
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>

3 years agoalsa-mixer: Support dual Front Headphone Jack
Kai-Heng Feng [Wed, 25 Mar 2020 10:08:56 +0000 (18:08 +0800)]
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>

3 years agoalsa-mixer: Handle the index for ALSA mixer jack identifiers
Kai-Heng Feng [Tue, 22 Dec 2020 05:39:05 +0000 (13:39 +0800)]
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>

3 years agocontext: add property to forcefully disable shared memory channels
Igor V. Kovalenko [Mon, 28 Dec 2020 21:03:41 +0000 (00:03 +0300)]
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>

3 years agobluetooth: align max renderable block size to frame size
Igor V. Kovalenko [Tue, 29 Dec 2020 21:00:50 +0000 (00:00 +0300)]
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>

3 years agobluetooth: correct possible segmentation fault
morrishoresh [Thu, 24 Dec 2020 21:58:54 +0000 (23:58 +0200)]
bluetooth: correct possible segmentation fault

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/443>

3 years agoswitch-on-port-available: Switch to headset or mic on unknown avail
Hui Wang [Mon, 23 Nov 2020 03:25:51 +0000 (11:25 +0800)]
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>

3 years agoalsa: mixer - add support up 8 mixer channels
Jaroslav Kysela [Wed, 14 Oct 2020 20:20:37 +0000 (22:20 +0200)]
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>

3 years agoalsa: mixer - use safe dB range values when the override mask is unset
Jaroslav Kysela [Sat, 24 Oct 2020 16:20:59 +0000 (18:20 +0200)]
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>

3 years agoCapitalize jack in module-jack-sink.c
David [Sun, 20 Dec 2020 11:35:30 +0000 (11:35 +0000)]
Capitalize jack in module-jack-sink.c

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/439>

3 years agoCapitalize jack in module-jack-source.c
David [Sun, 20 Dec 2020 11:32:02 +0000 (11:32 +0000)]
Capitalize jack in module-jack-source.c

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/439>

3 years agowin32: Fix meson build system for Windows.
Edward Lee [Thu, 1 Oct 2020 14:24:40 +0000 (10:24 -0400)]
win32: Fix meson build system for Windows.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/360>

3 years agowin32: Change linkage of lt_preloaded_symbols to match definition in libtool in daemo...
Edward Lee [Thu, 1 Oct 2020 14:22:20 +0000 (10:22 -0400)]
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>

3 years agowin32: Add support for Unix sockets in autoconf build.
Edward Lee [Thu, 1 Oct 2020 14:14:08 +0000 (10:14 -0400)]
win32: Add support for Unix sockets in autoconf build.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/360>

3 years agowin32: (Temporarily) Add sockaddr_un definition from <afunix.h>
Edward Lee [Thu, 1 Oct 2020 14:11:09 +0000 (10:11 -0400)]
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>

3 years agowin32: Check WSAGetLastError() in pa_is_unix_socket_stale.
Edward Lee [Thu, 1 Oct 2020 14:10:19 +0000 (10:10 -0400)]
win32: Check WSAGetLastError() in pa_is_unix_socket_stale.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/360>

3 years agowin32: Fix (interim) esound paths in module-protocol-stub.c
Edward Lee [Thu, 1 Oct 2020 13:56:45 +0000 (09:56 -0400)]
win32: Fix (interim) esound paths in module-protocol-stub.c

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/360>

3 years agowin32: Handle (WSA)EWOULDBLOCK as EAGAIN.
Edward Lee [Thu, 1 Oct 2020 13:39:54 +0000 (09:39 -0400)]
win32: Handle (WSA)EWOULDBLOCK as EAGAIN.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/360>

3 years agofilter-apply: Look for filter parameters also in device properties
Sebastian Krzyszkowiak [Thu, 29 Oct 2020 01:11:22 +0000 (02:11 +0100)]
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>

3 years agosink: Increase JACK device priority
Tanu Kaskinen [Thu, 17 Sep 2020 14:36:37 +0000 (17:36 +0300)]
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>

3 years agobuild-sys: meson: change oss-output boolean to Meson feature
Igor V. Kovalenko [Mon, 14 Dec 2020 05:48:11 +0000 (08:48 +0300)]
build-sys: meson: change oss-output boolean to Meson feature

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/437>

3 years agoalsa-mixer: Pick at most one fallback mapping
Tanu Kaskinen [Sat, 6 Jun 2020 14:00:01 +0000 (17:00 +0300)]
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>

3 years agoalsa-mixer: Respect XDG base directory spec when loading path configs
SimonP [Thu, 7 May 2020 15:13:27 +0000 (16:13 +0100)]
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>

3 years agoalsa-sink: increase watermark when there is nothing to rewind
Samuel Thibault [Sun, 26 Apr 2020 17:55:08 +0000 (19:55 +0200)]
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>

3 years agomodule-alsa-card: handle udev PULSE_MODARGS
Igor V. Kovalenko [Sun, 13 Dec 2020 10:09:19 +0000 (13:09 +0300)]
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>

3 years agoalsa-mixer: disable the Auto-Mute once the system has speaker
Hui Wang [Thu, 10 Dec 2020 07:36:40 +0000 (15:36 +0800)]
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>

3 years agoalsa-mixer: Enable volume control of SteelSeries Arctis stereo output
Mattias Jernberg [Thu, 26 Mar 2020 18:53:08 +0000 (19:53 +0100)]
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>

3 years agosink: Reduce chat sink priority
Tanu Kaskinen [Sat, 14 Mar 2020 08:42:44 +0000 (10:42 +0200)]
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>

3 years agopstream: Log "Cannot send block reference..." only once per pstream
Tanu Kaskinen [Sat, 14 Mar 2020 06:22:44 +0000 (08:22 +0200)]
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>

3 years agoalsa-mixer: add support for Sennheiser GSX 1000 gaming DAC
Patrick McLean [Wed, 26 Feb 2020 08:26:12 +0000 (00:26 -0800)]
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>

3 years agotunnel-sink-new: log buffer events
Pierre Ossman [Tue, 7 Jul 2015 11:01:22 +0000 (13:01 +0200)]
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>
3 years agobuild-sys: Add an option for enabling/disabling Valgrind
Tanu Kaskinen [Fri, 14 Feb 2020 05:29:33 +0000 (07:29 +0200)]
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.

3 years agomodule: Check version before loading a module
Tanu Kaskinen [Tue, 11 Feb 2020 07:40:49 +0000 (09:40 +0200)]
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.

3 years agocore, modules: Remove useless EINTR tests
Frédéric Danis [Tue, 28 May 2019 14:49:19 +0000 (16:49 +0200)]
core, modules: Remove useless EINTR tests

Since commit ad447d14682 (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.

3 years agojackdbus-detect: Passthrough more arguments to sink and source
Ben Buchwald [Mon, 6 Jan 2020 23:03:42 +0000 (18:03 -0500)]
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).

3 years agonull-source: Fix max_latency_msec argument is not changed
Jaechul Lee [Tue, 8 Dec 2020 02:20:14 +0000 (11:20 +0900)]
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>

3 years agoi18n: Update pulseaudio.pot
Tanu Kaskinen [Tue, 8 Dec 2020 11:52:39 +0000 (13:52 +0200)]
i18n: Update pulseaudio.pot

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/432>

3 years agoTranslated using Weblate (Slovak)
Dusan Kazik [Tue, 24 Nov 2020 08:32:06 +0000 (08:32 +0000)]
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>

3 years agomodule-match: Allow loading module more than once
Sanchayan Maity [Thu, 23 Jul 2020 15:03:36 +0000 (20:33 +0530)]
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>

3 years agoalsa-mixer: Add OnePlus Bullets udev rule
Laurențiu Nicola [Tue, 24 Nov 2020 16:57:41 +0000 (18:57 +0200)]
alsa-mixer: Add OnePlus Bullets udev rule

3 years agoman: clarify pactl command arguments
Jason Nader [Mon, 7 Dec 2020 10:56:39 +0000 (19:56 +0900)]
man: clarify pactl command arguments

3 years agonull-source: Add max_latency_msec argument
Jaechul Lee [Mon, 16 Nov 2020 01:14:56 +0000 (10:14 +0900)]
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.

3 years agomessage-params: consume array enclosing {} by array read methods
Igor V. Kovalenko [Mon, 30 Nov 2020 19:25:16 +0000 (22:25 +0300)]
message-params: consume array enclosing {} by array read methods

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/51>

3 years agomessage-params: add read length param reference to array read methods
Igor V. Kovalenko [Mon, 30 Nov 2020 19:39:23 +0000 (22:39 +0300)]
message-params: add read length param reference to array read methods

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/51>

3 years agocore-util-test: Test pa_atou64() and pa_atoi64()
Tanu Kaskinen [Thu, 23 Jul 2020 07:01:49 +0000 (10:01 +0300)]
core-util-test: Test pa_atou64() and pa_atoi64()

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/51>

3 years agocore-util-test: Drop "modargs" from test function names
Tanu Kaskinen [Thu, 23 Jul 2020 06:49:12 +0000 (09:49 +0300)]
core-util-test: Drop "modargs" from test function names

These tests aren't directly related to modargs. I suppose these were
first written for the modargs.h API and renaming was forgotten.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/51>

3 years agocore-util-test: Test parsing integer strings with leading zeros
Tanu Kaskinen [Thu, 23 Jul 2020 06:39:25 +0000 (09:39 +0300)]
core-util-test: Test parsing integer strings with leading zeros

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/51>