Min Soe Han

LegalBusinessElse


backTech:


Learning pw-dump

DATE 20240730

The pw-dump program produces a representation of the current PipeWire state as JSON, including the information on nodes, devices, modules, ports, and other objects.

The output of pw-dump is in JSON format and it can be extract required infomation by using jq command. As the output is so complicated, the following suggestion will be useful.

In the output, type is important. The format of type is "type": "PipeWire:Interface:Note". To see all the type, see the following example.

[user@hostname ~]$ pw-dump | jq -r '.[] | . | .type'
PipeWire:Interface:Core
PipeWire:Interface:Module
PipeWire:Interface:Profiler
PipeWire:Interface:Module
PipeWire:Interface:Factory
PipeWire:Interface:Module
PipeWire:Interface:Factory
PipeWire:Interface:Node
PipeWire:Interface:Node
PipeWire:Interface:Metadata
PipeWire:Interface:Client
...
            

To remove the leading PipeWire:Interface:, sort and filter unique, see the following example. The Node is important among the pipewire interface names.

[user@hostname ~]$ pw-dump | jq -r '.[] | . | .type' | cut -d ':' -f 3 | sort | uniq
Client
Core
Device
Factory
Link
Metadata
Module
Node
Port
Profiler
[user@hostname ~]$