Commit graph

8817 commits

Author SHA1 Message Date
Anders Jonsson
2307557652 po: Update Swedish translation 2022-05-23 15:39:58 +00:00
Trent Gord
799f4ce0a6 Update 90-pipewire-alsa.rules (ID 9886:0045 is for the Astro A20 Gen2) 2022-05-23 01:19:20 +00:00
Wim Taymans
840fa000eb man: escape |
It is used for delimiting a reference.
2022-05-21 19:46:02 +02:00
Piotr Drąg
d51a987190 Update Polish translation 2022-05-21 17:06:28 +00:00
James Hilliard
4738c934bb Fix build on uclibc without locale support
When uclibc is build with !UCLIBC_HAS_LOCALE the macro
__LOCALE_C_ONLY will be set, use this to disable unsupported and
not required(due to only supporting the C locale) locale functions.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2022-05-21 16:59:54 +00:00
Félix Poisot
5daa660a62 jack: replace unmatched atomic store with mutex
Fixes #1867, as this is the only u64 atomic access in the tree

All other accesses to pw_node_activation::sync_timeout are unprotected,
so they must assume lock ownership
2022-05-21 16:55:34 +00:00
Barnabás Pőcze
893567bed6 pulse-server: module-x11-bell: initialize module member
Previously, `module_x11_bell_data::module` was not initialized
properly, which led to a NULL pointer dereference in
`module_schedule_unload()` when called from `module_destroy()`
in case the native pipewire module was unloaded.

See #2392
2022-05-21 18:45:25 +02:00
Wim Taymans
700b1e7ff8 man: update pw-cat man page 2022-05-20 08:23:43 +02:00
Wim Taymans
81eee88dd8 pw-cat: support stdin/stdout for input/output
A - filename will read or write from the stdin/out.

Fixes #2387
2022-05-20 08:03:03 +02:00
Wim Taymans
b81b7febee pulse-server: don't export NETWORK nodes
Don't export network nodes with zeroconf.

Fixes #2384
2022-05-18 20:40:46 +02:00
Wim Taymans
05deba85a4 pulse-server: reset message length when freeing
When we move a message to the free list, reset the length to 0.
Otherwise the previous length plus the new length will be used to
allocated the message size, which would overallocate.
2022-05-18 17:31:23 +02:00
Wim Taymans
6ed91ae0d8 pw-cat: add -P option
Add -P option to pass custom properties to the stream.
2022-05-18 17:31:18 +02:00
Wim Taymans
e1a50a6c1a mixer-dsp: handle input offset
Handle the input buffer offset and clamp the size to maxsize.
2022-05-18 09:24:08 +02:00
Wim Taymans
411b12f59e audioadapter: improve error reporting
Improve the debug_params output.
Always either print the failed filter or that there was no filter.
Print the index of the enumerated failed param or a message when
there are no params.

See #2383
2022-05-17 09:52:48 +02:00
Barnabás Pőcze
970b5906a8 pipewire: module-spa-node-factory: remove resource listener when node is destroyed
Previously, the resource listener was not removed when
the `node_data` object was freed, which could lead to
a use-after-free when the resource emitted an event
later.

==2787072==ERROR: AddressSanitizer: heap-use-after-free on address 0x61d000016728 at pc 0x7ffff7175b52 bp 0x7fffffffb930 sp 0x7fffffffb920
WRITE of size 8 at 0x61d000016728 thread T0
    #0 0x7ffff7175b51 in spa_list_remove ../spa/include/spa/utils/list.h:77
    #1 0x7ffff717cb5a in pw_resource_destroy ../src/pipewire/resource.c:335
    #2 0x7ffff7051c56 in pw_global_destroy ../src/pipewire/global.c:417
    #3 0x7ffff6f82a68 in registry_destroy ../src/pipewire/impl-core.c:130
    #4 0x7ffff3a5f349 in registry_demarshal_destroy ../src/modules/module-protocol-native/protocol-native.c:784
    #5 0x7ffff3a2c9ed in process_messages ../src/modules/module-protocol-native.c:352
    #6 0x7ffff3a2e2ea in connection_data ../src/modules/module-protocol-native.c:423
    #7 0x7ffff3e09402 in source_io_func ../spa/plugins/support/loop.c:427
    #8 0x7ffff3e0851d in loop_iterate ../spa/plugins/support/loop.c:409
    #9 0x7ffff709c21d in pw_main_loop_run ../src/pipewire/main-loop.c:148
    #10 0x555555559722 in main ../src/daemon/pipewire.c:131
    #11 0x7ffff62a528f  (/usr/lib/libc.so.6+0x2928f)
    #12 0x7ffff62a5349 in __libc_start_main (/usr/lib/libc.so.6+0x29349)
    #13 0x5555555582a4 in _start (./src/daemon/pipewire+0x42a4)

0x61d000016728 is located 2216 bytes inside of 2264-byte region [0x61d000015e80,0x61d000016758)
freed by thread T0 here:
    #0 0x7ffff798c672 in __interceptor_free /usr/src/debug/gcc/libsanitizer/asan/asan_malloc_linux.cpp:52
    #1 0x7ffff70f9bc3 in pw_impl_node_destroy ../src/pipewire/impl-node.c:1880
    #2 0x7ffff70d1d57 in global_destroy ../src/pipewire/impl-node.c:638
    #3 0x7ffff7051a4f in pw_global_destroy ../src/pipewire/global.c:414
    #4 0x7ffff6f82a68 in registry_destroy ../src/pipewire/impl-core.c:130
    #5 0x7ffff3a5f349 in registry_demarshal_destroy ../src/modules/module-protocol-native/protocol-native.c:784
    #6 0x7ffff3a2c9ed in process_messages ../src/modules/module-protocol-native.c:352
    #7 0x7ffff3a2e2ea in connection_data ../src/modules/module-protocol-native.c:423
    #8 0x7ffff3e09402 in source_io_func ../spa/plugins/support/loop.c:427
    #9 0x7ffff3e0851d in loop_iterate ../spa/plugins/support/loop.c:409
    #10 0x7ffff709c21d in pw_main_loop_run ../src/pipewire/main-loop.c:148
    #11 0x555555559722 in main ../src/daemon/pipewire.c:131
    #12 0x7ffff62a528f  (/usr/lib/libc.so.6+0x2928f)

previously allocated by thread T0 here:
    #0 0x7ffff798d411 in __interceptor_calloc /usr/src/debug/gcc/libsanitizer/asan/asan_malloc_linux.cpp:77
    #1 0x7ffff70e5bb7 in pw_context_create_node ../src/pipewire/impl-node.c:1192
    #2 0x7ffff28c748e in pw_spa_node_new ../src/modules/spa/spa-node.c:112
    #3 0x7ffff28c9a9f in pw_spa_node_load ../src/modules/spa/spa-node.c:276
    #4 0x7ffff28c1618 in create_object ../src/modules/spa/module-node-factory.c:134
    #5 0x7ffff7106c4e in pw_impl_factory_create_object ../src/pipewire/impl-factory.c:273
    #6 0x7ffff6f86dd7 in core_create_object ../src/pipewire/impl-core.c:349
    #7 0x7ffff3a5cba9 in core_method_demarshal_create_object ../src/modules/module-protocol-native/protocol-native.c:680
    #8 0x7ffff3a2c9ed in process_messages ../src/modules/module-protocol-native.c:352
    #9 0x7ffff3a2e2ea in connection_data ../src/modules/module-protocol-native.c:423
    #10 0x7ffff3e09402 in source_io_func ../spa/plugins/support/loop.c:427
    #11 0x7ffff3e0851d in loop_iterate ../spa/plugins/support/loop.c:409
    #12 0x7ffff709c21d in pw_main_loop_run ../src/pipewire/main-loop.c:148
    #13 0x555555559722 in main ../src/daemon/pipewire.c:131
    #14 0x7ffff62a528f  (/usr/lib/libc.so.6+0x2928f)

SUMMARY: AddressSanitizer: heap-use-after-free ../spa/include/spa/utils/list.h:77 in spa_list_remove
2022-05-16 17:40:35 +00:00
jasker5183
6b619dd1b3 Doxygen - enable client side search engine. 2022-05-16 15:33:27 +00:00
Wim Taymans
b1578ee109 alsa: avoid allocation 2022-05-16 09:36:14 +02:00
Robert Rosengren
cd389240fa alsa-plugin: use ioplug sw_params callback
snd_pcm_sw_params states "The software parameters can be changed at
any time.". Adding the ioplug callback sw_params to get relevant
updates, and if min_avail has changed update the node latency of
the stream.

Ignoring callback received prior to prepare as stream not yet created.
2022-05-16 09:33:01 +02:00
Pauli Virtanen
98aa7ccff0 pulse-server: emulate synchronous MOVE_* commands
Make MOVE_SINK_INPUT/MOVE_SOURCE_OUTPUT change the linked peer
immediately in subsequent GET_SINK_INPUT_INFO/GET_SOURCE_OUTPUT_INFO
commands.  Do this by keeping track of the sink/source where the client
moved the stream to, and temporarily replying so in future GET_INFO (but
only in messages for that client).

We discard the temporary override when we either get an update event for
the stream (i.e. SM moved the stream), or a 1sec timer runs out. If the
timer runs out, we emit a sink-input/source-output change event, as in
that case what we claimed in the earlier GET_INFO messages might not be
true, so clients need to update their information.

This gets rid of race conditions where an application moves a stream,
and expects the move to be visible in future GET_INFO replies, which may
fail to happen because it takes some time for the session manager to
re-link the streams.

Fixes pasystray behavior.
2022-05-15 17:14:52 +00:00
Pauli Virtanen
83be5d866f pulse-server: implement temporary data attached to manager objects
Add functions for setting timer-based lifetimes for object data.

Having the timers in the object data themselves simplifies life cycle
management, as client/manager disconnects are handled without further
work.
2022-05-15 17:14:52 +00:00
Oğuz Ersen
36ad886388
po: Update Turkish translation 2022-05-14 18:38:15 +03:00
Jonas Holmberg
64c1b62aa8 alsa-pcm: Do not log warning when resync was expected
Log as info instead of warning when alsa sync was expected.
2022-05-11 17:45:27 +02:00
Wim Taymans
6ad59e0117 pulse-server: parse bool using pulseaudio rules 2022-05-11 17:06:33 +02:00
Wim Taymans
1fad806b8d pulse-server: add auth-anonymous option
Add the auth-anonymous option to module-native-protocol-tcp.

It does not exactly do what pulseaudio does but it will enable
unrestricted access instead.

Fixes #1899
2022-05-11 17:01:04 +02:00
Marcin Radomski
aa33c2841c pulse-server: avoid skipping more ringbuffer data than available
This prevents the ringbuffer from advancing the read pointer more than
the size of data actually available. It prevents the "avail" value from
keeping to drop when no audio is being played by the client.

Applying this patch seems to prevent the "randomly playing music after
a couple hours of silence" issue

Fixes #2366
2022-05-11 15:34:21 +02:00
Pauli Virtanen
9240a7b6f3 pipewire: don't setlocale in pw_init
Remove the backward compat workaround. Avoids threadsafety etc. issues.

New WP release sets the locale itself.
2022-05-11 13:19:09 +00:00
Wim Taymans
a3e10d6023 audioadapter: add some more debug 2022-05-11 15:13:46 +02:00
Wim Taymans
416dec530c audioconvert: debug result code 2022-05-11 14:55:37 +02:00
Wim Taymans
c2dbe1d64d audioconvert: remove props from info
After emiting the node info, remove the properties from the info again
so that we don't accidentally emit them again later, when the
info and properties are out of scope.
2022-05-11 14:51:14 +02:00
Wim Taymans
daf53b94ed adapter: pass spa_node to adapter
Make it possible to pass a spa_node as the follower of the adapter. This
avoids us having to wrap it in a pw_impl_node in order to unwrap it
again for the adapter spa_node.
2022-05-11 12:28:26 +02:00
Wim Taymans
9d186cf622 alsa-pcm: scale max_error with quantum size
Adjust the max-error between the hardware delay and the quantum. Limit
this between 256 and quantum/2 to make sure we are not too sensitive.
2022-05-11 10:34:27 +02:00
Wim Taymans
e6c2ac3450 stream: handle set_control when not connected
When we are not connected, return -EIO from set_control instead
of crashing later.
2022-05-10 15:36:00 +02:00
Wim Taymans
4efb1a03cb stream: don't emit param_changed from set_control
When we set a control, don't emit the param_changed event. We will
already receive the control_info as a result of the change.
Reserve the param_changed event for things that got changed by
something else.
2022-05-10 15:32:25 +02:00
Barnabás Pőcze
f24250da66 spa: bluez: ignore unsupported indicators
Do not emit a warning when a known, but
otherwise unsupported indicator is received.

Fixes wireplumber#253
2022-05-10 12:09:18 +02:00
Yuri Chornoivan
e6d762f4ba po: Update Ukrainian translation 2022-05-09 10:54:11 +00:00
jasker5183
c71db353f1 Documentation Updates 2022-05-08 17:06:28 +00:00
Wim Taymans
8afe5fe0f0 filtet-chain: handle empty nodes
When there are no nodes, we can't make links. This avoids getting into
an infinite loop when trying to find ports.
2022-05-07 15:58:39 +02:00
Wim Taymans
0c8cd4ab52 filter-chain: improve filter.graph parsing
First collect all the graph objects and then parse them in the
right order. Otherwise, we might try to parse links before the nodes if
they are first in the JSON string.

Fixes #1950
2022-05-07 15:53:10 +02:00
Barnabás Pőcze
211abaef5e protocol-native: remove destroyed client from client list
When the client destroys the protocol-native module, the server
and the client are destroyed but the client is still reffed (not freed).
It will be unreffed after its messages are processed, after which point
it will be freed and removed from the server client_list that is already
destroyed.

Fix this by removing the client from the server list when it is
destroyed.

See #565
2022-05-07 14:08:55 +02:00
Wim Taymans
d506781619 pulse-server: do a guess for the latency when starting
Guess the expected latency with the stream info we have and use that as
the node.latency. This way, the graph can attempt to start with some
sort of latency setting.

After we know the exact format, we can calculate the real latency and we
will update the node latency accordingly.
2022-05-06 16:54:22 +02:00
Wim Taymans
3f3e1352ae modules: update docs 2022-05-06 15:46:45 +02:00
Wim Taymans
eaf9a4feb0 pw-loopback: add -n option to set a node.name 2022-05-06 15:39:43 +02:00
Wim Taymans
37ba52005b module: also support global node.name
Support a global node.name and prefix it with input. and output.
if no per-stream node.name is given.
This might be less confusing.
2022-05-06 15:38:43 +02:00
Wim Taymans
32e957345d audioadapter: don't loop forever
Try 8 times to make progress, if nothing after that, xrun.

A stream that keeps sending 0 sized buffers would otherwise get into
an endless loop.

See #2359
2022-05-06 15:33:28 +02:00
Wim Taymans
19e3e20c47 protocol-native: improve client and resource refcounts
Add a refcount to resource and client so that we can keep them alive
while the native protocol is using them.

One problem might be that the protocol destroys the client or resource
while handling it and that would cause errors.

Fixes #565
2022-05-06 13:25:57 +02:00
Wim Taymans
383df85466 modules: handle factory destroy
Listen for factory destroy and clean up the module.

See #565
2022-05-06 12:11:20 +02:00
Wim Taymans
95f8c569a0 module-metadata: handle factory destroy
Destroy the module when the factory is destroyed.
2022-05-06 11:33:00 +02:00
Wim Taymans
8374c93e40 module-adapter: handle factory destroy
When the factory is destroyed, clean up and destroy the module as well.
2022-05-06 11:29:21 +02:00
Hagen
cb81e49f7d Remove unnecessary } in src/modules/module-raop-discover.c docs 2022-05-06 09:03:04 +00:00
Wim Taymans
15431570f4 module: handle global destroy properly
When the global is destroyed, we remove our listeners and set the global
to NULL.  We then destroy the module but because the global is NULL, we
don't remove ourselves from the list of modules, causing a crash later.

Fix this by always adding ourself to the list of modules and always
removing ourselves on destroy.

See #565
2022-05-06 10:16:37 +02:00