Commit graph

9489 commits

Author SHA1 Message Date
Georg Chini
4cdc0053c0 protocol-native: add message sending capability
This patch adds the PA_COMMAND_SEND_OBJECT_MESSAGE command to protocol-native
so that clients can use the messaging feature introduced in the previous patch.

Sending messages can in effect replace the extension system for modules. The
approach is more flexible than the extension interface because a generic string
format is used to exchange information. Furthermore the messaging system can be
used for any object, not only for modules, and is easier to implement than
extensions.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/51>
2020-12-03 14:41:39 +00:00
Igor V. Kovalenko
cb3d12377c build-sys: meson: use target_machine.cpu_family() for CANONICAL_HOST
target_machine provides information about the machine on which the compiled
binary's output will run.

cpu_family() returns CPU family name (such as x86_64, not more specific amd64)

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/426>
2020-11-30 13:40:04 +03:00
Igor V. Kovalenko
ecd597995a build-sys: meson: add oss-output option for OSS output support
Restore an option to disable OSS output available with autotools.
2020-11-28 00:34:49 +03:00
Jaechul Lee
1e7adb4fdb null-sink: Change block size to 50 msec when norewinds is set
playing sound through null sink takes almost 2 seconds at first time
playback when norewinds is set. Because block_usec is set 2 seconds at
initializing time. The value will be changed 50 msec after calling
update_request_latency callback.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/406>
2020-11-27 17:15:02 +00:00
Igor V. Kovalenko
0fc54f9e7a pa-info: look for alsa-info.sh in /usr/sbin as well
At least Gentoo and OpenSUSE install alsa-info.sh in /usr/sbin, look there too.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/422>
2020-11-26 17:28:46 +03:00
Laurent Bigonville
b8c656b664 tests: Fix incompatible pointer type on Debian kfreebsd
Debian kfreebsd uses the GNU libc that uses cpu_set_t instead of cpuset_t

Also do not include unnecessary headers on this platform

Fixes: #851
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/356>
2020-11-25 14:54:49 +00:00
Christopher Snowhill
00bd8e1ef8 virtual-surround-sink: Use FFTW3 instead of naive approach
This replaces the original virtual surround sink with a total
rewrite, aiming to implement any number of hrir use cases,
including asymmetrical impulses as two separate left and right
output files. It uses FFTW3 FFT convolution, using the overlap-
save method, with full rewind support. It operates in steps
equal to the resampled length of the hrir, and overlaps input
blocks in increments equal to the size of the FFT block. If
using paired hrirs, it requires matched sample spec and sample
rates and channel maps. For best results, the input files should
have speaker maps, rather than expecting the sample loader to
auto detect the mapping.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/240>
2020-11-24 03:56:02 +00:00
Arun Raghavan
5f3717f39c mutex-posix: Fix error assignment for unlock() check
This comment was missed in 757eb26448.
2020-11-23 22:45:42 +00:00
Tanu Kaskinen
a73ec2a3f4 alsa-mixer: Expand comments in the HP Thunderbolt Dock configuration 2020-11-23 17:35:03 -05:00
Kai-Heng Feng
05c373d939 alsa-mixer: Add support for HP Thunderbolt Dock
The HP Thunderbolt Dock [1] has two separate USB cards, a headset jack
and an optional module which is a speakerphone.

This patch adds new description for them, and mark the intended-roles as
phone for the speakerphone module.

[1] https://store.hp.com/us/en/pdp/hp-thunderbolt-dock-120w-g2-with-audio
2020-11-23 17:35:01 -05:00
Nazar Mokrynskyi
69ba5a2b58 alsa-mixer: add mono input support for Behringer UMC22 2020-11-23 22:27:36 +00:00
Sanchayan Maity
45abd0b43c Add default.pa.d folder support
The .include meta command already supports specifying a directory and
when including a directory, all files with the extension '.pa' in that
directory will be parsed in alphabetical order.

This feature can be used to add support for default.pa.d directory, so
that packages for other applications or users can just drop in a file
for configuration without changing the default.pa which is shipped.

We use the PA_DEFAULT_CONFIG_DIR for this, however, since meson quotes
this build variable, introduce an unquoted version for this purpose and
use it with .include.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/909

Signed-off-by: Sanchayan Maity <sanchayan@asymptotic.io>
2020-11-23 22:07:36 +00:00
Tanu Kaskinen
a28f2e7293 alsa-mixer: Add support for the Center/LFE element
We already supported the CLFE element, which should be semantically
equivalent, so I just copied all the CLFE element definitions.

The Center/LFE element is seen on Creative X-Fi with 20K1 chipset cards.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/978
2020-11-23 21:44:00 +00:00
Tanu Kaskinen
d5d0803591 main: set LC_NUMERIC to C
The webrtc backend of module-echo-cancel uses sscanf() to parse floating
point numbers from module arguments, which didn't work when the locale
used a comma for the decimal point. Setting the LC_NUMERIC locale
variable to C makes the pulseaudio process use a period as the decimal
point regardless of the user's locale configuration.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/89
2020-11-23 21:37:57 +00:00
Tanu Kaskinen
757eb26448 mutex-posix: Log pthread_mutex_unlock() error
This call has been seen failing on FreeBSD, and it's difficult to debug
without seeing which error the function returned.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/988
2020-11-23 21:25:23 +00:00
Tanu Kaskinen
093dd2f181 raop-sink: Don't set device.intended_roles=music
If there are RAOP devices in the network, it doesn't necessarily mean
that the user wants to play music to them.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/993
2020-11-23 19:11:31 +00:00
Arun Raghavan
9055f5baf3 stream-restore,device-restore: Avoid unaligned access
Newer GCC warns us that the channel_map and volume in legacy entries are
accessed via pointers, and these might be unaligned as the legacy entry
is a packed structure. For this reason, we read out those values into
local variables before accessing them as pointers.

The warnings are:

[146/433] Compiling C object src/modules/module-device-restore.so.p/module-device-restore.c.o
../src/modules/module-device-restore.c: In function ‘legacy_entry_read’:
../src/modules/module-device-restore.c:554:51: warning: taking address of packed member of ‘struct legacy_entry’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  554 |     if (le->volume_valid && !pa_channel_map_valid(&le->channel_map)) {
      |                                                   ^~~~~~~~~~~~~~~~
../src/modules/module-device-restore.c:559:48: warning: taking address of packed member of ‘struct legacy_entry’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  559 |     if (le->volume_valid && (!pa_cvolume_valid(&le->volume) || !pa_cvolume_compatible_with_channel_map(&le->volume, &le->channel_map))) {
      |                                                ^~~~~~~~~~~
../src/modules/module-device-restore.c:559:104: warning: taking address of packed member of ‘struct legacy_entry’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  559 |     if (le->volume_valid && (!pa_cvolume_valid(&le->volume) || !pa_cvolume_compatible_with_channel_map(&le->volume, &le->channel_map))) {
      |                                                                                                        ^~~~~~~~~~~
../src/modules/module-device-restore.c:559:117: warning: taking address of packed member of ‘struct legacy_entry’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  559 |     if (le->volume_valid && (!pa_cvolume_valid(&le->volume) || !pa_cvolume_compatible_with_channel_map(&le->volume, &le->channel_map))) {
      |                                                                                                                     ^~~~~~~~~~~~~~~~
[211/433] Compiling C object src/modules/module-stream-restore.so.p/module-stream-restore.c.o
../src/modules/module-stream-restore.c: In function ‘legacy_entry_read’:
../src/modules/module-stream-restore.c:1076:51: warning: taking address of packed member of ‘struct legacy_entry’ may result in an unaligned pointer value [-Waddress-of-packed-member]
 1076 |     if (le->volume_valid && !pa_channel_map_valid(&le->channel_map)) {
      |                                                   ^~~~~~~~~~~~~~~~
../src/modules/module-stream-restore.c:1081:48: warning: taking address of packed member of ‘struct legacy_entry’ may result in an unaligned pointer value [-Waddress-of-packed-member]
 1081 |     if (le->volume_valid && (!pa_cvolume_valid(&le->volume) || !pa_cvolume_compatible_with_channel_map(&le->volume, &le->channel_map))) {
      |                                                ^~~~~~~~~~~
../src/modules/module-stream-restore.c:1081:104: warning: taking address of packed member of ‘struct legacy_entry’ may result in an unaligned pointer value [-Waddress-of-packed-member]
 1081 |     if (le->volume_valid && (!pa_cvolume_valid(&le->volume) || !pa_cvolume_compatible_with_channel_map(&le->volume, &le->channel_map))) {
      |                                                                                                        ^~~~~~~~~~~
../src/modules/module-stream-restore.c:1081:117: warning: taking address of packed member of ‘struct legacy_entry’ may result in an unaligned pointer value [-Waddress-of-packed-member]
 1081 |     if (le->volume_valid && (!pa_cvolume_valid(&le->volume) || !pa_cvolume_compatible_with_channel_map(&le->volume, &le->channel_map))) {
      |
2020-11-23 19:02:33 +00:00
Arun Raghavan
c442227c6b glib-mainloop: Drop deprecated g_get_current_time() usage
This uses the year 2038-safe g_get_real_time() as recommended instead.
Bumps GLib dependency to 2.28 as a result.
2020-11-23 19:02:33 +00:00
Arun Raghavan
b546beef21 proplist-util: Drop deprecated G_CONST_RETURN macro
The preference in glib is now to just use the const qualifier directly.
2020-11-23 19:02:33 +00:00
Arun Raghavan
d1e0594e93 build-sys: Bump libpulse soversion
This is because we reverted the previous API breaking change to the
meaning of the pa_mainloop_prepare() timeout argument.
2020-11-23 13:24:03 -05:00
Arun Raghavan
e6b3edd3c1 Revert "mainloop: fix timeout assignment in pa_mainloop_prepare"
This reverts commit 6b1719d0ed, as it
inadvertently broke the semantics of timeout in the API.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1039
2020-11-23 18:05:27 +00:00
Tanu Kaskinen
2ea425d194 build-sys: Disable GStreamer by default with Autotools
With Meson GStreamer is already disabled by default, let's match that
with Autotools.
2020-11-23 19:12:27 +02:00
Pali Rohár
e99e862a3d alsa: Fix compile warnings
modules/alsa/alsa-sink.c: In function ‘pa_alsa_sink_new’:
modules/alsa/alsa-sink.c:2603:15: warning: declaration of ‘state’ shadows a previous local [-Wshadow]
         void *state;
               ^~~~~
modules/alsa/alsa-sink.c:2270:11: note: shadowed declaration is here
     void *state = NULL;
           ^~~~~
  CC       modules/alsa/module_alsa_sink_la-module-alsa-sink.lo
modules/alsa/alsa-source.c: In function ‘pa_alsa_source_new’:
modules/alsa/alsa-source.c:2289:15: warning: declaration of ‘state’ shadows a previous local [-Wshadow]
         void *state;
               ^~~~~
modules/alsa/alsa-source.c:1975:11: note: shadowed declaration is here
     void *state = NULL;
           ^~~~~
modules/alsa/module-alsa-card.c: In function ‘prune_singleton_availability_groups’:
modules/alsa/module-alsa-card.c:691:71: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
             pa_hashmap_put(group_counts, p->availability_group, count + 1);
                                                                       ^
2020-11-23 16:06:03 +00:00
Tanu Kaskinen
eaa6d5d6c1 switch-on-port-available: Fix switching away from unplugged headphones
Commits 323195e305 ("switch-on-port-available: Switch to headphones on
unknown availability") and d83ad6990e ("module-alsa-card: Drop
availability groups with only one port") broke switching from headphones
to speakers when headphones are unplugged. switch_from_port() selects
speakers, whose availability is unknown and availability group is unset,
and then calls switch_to_port(). The new logic in switch_on_port()
unintentionally blocked that switch.

This patch moves the problematic logic from switch_to_port() to
port_available_hook_callback() where it doesn't interfere with
switch_from_port().

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1043
2020-11-23 02:07:22 +00:00
Tanu Kaskinen
6ad2d207c5 alsa-mixer: Document the description and description-key mapping options 2020-11-22 16:14:58 +02:00
Emanuil Novachev
3efca093f5 Translated using Weblate (Bulgarian)
Currently translated at 2.6% (14 of 521 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/bg/
2020-11-21 19:49:45 +02:00
Dusan Kazik
5c6681e2fb Translated using Weblate (Slovak)
Currently translated at 69.2% (364 of 526 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/sk/
2020-11-21 19:49:45 +02:00
Emilio Herrera
f23394ef61 Translated using Weblate (Spanish)
Currently translated at 100.0% (521 of 521 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/es/
2020-11-21 19:49:45 +02:00
Karl Ove Hufthammer
ebbfa1bce1 Translated using Weblate (Norwegian Nynorsk)
Currently translated at 100.0% (527 of 527 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/nn/
2020-11-21 19:49:45 +02:00
Igor V. Kovalenko
e81873611c switch-on-port-available: Add logging for port availability group 2020-11-21 14:36:51 +00:00
Igor V. Kovalenko
329bfe8f20 module-alsa-card: Add debug logging if availability group was pruned 2020-11-21 14:36:51 +00:00
Igor V. Kovalenko
89a53e1b71 i18n: Update pulseaudio.pot 2020-11-21 16:49:12 +03:00
Igor V. Kovalenko
2d018a82ad pactl: explicitly print if port availability is unknown
Port availability is a tristate -- not-available / unknown / available.
Explicitly print if availability is unknown to reduce confusion.
2020-11-21 16:34:09 +03:00
Arun Raghavan
d83ad6990e module-alsa-card: Drop availability groups with only one port
These are not really meaningful, and can be confusing for clients.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1022
2020-11-17 16:38:56 +00:00
Arun Raghavan
323195e305 switch-on-port-available: Switch to headphones on unknown availability
Since not all users will have environments that asks what they plugged
in when their hardware supports TRRS inputs but don't have impedance
sensing, let's emulate our previous default behaviour of enabling the
headphone port at least.

This can likely be improved so users can configure the module to select
for the device they are most likely to plug in (so an option to enable
just the microphone, or headphones+headset-mic ports).

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1028
2020-11-15 04:00:25 -05:00
Tanu Kaskinen
e70d34ae18 alsa-mixer: Remove references to non-existent multichannel paths
We don't have any mixer configuration for the multichannel mappings.
2020-10-31 12:00:54 +02:00
Tanu Kaskinen
885cfc2c51 gitlab: Remove trailing whitespace from the issue template 2020-10-31 09:44:21 +02:00
Tanu Kaskinen
daf3a3c4b0 alsa-mixer: Fix jack name comparison
HDMI jacks are configured like this:

    [Jack HDMI/DP]
    append-pcm-to-name = yes

The pa_alsa_jack.name field is then "HDMI/DP" and pa_alsa_jack.alsa_name
is set to "HDMI/DP,pcm=3 Jack" or similar. If we compare the name fields
of HDMI paths, they appear to use the same jack element even though they
are different in reality, so all HDMI ports got incorrectly assigned to
the same availability group.
2020-10-30 16:55:39 +00:00
Tanu Kaskinen
eee8292ae1 alsa-mixer: Set availability groups once per card
Previously they were set once per mapping, which caused the numbering to
restart from 1 for every mapping, so ports were incorrectly assigned to
the same group.
2020-10-30 16:55:39 +00:00
Arun Raghavan
a9c6d43b7c sink, source: Skip filter streams while changing default sink/source
Streams connecting filter devices to their target devices shouldn't move
because of default settings (they are intended to be filtering the
specific device that are attached to).

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1015
2020-10-26 12:00:35 -04:00
Jaroslav Kysela
1d6bd6689f alsa: move the exceptionally large value errors from error to debug level
Almost all reports from users, I have seen in last years, were not valid.
The report is also printed when the system scheduler does not wake
the pulseaudio thread in the right time. Users are not able to distinguish
between slow machine and the real problem.

Move the log level from 'error' to 'debug' for those messages.

The right fix should be to measure the time between the call invocation and
return to determine (and skip) the scheduling problems, but it is another
extra code just to debug things.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-26 15:48:35 +00:00
Arun Raghavan
d8e708e44c build-sys: Set the GStreamer RTP backend to disabled by default
Packaging shouldn't be using the automatic setting anyway, and let's
disable by default for one release and mark this as experimental so we
can flush out any corner cases.
2020-10-23 12:11:46 -04:00
Arun Raghavan
314e97d995 rtp: gstreamer: Account for rounding errors in RTP timestamp conversion
Since the RTP timestamp is converted to time units and back, a small
error can creep up, which then results in a single frame error in where
we place the buffer in the output memblockq. This results in minor
glitches, so we check for and eliminate the error.
2020-10-23 12:11:35 -04:00
Arun Raghavan
5f12dde2f5 rtp: gstreamer: Don't count on buffer DTS for capture time
With GStreamer 1.18, the old behaviour of storing the capture time in
DTS is gone (which is reasonable, since the semantics really don't
match). So instead, we get a capture timestamp when the buffer is being
pushed from udpsrc. This should eventually move into udpsrc, and the
timestamp should come from the cmsg instead of the clock.

We still fallback to the DTS if the meta isn't available, as the meta
might be dropped in older versions of rtpL16pay due to a bug.
2020-10-23 12:11:35 -04:00
Igor V. Kovalenko
3fc2ac10c6 module-bluez5-discover: avoid use after free on de-init
Hashmap loaded_device_paths contain objects holding keys to entries, and
these objects must be alive while map is emptied.

Reorder freeing this hashmap before destroying device objects to fix
crash on exit.
2020-10-23 04:57:15 -04:00
Igor V. Kovalenko
ef6ceb83a2 build-sys: meson: adjust path to gsettings-helper runing from build tree 2020-10-20 15:24:52 -04:00
Arun Raghavan
40bb058a31 build-sys: meson: Add libm dep to raop module
This is required for using pow().
2020-10-20 14:37:10 -04:00
Igor V. Kovalenko
44c5317624 device-port: fire port available changed hook after streams are moved
If port becomes unavailable then PA_CORE_HOOK_PORT_AVAILABLE_CHANGED
callbacks may eventually destroy related source or sink object. Call
this hook after stream is moved to prevent crash reading from freed
memory.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1008
2020-10-20 17:31:29 +03:00
Arun Raghavan
7f4d7fcf5f Revert "alsa-mixer: support up to 8 channels per mixer element"
This reverts commit e0ab9fa4a4.

The change broke some Xonar cards, and we probably don't want to hold up
the 14.0 release for this.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1009
2020-10-13 21:03:30 -04:00
Tanu Kaskinen
8614a37a95 ci: Fix comment
The UBUNTU_DEBS variable has been replaced by FDO_DISTRIBUTION_PACKAGES.
2020-10-13 17:14:00 +03:00