Commit graph

11678 commits

Author SHA1 Message Date
Pauli Virtanen
d0ec322434 meson.build: set install tags on doc/man
These are predefined names in meson
2023-11-25 00:13:59 +02:00
Wim Taymans
2af5a90c90 evl: add fds to pollfd from rt thread
When we don't have the thread id yet, don't add the pollfds yet
but wait until we do our first wait operation.

Use flags for eventfd. We can use this to communicate between all kinds
of threads with read/write.

Use evl_init() in the init function, don't attach the main loop, just
the thread that dos the first poll.
2023-11-24 11:58:28 +01:00
Wim Taymans
a336aabe43 stream: pass properties to context_new
Whe  using pw_*_new_simple(), pass the properties to the automatically
created context as well so that we can configure it.

This makes it possible to, for example, load the client-rf.conf using the
simple API as well.
2023-11-24 10:12:49 +01:00
Pauli Virtanen
f14572648a bluez5: deal with too small Supported_Max_Codec_Frames_Per_SDU
Some devices appear to set Supported_Max_Codec_Frames_Per_SDU == 1 while
claiming they support two channels per stream, which is then not
possible.

In this case, limit the number of channels by the number of frames per
SDU when selecting.

Also adjust PAC sorting.
2023-11-23 17:47:55 +00:00
Pauli Virtanen
f327ed845f bluez5: add some debug to bap-codec-lc3
We don't want to dump on all calls to codec_select_config, so use debug
context.
2023-11-23 17:47:55 +00:00
Barnabás Pőcze
d88def09bd pipewire: module-roc-{sink,source}: add rudimentary ROC_INTERFACE_AUDIO_CONTROL support 2023-11-23 17:21:39 +01:00
Barnabás Pőcze
b19d0ffbc3 pipewire: module-roc-source: use SPA_NSEC_PER_MSEC instead of hard-coding 2023-11-23 15:12:50 +01:00
Barnabás Pőcze
b5e898ee83 pipewire: module-roc-{sink,source}: do not remove from argument property list
The property list is destroyed and not kept around, not passed
to any other component, so this is unnecessary work.
2023-11-23 15:12:50 +01:00
Barnabás Pőcze
68c0a13694 pipewire: module-roc-{sink,source}: pass 0 to pw_properties_get_uint32()
There is no reason to use `data->rate` as the default value
since it will be zero, so just pass 0 explicitly.
2023-11-23 15:12:50 +01:00
Barnabás Pőcze
0a3bd825cd pipewire: module-roc-{sink,source}: remove props member
The `props` member was not used at all, so get rid of it.
2023-11-23 15:12:47 +01:00
Barnabás Pőcze
6d8a31a3e4 pipewire: module-roc-{sink,source}: deduplicate protocol selection 2023-11-23 14:12:35 +01:00
Barnabás Pőcze
333fd8d2ae pipewire: module-roc-{sink,source}: port to ROC v0.3.X
ROC 0.3 introduced breaking changes, so adjust the code.
Also set the minimum supported ROC version to 0.3.0.

Fixes #3667
2023-11-23 14:12:35 +01:00
Barnabás Pőcze
5d62bf5c06 pipewire: daemon: do not set G_LOG_DOMAIN
GLib has not been used for logging for a long time,
so setting this macro has no effect and is unnecessary,
so remove it.
2023-11-23 11:57:45 +00:00
Wim Taymans
c59820493f docs: add some more doc about the threads 2023-11-23 12:32:35 +01:00
Wim Taymans
c4cd8fa73d impl-client: don't log warning when updating ignored keys
If a client tries to update an ignored key, don't log a warning. Only
log a warning when one of the security properties changed.

This is what we used to do before commit
0dfa05117b

It fixes a warning when a stream disconnects and reconnects because
the serial.id changed.
2023-11-23 12:29:55 +01:00
Wim Taymans
900f653860 docs: add some more docs 2023-11-23 10:21:08 +01:00
Arun Raghavan
63bb128948 rtp-stream: Set rtp.ptime on senders not receivers
The pw_stream direction is inverted from what we want (input => sender).
2023-11-23 01:28:20 -05:00
Barnabás Pőcze
aa681365c3 pipewire: module-filter-chain: fix buffer memory leaks
`impl::{silence_data,discard_data}` were not freed either
in case of an initialization error or graceful shutdown.
2023-11-23 05:50:17 +00:00
Barnabás Pőcze
2738bb4cb7 pipewire: remove pw_in_valgrind()
This function is very much orthogonal in function to the usual
features provided by pipewire, and there does not seem to be any
3rd party users based on Debian Code Search and GitHub.
So let's remove it before any 3rd party users start depending on
pipewire for their valgrind detection.
2023-11-22 23:05:03 +01:00
Barnabás Pőcze
3deaa2b0df pipewire: impl-module: respect PIPEWIRE_DLCLOSE
Commit b5c21c1fbc ("pipewire: use dlclose unless PIPEWIRE_DLCLOSE is set to false")
introduced the PIPEWIRE_DLCLOSE environmental variable to
force/prevent the dlclose()ing of shared objects. However,
native pipewire modules were not adjusted to respect its value,
and instead have been still using `pw_in_valgrind()` to
determine whether or not they should be unloaded.

Fix that by adding a private `pw_should_dlclose()` function
and using that in impl-module.c:pw_impl_module_destroy().
2023-11-22 22:58:00 +01:00
Pauli Virtanen
a3e86f1733 CI: bump fedora to 39
Needed to get new enough Doxygen version.
2023-11-22 20:10:49 +02:00
Pauli Virtanen
0fbcc87314 doc: make all manpages with Doxygen
Use (fixed-up) Doxygen manpage output for all program & module manpages.

This also allows formatting the manual pages properly in the HTML docs.

The Markdown pages work properly only with Doxygen >= 1.9.7, older
versions put them to wrong place in the HTML docs.
2023-11-22 20:10:49 +02:00
Wim Taymans
de954655bc modules: fix doc 2023-11-22 17:48:05 +01:00
Arun Raghavan
dec1102574 alsa: Move ctl sources to a main loop
It doesn't make sense to hang these on the data loop, so let's have
these on the main loop instead. Also avoids a potential crash while
removing them (since removal happens on the main loop and the data loop
might be polling while we're doing the remove).
2023-11-22 16:00:25 +00:00
Wim Taymans
bb82ddb601 Fix a warning
../src/modules/module-rt.c:615:21: warning: suggest parentheses around
assignment used as truth value [-Wparentheses]
2023-11-22 16:17:08 +01:00
Wim Taymans
3376b96f2a jack: handle concurrent jack_port_get_buffer()
Ardour calls jack_port_get_buffer() from multiple threads. For audio
buffers this will result in mixing the input samples into the target
buffer and there is no window for having a corrupt buffer.

For MIDI, there is a problem because we need to convert from and to
PipeWire MIDI and while we do that from multiple threads, the midi
buffer can be incomplete or corrupt.

Fix this by building the intermediate POD to a thread-local scratch area
and then copy it to the target buffer. If this is done from multiple
threads there is no moment where incomplete data can be seen in the
target buffer.

Make the complete midi-scratch buffer thread_local so that we also avoid
a race when converting midi data from a foreign port.

When we write into the scratch buffer when mixing and converting input
midi data, we also avoid a race there.

Fixes #3632
2023-11-22 16:16:30 +01:00
Jonas Holmberg
72323dcaf3 module-rt: Protect setrlimit() with mutex
Make sure threads initializing the module doesn't get/set RLIMIT_RTTIME
simultaneously.
2023-11-22 13:56:15 +00:00
Wim Taymans
f324f0e8e1 jack: optimize one buffer case
The normal case is using 1 buffer port port so we can avoid a
queue/dequeue pair of operations.
2023-11-22 13:20:52 +01:00
tytan652
33a3990c3c doc: fix xdg-desktop-portal documentation links 2023-11-21 21:25:13 +01:00
Pauli Virtanen
c29d4d4ab7 meson.build: make pandoc optional
Skip only pandoc-requiring parts if it is not available.
2023-11-21 17:00:45 +00:00
Dorinda Bassey
f4a56ad45d Fix some warnings
added cleanup of unused variables and fix warning about missing initializers
to resolve build warnings in pipewire-rs

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
2023-11-21 16:32:51 +00:00
Wim Taymans
e8c6c78982 jack: fix crash with fastpath debug
Don't deref p in the trace log because it can be NULL.
Don't try to dequeue a buffer when there are none. Improve some debug.

See #3632
2023-11-21 17:09:08 +01:00
Wim Taymans
b3ee9942f6 jack: enunerate Latency only for DSP ports
We don't really include the other ports in the API.
2023-11-20 18:17:31 +01:00
Wim Taymans
e4cee8eec2 libcamera: add latency param query
JACK queries this unconditionally but it's a good idea to implement this
like v4l2-source.
2023-11-20 17:51:27 +01:00
Wim Taymans
0fe7bd2780 jack: improve transport and times handling
Avoid reading from the activation directly to get cycle times but copy
the relevant fields of the clock when the cycle starts. Use the unique id
to get a consistent copy of the data.

This avoids some stay frames and values in jack_showtime.
2023-11-20 17:20:39 +01:00
Wim Taymans
49cdb468c2 alsa: also use interpolated time as nsec in IRQ mode
Don't use the current time as the nsec field in the graph clock because
it can jitter a lot. Instead, use the smoothed next_time, like we do
for timer based scheduling.

Since we track the current time against the rate converted ideal time,
lock on to the first timestamp when we reset the dll.

See #3657
2023-11-20 13:14:54 +01:00
Wim Taymans
0c857f5455 pulse-server: add stream/device state in dev_info
Also include and update the state of the device/stream in
collect_device_info so that we can compare it against the previous value
and emit a change event.

Fixes #3660
2023-11-20 11:39:31 +01:00
Pauli Virtanen
90bd9adb6b pulse-server: rename combine sinks option
Let's call it "sinks" in the docs, but keep the Pulseaudio name for
backward compat.
2023-11-20 08:41:13 +00:00
Pauli Virtanen
6d71fc637c man: add pipewire-pulse.conf.5
It mainly points to libpipewire-module-protocol-pulse(7) where the
documentation actually is.
2023-11-20 08:41:13 +00:00
Pauli Virtanen
b60ef222c1 doc: man: add see also in pipewire-pulse 2023-11-20 08:41:13 +00:00
Pauli Virtanen
fdcb02ed75 modules: add Module Name section to the module reference docs 2023-11-20 08:41:13 +00:00
Pauli Virtanen
843e733479 doc: add documentation for pipewire-pulse modules
Add (minimal) reference documentation for each pipewire-pulse module.

Add some preprocessing to substitute @pulse_module_options@ in docs from
PW_KEY_MODULE_USAGE so the module options don't need to be repeated.

Produce Doxygen docs + generate manpages pipewire-pulse-modules.7,
pipewire-pulse-module-*.7
2023-11-20 08:41:13 +00:00
Wim Taymans
0ae797ea28 client-node: handle port_buffers errors better
First check if all of the new buffers are ok before attemping to replace
our exising ones with the new ones. Else we might end up copying some
of the new buffers and cleaning them up twice later.
2023-11-20 09:36:02 +01:00
Pauli Virtanen
7cd242bffb CI: install pandoc for module manpage generation 2023-11-19 16:39:15 +00:00
Pauli Virtanen
21854f24a5 doc: generate man-pages also for pipewire modules
Use pandoc + some processing to convert Doxygen html output to man
pages.

Requires pandoc & python for building.

Generates manpages: libpipewire-modules.7, libpipewire-module-*.7
2023-11-19 16:39:15 +00:00
Pauli Virtanen
62f69581bf man: add pw-loopback.1 2023-11-19 16:39:15 +00:00
Pauli Virtanen
2ee4065c11 man: add pw-dump.1 2023-11-19 16:39:15 +00:00
Pauli Virtanen
77fad4ee13 doc: reorganize files
Separate various autogen files from the documentation .dox files.
Rename .dox files to match the intended tree structure.
2023-11-19 16:39:15 +00:00
Pauli Virtanen
eca773fc12 modules: strip "PipeWire Module:" from Doxygen page name
Make them appear nicer in the output.
2023-11-19 16:39:15 +00:00
Pauli Virtanen
7f5f88c04a client-node: store mix in pw_map so that they are not copied
struct mix contain pointers to themselves (see do_port_use_buffers) and
cannot be copied by value, so they should not be stored in pw_array.

Store them in pw_map instead.
2023-11-19 18:03:36 +02:00