Commit graph

344 commits

Author SHA1 Message Date
Wim Taymans
faeb42fa66 pw-loopback: fix leaks, improve cleanup 2021-03-25 16:50:49 +01:00
Arseny Maslennikov
403f27c531 meson, pw-top: use ncursesw
Some PulseAudio clients are known to use localised client and
stream names as values for the respective PulseAudio props, most
notably plain old pavucontrol.

We call setlocale before anything else for ncurses to display
localised text correctly. We also want to link with ncursesw, which
supports multibyte Unicode locales.
2021-03-25 11:22:52 +00:00
Wim Taymans
b759f9a691 pw-loopback: handle NULL buffers
Make sure we return the non-NULL buffers in all cases.
2021-03-24 17:45:18 +01:00
Wim Taymans
4bcb7e0468 tools: add pw-loopback
Sends the captured data from a source directly to a sink.

It uses an input and output stream so the source and sink can be
moved in pavucontrol, channel remixing is possible and the volume
can be adjusted.

See #959
2021-03-24 17:02:21 +01:00
Wim Taymans
3b0b5cb55d pw-dump: print id-xxx for unknown ids
When the id has no info in the type system use id-xxx instead
of "unknown".
2021-03-23 11:32:35 +01:00
Wim Taymans
4873dbcf8e pw-dump: respect NO_COLOR
See no-color.org
2021-03-13 20:30:13 +01:00
Thibault Saunier
485bae5eb0 meson: Use feature options everywhere it makes sense 2021-03-10 20:18:34 +00:00
FeRD (Frank Dana)
2931522d2c pw-cli: Make 'dump' type arg case-insensitive 2021-03-10 11:41:32 -05:00
Wim Taymans
c8fd34a41d metadata: store default-nodes as JSON
Don't just store the id in the metadata but a JSON object with
the node name. This makes it possible to easily introspect the
metadata and also extend the metadata with more fields later.

Instead of matching the metadata id to the global ids we now
have to match it against the name.
2021-03-05 17:37:12 +01:00
Wim Taymans
27f85d1f52 tools: remove registry listener before destroying
Otherwise we access freed memory when we try to remove
the listener later.
2021-02-24 14:58:20 +01:00
Wim Taymans
1f2cb7ac67 don't crash with missing libraries 2021-02-23 17:48:57 +01:00
Wim Taymans
91875c1fd8 pw-cli: always output to stdout
Use spa_debug_pod because spa_debug_format outputs to stderr
2021-02-19 16:42:21 +01:00
Wim Taymans
81ebc33b57 pw-top: period -> quantum
period has other connotations in alsa
2021-02-18 09:16:49 +01:00
Wim Taymans
80825aeaea conf: more work on config changes
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.
2021-02-12 10:31:29 +01:00
Wim Taymans
fc90a4e48a Implement config/state file handling
Make methods to load_config and load/save state. For now the config
and state directories are the same but it might not be. Implement
the search path for all config/state files as:

  $XDG_CONFIG_HOME/[$prefix]/$name
  $HOME/.config/[$prefix]/$name
  $PIPEWIRE_CONFIG_DIR/pipewire/[$prefix]/$name
  /etc/pipewire/[$prefix]/$name

Make some config files for jack and RT clients. Make pw-cat use the
client-rt config.

Use core state and config management in media-session.
Move all session manager state and config files to the build dir and
set the PIPEWIRE_CONFIG_DIR to this build dir.
2021-02-12 10:25:11 +01:00
Wim Taymans
90d8589fb9 pw-dump: always output colors and add option to disable
-N disables colors now. Usually we want to preserve them in debug
files and grep etc.
Use less -R to get colors

See #698
2021-02-08 19:52:24 +01:00
Wim Taymans
c25bdce645 rework param updates
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.
2021-02-05 11:03:47 +01:00
Wim Taymans
994fc1169e Revert "rework param updates"
This reverts commit 5aa7746c95.

Routes are duplicated for some reason, needs more debugging.
2021-02-04 20:56:54 +01:00
Wim Taymans
5aa7746c95 rework param updates
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.
2021-02-04 13:26:35 +01:00
Wim Taymans
4c46495c38 pw-dump: don't print unreadable params 2021-02-03 19:27:57 +01:00
Wim Taymans
be7415dac8 pw-top: improve period and rate columns 2021-02-03 11:46:01 +01:00
Wim Taymans
379cbeaa5d pw-cat: fix option for playback
Fixes #665
2021-02-02 15:17:38 +01:00
Wim Taymans
2b44f42845 pass the complete buffer size to snprintf
There is no reason to pass size-1, snprintf will always put a \0
at the end.
2021-02-02 12:09:29 +01:00
Wim Taymans
2b98b7dc7a pw-dump: print None pod as null 2021-01-22 17:23:33 +01:00
Wim Taymans
07b52299db pw-top: make a line shorter so that it fits better 2021-01-21 17:46:47 +01:00
Wim Taymans
4fb967211e pw-top: refresh immediately 2021-01-21 15:20:07 +01:00
Wim Taymans
579e8a4ea6 json: allocate one extra byte for the \0 2021-01-19 16:56:55 +01:00
Wim Taymans
f891324e25 pw-dump: mark objects without events as changed
Usually the event function marks the object as changed so when
there is no event function, mark the change immediately so that
we can dump it.
2021-01-19 16:36:55 +01:00
Wim Taymans
5a7f4a619a pw-dump: also dump properties 2021-01-15 09:45:56 +01:00
Wim Taymans
ae263eeffc pw-dump: only dump changed metadata entries 2021-01-14 21:14:16 +01:00
Wim Taymans
688b3c5ed4 pw-dump: only output [] when something changed 2021-01-14 20:17:22 +01:00
Wim Taymans
a97d4c44b4 pw-metadata: remove is when key == NULL 2021-01-14 20:11:43 +01:00
Wim Taymans
13cef576c9 pw-dump: dump metadata contents
Fix some leaks
2021-01-14 20:11:15 +01:00
Wim Taymans
792c01aede pw-dump: trigger change in metadata
so that it is displayed
2021-01-14 19:22:40 +01:00
Wim Taymans
abe73c9146 meson: use global b_pie to build PIE executables 2021-01-14 16:29:32 +01:00
Wim Taymans
a6433b0839 pw-dump: mark new objects without proxy as changed
So that they are actually printed.
2021-01-14 15:39:02 +01:00
Wim Taymans
c9354c238f Add -fPIE to installed executables
Fixes #570
2021-01-13 19:40:37 +01:00
Wim Taymans
878240e30a pw-dump: add simple monitor option (-m) 2021-01-11 10:24:39 +01:00
Wim Taymans
84eed9ef6f pw-cat: use none as default latency for record
Don't force the record latency to the large latency we use for playback
(100ms) but set it to none, which means use defaults.
2021-01-08 16:30:57 +01:00
Wim Taymans
9a03f8769e pw-cli: handle unquoted strings
Use parse_string for everything else to use it as a string value.
Make it possible to use short name for the param.

so now you can do:

pw-cli set-param 55 Props '{ channelVolumes: [ 0.3, 0.3 ], channelMap: [ FR,FL ] }'
2021-01-08 12:23:02 +01:00
Wim Taymans
ef6bb2195a pw-dump: dump all objects
Dump all objects, not only the ones for which we have a class.
2021-01-08 10:51:37 +01:00
Nicolai Syvertsen
7a82be3361 pw-top: Fallback to app name if no node name/desc exists 2021-01-04 19:26:44 +00:00
Wim Taymans
f28fb692a4 pw-top: handle io 2020-12-25 16:35:38 +01:00
Wim Taymans
ae8f8b25f6 pw-top: add new tool
Uses ncurses to display all drivers and nodes with their latency,
error count and DSP usage.
2020-12-25 16:33:54 +01:00
Gabriel Ebner
7bdcfb6383 pw-cat: report delay 2020-12-23 19:13:29 +00:00
Wim Taymans
7ef15f3721 pw-dump: convert unknown ids to id-<hexnum> 2020-12-18 17:54:40 +01:00
Wim Taymans
abe12cf790 pw-dump: improve choice values
Place range and step values on a single line
2020-12-18 17:49:46 +01:00
Wim Taymans
724d2581f0 pw-dump: add final \n at the end 2020-12-17 15:10:43 +01:00
Wim Taymans
0e9ba69d3a pw-dump: simplify the state handling
Fixes first \n
2020-12-15 18:12:21 +01:00
Wim Taymans
5e99ff52e7 pw-dump: handle NULL in link format 2020-12-15 10:17:47 +01:00