Make structure with defaults that holds the defaults as they are loaded
from the config file or initialized with default values.
Copy this structure to a settings version that is used at runtime.
Add a force-quantum and force-rate field in the settings that can be
used to force a quantum and samplerate if != 0.
Follow the rate of the _io_position area and adjust the resampler
to match. This ensures that we always process at the DSP samplerate
to the target negotiated fixed rate of the device/stream.
The merger and splitter use the samplerate from the _io_position
for the DSP formats so set the samplerate to 0 to make sure we
don't use it to negotiate a format with the peer.
Move the code to check the position duration for changes to one
new method.
Also check for samplerate changes and adjust the resampler state
accordingly.
Ensure all callbacks are called from the thread_loop and release
the thread lock before calling the callback.
Introduce a new rt_lock that is taken while the callbacks are called.
Only call the process_callback when we can acquire the rt_lock in the
data thread. This ensures the process callback is never called
concurrently with any other callback.
Give a warning when we try to call do_sync from the thread_loop
itself. We would deadlock because the thread that is supposed to do
the sync operation would be blocked in wait().
Fixes#1313
Check if the port id and direction is valid before accessing the
port array.
Handle unknown and invalid ports in many methods.
Free the port item after we removed the item from pipewire because
more methods are being called while removing the port and we don't
want them to fail.
impl_add_listener() could be called more than one time, ensure that we always emit node info
so that session manager(bluez-monitor) can receives it.
Fixes#1308
Previously, the configured test file would be named like the following:
spa-include-test-spa_control_control_h..cpp
fix that by removing one of the dots.
Furthermore, use the already existing `find` object instead of
calling `find_program` one more time.
Retrieve the pointer returned by `calloc()` and free that
instead of freeing the pointer to a member. This has worked
so far because as of yet `api` is the first member of the struct.
Since !737 it is not required of modules to emit the "loaded"
event if they can load immediately, therefore remove the
unnecessary `module_emit_loaded()` call.
Furthermore remove redundant log messages as well.
Also keep the context lock locked with emiting the registration,
portregistration and connect callbacks.
All the other callbacks are emited with the lock and it makes sense to
also emit these ones with the lock so that code in the callback gets
a consitent view.
See #1265
Modules no longer need to emit the "loaded" event manually
if they can load immediately. In that case, the module loading
code will take care of emitting the event. If they can't,
they must return an async spa result, and emit the "loaded" event
when they see fit.
Fixes#1232