Commit graph

9589 commits

Author SHA1 Message Date
Greg V
6cc1f1d91c 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>
2021-01-18 16:33:53 +00:00
Greg V
4ff664a3eb 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>
2021-01-18 16:33:52 +00:00
Greg V
42a9254891 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>
2021-01-18 16:33:52 +00:00
Tanu Kaskinen
ac7f2d96c7 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>
2021-01-18 17:40:28 +02:00
Benjamin Valentin
10ac01a206 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>
2021-01-18 17:36:12 +02:00
Carlos Garnacho
4868fcf5f3 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>
2021-01-18 15:20:19 +00:00
Carlos Garnacho
a155cf8ca5 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>
2021-01-18 15:20:19 +00:00
Carlos Garnacho
877889da60 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>
2021-01-18 15:20:19 +00:00
Igor V. Kovalenko
4f821adb55 alsa-mixer: add support for SteelSeries Arctis 9
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/462>
2021-01-18 15:07:50 +00:00
Piotr Drąg
e5988f35ca i18n: Remove src/pulsecore/dllmain.c from POTFILES.in
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/469>
2021-01-17 12:47:01 +00:00
Hui Wang
ab6a714cd1 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>
2021-01-17 12:28:51 +00:00
Tanu Kaskinen
9c5864c8d5 Update NEWS
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/471>
2021-01-16 20:18:58 +02:00
Arun Raghavan
c8655ac1fd Update NEWS
Add notes for 14.1.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/471>
2021-01-16 20:18:50 +02:00
Tanu Kaskinen
38eb74f66d 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>
2021-01-15 18:19:49 +02:00
Patrick Gaskin
613b3ebc2c win32: Fix privlibdir for running on Windows
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/458>
2021-01-13 03:42:24 +00:00
Patrick Gaskin
dd87e9f229 win32: Fix format specifiers for DWORD values
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/458>
2021-01-13 03:42:24 +00:00
Patrick Gaskin
7ac0d90615 win32: Use __MINGW_PRINTF_FORMAT instead of __printf__ for MinGW builds
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/458>
2021-01-13 03:42:24 +00:00
Patrick Gaskin
fc002e4dc6 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>
2021-01-13 03:42:24 +00:00
Patrick Gaskin
0edcf725bc 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>
2021-01-13 03:16:06 +00:00
Patrick Gaskin
fa0d30eee1 client: Make auto_connect_localhost respect HAVE_IPv6 and OS_IS_WIN32
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/455>
2021-01-13 03:10:02 +00:00
Patrick Gaskin
eb1297f124 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>
2021-01-13 03:03:58 +00:00
Arun Raghavan
7fc021f5d0 Update NEWS
Missed this in the 14.0 release.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/465>
2021-01-12 21:36:25 -05:00
Tanu Kaskinen
cded972022 i18n: Update pulseaudio.pot
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/463>
2021-01-11 21:25:08 +02:00
Tobias Weise
7797a603e6 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>
2021-01-11 21:19:27 +02:00
Jan Kuparinen
0a3f4d36d6 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>
2021-01-11 21:19:27 +02:00
Julien Humbert
f1589c08e5 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>
2021-01-11 21:19:27 +02:00
Fabian Affolter
5d42d861e3 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>
2021-01-11 21:19:27 +02:00
Patrick Gaskin
b1bdd27a6c 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>
2021-01-08 00:03:52 +00:00
Igor V. Kovalenko
c2ae56a73c database: clean up remaining references to CANONICAL_HOST
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/425>
2021-01-07 23:27:16 +00:00
Igor V. Kovalenko
7115023c51 database: pick old database file from any arch
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/425>
2021-01-07 23:27:16 +00:00
Igor V. Kovalenko
4ca8997aa0 database: drop arch from newly created database file name
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/425>
2021-01-07 23:27:16 +00:00
Igor V. Kovalenko
ae9d0cf307 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>
2021-01-07 23:27:16 +00:00
Igor V. Kovalenko
0ac6b16787 database: extract common method to handle machine id and architecture
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/425>
2021-01-07 23:27:16 +00:00
Georg Chini
0efae0488c 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>
2021-01-04 20:16:52 +00:00
Igor V. Kovalenko
f18f55bb5e daemon: fix default daemon.conf when running from build tree
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/446>
2021-01-04 16:11:04 +00:00
Igor V. Kovalenko
6bfd9c809e 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>
2021-01-04 15:59:22 +00:00
Igor V. Kovalenko
b6396dbe9c 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>
2021-01-04 15:59:22 +00:00
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