Commit graph

8536 commits

Author SHA1 Message Date
Barnabás Pőcze
b1c189fa86 test: rewrite test which destroys active source before dispatching
Rewrite the test that destroys an active managed source
right after polling is done. There is no need to use a
thread loop because the same thing can be simulated using
the before/after loop control hooks in a more controlled
manner.
2022-03-06 18:40:43 +00:00
Barnabás Pőcze
2eb36c00c1 spa: support: loop: add polling flag
Store whether or not the loop is currently polling, i.e.
calling `spa_system_pollfd_wait()`.
2022-03-06 18:40:43 +00:00
Barnabás Pőcze
4ed0365976 spa: support: loop: assert source type 2022-03-06 18:40:43 +00:00
Barnabás Pőcze
cfc8510ce8 spa: support: loop: add some invariant assertions 2022-03-06 18:40:43 +00:00
Barnabás Pőcze
55ee5ec8b2 spa: support: loop: rename variables
It may be a little confusing that both the loop object
and the `source_impl` objects are referred to with variables
named `impl`. For this reason, rename all source_impl objects
named `impl` to `s`.
2022-03-06 18:40:43 +00:00
Barnabás Pőcze
a4e7042176 spa: support: loop: do not return early in case of an error
It is expected that `nfds` is non-negative in the vast majority
of cases, so hopefully the runtime performance will not be
significantly affected by removing the check. This way
it is guaranteed that the destroy list is processed.
2022-03-06 18:40:43 +00:00
Barnabás Pőcze
275e23a34d spa: support: loop: print previous mask when updating
Print the previous event mask in `loop_update_io()`
as well as the new one.
2022-03-06 18:40:43 +00:00
Barnabás Pőcze
8941fc2866 spa: support: loop: get array size using macro 2022-03-06 18:40:43 +00:00
Barnabás Pőcze
cb8c2d8857 spa: support: loop: reset rmask after dispatch
Reset the `rmask` of the sources to zero after
dispatching the callbacks. This way the sources
are always as up-to-date as possible.
2022-03-06 18:40:43 +00:00
Barnabás Pőcze
a22ce76dbf spa: support: loop: initialize rmask
Set `rmask` to zero when a source is added to,
or removed from the loop.
2022-03-06 18:40:43 +00:00
Barnabás Pőcze
e2287f35db spa: support: loop: move struct members
Move the boolean members of `struct source_impl` to the end
of the struct. This changes the size of the struct from
104 bytes to 96 bytes on x86-64.

Before:

struct source_impl {
        struct spa_source          source;               /*     0    48 */
        struct impl *              impl;                 /*    48     8 */
        struct spa_list            link;                 /*    56    16 */
        /* --- cacheline 1 boundary (64 bytes) was 8 bytes ago --- */
        _Bool                      close;                /*    72     1 */

        /* XXX 7 bytes hole, try to pack */

        union {
                spa_source_io_func_t io;                 /*    80     8 */
                spa_source_idle_func_t idle;             /*    80     8 */
                spa_source_event_func_t event;           /*    80     8 */
                spa_source_timer_func_t timer;           /*    80     8 */
                spa_source_signal_func_t signal;         /*    80     8 */
        } func;                                          /*    80     8 */
        _Bool                      enabled;              /*    88     1 */

        /* XXX 7 bytes hole, try to pack */

        struct spa_source *        fallback;             /*    96     8 */

        /* size: 104, cachelines: 2, members: 7 */
        /* sum members: 90, holes: 2, sum holes: 14 */
        /* last cacheline: 40 bytes */
};

After:

struct source_impl {
        struct spa_source          source;               /*     0    48 */
        struct impl *              impl;                 /*    48     8 */
        struct spa_list            link;                 /*    56    16 */
        /* --- cacheline 1 boundary (64 bytes) was 8 bytes ago --- */
        union {
                spa_source_io_func_t io;                 /*    72     8 */
                spa_source_idle_func_t idle;             /*    72     8 */
                spa_source_event_func_t event;           /*    72     8 */
                spa_source_timer_func_t timer;           /*    72     8 */
                spa_source_signal_func_t signal;         /*    72     8 */
        } func;                                          /*    72     8 */
        struct spa_source *        fallback;             /*    80     8 */
        _Bool                      close;                /*    88     1 */
        _Bool                      enabled;              /*    89     1 */

        /* size: 96, cachelines: 2, members: 7 */
        /* padding: 6 */
        /* last cacheline: 32 bytes */
};
2022-03-06 18:40:43 +00:00
Barnabás Pőcze
1e99551233 test: loop: do not use NULL as event handler 2022-03-06 18:40:43 +00:00
Pauli Virtanen
67a27d80c6 gst: use target.object instead of node.target, soft-deprecate ids
Use target-object=<serial/name> instead of path=<id> for specifying
sink/src targets. Deprecate path= argument.

Change device provider to preferably expose serials instead of ids.
2022-03-06 18:34:47 +00:00
Pauli Virtanen
d66e9f1ae1 bluez5: a2dp-sink: stop flushing if source was removed
The flush source gets removed on I/O error. We should not continue
flushing after that.
2022-03-06 16:47:25 +02:00
Pauli Virtanen
7ade8fa8fb pwtest: fix daemon log scrambling
Nonblocking pipes can scramble logs if we read too slow, so use max size
buffers.

Also use CLOEXEC for the pipes to be safer, and minor other fixes.
2022-03-06 02:29:35 +02:00
Pauli Virtanen
8673f8c03d pwtest: shorter default timeout 2022-03-05 17:51:22 +00:00
Pauli Virtanen
9cb55852f4 CI: add functional test program deps 2022-03-05 17:51:22 +00:00
Pauli Virtanen
f3831da67a pwtest: ARG_DAEMON tests don't work on valgrind 2022-03-05 17:51:22 +00:00
Pauli Virtanen
c604f1608a test: add simple functional tests
Try running openal-info.
2022-03-05 17:51:22 +00:00
Pauli Virtanen
76bab25afb pwtest: handle SIGTERM/SIGINT in runner
Catch SIGTERM/SIGINT in test runner, and clean up any spawned processes.

Fixes printing test output on termination by signal (e.g. meson
timeout), and doesn't leave spawned processes running.
2022-03-05 17:51:22 +00:00
Pauli Virtanen
ad3c90dbb9 pwtest: use default debug level 4 for spawned daemons 2022-03-05 17:51:22 +00:00
Pauli Virtanen
a7bd52d07d pwtest/Makefile: set SPA_DATA_DIR 2022-03-05 17:51:22 +00:00
Pauli Virtanen
581f6c7f1d pwtest: add pwtest_spawn for running external programs 2022-03-05 17:51:22 +00:00
Pauli Virtanen
df4f844daa pwtest: ensure all spawned daemons are terminated
Set process group, and send signal to them all.
2022-03-05 17:51:22 +00:00
Pauli Virtanen
24fd273820 bluez5: backend-ofono: don't do codec probe connections + add wait
Codec probe connections can trigger bad behavior from oFono if done when
device is busy (e.g. at connect), and they might be done at the same
time as A2DP transport is acquired which cannot work.

Also, oFono will not reply to DBus Acquire, if device does not complete
codec negotiation correctly. This is most likely to happen just after
device connect, when it is busy with other stuff (eg A2DP).

Remove codec probe connections altogether: instead, we guess mSBC if
mSBC is enabled and otherwise CVSD. If the guess turns out to be wrong,
which is unlikely (almost all devices have mSBC), we recreate the
transport with correct codec (from main loop, must not be done in
*_acquire because that can destroy nodes + unload the spa libs while
we're being called from there).

To avoid oFono DBus hangs at startup, add delay before marking the
profile connected, enforcing a time difference to A2DP operations.
2022-03-05 17:46:40 +00:00
Michael D
8026b65caa Update meson.build
(cherry picked from commit 8da11c3853cb7a19cd267ad94de591f88461d31a)
2022-03-05 00:37:25 +00:00
Michael D
eec017f245 Update man/pw-top.1.rst.in 2022-03-04 22:43:51 +00:00
Wim Taymans
1647c169b2 alsa: improve latency update 2022-03-04 17:21:17 +01:00
Wim Taymans
bcdd1ea811 alsa: set better ranges on properties 2022-03-04 17:21:14 +01:00
Wim Taymans
c7de69eac7 channelmix: improve disabled flag
Also parse updates to the disabled flag when disabled so that we can
enabled it again.
2022-03-04 17:21:11 +01:00
Wim Taymans
2653e9f129 filter-chain: use property hints
Use property hints to expose int or bool controls.
2022-03-03 21:23:25 +01:00
Wim Taymans
2125ec048d filter-chain: use dynamic builder for param update 2022-03-03 21:22:23 +01:00
Wim Taymans
8646117374 stream: guard against NULL params 2022-03-03 21:21:43 +01:00
Wim Taymans
c03850fd76 merger: also remove PropInfo
We use the PropInfo from the channelmixer.
2022-03-03 19:46:33 +01:00
Wim Taymans
a6304b47f6 pw-cat: improve DSD file reading
Support reading non-multiples of the blocksize.
Stop reading at the end of the file.
2022-03-03 16:05:03 +01:00
Wim Taymans
ce2f1b3737 dsffile: fix negative interleave 2022-03-03 14:01:32 +01:00
Wim Taymans
d25bb89cc0 channelmix: enable upmixing by default, disable normalization 2022-03-03 12:33:02 +01:00
Wim Taymans
5a55e1a47a pulse-server: handle pulse.properties
Load properties from pulse.properties section so that they can have
overrides.
2022-03-03 11:59:55 +01:00
Wim Taymans
6c4d3a5158 0.3.48 2022-03-03 11:30:56 +01:00
Wim Taymans
b645793d7e filter-chain: remove stray debug 2022-03-02 21:43:37 +01:00
Wim Taymans
b7c78d0108 minimal.conf: add some more example config
Add an example for how to add a virtual source and how to link it
to the real source.

Fixes #2105
2022-03-02 12:20:44 +01:00
Wim Taymans
99f9f729ff handle open_memstream errors
Fixes #2182
2022-03-02 11:48:31 +01:00
Wim Taymans
fdaf4613d8 module-raop: handle and debug read errors
Fixes #2183
2022-03-02 11:28:43 +01:00
Wim Taymans
00d4de3799 module-raop: use the right socket to read from
See #2183
2022-03-02 11:24:40 +01:00
Wim Taymans
e7958fac1b filter-chain: remove limits on ports
Allocate all ports dynamically so that there is no limit anymore.

Fixes #2179
2022-03-02 10:12:22 +01:00
Wim Taymans
c89595d86f protocol: increase some limits 2022-03-02 10:05:27 +01:00
Wim Taymans
dfdca3ce29 stream: add support for PropsInfo
So that streams and filter can describe custom properties.
2022-03-02 10:02:55 +01:00
Wim Taymans
0db8d39dd8 spa: fix compilation with c++ 2022-03-01 21:40:30 +01:00
Wim Taymans
b324c02570 filter-chain: use offsets to deref pods
In a dynamic builder we can only save the offsets in the array and
deref after we completed building everything.

Increase the control limits.

See #2179
2022-03-01 21:24:39 +01:00
Wim Taymans
3d7ea3ee17 spa: use dyanmic builder for audioadapter 2022-03-01 21:17:08 +01:00