### Start JACK with qjackctl Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/resources/testing.rst.txt Instructions for starting JACK audio server through the qjackctl GUI, including enabling the D-Bus interface. ```bash Enable *Setup* -> *Misc* -> *Enable JACK D-Bus interface* Click *Start* on the main window ``` -------------------------------- ### Basic Constraint Examples Source: https://pipewire.pages.freedesktop.org/wireplumber/scripting/lua_api/lua_object_interest_api.html Examples demonstrating the creation of constraints with different subjects, verbs, and objects. ```lua Constraint { "node.id", "equals", "42" } Constraint { "node.id", "equals", 42 } Constraint { "port.physical", "=", true } ``` ```lua Constraint { "audio.channel", "not-equals", "FL" } ``` ```lua Constraint { "node.name", "matches", "v4l2_input*" } Constraint { "format.dsp", "#", "*mono audio*" } ``` ```lua -- matches either "default" or "settings" as a possible value for "metadata.name" Constraint { "metadata.name", "in-list", "default", "settings" } ``` ```lua -- matches any priority.session between 0 and 1000, inclusive Constraint { "priority.session", "in-range", 0, 1000 } ``` ```lua -- matches when the object has a "media.role" property Constraint { "media.role", "is-present" } ``` ```lua -- matches when "media.role" is not present in the properties list Constraint { "media.role", "is-absent" } ``` -------------------------------- ### Start WirePlumber with a Custom Profile Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/daemon/multi_instance.rst.txt Use the --profile command-line option to load a specific configuration profile for a WirePlumber instance. This is essential for multi-instance setups. ```console $ wireplumber --profile=custom ``` -------------------------------- ### Start JACK Manually Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/resources/testing.rst.txt Manually start the JACK audio server using command-line tools. ```bash jackdbus auto ``` ```bash qdbus org.jackaudio.service /org/jackaudio/Controller org.jackaudio.JackControl.StartServer ``` -------------------------------- ### WirePlumber Component and Profile Configuration Example Source: https://pipewire.pages.freedesktop.org/wireplumber/daemon/configuration/components_and_profiles.html This example demonstrates how components are defined with their provided and required features, and how a profile can specify which features are required, leading to a dependency chain. ```json wireplumber.components = [ { name = libwireplumber-module-dbus-connection, type = module provides = support.dbus } { name = libwireplumber-module-reserve-device, type = module provides = support.reserve-device requires = [ support.dbus ] } { name = monitors/alsa.lua, type = script/lua provides = monitor.alsa wants = [ support.reserve-device ] } ] wireplumber.profiles = { main = { monitor.alsa = required } } ``` -------------------------------- ### Execute WirePlumber Example Script Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/resources/testing.rst.txt Run a WirePlumber example script from the top-level directory using the wp-uninstalled.sh script. This example plays a test tone on the default ALSA device. ```console $ ./wp-uninstalled.sh ./build/tests/examples/audiotestsrc-play ``` -------------------------------- ### Start PulseAudio Client for Device Reservation Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/resources/testing.rst.txt Start a PulseAudio client, such as 'gst-launch-1.0 audiotestsrc ! pulsesink', to occupy a device before starting PipeWire and WirePlumber for device reservation testing. ```console $ gst-launch-1.0 audiotestsrc ! pulsesink ``` -------------------------------- ### Install WirePlumber using Ninja Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/daemon/installing.rst.txt Once compiled, use the 'ninja install' target to install WirePlumber. Ensure you are in the build directory or specify it with '-C build'. ```console ninja -C build install ``` -------------------------------- ### Install WirePlumber Source: https://pipewire.pages.freedesktop.org/wireplumber/daemon/installing.html After compilation, use the ninja install target to install WirePlumber to the specified prefix. ```bash ninja -C build install ``` -------------------------------- ### SPA-JSON Common Syntax Example Source: https://pipewire.pages.freedesktop.org/wireplumber/daemon/configuration/conf_file.html This example demonstrates the most common SPA-JSON syntax with key-value pairs and arrays. ```json # This is the most common syntax section1 = { string-key = value1 number-key = 123 boolean-key = true } section2 = [ val1, val2, val3 ] ``` -------------------------------- ### Install Object Manager on Core Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/obj_manager_api.html Installs an object manager onto a core instance, activating its management engine. This may immediately emit signals for existing objects that match the manager's interests. ```c void wp_core_install_object_manager(WpCore *self, WpObjectManager *om) ``` -------------------------------- ### SPA-JSON Mixed Syntax Example Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/daemon/configuration/conf_file.rst.txt Shows a mixed SPA-JSON syntax example using both quoted and unquoted keys, ':' and '=' separators, and flexible array formatting. ```json # Mixed syntax section1 { "string-key" = "value1" number-key: 123 boolean-key true } section2 = [ val1, val2 val3, ] ``` -------------------------------- ### Define ALSA Monitor Rules for Devices Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/daemon/configuration/alsa.rst.txt Configure rules to match ALSA devices based on properties and update their settings. This example matches devices with 'device.name' starting with 'alsa_card.*'. ```configuration monitor.alsa.rules = [ { matches = [ { # This matches the value of the 'device.name' property of the device. device.name = "~alsa_card.*" } ] actions = { update-props = { # Apply all the desired device settings here. api.alsa.use-acp = true } } } { matches = [ # This matches the value of the 'node.name' property of the node. { node.name = "~alsa_output.*" } ] actions = { # Apply all the desired node specific settings here. update-props = { node.nick = "My Node" priority.driver = 100 session.suspend-timeout-seconds = 5 } } } ] ``` -------------------------------- ### ALSA IEC958 Codec Configuration Example Source: https://pipewire.pages.freedesktop.org/wireplumber/daemon/configuration/alsa.html This example shows the format for the `iec958.codecs` property, which is an array of strings representing supported S/PDIF codecs. This configuration is necessary to enable S/PDIF passthrough on an ALSA device. ```text [ "PCM", "DTS", "AC3", "EAC3", "TrueHD", "DTS-HD" ] ``` -------------------------------- ### Get spa_log Instance Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/log_api.html Gets WirePlumber's instance of `spa_log`. This can redirect PipeWire's log messages to the installed GLogWriterFunc. It's automatically installed when wp_init() is called with WP_INIT_SET_PW_LOG. ```c struct spa_log *wp_spa_log_get_instance(void); ``` -------------------------------- ### Create Implementation Metadata with Properties Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/metadata_api.html Creates a new WpImplMetadata object and initializes it with a properties dictionary. This allows setting initial metadata values. ```c WpImplMetadata *wp_impl_metadata_new_full(WpProperties *properties); ``` -------------------------------- ### Configure and Compile WirePlumber Source: https://pipewire.pages.freedesktop.org/wireplumber/daemon/installing.html Use meson to set up the build directory and then compile the project. Ensure you specify the installation prefix if needed. ```bash meson setup --prefix=/usr build meson compile -C build ``` -------------------------------- ### Check if Object Manager is Installed Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/obj_manager_api.html Verifies if the object manager has been installed on a WpCore and if the 'installed' signal has been emitted. This indicates that initial object preparation is complete. ```c gboolean wp_object_manager_is_installed(WpObjectManager *self); ``` -------------------------------- ### Basic Constraint Examples Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/scripting/lua_api/lua_object_interest_api.rst.txt Illustrates the creation of basic constraints using different verbs and data types for property matching. ```lua Constraint { "node.id", "equals", "42" } Constraint { "node.id", "equals", 42 } Constraint { "port.physical", "=", true } ``` -------------------------------- ### Launch JACK Client with PipeWire Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/resources/testing.rst.txt Launch the qjackctl application through the PipeWire JACK compatibility layer. This should establish a correct connection and display the PipeWire graph in qjackctl. ```console $ pw-jack qjackctl ``` -------------------------------- ### Event and Hook Execution Order Example Source: https://pipewire.pages.freedesktop.org/wireplumber/design/events_and_hooks.html Illustrates a basic execution order of events with priorities and their associated hooks. ```text List of events | event1 (prio 99) -> hook1, hook2, hook3 | event2 (prio 50) -> hook5, hook2, hook4 v ``` -------------------------------- ### Event Scheduling with Inter-Event Dependencies Example Source: https://pipewire.pages.freedesktop.org/wireplumber/design/events_and_hooks.html Demonstrates how events with different priorities and their hooks are processed, including scenarios where new events might be added during processing. ```text List of events | "device-added" (prio 20) -> set-profile, set-route | "node-added" (prio 10) -> restore-stream, create-session-item v ``` -------------------------------- ### Change Default Configuration File Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/daemon/configuration/conf_file.rst.txt Demonstrates how to specify a custom configuration file using the --config-file or -c command-line option. ```bash $ wireplumber --config-file=custom.conf ``` -------------------------------- ### SPA-JSON Standard JSON Syntax Example Source: https://pipewire.pages.freedesktop.org/wireplumber/daemon/configuration/conf_file.html This example illustrates how standard JSON is also valid SPA-JSON, including comments. ```json # Standard JSON (albeit this comment line) "section1": { "string-key": "value1", "number-key": 123, "boolean-key": true } "section2": [ "val1", "val2", "val3" ] ``` -------------------------------- ### Equivalent Python Logic for Configuration Rule Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/daemon/configuration/modifying_configuration.rst.txt Illustrates the logical expression equivalent to the example WirePlumber configuration rule. ```python if (properties["object.name"] == "my_object" and properties["object.profile.name"] == "my_profile") or (properties["object.name"] == "other_object"): properties["object.tag"] = "matched_by_my_rule" ``` -------------------------------- ### Get WpSiAdapter Ports State Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/si_interfaces_api.html Gets the current ports state of a WpSiAdapter. The state indicates whether the ports have been configured, are being configured, or have never been configured. ```c WpSiAdapterPortsState wp_si_adapter_get_ports_state(WpSiAdapter *self) ``` -------------------------------- ### Define ALSA Monitor Rules Source: https://pipewire.pages.freedesktop.org/wireplumber/daemon/configuration/alsa.html Configure ALSA device and node settings using rules. This example shows how to match devices by name and apply properties, and how to configure specific node settings like nickname and suspend timeout. ```configuration monitor.alsa.rules = [ { matches = [ { # This matches the value of the 'device.name' property of the device. device.name = "~alsa_card.*" } ] actions = { update-props = { # Apply all the desired device settings here. api.alsa.use-acp = true } } } { matches = [ # This matches the value of the 'node.name' property of the node. { node.name = "~alsa_output.*" } ] actions = { # Apply all the desired node specific settings here. update-props = { node.nick = "My Node" priority.driver = 100 session.suspend-timeout-seconds = 5 } } } ] ``` -------------------------------- ### Object Manager Installed Signal Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/obj_manager_api.html Emitted once after the object manager is installed. Delays emission if internal objects require asynchronous preparation, ensuring all initial objects are ready. ```c void installed_callback (WpObjectManager * self, gpointer user_data) ``` -------------------------------- ### Run JACK Simple Client with PipeWire Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/resources/testing.rst.txt Execute the 'jack_simple_client' using the PipeWire JACK compatibility layer. A node ID must be specified using the PIPEWIRE_NODE environment variable as the JACK layer manages its own links. ```console $ wpctl status # find the target device node id $ wpctl inspect # find the node.id $ PIPEWIRE_NODE= pw-jack jack_simple_client ``` -------------------------------- ### Configure BlueZ MIDI Node Properties Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/daemon/configuration/bluetooth.rst.txt This example shows how to set properties for BlueZ MIDI nodes using rules. It matches nodes with names like 'bluez_midi.*' and updates their properties such as nickname, priorities, pause-on-idle behavior, suspend timeout, and latency offset. ```conf monitor.bluez-midi.rules = [ { matches = [ { node.name = "~bluez_midi.*" } ] actions = { update-props = { node.nick = "My Node" priority.driver = 100 priority.session = 100 node.pause-on-idle = false session.suspend-timeout-seconds = 5 node.latency-offset-msec = 0 } } } ] ``` -------------------------------- ### Create Implementation Metadata Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/metadata_api.html Creates a new WpImplMetadata object. This is an internal implementation detail for managing metadata. ```c WpImplMetadata *wp_impl_metadata_new(void); ``` -------------------------------- ### Uninstall WirePlumber using Ninja Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/daemon/installing.rst.txt To revert the installation, use the 'ninja uninstall' target. This command removes the installed WirePlumber files. Specify the build directory with '-C build'. ```console ninja -C build uninstall ``` -------------------------------- ### spa_log Instance Retrieval Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/log_api.html Retrieves WirePlumber's instance of `spa_log`, which can be used to redirect PipeWire's log messages to the currently installed GLogWriterFunc. This is automatically installed when wp_init() is called with WP_INIT_SET_PW_LOG. ```APIDOC ## spa_log_get_instance ### Description Gets WirePlumber's instance of `spa_log`. This can be used to redirect PipeWire's log messages to the currently installed GLogWriterFunc. This is installed automatically when you call wp_init() with WP_INIT_SET_PW_LOG set in the flags. ### Returns (struct spa_log *) - WirePlumber's instance of `spa_log`. ``` -------------------------------- ### Create a New Object Manager Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/obj_manager_api.html Constructs a new WpObjectManager instance. This is the first step in setting up an object manager. ```c WpObjectManager *wp_object_manager_new(void); ``` -------------------------------- ### Get Total Number of Ports Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/node_api.html Gets the total number of ports discovered for a node. This count may not equal the sum of input and output ports due to discovery delays or permissions. Requires WP_NODE_FEATURE_PORTS. ```c guint wp_node_get_n_ports(WpNode *self) ``` -------------------------------- ### Play Audio with pw-cat (Default Device) Source: https://pipewire.pages.freedesktop.org/wireplumber/resources/testing.html Play an audio file using the default audio device with pw-cat. Verify the default device using 'wpctl status'. ```bash $ wpctl status # verify the default device $ pw-play test.wav ``` -------------------------------- ### Get Specific PipeWire Property Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/pipewire_object_api.html Retrieves the value of a single PipeWire property by its key. This is more efficient than getting all properties and then accessing one. The value is owned by the proxy and guaranteed to be valid until the event loop returns. ```c const gchar *wp_pipewire_object_get_property(WpPipewireObject *self, const gchar *key); ``` -------------------------------- ### wp_spa_device_get_properties Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/spa_device_api.html Gets the properties of this device. ```APIDOC ## wp_spa_device_get_properties ### Description Gets the properties of this device. ### Method `WpProperties *wp_spa_device_get_properties(WpSpaDevice *self)` ### Parameters - **self** (WpSpaDevice *) - the spa device ### Returns (transfer full): the device properties ``` -------------------------------- ### Loading PipeWire Modules with Flags Source: https://pipewire.pages.freedesktop.org/wireplumber/daemon/configuration/conf_file.html This example shows how to load PipeWire modules within WirePlumber. It includes specifying module names, arguments, and flags like 'ifexists' to control module loading behavior. The 'ifexists' flag prevents errors if a module is not found. ```json { name = [ args = { = ... } ] [ flags = [ [ ifexists ] [ nofail ] ] } ``` ```json context.modules = [ { name = libpipewire-module-adapter } { name = libpipewire-module-metadata, flags = [ ifexists ] } ] ``` -------------------------------- ### Get WpSiAdapter Ports Format Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/si_interfaces_api.html Gets the format used to configure the adapter session item's ports. Returns the format and optionally the mode. Some items auto-select format, others require manual setting. ```c WpSpaPod *wp_si_adapter_get_ports_format(WpSiAdapter *self, const gchar **mode) ``` -------------------------------- ### Build and Run PipeWire with WirePlumber from Source Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/daemon/running.rst.txt Configure PipeWire to build WirePlumber as a subproject and run the entire stack without installation. This is useful for development and testing. ```console meson -Dsession-managers="[ 'wireplumber' ]" build ninja -C build make -C build run ``` -------------------------------- ### Configure WirePlumber Project with Meson Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/daemon/installing.rst.txt Use this command to configure the WirePlumber project. Specify the installation prefix and any additional options as needed. The build directory is 'build' and the source directory is the current directory. ```console meson setup --prefix=/usr build ``` -------------------------------- ### wp_properties_item_get_value Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/properties_api.html Gets the value from a properties item. ```APIDOC ## wp_properties_item_get_value ### Description Gets the value from a properties item. ### Since 0.4.2 ### Parameters - **self** (WpPropertiesItem *) - The item held by the GValue that was returned from the WpIterator of wp_properties_new_iterator(). ### Returns - **const gchar *** - The property value of the item. ``` -------------------------------- ### wp_properties_item_get_key Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/properties_api.html Gets the key from a properties item. ```APIDOC ## wp_properties_item_get_key ### Description Gets the key from a properties item. ### Since 0.4.2 ### Parameters - **self** (WpPropertiesItem *) - The item held by the GValue that was returned from the WpIterator of wp_properties_new_iterator(). ### Returns - **const gchar *** - The property key of the item. ``` -------------------------------- ### Play Audio Client on PipeWire Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/resources/testing.rst.txt Example command to play an audio file using PipeWire, demonstrating audio routing through JACK when JACK is active. ```bash pw-play test.wav ``` -------------------------------- ### Create a new WpTransition with a callback Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/transitions_api.html Creates a new WpTransition instance. The transition does not start automatically; wp_transition_advance() must be called to initiate it. The transition is unreferenced after the callback is executed. ```c WpTransition *wp_transition_new(GType type, gpointer source_object, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer callback_data) ``` -------------------------------- ### wp_node_get_n_ports Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/node_api.html Gets the number of ports of this node. ```APIDOC ## wp_node_get_n_ports ### Description Gets the number of ports of this node. Note that this number may not add up to wp_node_get_n_input_ports() + wp_node_get_n_output_ports() because it is discovered by looking at the number of available ports in the registry, however ports may appear there with a delay or may not appear at all if this client does not have permission to read them. ### Remark Requires WP_NODE_FEATURE_PORTS ### Method `guint wp_node_get_n_ports (WpNode *self)` ### Parameters - **self** (WpNode *) - the node ### Returns the number of ports of this node ``` -------------------------------- ### wp_node_get_state Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/node_api.html Gets the current state of the node. ```APIDOC ## wp_node_get_state ### Description Gets the current state of the node. ### Method `WpNodeState wp_node_get_state (WpNode *self, const gchar **error)` ### Parameters - **self** (WpNode *) - the node - **error** (const gchar **) - (out) (optional) (transfer none): the error ### Returns the current state of the node ``` -------------------------------- ### Compile and Run PipeWire with WirePlumber from Source Source: https://pipewire.pages.freedesktop.org/wireplumber/daemon/running.html Compile the PipeWire project, which now includes WirePlumber, and then run the entire stack. This is useful for development and testing without installation. ```bash $ ninja -C build $ make -C build run ``` -------------------------------- ### wp_node_get_n_output_ports Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/node_api.html Gets the number of output ports of this node. ```APIDOC ## wp_node_get_n_output_ports ### Description Gets the number of output ports of this node. ### Remark Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO ### Method `guint wp_node_get_n_output_ports (WpNode *self, guint *max)` ### Parameters - **self** (WpNode *) - the node - **max** (guint *) - (out) (optional): the maximum supported number of output ports ### Returns the number of output ports of this node, as reported by the node info ``` -------------------------------- ### wp_node_get_n_input_ports Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/node_api.html Gets the number of input ports of this node. ```APIDOC ## wp_node_get_n_input_ports ### Description Gets the number of input ports of this node. ### Remark Requires WP_PIPEWIRE_OBJECT_FEATURE_INFO ### Method `guint wp_node_get_n_input_ports (WpNode *self, guint *max)` ### Parameters - **self** (WpNode *) - the node - **max** (guint *) - (out) (optional): the maximum supported number of input ports ### Returns the number of input ports of this node, as reported by the node info ``` -------------------------------- ### Play Video Using Default Device Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/resources/testing.rst.txt Play video using the default device. Navigate to the PipeWire source directory and execute the video-play example. ```console $ cd path/to/pipewire-source-dir $ ./build/src/examples/video-play ``` -------------------------------- ### wp_spa_pod_parser_get_boolean Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/spa_pod_api.html Gets the boolean value from a spa pod parser. ```APIDOC ## wp_spa_pod_parser_get_boolean ### Description Gets the boolean value from a spa pod parser. ### Parameters - **self** (WpSpaPodParser *) - the spa pod parser object - **value** (gboolean *) - (out): the boolean value ### Returns - TRUE if the value was obtained, FALSE otherwise ``` -------------------------------- ### Get WpState GType Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/state_api.html Returns the GType for the WpState class. ```c WP_TYPE_STATE (wp_state_get_type ()); ``` -------------------------------- ### wp_init() Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/wp_api.html Initializes the WirePlumber library and its underlying PipeWire components. The 'flags' parameter allows for customization of the initialization process, enabling external handling of certain parts. ```APIDOC void wp_init(WpInitFlags flags) Initializes WirePlumber and PipeWire underneath. _flags_ can modify which parts are initialized, in cases where you want to handle part of this initialization externally. Parameters: * flags -- initialization flags ``` -------------------------------- ### Uninstall WirePlumber Source: https://pipewire.pages.freedesktop.org/wireplumber/daemon/installing.html To revert the installation, use the ninja uninstall target. ```bash ninja -C build uninstall ``` -------------------------------- ### wp_spa_pod_parser_get Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/spa_pod_api.html Gets a list of values from a spa pod parser object. ```APIDOC ## wp_spa_pod_parser_get ### Description Gets a list of values from a spa pod parser object. ### Parameters #### Path Parameters - **self** (WpSpaPodParser *) - the spa pod parser object - **...** (...) - (out): a list of values to get, followed by NULL ### Returns TRUE if the values were obtained, FALSE otherwise ``` -------------------------------- ### Record Audio Using Default Device Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/resources/testing.rst.txt Record audio to a file named 'test.wav' using the default audio device. First, verify the default device with 'wpctl status'. ```console $ wpctl status # verify the default device $ pw-record test.wav ``` -------------------------------- ### wp_spa_pod_parser_get_fd Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/spa_pod_api.html Gets the Fd value from a spa pod parser object. ```APIDOC ## wp_spa_pod_parser_get_fd ### Description Gets the Fd value from a spa pod parser object. ### Parameters - **self** (WpSpaPodParser *) - the spa pod parser object - **value** (gint64 *) - (out): the Fd value ### Returns - TRUE if the value was obtained, FALSE otherwise ``` -------------------------------- ### wp_core_install_object_manager Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/obj_manager_api.html Installs an object manager on the core, activating its management engine and emitting initial signals for existing objects of interest. ```APIDOC ## wp_core_install_object_manager ### Description Installs the object manager on this core, activating its internal management engine. This will immediately emit signals about objects added on _om_ if objects that the _om_ is interested in were in existence already. ### Parameters * **self** -- the core * **om** -- (transfer none): a WpObjectManager ``` -------------------------------- ### wp_spa_pod_parser_get_string Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/spa_pod_api.html Gets the string value from a spa pod parser object. ```APIDOC ## wp_spa_pod_parser_get_string ### Description Gets the string value from a spa pod parser object. ### Parameters - **self** (WpSpaPodParser *) - the spa pod parser object - **value** (const char **) - (out) (transfer none): the string value ### Returns - TRUE if the value was obtained, FALSE otherwise ``` -------------------------------- ### WirePlumber Component Configuration Example Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/daemon/configuration/components_and_profiles.rst.txt Defines components, their provided features, and their dependencies. Used to set up the base modules and scripts WirePlumber can utilize. ```ini wireplumber.components = [ { name = libwireplumber-module-dbus-connection, type = module provides = support.dbus } { name = libwirewireplumber-module-reserve-device, type = module provides = support.reserve-device requires = [ support.dbus ] } { name = monitors/alsa.lua, type = script/lua provides = monitor.alsa wants = [ support.reserve-device ] } ] wireplumber.profiles = { main = { monitor.alsa = required } } ``` -------------------------------- ### Configure BlueZ MIDI Server Nodes Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/daemon/configuration/bluetooth.rst.txt Set a list of MIDI server node names for creating Bluetooth LE MIDI service instances. Use this in the 'monitor.bluez-midi.servers' section of the WirePlumber configuration. ```lua monitor.bluez-midi.servers = [ "bluez_midi.server" ] ``` -------------------------------- ### wp_spa_pod_parser_get_double Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/spa_pod_api.html Gets the double value from a spa pod parser object. ```APIDOC ## wp_spa_pod_parser_get_double ### Description Gets the double value from a spa pod parser object. ### Parameters - **self** (WpSpaPodParser *) - the spa pod parser object - **value** (double *) - (out): the double value ### Returns - TRUE if the value was obtained, FALSE otherwise ``` -------------------------------- ### wp_spa_pod_parser_get_float Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/spa_pod_api.html Gets the float value from a spa pod parser object. ```APIDOC ## wp_spa_pod_parser_get_float ### Description Gets the float value from a spa pod parser object. ### Parameters - **self** (WpSpaPodParser *) - the spa pod parser object - **value** (float *) - (out): the float value ### Returns - TRUE if the value was obtained, FALSE otherwise ``` -------------------------------- ### Play Audio Using Default Device Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/resources/testing.rst.txt Play the audio file 'test.wav' using the default audio device. ```console $ pw-play test.wav ``` -------------------------------- ### wp_spa_pod_parser_get_long Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/spa_pod_api.html Gets the long value from a spa pod parser object. ```APIDOC ## wp_spa_pod_parser_get_long ### Description Gets the long value from a spa pod parser object. ### Parameters - **self** (WpSpaPodParser *) - the spa pod parser object - **value** (gint64 *) - (out): the long value ### Returns - TRUE if the value was obtained, FALSE otherwise ``` -------------------------------- ### Basic GObject Reference Management in Lua Source: https://pipewire.pages.freedesktop.org/wireplumber/scripting/lua_api/lua_gobject.html Demonstrates creating a GObject instance in Lua and how setting the variable to nil releases the GObject reference. ```lua -- creating a new FooObject instance; obj holds the GObject reference local obj = FooObject() -- GObject reference is dropped and FooObject is finalized obj = nil ``` -------------------------------- ### wp_spa_pod_parser_get_int Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/spa_pod_api.html Gets the int value from a spa pod parser object. ```APIDOC ## wp_spa_pod_parser_get_int ### Description Gets the int value from a spa pod parser object. ### Parameters - **self** (WpSpaPodParser *) - the spa pod parser object - **value** (gint32 *) - (out): the int value ### Returns - TRUE if the value was obtained, FALSE otherwise ``` -------------------------------- ### Play Video Using Specific Node ID Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/resources/testing.rst.txt Play video using a specific device node ID. First, find the node ID using 'wpctl status', then execute the video-play example with the node ID as an argument. ```console $ wpctl status # find the device node id from the list $ cd path/to/pipewire-source-dir $ ./build/src/examples/video-play ``` -------------------------------- ### wp_spa_pod_parser_get_id Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/spa_pod_api.html Gets the Id value from a spa pod parser object. ```APIDOC ## wp_spa_pod_parser_get_id ### Description Gets the Id value from a spa pod parser object. ### Parameters - **self** (WpSpaPodParser *) - the spa pod parser object - **value** (guint32 *) - (out): the Id value ### Returns - TRUE if the value was obtained, FALSE otherwise ``` -------------------------------- ### Link Policy Configuration (Old Format) Source: https://pipewire.pages.freedesktop.org/wireplumber/daemon/configuration/migration.html This snippet demonstrates the old format for linking policy configuration. ```lua default_policy.policy = { ["move"] = false, ["follow"] = false, } ``` -------------------------------- ### wp_spa_pod_get_bytes Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/spa_pod_api.html Gets the bytes value and its length from a spa pod object. ```APIDOC ## wp_spa_pod_get_bytes ### Description Gets the bytes value and its len of a spa pod object. ### Parameters * **self** -- the spa pod object * **value** -- (out): the bytes value * **len** -- (out): the length of the bytes value ### Returns TRUE if the value was obtained, FALSE otherwise ``` -------------------------------- ### WirePlumber 0.4 Components Section Example Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/daemon/configuration/migration.rst.txt This snippet shows the typical 'wireplumber.components' section in a WirePlumber 0.4 configuration file, listing Lua scripts to be loaded. ```text wireplumber.components = [ #{ name = , type = } # # WirePlumber components to load # # The lua scripting engine { name = libwireplumber-module-lua-scripting, type = module } # The lua configuration file(s) # Other components are loaded from there { name = main.lua, type = config/lua } { name = policy.lua, type = config/lua } { name = bluetooth.lua, type = config/lua } ] ``` -------------------------------- ### wp_spa_id_value_short_name Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/spa_type_api.html Gets the short name of a given SPA ID value. ```APIDOC ## wp_spa_id_value_short_name ### Description Gets the short name of an id value. ### Method (Not applicable, C function) ### Parameters #### Path Parameters (None) #### Query Parameters (None) #### Request Body (None) ### Parameters * **id** -- an id value ### Returns the short name of this id value ``` -------------------------------- ### Configure IEC958 Codecs at Runtime Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/daemon/configuration/alsa.rst.txt Configure supported codecs for S/PDIF passthrough at runtime using 'pw-cli'. This allows dynamic adjustment of audio formats for passthrough. ```console pw-cli s Props '{ iec958Codecs : [ PCM ] }' ``` -------------------------------- ### wp_spa_id_value_name Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/spa_type_api.html Gets the full name of a given SPA ID value. ```APIDOC ## wp_spa_id_value_name ### Description Gets the name of an id value. ### Method (Not applicable, C function) ### Parameters #### Path Parameters (None) #### Query Parameters (None) #### Request Body (None) ### Parameters * **id** -- an id value ### Returns the full name of this id value ``` -------------------------------- ### wp_spa_id_value_number Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/spa_type_api.html Gets the numeric representation of a given SPA ID value. ```APIDOC ## wp_spa_id_value_number ### Description Gets the numeric value of an id value. ### Method (Not applicable, C function) ### Parameters #### Path Parameters (None) #### Query Parameters (None) #### Request Body (None) ### Parameters * **id** -- an id value ### Returns the numeric representation of this id value ``` -------------------------------- ### Show All WirePlumber Settings with wpctl Source: https://pipewire.pages.freedesktop.org/wireplumber/_sources/tools/wpctl.rst.txt Display all current WirePlumber settings. ```bash wpctl settings ``` -------------------------------- ### wp_core_get_pw_context Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/core_api.html Gets the internal PipeWire context associated with the core object. ```APIDOC ## wp_core_get_pw_context ### Description Gets the internal PipeWire context of the core. This function provides access to the underlying `pw_context` object managed by WirePlumber. ### Method `struct pw_context *wp_core_get_pw_context(WpCore *self)` ### Parameters - **self** (`WpCore *`) - The core object. ### Returns (transfer none): The internal `pw_context` object. ``` -------------------------------- ### WpClient Methods Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/client_api.html Provides documentation for various methods of the WpClient class, including sending errors, updating permissions, and managing properties. ```APIDOC ## wp_client_send_error() ### Description Send an error to the client. ### Method void ### Parameters #### Path Parameters - **self** (WpClient *) - the client - **id** (guint32) - the global id to report the error on - **res** (int) - an errno style error code - **message** (const gchar *) - the error message string ## wp_client_update_permissions() ### Description Update client's permissions on a list of objects. An object id of `-1` can be used to set the default object permissions for this client. ### Method void ### Parameters #### Path Parameters - **self** (WpClient *) - the client - **n_perm** (guint) - the number of permissions specified in the variable arguments - **...** - _n_perm_ pairs of guint32 numbers; the first number is the object id and the second is the permissions that this client should have on this object ## wp_client_update_permissions_array() ### Description Update client's permissions on a list of objects. An object id of `-1` can be used to set the default object permissions for this client. ### Method void ### Parameters #### Path Parameters - **self** (WpClient *) - the client - **n_perm** (guint) - the number of permissions specified in the _permissions_ array - **permissions** (const struct pw_permission *) - (array length=n_perm) (element-type pw_permission): an array of permissions per object id ## wp_client_update_properties() ### Description Updates the properties of _self_. This requires W and X permissions on the client. ### Method void ### Parameters #### Path Parameters - **self** (WpClient *) - the client - **updates** (WpProperties *) - (transfer full): updates to apply to the properties of _self_ ; this does not need to include properties that have not changed ## wp_client_attach_permission_manager() ### Description Attaches a permission manager in the client to handle permissions automatically. ### Method void ### Parameters #### Path Parameters - **self** (WpClient *) - the client - **pm** (WpPermissionManager *) - (transfer none) (nullable): the permission manager to attach, or NULL to detach the current permission manager. ## wp_client_get_permission_manager() ### Description Gets the permission manager attached to this client, if any. ### Method WpPermissionManager * ### Parameters #### Path Parameters - **self** (WpClient *) - the client ### Returns (transfer full) (nullable): the attached permission manager, or NULL if no permission manager is attached ## WP_TYPE_CLIENT ### Description The WpClient GType. ### Method wp_client_get_type () ``` -------------------------------- ### wp_core_get_conf Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/core_api.html Gets the main configuration file associated with the core object. ```APIDOC ## wp_core_get_conf ### Description Gets the main configuration file of the core. This function allows access to the WpConf object used by the core for its settings. ### Method `WpConf *wp_core_get_conf(WpCore *self)` ### Parameters - **self** (`WpCore *`) - The core object. ### Returns (transfer full) (nullable): The main configuration file. ``` -------------------------------- ### wp_spa_device_new_from_spa_factory Source: https://pipewire.pages.freedesktop.org/wireplumber/library/c_api/spa_device_api.html Constructs a `SPA_TYPE_INTERFACE_Device` by loading the given SPA _factory_name_. ```APIDOC ## wp_spa_device_new_from_spa_factory ### Description Constructs a `SPA_TYPE_INTERFACE_Device` by loading the given SPA _factory_name_. To export this device to the PipeWire server, you need to call wp_object_activate() requesting WP_PROXY_FEATURE_BOUND and wait for the operation to complete. ### Method `WpSpaDevice *wp_spa_device_new_from_spa_factory(WpCore *core, const gchar *factory_name, WpProperties *properties)` ### Parameters - **core** (WpCore *) - the wireplumber core - **factory_name** (const gchar *) - the name of the SPA factory - **properties** (WpProperties *) - (nullable) (transfer full): properties to be passed to device constructor ### Returns (nullable) (transfer full): A new WpSpaDevice wrapping the device that was constructed by the factory, or NULL if the factory does not exist or was unable to construct the device ```