Commit graph

445 commits

Author SHA1 Message Date
Wim Taymans
99f9f729ff handle open_memstream errors
Fixes #2182
2022-03-02 11:48:31 +01:00
Tasos Sahanidis
daf85f1cd6 pw-top: Fix unicode character clipping
Instead of using snprintf to clip the node line to the terminal width,
causing multibyte characters to be split improperly, this lets curses
wrap the text as it normally would, and then overwrites the wrapped
text with the next line, simulating clipping.
2022-02-28 18:30:34 +00:00
Wim Taymans
bf52630153 pw-cli: fix print of pod debug 2022-02-25 11:14:34 +01:00
Wim Taymans
e82f775fb3 tools: remove listeners 2022-02-09 16:30:13 +01:00
Wim Taymans
3db14600b2 remove some listeners 2022-02-09 12:33:52 +01:00
Wim Taymans
afc88a12e5 tools: cleanup up printf
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
2022-02-07 17:03:46 +01:00
Barnabás Pőcze
cc73053512 treewide: meson.build: use feature.allowed()
Since meson 0.59.0, a feature object has an `allowed()`
method which returns true when the feature is set to
'enabled' or 'auto'.

Utilize that instead of the previously used

  not feature.disabled()
2022-02-04 00:15:59 +01:00
Wim Taymans
7ac809618e pw-link: improve help and error messages
See #2089
2022-02-03 16:39:52 +01:00
Wim Taymans
a947faeaa0 pw-link: clarify -L option
-L is enabled by default, unless -m is specified.
2022-02-03 16:30:06 +01:00
Wim Taymans
b5cd6d02fd pw-link: fix -L comment 2022-02-03 16:22:21 +01:00
Wim Taymans
3256c6e5e7 tools: fix compilation with musl 2022-01-27 14:59:11 +01:00
Wim Taymans
bb5c43b5ba pw-cli: add support for sending commands to a node
So that it can be suspended manually.
2022-01-27 12:34:54 +01:00
Wim Taymans
420d65fb38 pw-cli: add pattern matching lookups
ex:

pw-cli e alsa_card.usb-BEHRINGER_UMC404HD_192k-00 Profile
pw-cli ls alsa_input*
2022-01-26 16:32:35 +01:00
Wim Taymans
b7e0b5437b pw-dump: add pattern matching
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
2022-01-26 16:31:38 +01:00
Wim Taymans
97d571d1e7 pw-cli: improve object lookup
Also allow object lookup with object.serial, and <type>.name
2022-01-26 15:12:27 +01:00
Wim Taymans
aa128ed489 spa: make common function to find type from short name 2022-01-20 18:08:30 +01:00
Wim Taymans
a8bafa0631 pw-metadata: handle NULL props from metadata object 2022-01-18 12:41:17 +01:00
Wim Taymans
5ebbe09371 pw-cli: move json to pod code to SPA 2022-01-18 10:38:11 +01:00
Wim Taymans
8415fa525f pw-cat: print "monitor" when recording from a sink 2022-01-17 14:47:27 +01:00
Wim Taymans
5135f9767a Revert "pw-cli: use a list for globals instead of a map"
This reverts commit 3c68476984.
2022-01-17 12:12:48 +01:00
Wim Taymans
3c68476984 pw-cli: use a list for globals instead of a map
Now that the global ids are not reused we can't use an array to look up
ids.
2022-01-13 14:53:18 +01:00
Wim Taymans
611591d0fc json: add spa_json_parse_stringn()
It also checks the destination size.
2022-01-04 12:37:00 +01:00
Wim Taymans
c46113faa3 json: spa_json_get_string() writes up to len chars or fail 2022-01-04 10:42:32 +01:00
Wim Taymans
2f4c589d5b pw-cat: also list additional targets in record mode
Also list the sink and output stream nodes because we can also record
from them.

Fixes #1952
2022-01-03 16:59:21 +01:00
Peter Hutterer
671410b3bf pw-mon: add support for colored output
Same CLI as pw-dump, i.e. -N, --no-colors, --color=always etc are
supported.

This uses a for-loop macro hack to automatically print prefixes and
suffixes, the with_prefix() macro resolves into the correct printf
statements to insert either just the marker "*" or the ansi sequences
for color/reset. Use of the macro is simply:
```
   with_prefix(true, stderr) {
	fprintf(stderr, "this will be prefixed\n");
   }
```
2021-11-11 08:21:58 +00:00
Peter Hutterer
cafe94efc2 pw-mon: switch the changed marker from single char to string
Prep work for coloured output where the prefix/suffix may be multiple
characters if ANSI sequences are used.
2021-11-11 08:21:58 +00:00
Peter Hutterer
2531ab0acd pw-mon: switch to use stderr everywhere
Most of pwmon's output uses spa_debug() or some related helper which
prints to stderr. Let's switch our explicit printfs over so we can
redirect the whole thing in one go.
2021-11-11 08:21:58 +00:00
Wim Taymans
5ed4977b38 destroy proxies when global is removed
When a global is removed, also remove the proxies. We can have multiple
proxies to a global otherwise when a client has a sequence of events
queued from the server like this:

Global 1 added
Global 1 removed
Global 1 added

The proxy we added in the firt event would not be destroyed because the
server did not know about it when global 1 was removed and then a
second one would be made.
2021-11-08 12:55:41 +01:00
Wim Taymans
b0e3e43c42 pw-mon: destroy proxies in global_remove event
Keep track of the proxies and remove them when the global is removed.
Otherwise we might end up in a case where the have 2 proxies when
an add/remove/add sequence of messages was queued.
2021-11-03 17:25:11 +01:00
Wim Taymans
f39f9b207b map: don't mix insert_at() and _remove()
You are supposed to allocate with _insert_new()/_remove() or use
someone elses allocated number with _insert_at(), never mix the
two or it will give an error.
2021-10-28 09:36:41 +02:00
Gleb Popov
43ef614537 Remove unused function. 2021-10-22 19:05:43 +03:00
Wim Taymans
45d9c2c9df pw-cat: use default metadata for default source/sink 2021-10-20 11:40:33 +02:00
Peter Hutterer
b78371f702 tools: update pw-reserve so don't need to include the c file 2021-10-18 20:44:11 +10:00
Peter Hutterer
1bced6b2ef Remove media-session from this tree
It is now available as a separate project in
https://gitlab.freedesktop.org/pipewire/media-session

The code required by pw-reservice has moved to src/tools/reserve.{c|h}
2021-10-18 20:44:07 +10:00
Wim Taymans
5f7c4dec34 meson: make it possible to compile without dbus
Make an option to disable dbus and all the code that depends on
it.

Fixes #1685
2021-10-09 15:00:04 +02:00
Wim Taymans
f275e3baaa jack: add jack log topic 2021-10-03 08:52:27 +02:00
Peter Hutterer
abd5f9fbe8 Remove remaining tabs from meson.build files
No changes, just tab-to-space replacement and a little bit of manual
twiddling.
2021-09-30 00:08:27 +00:00
Peter Hutterer
ae59185f6f pw-cli: use readline() in interactive mode
With history and a simple command completion hook this makes the
interactive mode a lot easier to deal with.
2021-09-28 07:19:13 +00:00
Peter Hutterer
7d58ce9e24 pw-cli: add a 'quit' command to exit
Slightly less confusing for new users if we have at least one
help-listed command to exit.
2021-09-28 07:19:13 +00:00
Peter Hutterer
e46a30562f Promote media-session to its own subdirectory
media-session is past the point of being a mere example, let's promote
it out of the subdirectory.

pw-reserve is moved to tools/
2021-09-22 08:53:08 +02:00
Wim Taymans
d8aec1c7b4 pw-play: move dsdplay into pw-cat 2021-09-21 12:29:41 +02:00
Wim Taymans
0ec77ab09c dsd: show rate in bytes per seconds. 2021-09-21 12:25:42 +02:00
Wim Taymans
275b8a0f9e dsdplay: make separate dsffile 2021-09-21 10:50:45 +02:00
Wim Taymans
ae9f90eccc dsdplay: implement data processing
Simplify channel layout management a little.
Use the bitorder and interleaving to read and format the DSD in the
buffer.
2021-09-21 10:50:45 +02:00
Wim Taymans
43b27002eb tools: add beginnings of DSD player 2021-09-21 10:50:44 +02:00
Wim Taymans
bf29130f84 midifile: debug some more message types 2021-09-14 15:39:35 +02:00
Konstantin Kharlamov
a4f3a23095 tools/pw-dump: add support for --color-always 2021-08-31 08:42:15 +00:00
Julian Bouzas
34b1ecc244 pw-cat: calculate number of samples properly with io_rate_match
Fixes wrong buffer sizes when adapter is configured in passthrough mode.
2021-08-25 19:23:23 +00:00
Wim Taymans
0bad741d45 pw-cat: suggest samplerate as graph rate 2021-08-18 09:44:53 +02:00
Wim Taymans
49c1c0386f pw-cat: fix raw read
raw read needs bytes, so use the stride to calculate it from frames.
Move ulaw/alaw to packed formats.
2021-08-17 17:56:31 +02:00