Commit graph

6723 commits

Author SHA1 Message Date
Barnabás Pőcze
6f5b089767 pulse-server: clear hook list when module is freed
Moreover, rename the hook list to "listener_list".
2021-06-11 20:50:30 +02:00
Barnabás Pőcze
d9befc0792 pulse-server: eliminate some memory leaks in modules 2021-06-11 20:50:30 +02:00
Barnabás Pőcze
1d5fb2a7db pulse-server: remove unnecessary struct members 2021-06-11 20:50:30 +02:00
Barnabás Pőcze
cd0eb829dd pulse-server: remove redundant log messages from modules
The same information is printed in
* `on_module_loaded()`,
* `module_load()`, and
* `module_unload()`.
2021-06-11 20:50:30 +02:00
Wim Taymans
a90c86dd47 defs: reorganize the assert macros a little
Make a special Coverity version of spa_assert_se borrowed from
PulseAudio
NDEBUG now compiles the asserts to nop, except for the _se one.

See !755
2021-06-11 20:05:25 +02:00
Wim Taymans
b7c2e7a693 conf: the midi bridge example is from a spa-node-factory
Fixes #1294
2021-06-10 23:47:15 +02:00
Wim Taymans
a6b687ee98 audioadapter: proxy Latency param from follower port 2021-06-10 23:42:05 +02:00
Nicolai Syvertsen
01875ad223 pipewire-pulse: set description
Some applications like TeamSpeak crash when this isn't set.
2021-06-10 22:21:26 +02:00
Wim Taymans
77a4ae380e json: remove obsolete # comment handling
Comments are handled by the parser now. Keys and values starting
with # are intentional now.
2021-06-10 18:02:34 +02:00
Wim Taymans
826f52344f spa: properly re-encode the keys and string values
Instead of pasting quotes around them.
2021-06-10 16:32:16 +02:00
Wim Taymans
1c513464c8 alsa: strip and add the _alibpref from device names
Strip the _alibpref from the device name, it contains a local counter
to identify the ucm card that should remain internal. We set a flag on
the device to notify of this.

Re-add the _alibpref of the local card to the device name if the
device was flagged.

See #1286
2021-06-10 15:36:26 +02:00
Wim Taymans
283e13629c alsa: use the local alibpref of the card
The _alibpref of the device was created in the session manager and
does not match our local _alibpref. Patch the device name with
the local _alibpref to make things match.

See #1286
2021-06-10 13:25:54 +02:00
Wim Taymans
23a0f29d48 acp: don't use the card index for alibpref
The alibpref fallback does not contain the card number but it is
a local counter instead. Just check if it starts with something in
case the alsa library is not patched to return _alibpref.
2021-06-10 13:25:53 +02:00
Peter Hutterer
461ae02c50 test: shut up a compiler warning about an unused variable
gcc 9 complains about `v` being potentially uninitialized. This is a false
positive, we'd exit() on any error before using `v` but the compiler doesn't
seem to know that. Let's shut up the warning.
2021-06-10 20:39:58 +10:00
Peter Hutterer
3f325819da gitlab CI: add a build job for Ubuntu 20.04
To avoid adding dependencies that may be considered a bit too recent, let's
build on the current Ubuntu LTS.

Unlike the current Fedora job, this is just the default build with no special
options. They can be added by anyone motivated enough to track down the
required package names :)
2021-06-10 20:39:28 +10:00
Wim Taymans
342ae0b643 Revert "conf: Load and stack all config files."
This reverts commit db44fe47ee.

We should not be merging config files at this point. Generating config
files should be done offline and only the result is loaded here.
2021-06-10 11:28:37 +02:00
Wim Taymans
61007dd412 Revert "conf: add comment about removing sections"
This reverts commit 85d34d8d94.
2021-06-10 11:27:31 +02:00
Wim Taymans
d8e0176bcf alsa: open UCM only once.
See #1286 #1269
2021-06-10 09:58:11 +02:00
takooakes
51d01b33c8 Expose output select for Soundblaster cards
Enable selecting Speakers or Headphones for Soundblaster cards.
This switch was name Output Select.
2021-06-10 07:39:04 +00:00
Peter Hutterer
7177d82c34 test: check for CAP_SYS_PTRACE before testing for an attached debugger
If we don't have the capability to ptrace, we are probably running inside a
container, not the debugger. Check this first so we don't disable forking
mode.

Make this conditional on libcap - where libcap is not available always assume
we *do not* have a debugger attached. This is easier than telling everyone who
runs the tests in a confined system to install libcap.

Fixes #1285
2021-06-10 09:36:12 +02:00
Peter Hutterer
2d238f1d33 meson.build: drop config.h.meson
This seems to be a leftover from the autotools conversion but it
does not provide huge benefits. Meson's default behavior is to generate a
header like this, the main advantage of a config.h.meson header is to *filter*
things that should show up in the config.h file. That comes at the cost of
having to #mesondefine every single variable we want.

In most cases, it's easier with meson to just use different configuration_data
objects instead - which we do for most of the code.

The new header file is identical to the old one, discounting comments, sort
order and the following #defines that didn't end up in the config.h before:
  HAVE_STRNDUPA
  HAVE_STDDEF_H
2021-06-10 09:31:47 +02:00
Peter Hutterer
0cd0d6e826 meson.build: split the version data into a separate config
Use this for the version.h file so we enforce that being used everywhere
instead of accidentaly relying on whatever ends up in config.h.

The generated version.h file is identical.
2021-06-10 09:30:56 +02:00
Peter Hutterer
b5e98027b7 meson.build: drop VERSION, use PACKAGE_VERSION in the C sources
Slightly better namespaced since it's not usually used anywhere else, VERSION
is too generic.
2021-06-10 09:30:56 +02:00
Peter Hutterer
c4e3efbcf8 meson.build: drop PIPEWIRE_PACKAGE_ORIGIN and PIPEWIRE_LICENSE defines
These seems to be a copy/paste from GST_* but was never actually used anywhere
in our tree.
2021-06-10 09:30:56 +02:00
Peter Hutterer
66abafaa3d meson.build: drop the PIPEWIRE_PACKAGE_NAME define
The only user of this was the dbus protocol, dropped in 7cbdaeb3b6
2021-06-10 09:30:56 +02:00
Peter Hutterer
d1e2ab1eac config.h.meson: remove hack for MacOS 10.5
https://lists.gnu.org/r/bug-autoconf/2020-02/msg00004.html

MacOS 10.6 no longer requires that hack and it predates our initial commit by
6 years (2009 vs 2015), so let's conservatively assume this hack is not needed
here.
2021-06-10 09:30:56 +02:00
Peter Hutterer
478e1cc516 meson.build: define WORDS_BIGENDIAN if need be
Drop the Apple-specific defines from config.h.meson - this was never true in
the meson build anyway as nothing set the AC_APPLE_UNIVERSAL_BUILD and the
else condition only undef'd WORDS_BIGENDIAN if... it was not defined.

Drop this and replace it with a meson endian check. There is only one source
file that checks for this #define in spa/plugins/alsa/acp/compat.h, let's hope
nothing breaks here.
2021-06-10 09:30:56 +02:00
Peter Hutterer
14eb43ea86 meson.build: check for SYS_pidfd_open 2021-06-10 15:19:20 +10:00
Peter Hutterer
18b3efa2ed spa: make two headers compatible with older gcc-c++
c++ 7.5.0 can only initialize structs with continuous members, so let's
initialize the fields explicitly to NULL.

Fixes #1284
2021-06-10 15:19:15 +10:00
Peter Hutterer
731f45ed50 test: add sigabbrev_np() for systems where it's not available
sigabbrev_np() was first added to glibc 2.32 (Aug 2020) which is too recent
for some of the distributions we support.
2021-06-10 15:13:57 +10:00
Peter Hutterer
5cf3c28fa4 config.h is a local header, not a system one
Change the #include accordingly, that's what we use in the rest of the tree
too.
2021-06-10 09:04:16 +10:00
Peter Hutterer
da339c286f meson.build: drop HAVE_CONFIG_H
This is an autotools leftover, with meson we're always guaranteed to have
the config.h file.
2021-06-10 09:04:16 +10:00
Peter Hutterer
5ba43b8349 audioconvert: add config.h to include directories
Some of the files here #include "config.h"
2021-06-10 09:04:16 +10:00
Peter Hutterer
e38cc427bf spa: fix indentation in audioconvert/meson.build
Was partially using spaces, partially 2-space tabs. Use 2 spaces only and fix
the few lines where the indentation was completely out of whack.
2021-06-10 09:04:16 +10:00
Peter Hutterer
b2206e2530 test: change VERSION to HOOK_VERSION for the spa hooks test
VERSION is defined in config.h for the project version which will cause a
conflict here.
2021-06-10 09:04:16 +10:00
Wim Taymans
1b5ffa7891 filter: init the Latency param correctly
See #911
2021-06-09 21:12:19 +02:00
Wim Taymans
667fa18526 test: fix property test
The long key is now ignored instead of truncated.
2021-06-09 18:17:31 +02:00
Wim Taymans
d91cc99d92 properties: escape '/' as well 2021-06-09 18:08:26 +02:00
Wim Taymans
eb8546a682 json: also escape '/' as required by JSON 2021-06-09 18:03:42 +02:00
Wim Taymans
262e609b73 conf: use serialize_dict to write state files
Instead of our home-brew version.
2021-06-09 18:00:47 +02:00
Wim Taymans
54326abd54 properties: improve serialize method
Properly escape the keys because we're trying to generate
valid JSON.
Always place ',' after items.
Add a flag to add a '\n' before each item.
Don't try to string-encode the value when it's already a string.
2021-06-09 17:57:58 +02:00
Wim Taymans
a10cb3a597 jack: unlock mutex on error path
This needs some more fixing because it leaks everything.
2021-06-09 17:57:05 +02:00
Wim Taymans
4b6fb5e96a v4l2: report latency 2021-06-09 17:15:34 +02:00
Wim Taymans
85d34d8d94 conf: add comment about removing sections
Sections that don't need to be changed can be removed because they
are now taken from the main config file.
2021-06-09 15:25:58 +02:00
Wim Taymans
db44fe47ee conf: Load and stack all config files.
Load and parse config files in the following order:

$PIPEWIRE_CONFIG_DIR or /usr/share/pipewire
/etc/pipewire
$XDG_CONFIG_DIR or ~/.config/pipewire

This ensure we always load a working base config and reduce the
chances of failing because of a back user config file.

The user config file now only needs to contain the section that
needs the be changed.

See #207
2021-06-09 12:15:39 +02:00
Peter Hutterer
d09df66aec test: drop the valgrind timeout multiplier to 3
30s * 100 as timeout for a single test is a bit too much.
2021-06-09 19:41:07 +10:00
Peter Hutterer
9a65d90e88 test: move the spa tests to pwtest
Move the spa tests to the pwtest framework. The pod tests have only been
wrapped in the function callers, they don't use the variuos pwtest helpers -
too much work for very little gain here. Can be done incrementally if needed.

Note that this removes the spa tests from the installed tests. Arguably,
installing those tests was unnecessary anyway since they are static binaries
and don't load anything. So having them installed runs the same tests as
having them run in the source tree.

Goal for the pwtest framework is to allow for installed tests, just not there
yet.
2021-06-09 18:00:59 +10:00
Peter Hutterer
008195924c test: add a test for the properties stack overflow
See #1249
2021-06-09 18:00:58 +10:00
Peter Hutterer
7240058bee test: add test for logger's ANSI escape sequences
Set up the logger with colors enabled but since our log file is not a tty,
this should not print any ansi sequences into the log.
2021-06-09 18:00:39 +10:00
Peter Hutterer
518ffde9ec test: add a test for the logger truncation
See c851349f17
2021-06-09 18:00:39 +10:00