Disallow = and : as bare items in [] containers, as that likely is
"[ { foo = bar } ]" mistyped as "[ foo = bar ]".
Disallow nesting errors, eg. "[ foo bar" or "[ foo bar }".
Fix handling of ", \ and # in bare strings.
Fix ignoring trailing comments.
Add a fixed-size stack (128 levels) to the tokenizer, so that it can
check these at levels below its depth.
When the tokenizer encounters an error, make it and its parents enter
error state where no further input will be processed. This allows caller
to check for parse errors later as convenient.
The error state can be queried using spa_json_get_error, which also
looks up the error line/column position.
spa_json_parse_float/int receive non nul-terminated string, so calling
string functions assuming nul-termination is invalid.
Fix by copying data to a buffer before doing parsing.
Call _activate() in the aec spa plugin before both capture and sink
streams are started and call _deactivate() after both capture and sink
streams are stopped, to make sure _run() is not called while the spa
plugin is inactive.
Make a new function to set the rtp stream in the error state.
When we fail to start the stream, set the error state. Otherwise (like
when we try to use an invalid interface name) the socket create will
fail but the stream will still try to send data to the invalid socket.
spa_exchange() is used in spa_clear_ptr() and spa_clear_fd() which
already use the _old_value variable. So make it use a slightly different
local variable name to avoid shadow warnings.
Fixes#3915
Rework some things so that we can actually completely close and reopen
the driver when suspending. Leaving the device opened but not streaming
causes trouble when ffado-mixer changes the settings in between.
Do this by first doing a probe to get the ports and streams and then
link those to the actual buffers when we start streaming.
Follow the graph rate and quantum so that we open with the right
settings, this makes pw-metadata work on the quantum and rate. It
requires a driver reopen so it might be slower.
Try to handle some errors better.
See #3558
spa_json_parse_stringn() can be used when the strings source and
destination are overlapping so use memmove instead of strncpy to
avoid corruption of the strings.
Use alsa:acp: as the object prefix to make it different from the
alsa:pcm prefix when we are not using ACP.
Replace the card index in the object.path with the card_name, which
we try to construct from the alsa.id when it is available. This brings
the object.path in line with the alsa-pcm-device naming and adds the
user configurable id in the object.path to make it possible to
differentiate between identical devices.
Place the acp device index after the card_name instead of the unstable
device name (which depends on the alsa card number, which depends on the
kernel probing order).
This should make the object.path stable accross reboots for ACP and user
configurable with udev. With such a stable id, the other fields can be
made stable as well with custom rules.
See #3912
Use snd_ctl_card_info to set some more card properties such as the
alsa.id, alsa.mixer_name and alsa.components.
alsa.id is interesting because it is possible to use udev rules to set a
custom id, which is handy when you have two identical cards in the
system and want to assign unique ids to them.
See #3912
As part of LibreSSL's cleanup of removed ENGINE support, <openssl/x509.h> is no longer included in <openssl/engine.h>. <openssl/evp.h> was transiently included in <openssl/x509.h>, compared to <openssl/rand.h> for OpenSSL.
The v4l2 build unsets _FILE_OFFSET_BITS, which is not allowed when setting
_TIME_BITS=64. Having verified that nothing in this module is sensitive to
64-bit time_t (none of the functions it intercepts handle time), we also
unset _TIME_BITS to allow this to build as before.
Signed-off-by: Steve Langasek <steve.langasek@canonical.com>
Reviewed-by: Dylan Aïssi <dylan.aissi@collabora.com>
Parse the audio rate from the caps and set this as the stream node.rate
property. This will try to switch the graph to this rate and avoids
resampling.
Rework some of the property handling.
Add pw_conf_section_update_props_rules() that will not only update the
properties of a section but wil also apply rules in section.rules and
match against the context properties.
Use this by default when using pw_context_conf_update_props().
Add a new method to get a string name of the VM type. Place the
cpu.vm.name in the context properties.
This makes it possible to deprecate the vm.overrides with something more
flexible based on rules. Update the conf files and docs to refect this.
For capture streams, place the time of the cycle when we received this
buffer in the new buffer time field.
Without this (and without timestamps in an optional header metadata)
it's impossible to determine when a buffer was created. With this field
and the pw_stream_get_time_n() and pw_stream_get_nsec() we can derive
the mapping to ticks and delay in the graph.
This does a couple of things: first, we implement revents demangling,
which seems to be required (although hw: devices work fine without it).
The second is to actually read the ctl events so we can tell when
elements we care about have changed, instead of reading everything and
trying to do a diff.
The latter is also required from a correctness perspective, as otherwise
the ctl might keep triggering wakeups while the fd is ready to be read.
Always copy the timing info when capturing, not only when there is a
buffer to dequeue.
We can update the rate_queued and rate_size with defaults when we don't
have rate matching. We can then also directly use the rate_size field
to update the buffer requested size.
Add a new extension that can create a server on a user provided socket
with user provided security properties.
This is mainly used in flatpaks that want to create and bind a pipewire
socket with specific permissions for the flatpak app.
The flatpak will also provide an fd that will be closed when the server
can be removed.