Commit graph

565 commits

Author SHA1 Message Date
Wim Taymans
1bbaf270f8 stream: add resample size to pw_time
Now that the resampler input size is set in the io_rate field when we
start we can add it to the pw_time struct as well.

This way we can know the required resampler input without having
to dequeue a buffer. This can be handy when the stream is a driver
and needs to know how much data to accumulate before starting the graph.

See #3750
2024-01-15 15:35:33 +01:00
Barnabás Pőcze
d8ab51a9fc pw-top: use media.name as display name
Try to use `media.name` as the display name for a node
when none of the other keys are found in its properties.

For example, `pw_stream_new_simple()` only sets `media.name`
on the created node object by default.
2024-01-12 02:12:55 +01:00
Barnabás Pőcze
9d439bac06 pw-top: update name when it changes
Recalculate the display name for a given node after its properties change.
2024-01-12 01:47:05 +01:00
Barnabás Pőcze
e2d3f9140b pw-reserve: fix potential DBusMessage memory leak
Our reference to the message must always be dropped,
even if `dbus_connection_send()` fails.
2024-01-08 10:55:02 +00:00
Barnabás Pőcze
72d5417857 pw-reserve: use arg0namespace for dbus match rule
Only names in the `org.freedesktop.ReserveDevice1` namespace
are interesting for the purposes of device reservation, so
use `arg0namespace` in the dbus match rule to filter out others.
2024-01-08 10:55:02 +00:00
Wim Taymans
94f898ddc5 stream: check requested before use
It can be 0 and so we should fill the complete buffer.

Fixes #3683
2023-11-30 11:10:47 +01:00
Pauli Virtanen
b12119da28 pw-reserve: require valid name + check rd_reserve_new errors
Empty name in rd_device_new triggers assert inside DBus, so bail out
before that.
2023-11-28 10:26:43 +00:00
Théo Lebrun
38157a8937 pw-top: fix version constant used for pw_node_events
This changes the value declared (3 currently versus 0 following this
patch). I have not seen code checking this version number.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2023-11-02 12:42:50 +01:00
Pauli Virtanen
963ea1f57c tools: make pw-dump/mon/top try to connect to the default manager socket
These tools are used for debugging, and should default to connecting to
the manager socket if present.
2023-10-24 07:08:07 +00:00
Wim Taymans
b3f8df6dfc pw-cat: don't overrun our param array 2023-10-11 13:34:18 +02:00
Wim Taymans
dcad1243a8 pw-cli: avoid NULL deref
info can be NULL so use the update instead.
2023-10-06 08:50:22 +02:00
Wim Taymans
53a4a124aa pw-cli: handle some allocation failures or NULL info 2023-10-05 11:16:57 +02:00
Wim Taymans
be1a60c5f9 pw-cat: add DFF file suppport 2023-10-02 16:51:37 +02:00
Barnabás Pőcze
436787d6ba treewide: try to use const char * for string literals 2023-09-16 17:47:35 +02:00
Simon Ruderich
615f950c2f pw-top: add missing options to man page and improve --help output 2023-09-11 18:50:24 +00:00
Stefan Ursella
cacdcc1b62 pw-mon: add filter param to hide props and/or params 2023-09-11 17:42:14 +00:00
Wim Taymans
ebeae802ad audioconvert: improve tag and latency handling
Don't just forward the tag and latency events to the follower but let
the audioconvert aggregate and emit the updated tag/latency event
that is then configured on the follower.

When using the DSP mode of the audioconvert, this results in an
accumulated latency/tag from all the DSP ports instead of just
the last DSP port param update.

Put properties with media. prefix in tags in pw-cat.
2023-09-07 15:27:21 +02:00
Wim Taymans
d7f7fd258d pw-cat: set default properties after setup
So that we can still set the MEDIA_NAME from the artist/title.
2023-09-07 10:05:15 +02:00
Peter Hutterer
26ecde20b9 pw-mon: check stdout, not stderr for tty
Commit afc88a12e5 changed pw-mon to use printf so we now need to check
stdout to know whether we need to print with colors.
2023-08-25 13:32:41 +00:00
Stefan Ursella
71653e04d2 pw-top: add 'batch-mode' and iterations known from top 2023-08-23 09:53:51 +00:00
Stefan Ursella
7f30621b86 pw-top: format 'show_help' and sort options 2023-08-23 09:53:51 +00:00
Wim Taymans
390f6c9cb8 perm: add a new L permissions
When a client has the L permission on the node, it can make links
between the node even if the owner of the node can't see the other node.
2023-07-28 11:01:43 +02:00
Wim Taymans
0ab6452b7e pw-cat: exit when we are unconnected
We get unconnected when the session manager kills us when it can't
make a link.

See #2731
2023-07-26 16:03:40 +02:00
Barnabás Pőcze
fe45786a5d treewide: add some examples for the spa_auto* macros 2023-07-11 14:23:53 +02:00
Wim Taymans
d5d8ebeaac pw-cat: only override properties when not already set
This makes it possible to override any of the properties with -P such as
the graph rate.
2023-06-30 16:24:13 +02:00
Wim Taymans
2d253de359 module-profiler: add per client xrun count in profiler data
So that pw-top can show the client xruns instead of the driver xruns
2023-06-02 13:23:55 +02:00
Wim Taymans
3f46044c39 impl-node: update xrun_count of late nodes
When the graph didn't complete, update the xrun_count in each node
that didn't complete.

We can then remove the code to simulate that from pw-top.
2023-05-22 10:24:51 +02:00
Wim Taymans
2ed65a7e36 profiler: improve profiler stats
The driver and follower signal times are currently the same timestamp
so allow a 0 difference between the driver and follower signal time
to calculate the scheduling delay.
2023-05-06 10:54:57 +02:00
Wim Taymans
181cbc5c99 pw-config: fix include for isatty 2023-04-20 10:40:47 +02:00
Wim Taymans
e90e948166 man: add pw-config man page 2023-04-20 10:24:29 +02:00
Wim Taymans
2d388c6908 properties: add color support for dumping properties 2023-04-20 10:02:08 +02:00
Wim Taymans
d1aeb8144b tools: add pw-config
Add a tool to debug how config files are loaded and merged.
2023-04-19 18:06:22 +02:00
Wim Taymans
ccd118368e pw-metadata: add -l option to list available metadata 2023-04-14 15:06:55 +02:00
Wim Taymans
e1aedbab5b pw-cli: avoid property leak 2023-03-16 12:55:27 +01:00
Wim Taymans
98a214891d handle some uninitialized variables 2023-03-16 12:29:15 +01:00
Wim Taymans
1c18e8aa69 handle some error cases 2023-03-16 12:28:29 +01:00
Barnabás Pőcze
1ef43a5255 meson.build: install symbolic links instead of compiling multiple times
Currently, among others, the `pipewire-pulse` executable is an
exact copy of the `pipewire` executable. Use meson's
`install_symlink()` to avoid the need for compiling the same thing
multiple times. Also use `custom_target()` so that the aliases
are available in an uninstalled environment.

Do the same for `pw-cat`. The benefit is that all aliases
of `pw-cat` are now available in an uninstalled environment.

This commit increasese the minimum meson version to 0.61.1
as that is needed for `install_symlink()`.

The reason for using 0.61.1 instead of 0.61.0 is the following bug:
https://github.com/mesonbuild/meson/issues/9820
2023-03-10 19:50:29 +01:00
Carlos Rafael Giani
f03c606ad9 pw-cat: Keep track of excess playtime when playing encoded audio 2023-02-24 14:15:13 +01:00
Carlos Rafael Giani
dc161fc6af pw-cat: Rework encoded audio support to use libavformat to parse frames 2023-02-24 14:15:13 +01:00
Carlos Rafael Giani
580a3d9872 pw-cat: Enable libavutil logs
This is useful for debugging pw-cat encoded audio playback errors.
2023-02-24 14:15:13 +01:00
Barnabás Pőcze
934ab3036e treewide: use SPDX tags to specify copyright information
SPDX tags make the licensing information easy to understand and clear,
and they are machine parseable.

See https://spdx.dev for more information.
2023-02-16 10:54:48 +00:00
Wim Taymans
dd0d3ac264 pw-cat: remove useless code
The data stride for encoded formats should be 1 and also placed in the
stride in the buffer (not 0). So there is really no difference with the
regular codepath.
2023-02-14 16:44:52 +01:00
Wim Taymans
b9ddd54a98 pw-cat: don't read more than the requested frames 2023-02-14 16:44:52 +01:00
Carlos Rafael Giani
59ad6c26aa pw-cat: Add fallback for the older libavcodec channel layout API
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-01-24 08:44:14 +00:00
Carlos Rafael Giani
e261f2ac1c pw-cat: Check for pw_cat_ffmpeg flag instead of HAVE_ALSA_COMPRESS_OFFLOAD
FFmpeg integration in pw-cat does not strictly require Compress-Offload;
for example, there could be other nodes in the graph that can handle
compressed audio.

Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-01-24 08:44:14 +00:00
Carlos Rafael Giani
6284cf39c0 meson: Rework FFmpeg / tinycompress detection and add pw-cat-ffmpeg option
* Decouple FFmpeg integration in pw-cat from the ffmpeg option; if
  one wants to use Compress-Offload but not the ffmpeg SPA plugin,
  it is then possible to just pass -Dpw-cat-ffmpeg=enabled to meson.
  Likewise, this also makes it possible to build the ffmpeg plugin
  without extending pw-cat.
* tinycompress does not need to be detected in the root meson.build,
  since it is only needed by the alsa plugin.
2023-01-24 08:44:14 +00:00
Carlos Rafael Giani
e9a2c6aa34 Rename "compressed-offload to "Compress-Offload" in the code 2023-01-24 08:44:14 +00:00
Sanchayan Maity
55a79fd16a pw-cat: Add support for compressed formats 2023-01-24 08:44:14 +00:00
Wim Taymans
3bfee14d7f pw-cli: add -m option to help 2023-01-24 09:14:33 +01:00
Wim Taymans
d83f2520b6 pw-cli: silence port changes outside of monitor mode 2023-01-20 17:10:52 +01:00