Commit graph

603 commits

Author SHA1 Message Date
Wim Taymans
f0cfe9449d tools: dump sndfile loginfo on error when verbose 2025-09-10 10:12:00 +02:00
Arun Raghavan
487c7ee933 tools: Fix -C handling for pw-dump
The short form needs to have a :: to signal an optional argument so
that something like -Calways can work.
2025-09-10 10:11:36 +02:00
Wim Taymans
f5c3d0d29a midifile: fix seeking in midifile
When we perform a seek, we need to update the current position in the
file as well or we calculate wrong offsets.
2025-09-10 10:05:31 +02:00
Wim Taymans
76db05a0f8 Use "8 bit raw midi" for control ports again
There is no need to encode the potential format in the format.dsp of
control ports, this is just for legacy compatibility with JACK apps. The
actual format can be negotiated with the types field.

Fixes midi port visibility with apps compiled against 1.2, such as JACK
apps in flatpaks.
2025-05-23 17:00:05 +02:00
Wim Taymans
8c1e1ea17f midifile: unpack the UMP SysRT bytes correctly
They are packed in a native endian uint32_t so read it like that and
then use shifts to get the right bytes.
2025-05-09 11:50:43 +02:00
Simon Ruderich
63bf21d7b8 midifile: decode UMP SysRT messages 2025-05-09 11:50:36 +02:00
Pauli Virtanen
f120b595f0 pw-loopback: add missing --channel-map long option 2025-04-14 09:40:02 +02:00
Wim Taymans
58c412c9dc pw-cat: improve sndfile file format debug info
Print the endianness, container name and the sample format nicely
instead of dumping the hex values.
2025-04-02 15:33:54 +02:00
Wim Taymans
081cb6848e pw-cat: prefer AU format when using stdin/stdout
WAV is actually not usable for streaming output by sndfile.

See #4629
2025-04-02 15:33:54 +02:00
Wim Taymans
516f86c329 protocol: improve manager socket handling
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.
2025-01-29 12:59:45 +01:00
Wim Taymans
24bcacc619 conf: remove client-rt.conf
We now automatically move non-rt clients into non-rt threads so the
client-rt.conf is obsolete.

Move the module-rt in client.conf and add conditions to disable modules.

Transparently load client.conf in case applications still specify
client-rt.conf.

Custon configuration in the client-rt.conf.d/ should be moved to
client.conf.d/
2025-01-14 12:40:05 +01:00
Arun Raghavan
088d8011f2 tools: Document a couple of missing short form args for pw-loobpack 2024-12-31 11:22:49 -05:00
Barnabás Pőcze
05ec64623a pw-cli: remove unused INDENT macro 2024-12-14 23:27:45 +01:00
Barnabás Pőcze
1f06d00838 pw-container: fix indentation 2024-12-14 23:27:45 +01:00
Wim Taymans
84bd4b7ea9 spa: use static inline for interfaces instead of macro
It gives better typechecking and a path to make a library of functions.
2024-11-26 11:35:49 +01:00
Pauli Virtanen
c36c028dd2 pw-dump: don't emit remove events when not monitoring
When pw-dump is called without --monitor, it should output exactly one
JSON array, and no remove event indicators.
2024-11-23 12:11:33 +00:00
George Kiagiadakis
f12d37a421 pw-dot: fix information on the link labels 2024-11-05 12:09:43 +02:00
Wim Taymans
fa1ec61cf0 profiler: add followerClock block
Add a new followerClock block in the profiler info. This is only set
when the follower could be a driver and it contains the clock info used
for following the driver, mostly the rate difference and delay.

Dump this info in pw-profiler -J

Make sure we always set the info in the clock, especially also when we
are following.
2024-10-09 11:31:54 +02:00
Wim Taymans
d1efc9c2c6 tools: improve profiler -J output
Put the newline and comma right after printing the line so that it gets
flushed immediately. Otherwise we only see the last line in the next
cycle. We then need to end the JSON output with an empty object.

Pretty print the node status instead of the value.
2024-10-04 10:42:38 +02:00
Wim Taymans
b5f9409c12 pw-cli: implement unload_module
Fixes #4276
2024-09-23 15:46:33 +02:00
Wim Taymans
4b9db9492e json-pod: add error checking version of json to pod
Add an error checking version of the json to pod converter and use that
in pw-cli to report about json parsing errors.
2024-09-23 10:12:56 +02:00
Wim Taymans
e2991f6398 json: add helper function to parse channel positions
Use the helper instead of duplicating the same code.

Also add some helpers to parse a json array of uint32_t

Move some functions to convert between type name and id.
2024-09-18 09:54:34 +02:00
Wim Taymans
41f9abc733 types: add function to convert audio channel short name to type
Move some functions around for this
2024-09-16 17:00:44 +02:00
Wim Taymans
ce390d5b22 spa: add spa_json_object_next
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.
2024-09-16 09:50:36 +02:00
Wim Taymans
cd81b5f39a spa: add spa_json_begin_array/object and relaxed versions
Add spa_json_begin_array/object to replace
spa_json_init+spa_json_begin_array/object

This function is better because it does not waste a useless spa_json
structure as an iterator. The relaxed versions also error out when the
container is mismatched because parsing a mismatched container is not
going to give any results anyway.
2024-09-16 09:50:33 +02:00
Wim Taymans
feccb882b6 spa: add spa_json_begin
That combines spa_json_init() and spa_json_next, a common thing to do.
2024-09-16 09:50:31 +02:00
Wim Taymans
0956fc0884 tools: try to parse float values better
First try to parse the float value as a JSON number and then fall
back to atof to get the locale dependent variant.

This transparently makes things work with values such as 0.5 and 0,5.

Fixes #4234
2024-08-28 16:49:28 +02:00
Wim Taymans
19f4fac1e1 pw-cat: add support for streaming
sndfile actually supports reading and writing from/to stdin/out with the -
filename, so allow that.

Add support for streaming in dsf, dff and midifile as well.

Add a -a option to pw-cat use a pipe with raw bytes, otherwise try to
use the parsers and sndfile to read/write from/to stdin/stdout.

You can then do things like:

 sox 2L-053_04_stereo-DSD64.dff -t dsf -  | pw-cat -pdv -

 pw-cat 07.Joe.Satriani.Clouds.race.across.the.sky.wav | pw-cat -pv -

 pw-cat -rmv --target=0 - | pw-mididump -

Fixes: #4204
2024-08-23 15:44:31 +02:00
Wim Taymans
d9bd2628d9 midifile: remove MIDI1 message requirement
We can transparently convert to MIDI1 so there is not need for the
assert.
2024-08-23 15:35:16 +02:00
Wim Taymans
63afe65e3f midifile: use the meta.offset to get to the metadata 2024-08-23 15:34:36 +02:00
Wim Taymans
a60cf79226 pw-cat: add dsd and encoded long options 2024-08-23 15:33:25 +02:00
Wim Taymans
8dd2229364 tools: also list some midi properties 2024-08-23 15:32:40 +02:00
Wim Taymans
3dfecf18d6 pw-cat: redirect verbose output to stderr
So that it doesn't interfere with the stdout output when using a
pipe.
2024-08-23 15:31:36 +02:00
William Wedler
7eb1257a8f pw-top: Limit length of formatted shortname to resolve build error
Resolves:

"error: ‘%s’ directive output may be truncated writing likely 33 or more bytes into a region of size 10 [-Werror=format-truncation=]""
2024-08-08 15:12:28 -04:00
Wim Taymans
b61765eaf4 pw-cli: support arbitrary large params and commands
Use a memstream to collect the arguments so that it can dynamically
allocate as much memory as necessary.

Use a dynamic pod builder to construct the pods so that they can be of
arbitrary size.

Fixes #4166
2024-07-31 17:36:45 +02:00
Wim Taymans
d057c95b2b midifile: add support for UMP
Add a type to the events, which can be MIDI1 or UMP.

Add debug functions for UMP messages.

midifile only supports saving MIDI1 format files for now. It will convert
to MIDI1 when asked to write an UMP message.

In pw-cat, convert the MIDI1 messages to UMP before sending into the
graph.
2024-07-30 09:38:40 +02:00
Arun Raghavan
ab5fadec2b pw-profiler: Move clients' legend away from graph data
With a large number of clients, some of them might be obscured by the
graph. Separate out the legend for now. We might be able to do better
formatting, but for now, this should do.
2024-07-17 15:54:34 +00:00
Arun Raghavan
585106df04 pw-profiler: Add more explanatory text to profile graphs
Should help make it easier to parse what each field means.
2024-07-17 15:54:34 +00:00
Wim Taymans
3de4f0d48b pw-profiler: add -n and -J options
The -n option sets the number of iterations to log.

The -J option dumps the raw profiler data as JSON on stdout.
2024-07-15 12:23:58 +02:00
Barnabás Pőcze
17fcc9fc51 pw-container: use smaller path for temporary file
The automatically deduced size is sufficient. This
prevents a -Wformat-overflow warning.
2024-06-27 21:18:06 +00:00
Arun Raghavan
92c9b27c94 pw-cli: Dump object info on events
This prints changed state, props and params when run with -m and running
the `info` command. We try to print only things that have changed. It
would probably be good to make the props (and params) print a diff of
what's changed as well.
2024-06-21 16:08:24 -04:00
Wim Taymans
1ae4374ccf Fix compilation with -Werror=float-conversion
Better make the conversions explicit so that we don't get any surprises.

Fixes #4065
2024-06-18 12:17:56 +02:00
Barnabás Pőcze
eed7eb1556 pw-dump: sync on metadata change so that changes are displayed soon
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
2024-06-13 00:04:11 +02:00
Wim Taymans
cdfe95c091 pw-link: avoid crash when proxy was already destroyed
When a link already exists, the link will fail and the proxy will be
destroyed and the pointer set to NULL. Avoid doing things with the NULL
pointer when cleaning up.
2024-06-11 15:57:44 +02:00
Wim Taymans
c48c444566 pw-link: avoid memleak when proxy create fails 2024-06-11 15:57:21 +02:00
Diego Viola
7410755c03 Fix typos
found them with codespell.

Signed-off-by: Diego Viola <diego.viola@gmail.com>
2024-05-22 09:19:34 +02:00
Barnabás Pőcze
b3bd026699 pipewire: remove cleanup.h
Since `spa/utils/cleanup.h` is not a private header anymore, there is
no need for a separate `pipewire/cleanup.h` since the definitions of
the cleanup routines can now be moved into the respective headers.
2024-05-16 17:35:58 +02:00
Wim Taymans
d7df3811e1 tools: queue the buffer again in all cases 2024-05-09 19:32:37 +02:00
Barnabás Pőcze
6d7b0284dd pw-dump: destroy all objects not just those matching the pattern
`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")
2024-05-05 16:39:42 +02:00
Barnabás Pőcze
0c0d520c32 pw-dump: fix string memory leak on error
`object::type` was not cleared in the error path. Fix that
by calling `object_destroy()`, which takes care of it.
2024-05-05 16:38:40 +02:00