Handle the case where the converter in a source needs more output
buffers (-EPIPE). Schedule the follower in that case and try to
run the converter again until we have output or we can't make progress
anymore.
If the converter needs more data, schedule the follower before we
exit the loop with the data. This gives the follower a chance to get
more data asynchronously for the next iteration.
If we are already in the loop thread and flushing, this means we
added a new invoke item on the list from a callback. Place the
item on the queue and let the flush code take care of it after the
callback completes.
Required to fix some issues with draining in pulse where a stream
is destroyed from the drained callback which then invokes a pause.
Release transport when endpoint connection property is updated to false.
This also checks if the transport is already created when receiving
endpoint properties update to prevent multiple transport creation.
Because the signal can't be removed from the callback we can
simply iterate backwards and then forwards.
The first added hook (the unlock/lock pair) is called last before
going into the poll and first when leaving. This executes all other
callbacks inside a locked situation. And removing them with the lock
is not going to cause problems.
Use a safer version of the before and after hooks. First call
all before hooks and save them in reverse order in a save list.
Then call the after event for the ones remaining in the save list
and move them back to the hook list.
This makes it possible to remove the hooks from one the callbacks or
even from other threads with the right locks. Found as a solution to
the following problem as observed in vlc:
main thread thread_loop
pw_thread_loop_lock() before hook: lock suspend thread
pw_context_destroy()
- removes before hook to flush clients
pw_thread_loop_unlock()
before hook: lock acquired, resume
before hook: flush client hook executed
*crash*
pw_thread_loop_stop()
pw_thread_loop_destroy()
Any of the safer cursor methods (like spa_hook_list_call()) would also
work but are more expensive and don't reverse the before/after
order.
Don't change the resampler delay value, we need it to make sure
we keep samples around for the next round. With small period sizes,
we set the delay to 0 and mess up the resampler and cause dropouts
and clicking.
Fixes#287
This makes installed-tests (see commit b852b58f) do the right thing.
For build-time testing, spa/plugins/audioconvert/meson.build overrides
this with the SPA_PLUGIN_DIR environment variable, and for ad-hoc
testing by developers, pw-uninstalled.sh sets the necessary variables.
Signed-off-by: Simon McVittie <smcv@debian.org>
It is not clear if the port index is in the card or device port array
and it doesn't work when many ports are active. So simply iterate the
device ports and find the ones with the active flag set.
Continue processing the input data until we can't send anymore. When
we are following another driver, we need to process each buffer in
the cycle completely or we will start lagging behind.
The ConnectAudio method triggers Introspect and NewConnection calls from
hsphfpd to the backend, which will set the fd to use for the SCO data.
This imply to run the DBus loop while waiting for ConnectAudio reply to be
able to reply to those method calls.
MTU is hard-coded to 48. Using MTU from hsphfpd may prevent correct
sound operations.
Volume management is not yet implemented.
As hsphfpd is a prototype and its API subject to change, this backend is
disable by default.
This skeleton connects to hsphfpd daemon and list the managed devices.
This tool detects and fixes common English spelling mistakes, with
generally very few mistakes.
Here is the command I used to generate this commit. There were a few
changes that had to be done manually, and of course adding the ignore
file:
```shell
codespell -I .codespell-ignore -x .codespell-ignore -w
```
I didn’t add it to the CI, but this would be a good place for it.