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
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
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.
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
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
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
The file name "lc3.h" in the ETSI LC3plus package may conflict with the
actual LC3 codec, so try to find a file "lc3plus.h" instead. Also try
to find a pkg-config dependency for it first (in which case use lc3.h,
assuming it's in different directory). This can be fine tuned, if
something starts to package that library.
Use the new requested buffer field to only queue the amount of samples
required by the resampler for the current quantum. This avoid spikes
when the maxsize block of samples is processed.
Fixes#2353
LC3plus expands 509 bytes input -> 7680 bytes output, which is bigger
than current decode buffer.
Make the decode buffer bigger, and put it on heap, not stack.
Codecs may need to fragment a single encoder frame across multiple
packets that are sent consecutively.
Allow codec->encode() to set need_flush=NEED_FLUSH_FRAGMENT, so that
sink should immediately call start_encode + encode with NULL input data,
to produce the next packet.
Previously, other return values than need_flush=1 were unused, so no
need to bump codec ABI for this.
Add some more context to the match rules and return how many properties
changed. If something changed, send all the properties as updates
instead of just the original changed ones.
When some blocking method is performed on the process thread, like
jack_connect() mark the data thread as blocked while we wait for the
thread loop to process the result.
If we then try to do a blocking _invoke from the thread loop on the
data thread, make sure we don't wait for it to complete or else we
deadlock.
We need exactly 4 hex characters, everything else is refused. We
also copy those characters directly to the output string without
assuming any encoding.
See #2337
Codec switch flag should be cleared on device connection status change,
to deal with codec_switched() callback not being called if device is
suddenly disconnected.
When device is disconnected, running codec switches are not meaningful,
and should be stopped.
The codec switch callback may also trigger A2DP profile switch, which
may reconnect the device. Fix it so this does not happen.
See #2334