Commit graph

9603 commits

Author SHA1 Message Date
Greg V
72792db74c module-devd-detect: new module for soundcard hotplug on FreeBSD
Used in addition to module-detect, since devd only provides hotplug events.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>
2021-01-18 16:33:53 +00:00
Greg V
0f70a6f519 oss: parse device names correctly on FreeBSD
This fixes devices being named just "/dev/dspN" instead of actual
soundcard names.

Also synchronizes some things like the unsigned type with the
detect module.

Loosely based on patch by lightside <lightside@gmx.com>.

ref: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245156

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>
2021-01-18 16:33:53 +00:00
Greg V
ef8fa7c997 oss: support hot-unplug on FreeBSD
Patch by Hans Petter Selasky <hselasky@FreeBSD.org>

ref: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194727#c27

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>
2021-01-18 16:33:53 +00:00
Greg V
a9d1afbefd 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>
2021-01-18 16:33:53 +00:00
Greg V
de2093fcc7 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>
2021-01-18 16:33:53 +00:00
Greg V
eccffaba26 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>
2021-01-18 16:33:53 +00:00
Greg V
f57ceec7a2 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>
2021-01-18 16:33:53 +00:00
Greg V
e6560becf1 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>
2021-01-18 16:33:53 +00:00
Greg V
2a06309edd iochannel: support credentials passing on FreeBSD
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>
2021-01-18 16:33:53 +00:00
Greg V
e7465e1a9b build-sys: meson: support memfd without SYS_memfd_create (FreeBSD 13)
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>
2021-01-18 16:33:53 +00:00
Greg V
51fecacd46 build-sys: meson: add execinfo dependency for FreeBSD
For 'backtrace' and related symbols

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>
2021-01-18 16:33:53 +00:00
Greg V
207c4cabde raop: add missing netinet include on FreeBSD
For 'struct sockaddr_in'

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>
2021-01-18 16:33:53 +00:00
Greg V
e94c81aef6 padsp: fix build on FreeBSD (use same ioctl signature as glibc)
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>
2021-01-18 16:33:53 +00:00
Greg V
3e6ba5b000 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>
2021-01-18 16:33:53 +00:00
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