Some JACK clients place OSC messages in MIDI buffers. Try to detect the
OSC messages and mark the control as OSC.
Also allow OSC control to be converted to JACK MIDI.
This should make things work better with native PipeWire clients that
handle MIDI and OSC.
We place the currently configured runtime settings in the properties but
clear the values when not negotiated. Don't do that but place the
defaults (when set) instead.
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.
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.
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.
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.
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.
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().
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.
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).
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
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>
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.
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
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
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
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.