Multimedia processing graphs
Find a file
Pantelis Antoniou 7ead270265 Implement JSON/YAML command for graph tree traversal
Implement a single command that allows viewing all information
about a remotes properties/parameters and info variables.

This patch creates a framework for accessing properties using
a simple dotted variable access method or JSON/YAML path expressions.

The root of the tree is a sequence of all globals objects, and
accessing a the first one is simply 0 (or /0 is JSON/YAML path form).

	pipewire-0>>graph 0
	id: 0
	type: PipeWire:Interface:Core
	permissions: rwx
	version: 3
	info:
	    id: 0
	    cookie: 1602594817
	    user_name: panto
	    host_name: nuc2
	    version: 0.2.96
	    name: pipewire-0
	    change_mask: props
	    props:
		pipewire.core.name: pipewire-0
		context.profile.modules: none
		pipewire.core.daemon: 1
		link.max-buffers: 16
		default.clock.rate: 48000
		default.clock.quantum: 1024
		default.clock.min-quantum: 32
		default.clock.max-quantum: 8192
		default.video.width: 640
		default.video.height: 480
		default.video.rate.num: 25
		default.video.rate.denom: 1
		mem.allow-mlock: true
		cpu.max-align: 32
		object.id: 0
	properties:
	    pipewire.core.name: pipewire-0

Displaying a nodes information is simply:

	pipewire-0>>graph /32
	id: 32
	type: PipeWire:Interface:Node
	permissions: rwx
	version: 3
	info:
	    id: 32
	    max_input_ports: 128
	    max_output_ports: 0
	    n_input_ports: 2
	    n_output_ports: 2
	    state: suspended
	    error:
	    change_mask: "n_input_ports,n_output_ports,state,props,params"
	    props:
		object.path: alsa:pcm:HDMI:3:playback
		api.alsa.path: "hw:0,3"
		api.alsa.pcm.card: 0
		api.alsa.pcm.device: 3
		api.alsa.pcm.subdevice: 0
		api.alsa.pcm.stream: playback
		api.alsa.pcm.id: "HDMI 0"
		api.alsa.pcm.name: "HDMI 0"
		api.alsa.pcm.subname: "subdevice #0"
		api.alsa.pcm.class: generic
		api.alsa.pcm.subclass: generic-mix
		api.alsa.pcm.sync-id: 00000000:00000000:00000000:00000000
		device.id: 26
		factory.name: api.alsa.pcm.sink
		priority.master: 696
		priority.session: 696
		media.class: Audio/Sink
		node.name: alsa_card.pci-0000:00:03.0.playback.3.0
		node.description: "Built-in Audio (HDMI 0)"
		factory.id: 17
		client.id: 24
		device.api: alsa
		node.driver: true
		factory.mode: merge
		audio.adapt.slave:
		library.name: audioconvert/libspa-audioconvert
		object.id: 32
	    params:
		EnumFormat:
		    mediaType: audio
		    mediaSubtype: raw
		    format:
			default: S32LE
			alt0: S32LE
			alt1: S16LE
		    rate:
			default: 48000
			min: 32000
			max: 48000
		    channels: 2
		    position:
		      - FL
		      - FR
		PropInfo:
		  - id: volume
		    name: Volume
		    type:
			default: 1.000000
			min: 0.000000
			max: 10.000000
		  - id: mute
		    name: Mute
		    type:
			default: false
			alt0: false
			alt1: true
		  - id: channelVolumes
		    name: "Channel Volumes"
		    type:
			default: 1.000000
			min: 0.000000
			max: 10.000000
		Props:
		    volume: 1.000000
		    mute: false
		    channelVolumes: []
		Format: {}
		EnumPortConfig:
		  - direction: Input
		    mode: dsp
		  - direction: Output
		    mode: dsp
		  - direction: Input
		    mode: convert
		  - direction: Output
		    mode: convert
		PortConfig: {}
	properties:
	    object.path: alsa:pcm:HDMI:3:playback
	    factory.id: 17
	    client.id: 24
	    device.id: 26
	    priority.session: 696
	    priority.master: 696
	    node.description: "Built-in Audio (HDMI 0)"
	    node.name: alsa_card.pci-0000:00:03.0.playback.3.0
	    media.class: Audio/Sink

To simply display the parameters of the same object:

	pipewire-0>>graph 32/info/params
	EnumFormat:
	    mediaType: audio
	    mediaSubtype: raw
	    format:
		default: S32LE
		alt0: S32LE
		alt1: S16LE
	    rate:
		default: 48000
		min: 32000
		max: 48000
	    channels: 2
	    position:
	      - FL
	      - FR
	PropInfo:
	  - id: volume
	    name: Volume
	    type:
		default: 1.000000
		min: 0.000000
		max: 10.000000
	  - id: mute
	    name: Mute
	    type:
		default: false
		alt0: false
		alt1: true
	  - id: channelVolumes
	    name: "Channel Volumes"
	    type:
		default: 1.000000
		min: 0.000000
		max: 10.000000
	Props:
	    volume: 1.000000
	    mute: false
	    channelVolumes: []
	Format: {}
	EnumPortConfig:
	  - direction: Input
	    mode: dsp
	  - direction: Output
	    mode: dsp
	  - direction: Input
	    mode: convert
	  - direction: Output
	    mode: convert
	PortConfig: {}

The graph command also supports the following options:

	-y Select YAML format (this is the default)
	-j Select JSON format
	-n Display numeric instead of textual IDs
	-f Display full type info, i.e. instead of EnumFormat will
	   display Spa:Enum:ParamId:EnumFormat

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
2020-02-21 11:30:49 +01:00
doc ci: Automate container building in Gitlab 2019-11-21 17:24:21 +05:30
man man: improve man pages a little 2020-02-18 10:36:28 +01:00
pipewire-alsa plugins: fix the licence of alsa and jack libraries 2020-02-07 15:43:13 +01:00
pipewire-jack tweak buffers a little 2020-02-19 10:17:00 +01:00
pipewire-pulseaudio added simple api to pipewire pulseaudio wrapper 2020-02-20 13:38:59 +01:00
po Update POTFILES.in 2017-09-19 17:42:12 +02:00
spa Add a spa_debug_type_find_short_name method 2020-02-21 11:30:49 +01:00
src Implement JSON/YAML command for graph tree traversal 2020-02-21 11:30:49 +01:00
.editorconfig add .editorconfig files 2019-02-13 11:19:21 +01:00
.gitignore gitignore: Add generated Makefile 2019-11-08 13:00:00 +05:30
.gitlab-ci.yml pwcat: simple native playback/record tool 2020-01-27 12:23:15 +01:00
_config.yml Set theme jekyll-theme-slate 2017-09-04 19:55:46 +02:00
autogen.sh make libpulse-simple symlinks for developement 2020-02-20 15:04:44 +01:00
check_missing_headers.sh fix missing headers check 2020-02-05 17:21:12 +01:00
CODE_OF_CONDUCT.md Add a code of coduct 2019-11-08 13:57:36 +05:30
config.h.meson add systemd socket activation 2018-10-18 12:36:10 +02:00
COPYING Relicense as MIT/X11 2018-11-05 17:48:52 +01:00
LICENSE Relicense as MIT/X11 2018-11-05 17:48:52 +01:00
Makefile.in rename pipewire tools 2020-01-27 15:42:59 +01:00
meson.build enable and fix -Werror=suggest-attribute=format 2020-02-20 18:20:04 +01:00
meson_options.txt rename pipewire tools 2020-01-27 15:42:59 +01:00
NEWS 0.3.0 2020-02-20 15:33:31 +01:00
PROTOCOL Initial commit 2015-04-16 16:58:33 +02:00
pw-uninstalled.sh make symlinks to replacement libs for uninstalled script 2020-01-16 13:26:47 +01:00
README.md readme: Format in Markdown and add some more information 2019-11-04 16:33:51 +00:00

PipeWire

PipeWire is a server and user space API to deal with multimedia pipelines. This includes:

  • Making available sources of video (such as from a capture devices or application provided streams) and multiplexing this with clients.
  • Accessing sources of video for consumption.
  • Generating graphs for audio and video processing.

Nodes in the graph can be implemented as separate processes, communicating with sockets and exchanging multimedia content using fd passing.

Building

Pipewire uses the Meson and Ninja build system to compile. You can run it with:

$ meson build
$ cd build
$ ninja

You can see the available meson options in meson_options.txt file.

If you're not familiar with these tools, the included autogen.sh script will automatically run the correct meson/ninja commands, and output a Makefile. It follows that there are two methods to build Pipewire, however both rely on Meson and Ninja to actually perform the compilation:

$ ./autogen.sh
$ make

Running

If you want to run PipeWire without installing it on your system, there is a script that you can run. This puts you in an environment in which PipeWire can be run from the build directory, and ALSA, PulseAudio and JACK applications will use the PipeWire emulation libraries automatically in this environment. You can get into this environment with:

$ ./pw-uninstalled.sh