diff --git a/configs/AM62AX/AM62AX_linux_toc.txt b/configs/AM62AX/AM62AX_linux_toc.txt index 0591fbe6d..d30669a61 100644 --- a/configs/AM62AX/AM62AX_linux_toc.txt +++ b/configs/AM62AX/AM62AX_linux_toc.txt @@ -126,6 +126,7 @@ linux/How_to_Guides/Host/SYSFW_Trace_Parser linux/How_to_Guides/Target/Processor_SDK_Linux_File_System_Optimization_Customization linux/How_to_Guides/Target/How_to_boot_quickly linux/How_to_Guides/Target/How_to_emmc_boot +linux/How_to_Guides/Target/How_to_use_PipeWire linux/How_to_Guides/Target/How_to_mmcsd_boot_emmc_uda linux/How_to_Guides/Target/How_to_test_MCAN_on_AM62x linux/How_to_Guides/Target/How_to_enable_DT_overlays_in_linux diff --git a/configs/AM62DX/AM62DX_linux_toc.txt b/configs/AM62DX/AM62DX_linux_toc.txt index 49de07843..f5126447a 100644 --- a/configs/AM62DX/AM62DX_linux_toc.txt +++ b/configs/AM62DX/AM62DX_linux_toc.txt @@ -110,6 +110,7 @@ linux/How_to_Guides/Host/SYSFW_Trace_Parser linux/How_to_Guides/Target/Processor_SDK_Linux_File_System_Optimization_Customization linux/How_to_Guides/Target/How_to_enable_DT_overlays_in_linux linux/How_to_Guides/Target/How_to_emmc_boot +linux/How_to_Guides/Target/How_to_use_PipeWire linux/How_to_Guides/Target/How_to_mmcsd_boot_emmc_uda #linux/How_to_Guides/Target/How_to_test_MCAN_on_AM62x linux/How_to_Guides/Target/How_to_Use_K3Conf_Tool diff --git a/configs/AM62LX/AM62LX_linux_toc.txt b/configs/AM62LX/AM62LX_linux_toc.txt index 336f87921..09d1602c4 100644 --- a/configs/AM62LX/AM62LX_linux_toc.txt +++ b/configs/AM62LX/AM62LX_linux_toc.txt @@ -131,6 +131,7 @@ linux/How_to_Guides/Target/How_to_enable_DT_overlays_in_linux linux/How_to_Guides/Target/How_to_playback_audio_over_HDMI #linux/How_to_Guides/Target/How_to_boot_quickly linux/How_to_Guides/Target/How_to_emmc_boot +linux/How_to_Guides/Target/How_to_use_PipeWire linux/How_to_Guides/Target/How_to_mmcsd_boot_emmc_uda linux/How_to_Guides/Target/How_To_Enable_M2CC3301_in_linux linux/How_to_Guides/Target/Runtime_debug_unlock_on_secure_device diff --git a/configs/AM62PX/AM62PX_linux_toc.txt b/configs/AM62PX/AM62PX_linux_toc.txt index ea88d28b6..4d814a341 100644 --- a/configs/AM62PX/AM62PX_linux_toc.txt +++ b/configs/AM62PX/AM62PX_linux_toc.txt @@ -162,6 +162,7 @@ linux/How_to_Guides/Host/SYSFW_Trace_Parser #linux/How_to_Guides/Host/Minimal_Platform_Development linux/How_to_Guides/Target/Processor_SDK_Linux_File_System_Optimization_Customization linux/How_to_Guides/Target/How_to_emmc_boot +linux/How_to_Guides/Target/How_to_use_PipeWire linux/How_to_Guides/Target/How_to_mmcsd_boot_emmc_uda #linux/How_to_Guides/Target/How_to_suspend_to_ram_on_AM62x linux/How_to_Guides/Target/How_to_test_MCAN_on_AM62x diff --git a/configs/AM62X/AM62X_linux_toc.txt b/configs/AM62X/AM62X_linux_toc.txt index 07b01f227..e376cac57 100644 --- a/configs/AM62X/AM62X_linux_toc.txt +++ b/configs/AM62X/AM62X_linux_toc.txt @@ -169,6 +169,7 @@ linux/How_to_Guides/Host/Minimal_Platform_Development linux/How_to_Guides/Target/Processor_SDK_Linux_File_System_Optimization_Customization #linux/How_to_Guides/Target/How_to_boot_quickly linux/How_to_Guides/Target/How_to_emmc_boot +linux/How_to_Guides/Target/How_to_use_PipeWire linux/How_to_Guides/Target/How_to_mmcsd_boot_emmc_uda linux/How_to_Guides/Target/How_to_suspend_to_ram_on_AM62x linux/How_to_Guides/Target/How_to_test_MCAN_on_AM62x diff --git a/configs/AM64X/AM64X_linux_toc.txt b/configs/AM64X/AM64X_linux_toc.txt index c8ed786b6..dbd59c88b 100644 --- a/configs/AM64X/AM64X_linux_toc.txt +++ b/configs/AM64X/AM64X_linux_toc.txt @@ -152,6 +152,7 @@ linux/How_to_Guides/Host/How_to_Setup_and_Debug_using_Lauterbach linux/How_to_Guides/Host/SYSFW_Trace_Parser linux/How_to_Guides/Host/Program_MMC_boot_media linux/How_to_Guides/Target/How_to_emmc_boot +linux/How_to_Guides/Target/How_to_use_PipeWire linux/How_to_Guides/Target/How_to_mmcsd_boot_emmc_uda linux/How_to_Guides/Target/How_to_Tune_Real_Time_Linux common/How_to_Guides/AM64x_EVM_Hardware_Setup diff --git a/configs/AM67/AM67_linux_toc.txt b/configs/AM67/AM67_linux_toc.txt index be8507d39..bc6d9c6d8 100644 --- a/configs/AM67/AM67_linux_toc.txt +++ b/configs/AM67/AM67_linux_toc.txt @@ -116,6 +116,7 @@ linux/How_to_Guides/Target/Processor_SDK_Linux_File_System_Optimization_Customiz linux/How_to_Guides/Target/How_to_Change_dtb_File linux/How_to_Guides/Target/How_to_enable_DT_overlays_in_linux linux/How_to_Guides/Target/How_to_emmc_boot +linux/How_to_Guides/Target/How_to_use_PipeWire linux/How_to_Guides/Target/How_to_mmcsd_boot_emmc_uda linux/How_to_Guides/Target/How_to_visualize_statistics_data linux/How_to_Guides/Target/How_to_Use_K3Conf_Tool diff --git a/configs/AM67A/AM67A_linux_toc.txt b/configs/AM67A/AM67A_linux_toc.txt index 33b1db8f6..e5da92dea 100644 --- a/configs/AM67A/AM67A_linux_toc.txt +++ b/configs/AM67A/AM67A_linux_toc.txt @@ -116,6 +116,7 @@ linux/How_to_Guides/Target/Processor_SDK_Linux_File_System_Optimization_Customiz linux/How_to_Guides/Target/How_to_Change_dtb_File linux/How_to_Guides/Target/How_to_enable_DT_overlays_in_linux linux/How_to_Guides/Target/How_to_emmc_boot +linux/How_to_Guides/Target/How_to_use_PipeWire linux/How_to_Guides/Target/How_to_mmcsd_boot_emmc_uda linux/How_to_Guides/Target/How_to_visualize_statistics_data linux/How_to_Guides/Target/How_to_Use_K3Conf_Tool diff --git a/configs/AM69/AM69_linux_toc.txt b/configs/AM69/AM69_linux_toc.txt index 404c58488..e23aa5588 100644 --- a/configs/AM69/AM69_linux_toc.txt +++ b/configs/AM69/AM69_linux_toc.txt @@ -122,6 +122,7 @@ linux/How_to_Guides/Target/Processor_SDK_Linux_File_System_Optimization_Customiz linux/How_to_Guides/Target/How_to_Change_dtb_File linux/How_to_Guides/Target/How_to_enable_DT_overlays_in_linux linux/How_to_Guides/Target/How_to_emmc_boot +linux/How_to_Guides/Target/How_to_use_PipeWire linux/How_to_Guides/Target/How_to_mmcsd_boot_emmc_uda linux/How_to_Guides/Target/How_to_visualize_statistics_data linux/How_to_Guides/Target/How_to_Use_K3Conf_Tool diff --git a/configs/AM69A/AM69A_linux_toc.txt b/configs/AM69A/AM69A_linux_toc.txt index 1fb0f5df3..395bfab0e 100644 --- a/configs/AM69A/AM69A_linux_toc.txt +++ b/configs/AM69A/AM69A_linux_toc.txt @@ -121,6 +121,7 @@ linux/How_to_Guides/Target/Processor_SDK_Linux_File_System_Optimization_Customiz linux/How_to_Guides/Target/How_to_Change_dtb_File linux/How_to_Guides/Target/How_to_enable_DT_overlays_in_linux linux/How_to_Guides/Target/How_to_emmc_boot +linux/How_to_Guides/Target/How_to_use_PipeWire linux/How_to_Guides/Target/How_to_mmcsd_boot_emmc_uda linux/How_to_Guides/Target/How_to_visualize_statistics_data linux/How_to_Guides/Target/How_to_Use_K3Conf_Tool diff --git a/configs/J7200/J7200_linux_toc.txt b/configs/J7200/J7200_linux_toc.txt index 559609ad6..d4af3fab2 100644 --- a/configs/J7200/J7200_linux_toc.txt +++ b/configs/J7200/J7200_linux_toc.txt @@ -109,6 +109,7 @@ linux/How_to_Guides/Host/K3_Resource_Partitioning_Tool linux/How_to_Guides/Target/Processor_SDK_Linux_File_System_Optimization_Customization linux/How_to_Guides/Target/How_to_Change_dtb_File linux/How_to_Guides/Target/How_to_emmc_boot +linux/How_to_Guides/Target/How_to_use_PipeWire linux/How_to_Guides/Target/How_to_mmcsd_boot_emmc_uda linux/How_to_Guides/Target/How_to_visualize_statistics_data linux/How_to_Guides/Target/How_to_Use_K3Conf_Tool diff --git a/configs/J721E/J721E_linux_toc.txt b/configs/J721E/J721E_linux_toc.txt index 9e6d06c17..c6160b4a3 100644 --- a/configs/J721E/J721E_linux_toc.txt +++ b/configs/J721E/J721E_linux_toc.txt @@ -132,6 +132,7 @@ linux/How_to_Guides/Target/Processor_SDK_Linux_File_System_Optimization_Customiz linux/How_to_Guides/Target/How_to_Change_dtb_File linux/How_to_Guides/Target/How_to_enable_DT_overlays_in_linux linux/How_to_Guides/Target/How_to_emmc_boot +linux/How_to_Guides/Target/How_to_use_PipeWire linux/How_to_Guides/Target/How_to_mmcsd_boot_emmc_uda linux/How_to_Guides/Target/How_to_visualize_statistics_data linux/How_to_Guides/Target/How_to_Use_K3Conf_Tool diff --git a/configs/J721S2/J721S2_linux_toc.txt b/configs/J721S2/J721S2_linux_toc.txt index ac3a08b5b..c8b3babcf 100644 --- a/configs/J721S2/J721S2_linux_toc.txt +++ b/configs/J721S2/J721S2_linux_toc.txt @@ -129,6 +129,7 @@ linux/How_to_Guides/Target/Processor_SDK_Linux_File_System_Optimization_Customiz linux/How_to_Guides/Target/How_to_Change_dtb_File linux/How_to_Guides/Target/How_to_enable_DT_overlays_in_linux linux/How_to_Guides/Target/How_to_emmc_boot +linux/How_to_Guides/Target/How_to_use_PipeWire linux/How_to_Guides/Target/How_to_mmcsd_boot_emmc_uda linux/How_to_Guides/Target/How_to_visualize_statistics_data linux/How_to_Guides/Target/How_to_Use_K3Conf_Tool diff --git a/configs/J722S/J722S_linux_toc.txt b/configs/J722S/J722S_linux_toc.txt index 1db71c708..b40651364 100644 --- a/configs/J722S/J722S_linux_toc.txt +++ b/configs/J722S/J722S_linux_toc.txt @@ -129,6 +129,7 @@ linux/How_to_Guides/Target/Processor_SDK_Linux_File_System_Optimization_Customiz linux/How_to_Guides/Target/How_to_Change_dtb_File linux/How_to_Guides/Target/How_to_enable_DT_overlays_in_linux linux/How_to_Guides/Target/How_to_emmc_boot +linux/How_to_Guides/Target/How_to_use_PipeWire linux/How_to_Guides/Target/How_to_mmcsd_boot_emmc_uda linux/How_to_Guides/Target/How_to_visualize_statistics_data linux/How_to_Guides/Target/How_to_Use_K3Conf_Tool diff --git a/configs/J742S2/J742S2_linux_toc.txt b/configs/J742S2/J742S2_linux_toc.txt index 6b71787c3..9e257d3a4 100644 --- a/configs/J742S2/J742S2_linux_toc.txt +++ b/configs/J742S2/J742S2_linux_toc.txt @@ -131,6 +131,7 @@ linux/How_to_Guides/Target/Processor_SDK_Linux_File_System_Optimization_Customiz linux/How_to_Guides/Target/How_to_Change_dtb_File linux/How_to_Guides/Target/How_to_enable_DT_overlays_in_linux linux/How_to_Guides/Target/How_to_emmc_boot +linux/How_to_Guides/Target/How_to_use_PipeWire linux/How_to_Guides/Target/How_to_mmcsd_boot_emmc_uda linux/How_to_Guides/Target/How_to_visualize_statistics_data linux/How_to_Guides/Target/How_to_Use_K3Conf_Tool diff --git a/configs/J784S4/J784S4_linux_toc.txt b/configs/J784S4/J784S4_linux_toc.txt index 98a2252b4..c05ec5017 100644 --- a/configs/J784S4/J784S4_linux_toc.txt +++ b/configs/J784S4/J784S4_linux_toc.txt @@ -131,6 +131,7 @@ linux/How_to_Guides/Target/Processor_SDK_Linux_File_System_Optimization_Customiz linux/How_to_Guides/Target/How_to_Change_dtb_File linux/How_to_Guides/Target/How_to_enable_DT_overlays_in_linux linux/How_to_Guides/Target/How_to_emmc_boot +linux/How_to_Guides/Target/How_to_use_PipeWire linux/How_to_Guides/Target/How_to_mmcsd_boot_emmc_uda linux/How_to_Guides/Target/How_to_visualize_statistics_data linux/How_to_Guides/Target/How_to_Use_K3Conf_Tool diff --git a/source/images/pipewire_stack.png b/source/images/pipewire_stack.png new file mode 100644 index 000000000..0c75b74ed Binary files /dev/null and b/source/images/pipewire_stack.png differ diff --git a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Audio.rst b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Audio.rst index ae1c7b4f4..6eb97e236 100644 --- a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Audio.rst +++ b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/Audio.rst @@ -28,6 +28,10 @@ Linux ALSA (Advanced Linux Sound Architecture) framework, which allows control and configuration of the hardware through common APIs. For more details check the `links below <#additional-information>`__. +The default audio server on TI Linux SDK is PipeWire, which provides a modern +multimedia framework for audio and video handling. For more information about +PipeWire setup and usage, refer :ref:`how-to-use-pipewire`. + Within the kernel there are separate drivers for each component. For each board a sound-card instance is created, usually using the :code:`sound {}` device tree node, that links together various components like different McASP diff --git a/source/linux/How_to_Guides/Target/How_to_use_PipeWire.rst b/source/linux/How_to_Guides/Target/How_to_use_PipeWire.rst new file mode 100644 index 000000000..1e6583f0e --- /dev/null +++ b/source/linux/How_to_Guides/Target/How_to_use_PipeWire.rst @@ -0,0 +1,510 @@ +.. _how-to-use-pipewire: + +################### +How to Use PipeWire +################### + +************ +Introduction +************ + +PipeWire is a modern, low-latency multimedia framework that has become the +standard for audio and video handling in Linux applications, providing +graph-based processing with real-time capabilities using unified +architecture. PipeWire’s multi-process architecture allows multiple +applications to seamlessly share multimedia content without conflicts or +resource contention. + +************** +Key Highlights +************** + +- Unified Multimedia Framework: Single solution for professional audio + (JACK), consumer audio (PulseAudio), and video processing. +- Low Latency Performance. +- Security Model: Built-in sandboxing support for containerized + applications. +- Multi-process architecture to let applications share multimedia content. +- Real-time multimedia processing on audio and video. + +************** +Basic Concepts +************** + +PipeWire Server +=============== +The server is the core daemon that manages a graph-based multimedia +processing engine. It handles the creation and execution of the media +graph where audio, video, or MIDI data flows between different processing +components. + +PipeWire Clients +================ +Clients are applications that connect to the PipeWire server to produce or +consume media streams. They create nodes in the media graph to send or +receive audio or video data. + +Session Manager +=============== +PipeWire does not handle device routing or policy decisions by itself. +These tasks are managed by a session manager, which monitors devices and +automatically connects streams. In this document, WirePlumber is used as +the session manager. + +Nodes, Ports, and Links +======================= +The PipeWire processing graph consists of nodes, ports, and links. A node +represents a processing element, ports act as input or output interfaces, +and links connect ports between nodes to allow media data to flow through +the graph. + +************************ +PipeWire Main Components +************************ + +- A PipeWire Daemon that implements the IPC and graph processing. +- An example PipeWire Session Manager that manages objects in the + PipeWire Daemon. +- A set of Programs to introspect and use the PipeWire Daemon. +- A PipeWire Library to develop PipeWire applications and plugins. +- The SPA (Simple Plugin API) used by both the PipeWire Daemon and in the + PipeWire Library. + +For more info refer `PipeWire Docs `__. + +************************* +Audio System Architecture +************************* + +.. figure:: /images/pipewire_stack.png + :align: center + :width: 600 + +- In Linux audio system using, applications such as media players, + browsers, VoIP clients, or tools like GStreamer send and receive + audio through APIs like the native PipeWire API or compatibility + layers for Jack, Pulseaudio or (ALSA). +- These audio streams are handled by the PipeWire media server, which + builds a processing graph to mix, route, and schedule audio from + multiple applications. +- A session manager such as WirePlumber applies policies like device + selection and automatic routing. +- PipeWire accesses actual audio devices using its SPA device plugins + (for example the ALSA plugin), which communicate with the ALSA sound + subsystem inside the Linux kernel. +- The kernel drivers then control the physical hardware such as audio + codecs, sound cards, or interfaces like I2S or HDMI, completing the + path from application audio streams to the real audio output or + input devices. + +********************** +Start and use PipeWire +********************** + +After the board is booted, use following commands to get started on +PipeWire: + +Check service status +==================== + +.. code-block:: console + + root@: systemctl status pipewire wireplumber + +Enable PipeWire and Wireplumber +=============================== + +Enable service to start automatically at boot + +.. code-block:: console + + root@: systemctl enable pipewire wireplumber + +.. ifconfig:: CONFIG_part_variant in ('AM62DX') + + A new service is also added by patches to set default audio devices in + WirePlumber to avoid manual setup. To enable it: + + .. code-block:: console + + root@: systemctl enable set-audio-defaults + +Start PipeWire and WirePlumber +============================== + +Start PipeWire and WirePlumber if not started by default + +.. code-block:: console + + root@: systemctl start pipewire wireplumber + +.. ifconfig:: CONFIG_part_variant in ('AM62DX') + + .. code-block:: console + + root@: systemctl start set-audio-defaults + +************************* +General PipeWire commands +************************* + +List all objects currently in PipeWire server +============================================= + +.. code-block:: console + + root@: pw-cli list-objects + id 0, type PipeWire:Interface:Core/4 + object.serial = "0" + core.name = "pipewire-0" + id 1, type PipeWire:Interface:Module/3 + object.serial = "1" + module.name = "libpipewire-module-rt" + id 2, type PipeWire:Interface:Module/3 + object.serial = "2" + module.name = "libpipewire-module-protocol-native" + id 3, type PipeWire:Interface:SecurityContext/3 + object.serial = "3" + id 4, type PipeWire:Interface:Module/3 + object.serial = "4" + module.name = "libpipewire-module-profiler" + id 5, type PipeWire:Interface:Profiler/3 + object.serial = "5" + +List only nodes +=============== + +.. code-block:: console + + root@: pw-cli list-objects Node + id 29, type PipeWire:Interface:Node/3 + object.serial = "29" + factory.id = "11" + priority.driver = "200000" + node.name = "Dummy-Driver" + id 30, type PipeWire:Interface:Node/3 + object.serial = "30" + factory.id = "11" + priority.driver = "190000" + node.name = "Freewheel-Driver" + id 31, type PipeWire:Interface:Node/3 + object.serial = "31" + factory.id = "19" + node.description = "Audio Output" + node.name = "alsa_audio_sink" + media.class = "Audio/Sink" + id 32, type PipeWire:Interface:Node/3 + object.serial = "32" + factory.id = "19" + node.description = "Audio Input" + node.name = "alsa_audio_source" + media.class = "Audio/Source" + +Inspect specific object +======================= + +Inspect specific object using command ``pw-cli info ``. + +.. code-block:: console + + root@: pw-cli info 31 + id: 31 + permissions: rwxm- + type: PipeWire:Interface:Node/3 + input ports: 0/0 + output ports: 8/129 + state: "suspended" + properties: + factory.name = "api.alsa.pcm.source" + node.name = "alsa_audio_source" + node.description = "Audio Input" + media.class = "Audio/Source" + api.alsa.period-size = "1024" + node.driver = "true" + api.alsa.disable-mmap = "false" + api.alsa.disable-batch = "false" + api.alsa.path = "hw:0,0" + audio.rate = "48000" + audio.channels = "8" + +Play and Record Stereo Audio +============================ + +Play audio via ``pw-play``. + +.. code-block:: console + + root@: pw-play + +Record audio via ``pw-record``. + +.. code-block:: console + + root@: pw-record + +Configuration Details +===================== + +A typical PipeWire setup consists of + +- PipeWire daemon +- Session manager (usually WirePlumber) +- Compatibility servers (PulseAudio, JACK) +- Client configuration + +Each of these has its own configuration file which uses SPA JSON format, +which is a relaxed JSON syntax. + +.. list-table:: Configuration files + :widths: 30 70 + :header-rows: 1 + + * - Files + - Purpose + * - pipewire.conf + - Configures the PipeWire daemon + * - client.conf + - Configures PipeWire clients + * - pipewire-pulse.conf + - PulseAudio compatibility server + * - filter-chain.conf + - Audio processing filters + +Instead of modifying the main file, PipeWire recommends using drop-in files +to override only specific settings. For other default paths and syntax info, +refer `PipeWire Conf Manual `__ + +.. code-block:: console + + $ /etc/pipewire/pipewire.conf.d/ + +.. ifconfig:: CONFIG_part_variant in ('AM62DX') + + There are two reference configurations files, sink and source added for + AM62D2-EVM. + + **90-pipewire-sink.conf** + + .. code-block:: text + + # PipeWire sink configuration for AM62D. + + context.objects = [ + { + factory = adapter + args = { + factory.name = api.alsa.pcm.sink + node.name = "alsa_audio_sink" + node.description = "Audio Output" + media.class = "Audio/Sink" + api.alsa.path = "hw:AM62D2EVM,0" + audio.rate = 48000 + audio.channels = 8 + audio.position = [ FL FR FC LFE RL RR SL SR ] + } + } + ] + + **91-pipewire-source.conf** + + .. code-block:: text + + # PipeWire source configuration for AM62D. + + context.objects = [ + { + factory = adapter + args = { + factory.name = api.alsa.pcm.source + node.name = "alsa_audio_source" + node.description = "Audio Input" + media.class = "Audio/Source" + api.alsa.path = "hw:AM62D2EVM,0" + audio.rate = 48000 + audio.channels = 8 + audio.position = [ FL FR FC LFE RL RR SL SR ] + } + } + ] + +.. ifconfig:: CONFIG_part_variant not in ('AM62DX') + + For other platforms, you can use similar configuration files for sink and source. + Below are example configurations for both. + + **90-pipewire-sink.conf** + + .. code-block:: text + + # PipeWire sink configuration + context.objects = [ + { + factory = adapter + args = { + factory.name = api.alsa.pcm.sink + node.name = "alsa_audio_sink" + node.description = "Audio Output" + media.class = "Audio/Sink" + api.alsa.path = "hw:0,0" + audio.rate = 48000 + audio.channels = 2 + audio.position = [ FL FR ] + } + } + ] + + **91-pipewire-source.conf** + + .. code-block:: text + + # PipeWire source configuration + context.objects = [ + { + factory = adapter + args = { + factory.name = api.alsa.pcm.source + node.name = "alsa_audio_source" + node.description = "Audio Input" + media.class = "Audio/Source" + api.alsa.path = "hw:0,0" + audio.rate = 48000 + audio.channels = 2 + audio.position = [ FL FR ] + } + } + ] + +Both files use identical structural patterns with only key functional +differences: + +- **context.objects** + Main configuration array defining objects created in PipeWire context. + Each object in this array becomes a node in the PipeWire graph. +- **factory = adapter** + Specifies that this object should be created using the "adapter" + factory. Adapters in PipeWire are used to bridge between different + APIs (in this case, ALSA to PipeWire). Both configuration files use + adapter factory to bridge ALSA hardware to PipeWire nodes. +- **factory.name** + Determines direction: output vs input +- **node.name** + Internal PipeWire node identifier. Creates alsa_audio_sink for playback + and alsa_audio_source for capture. +- **node.description** + Human-readable name in audio apps. +- **media.class** + PipeWire media classification "Audio/Sink" for playback and + "Audio/Source" for recording. +- **api.alsa.path** + For direct hardware access. Only PipeWire can access the audio hardware + and ALSA applications must go through PipeWire. +- **audio.channels** + Configures both input and output for 8 channel audio in case of + AM62D2-EVM and stereo audio in case of other devices. + +These configurations create two fundamental nodes in PipeWire's audio +graph: +- Sink Node: Terminal endpoint for audio playback chains +- Source Node: Starting point for audio capture chains +- Matched Pair: Enables full-duplex audio applications + +For more information, see the upstream `Alsa Configuration `__. + +WirePlumber Configuration +^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. ifconfig:: CONFIG_part_variant in ('AM62DX') + + Use the command below to list all the available audio sinks and sources. + + .. code-block:: console + + root@: wpctl status + PipeWire 'pipewire-0' [1.6.0, root@am62dxx-evm, cookie:3333499771] + └─ Clients: + 34. WirePlumber [1.6.0, root@am62dxx-evm, pid:9716] + 58. WirePlumber [export] [1.6.0, root@am62dxx-evm, pid:9716] + 94. wpctl [1.6.0, root@am62dxx-evm, pid:9753] + + Audio + ├ Devices: + │ 59. Built-in Audio [alsa] + │ + ├ Sinks: + │ * 31. Audio Output [vol: 1.00] + │ 68. Built-in Audio Stereo [vol: 0.40] + │ + ├ Sources: + │ * 32. Audio Input [vol: 1.00] + │ 69. Built-in Audio Stereo [vol: 1.00] + │ + ├ Filters: + │ + └─ Streams: + + Video + ├ Devices: + │ + ├ Sinks: + │ + ├ Sources: + │ + ├ Filters: + │ + └─ Streams: + + Settings + └─ Default Configured Devices: + 0. Audio/Sink alsa_audio_sink + 1. Audio/Source alsa_audio_source + +.. ifconfig:: CONFIG_part_variant not in ('AM62DX') + + Use the command below to list all the available audio sinks and sources. + + .. code-block:: console + + root@: wpctl status + PipeWire 'pipewire-0' [1.6.0, root@, cookie:3333499771] + └─ Clients: + 34. WirePlumber [1.6.0, root@, pid:9716] + 58. WirePlumber [export] [1.6.0, root@am62dxx-evm, pid:9716] + 94. wpctl [1.6.0, root@, pid:9753] + + Audio + ├ Devices: + │ 59. Built-in Audio [alsa] + │ + ├ Sinks: + │ * 68. Built-in Audio Stereo [vol: 0.40] + │ + ├ Sources: + │ * 69. Built-in Audio Stereo [vol: 1.00] + │ + ├ Filters: + │ + └─ Streams: + + Video + ├ Devices: + │ + ├ Sinks: + │ + ├ Sources: + │ + ├ Filters: + │ + └─ Streams: + +Use ``wpctl`` inspect to display information about the specified object. + +.. code-block:: console + + root@: wpctl inspect + +Defaults source could also be set manually by using the ID number of sinks +and sources: + +.. code-block:: console + + root@: wpctl set-default diff --git a/source/linux/How_to_Guides_Developer_Notes.rst b/source/linux/How_to_Guides_Developer_Notes.rst index da025d99f..01c91e8cd 100644 --- a/source/linux/How_to_Guides_Developer_Notes.rst +++ b/source/linux/How_to_Guides_Developer_Notes.rst @@ -21,6 +21,7 @@ Developer Notes How_to_Guides/Target/How_To_Enable_M2CC3301_in_linux How_to_Guides/Target/How_to_flash_emmc_device How_to_Guides/Target/How_to_emmc_boot + How_to_Guides/Target/How_to_use_PipeWire How_to_Guides/Target/How_to_mmcsd_boot_emmc_uda How_to_Guides/Target/How_to_suspend_to_ram_on_AM62x How_to_Guides/Target/How_to_test_MCAN_on_AM62x