Some of the tools would like to connect to the manager socket first
because they are manager style apps. They however completely ignore any
of the configured sockets in the config and assume everything is the
default.
Fix this by adding a remote.intention = "manager" to those apps. This
instructs the protocol to first try to connect to a socket with the
-manager extension before attempting the regular configured socket.
This makes things work when you have sockets configured in /tmp
and have remote.name = /tmp/pipewire-0 in the config.
This gets the next key and value from an object. This function is better
because it will skip key/value pairs that don't fit in the array to hold
the key.
The previous code patter would stop parsing the object as soon as a key
larger than the available space was found.
In order to show metadata changes when monitoring, a sync must be
triggered just like it is done for other objects, to make sure that
`dump_objects()` is called some time later and the changed metadata
objects are shown.
Otherwise metadata changes would never be displayed unless there
was a change to a different type of object, whose event handlers
do trigger a sync.
Fixes#4053
`registry_event_global()` creates an `object` object for every object,
not just those matching `data::pattern`. However, previously
`registry_event_global_remove()` only destroyed those objects
that matched the given pattern. Fix that by destroying
every object.
Fixes#4001
Fixes 47e1f38f03 ("pw-dump: also dump object removal")
Dictionaries are by default printed in their insertion order.
This is unergonimic when comparing properties created by different
clients, as they may insert them in different orders.
Add a sequence number to pw_param.
Add param_info to param_update to filter out the params of the latest
sequence number.
This can be used to track params from a certain sequence number. Update
node, port and device.
Add a new seq field in the param-info struct. Users can use this
field to keep track of pending param updates.
Store the latest seq number of the param update in the seq field. Remove
all params that don't match the sequence number because they are too
old. This avoids duplicate old params in pw-dump output.
Rework the pulseaudio manager with this same method.
Library code generally shouldn't modify global state, so pw_init()
should not result to changing the C locale.
Instead, set the C locale in main() for tools and daemons.
We'll still setlocale for LC_MESSAGES, to get translated UI elements in
wireplumber. This workaround should be removed eventually...
And use this in spa_json_format_float() where we also avoid invalid
json floats.
Use json float format in some places where we serialize json floats.
Add a unit test.
See #2223
Make all tools output to stdout (pw-mon mostly) so that we can pipe the
output around.
Send errors to stderr.
fprintf(stdout, ...) -> printf(...)
setlinebuf for stdout so that pipe works better.
See #2110
Do pattern matching on object properties to also allow lookups on
type, object.path, object.serial and <type>.name.
ex:
pw-dump alsa_card.usb-BEHRINGER_UMC404HD_192k-00
pw-dump alsa_input*
pw-dump Node
Mark some structures, arrays static/const at various places.
In some cases this prevents unnecessary initialization
when a function is entered.
All in all, the text segments across all shared
libraries are reduced by about 2 KiB. However,
the total size increases by about 2 KiB as well.
This also brings the advantage that all tools, examples, modules, components
can also be compiled standalone out-of-tree using libpipewire from the system
Just like the real free() we should just ignore a NULL pointer, makes the
caller code easier for those instances where properties are optional.
Patch generated with concinelle with a few manual fixes.
Previously,
isatty(fileno(data.out) && getenv("NO_COLOR") == NULL))
would call `isatty()` with
fileno(data.out) && getenv("NO_COLOR") == NULL
as its argument. This meant that, for example,
NO_COLOR=1 pw-dump
would still produce colored output when run with
a TTY as its standard input.
Fix that by moving the parenthesis.
Fixes: af63d08453 ("tools/pw-dump: only print colors if we're connected to a terminal")
SPA_MEMBER is misleading, all we're doing here is pointer+offset and a
type-casting the result. Rename to SPA_PTROFF which is more expressive (and
has the same number of characters so we don't need to re-indent).
Don't escape the Spa:String:JSON types in the metadata as it is
supposed to be valid JSON that can be output directly. We might want
to reparse and reformat it later to be sure.
Add -c option to pipewire to select config file. Use this to select
the uninstalled conf file.
Rename conf properties, prefix with context.
Simplify the main daemon now that everything can go in config.
Simplify pipewire-pulse now that we can put everything in config, it's
now virtually the same as pipewire but with a differenct config file.
Parse server addresses as array of strings.
Make it possible to add a NULL param to the pending list. The NULL
param removes all previous updates.
When applying the updates, the NULL param removes the params from
the target list.
For the cached params in the node/device/port we need to be careful
because multiple clients might ask for updates concurrently. Clear
the pending list whenever a new param update starts so that we always
only keep the last set of updates.
This has two advantages: it actually removes params that become
unreadable or that got removed and it allows us to update the target
list more efficiently in one single loop.
Make it possible to add a NULL param to the pending list. The NULL
param removes all previous updates.
When applying the updates, the NULL param removes the params from
the target list.
This has two advantages: it actually removes params that become
unreadable or that got removed and it allows us to update the target
list more efficiently in one single loop.