Skip to content

Commit 9429602

Browse files
committed
feat: Demos: Adds Documentation for AM62D Audio-DSP-Offload Linux example
Adds documentation support for the out-of-box GP DSP offload demo for AM62Dx. Signed-off-by: Vishnu Singh <[email protected]>
1 parent c61b21a commit 9429602

File tree

9 files changed

+310
-0
lines changed

9 files changed

+310
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ of directories listed under `configs/`. For example:
3838
* "AM62AX" (representing AM62AX family)
3939
* "AM62PX" (representing AM62PX family)
4040
* "AM62LX" (representing AM62L family)
41+
* "AM62DX" (representing AM62D family)
4142
* "AM65X" (representing AM65X family)
4243
* "DRA821A" (representing DRA821A)
4344
* "J721E" (representing Jacinto 7 ES)

configs/AM62DX/AM62DX_linux_toc.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,7 @@ linux/How_to_Guides/FAQ/How_to_Integrate_Open_Source_Software
7575
linux/How_to_Guides_Hardware_Setup_with_CCS
7676
linux/How_to_Guides/Hardware_Setup_with_CCS/AM62DX_EVM_Hardware_Setup
7777

78+
linux/Demo_User_Guides/index_Demos
79+
linux/Demo_User_Guides/AM62D_Dsp_Offload_User_Guide
80+
7881
linux/Documentation_Tarball

source/images/AM62D_DSP_offload_Demo.svg

Lines changed: 4 additions & 0 deletions
Loading
12 KB
Loading
497 KB
Loading

source/images/AM62D_evm_setup.png

1.18 MB
Loading
243 KB
Loading
Lines changed: 301 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,301 @@
1+
.. _AM62D-dsp-offload-from-linux-user-guide:
2+
3+
AM62D DSP offload from Linux - User Guide
4+
=========================================
5+
6+
Overview
7+
--------
8+
9+
This guide describes how to set up, build, and run audio DSP offload example by using the Texas Instruments AM62D audio evaluation module (EVM).
10+
This demo example shows how to offload 8ch audio filtering to C7x from Linux, input is 8-channel, 256 block size audio data in channel interleaved form.
11+
The output is the processed eight-channel, sample rate 48KHz and 256 block size audio data in channel interleaved form.
12+
Below figure shows how this demo works:
13+
14+
.. figure:: /images/AM62D_DSP_offload_Demo.svg
15+
:height: 500
16+
:width: 1000
17+
18+
- Step 1: Read (Linux - A53 from SDCard)
19+
- An 8-channel sample audio .wav file is read from the SDCard. This file contains multi-channel audio data (Ch 1–8).
20+
21+
- Step 2: Copy Data to Shared DMABuffer (DDR)
22+
- The raw audio data read from the SDCard is copied into a shared DMA buffer located in DDR memory.
23+
24+
- Step 3: Notify DSP using RPMSG (IPC)
25+
- A53 sends a control message via RPMsg (Remote Processor Messaging) to the C7x core. This message informs the C7x that new input audio data is available for processing in the shared DDR buffer.
26+
27+
- Step 4: C7x Reads from Shared DMABuffer into L2 SRAM
28+
- The C7x DSP copies the audio data from the DMA buffer (DDR) into its local L2 SRAM for processing. This operation minimizes access latency compared to reading directly from DDR.
29+
30+
- Step 5: Signal Chain Execution on DSP
31+
- Below figure shows the C7x signal chain executed on C7x:
32+
33+
.. figure:: /images/AM62D_dsp_signal_chain_11.01.png
34+
:height: 80
35+
:width: 1000
36+
37+
- CasadeBiquad Low-Pass Filter:
38+
- This filter is a three-stage, direct form 1 design with a low-pass cut-off frequency of 10KHz.
39+
40+
- CasadeBiquad High-Pass Filter:
41+
- This filter is also a three-stage, direct form 1 design with a high-pass cut-off frequency of 2KHz.
42+
43+
- Finite Impulse Response(FIR) Low-Pass Filter:
44+
- This filter is a 64-tap low-pass filter with a cut-off frequency of 8KHz.
45+
46+
- Real Fast Fourier Transform(FFT) and Inverse Fast Fourier Transform(IFFT) Real:
47+
- Perform FFT and IFFT of a real signal.
48+
49+
- Matrix Transpose:
50+
- Convert the data format between de-interleaved and interleaved formats within the signal chain.
51+
52+
- Step 6: Processed Data is Copied Back to Shared DMABuffer (DDR)
53+
- Once DSP processing is complete, the output (filtered/processed audio) is copied back into the same section of the shared DMA buffer.
54+
55+
- C7x sends a control message via RPMsg (Remote Processor Messaging) to the A53 core. This message informs the A53 that processed output audio data is available in the shared DDR buffer.
56+
57+
- Step 7: A53 Reads Back Processed Data from DMABuffer
58+
- A53 copies the processed audio data from the shared buffer, send this to audio output and forward to a host for visualization.
59+
60+
- Step 8: Audio Output (Playback)
61+
- The processed 8-channel audio is routed to DACs ports to speakers (Ch 1–8).
62+
63+
- Step 9: Host GUI Utility (Over RJ45 or Serial)
64+
65+
- A53 communicates with a Host PC GUI utility over Ethernet (RJ45) or Serial.
66+
67+
- Live display of input/output spectrum (if using IP mode).
68+
69+
- Latency graphing (measuring round-trip delay).
70+
71+
- ON/OFF control for filters.
72+
73+
- DSP/CPU load monitoring.
74+
75+
Hardware Prerequisites
76+
----------------------
77+
78+
- `AM62D-EVM <https://www.ti.com/tool/AUDIO-AM62D-EVM>`__
79+
80+
- Any audio device with output speaker and 3.5mm audio jack (Needed for running audio offload examples)
81+
82+
- SD card (minimum 16GB)
83+
84+
- USB Type-C 20W power supply (make sure to use type-C to type-C cable).
85+
86+
- USB-to-UART cable for console access
87+
88+
- PC (Windows or Linux) to flash image onto an SD Card
89+
90+
- Ethernet cable for audio offload examples host utility
91+
92+
- The ethernet expansion board `DP83867-EVM-AM <https://www.ti.com/tool/DP83867-EVM-AM>`__
93+
94+
- Host PC Requirements:
95+
96+
- operating system:
97+
98+
- Windows: Windows 11 64-bit
99+
100+
- Linux: Ubuntu 22.04 64-bit or higher
101+
102+
- Memory: Minimum 4GB RAM (8GB or more recommended)
103+
104+
- Storage: At least 10GB of free space
105+
106+
Software and Tools
107+
------------------
108+
109+
- TI Processor SDK Linux RT (AM62Dx)
110+
111+
- MCU+ SDK for AM62Dx
112+
113+
- `C7000-CGT <https://www.ti.com/tool/C7000-CGT#downloads>`__ compiler
114+
115+
- `Code Composer Studio <https://software-dl.ti.com/mcu-plus-sdk/esd/AM62DX/11_00_00_16/exports/docs/api_guide_am62dx/CCS_PROJECTS_PAGE.html>`__
116+
117+
- `TI Clang Compiler Toolchain <https://www.ti.com/tool/download/ARM-CGT-CLANG>`__
118+
119+
- CMake, GCC, make, git, scp, minicom, Python3
120+
121+
- `rpmsg-dma library <https://github.com/TexasInstruments/rpmsg-dma/tree/scarthgap>`__
122+
123+
124+
EVM Setup
125+
---------
126+
127+
#. Cable Connections
128+
129+
- The figure below shows some important cable connections, ports and switches.
130+
131+
- Take note of the location of the "BOOTMODE" switch, this is used to switch between different boot modes like SD, MMC SD mode
132+
133+
.. figure:: /images/AM62D_evm_setup.png
134+
:height: 600
135+
:width: 1000
136+
137+
#. Setup UART Terminal
138+
139+
- First identify the UART port as enumerated on the host machine.
140+
141+
- Make sure that the EVM and UART cable connected to UART to USB port as shown in Cable Connections
142+
143+
- In windows, you can use the "Device Manager" to see the detected UART ports
144+
- Search "Device Manager" in Windows Search Box in the Windows taskbar.
145+
146+
- If you don't see any USB serial ports listed in "Device Manager" under "Ports (COM & LPT)", then make sure you have installed the UART to USB driver from `FTDI <https://www.ftdichip.com/drivers>`__.
147+
148+
- For A53 Linux console select UART boot port (ex: COM34 in below screenshot), keep other options to default and set 115200 baud rate.
149+
150+
#. Setup SDCard Boot Mode
151+
152+
- This mode is used to boot applications via SD card on the EVM.
153+
154+
- BOOTMODE [ 8 : 15 ] (SW3) = 0100 0000
155+
156+
- BOOTMODE [ 0 : 7 ] (SW2) = 1100 0010
157+
158+
.. figure:: /images/AM62D_evm_sdcard_boot_mode.png
159+
:height: 300
160+
:width: 600
161+
162+
Steps to validate Audio DSP offload Demo
163+
----------------------------------------
164+
165+
#. Flash an SD card with the :file:`tisdk-default-image-rt-am62dxx-evm.rootfs.wix.xz` wic image. Please follow the instructions provided at :ref:`Create SD Card <processor-sdk-linux-create-sd-card>` guide.
166+
167+
#. Insert the flashed SD card to `AUDIO-AM62D-EVM <https://www.ti.com/tool/AUDIO-AM62D-EVM>`__, connect the 3.5mm jack headset/Speaker, Ethernet Cable and power on TI AUDIO-AM62D-EVM.
168+
169+
#. Make sure the EVM boot mode switches are set properly for SD card boot as described earlier
170+
171+
#. Connect the USB-C cable from the power adapter to one of the two USB-C ports on the EVM.
172+
173+
#. Download Host Utility `audmon.py <https://github.com/TexasInstruments/rpmsg-dma/blob/scarthgap/example/audio_offload/host%20utility/audmon.py>`__.
174+
175+
#. The EVM should boot and the booting progress should display in the serial port console. At the end of booting, the Arago login prompt will appear. Just enter "root" to log in.
176+
177+
#. Get the EVM ip address
178+
179+
.. code-block:: console
180+
181+
root@am62dxx-evm:~# ifconfig
182+
183+
.. note::
184+
185+
EVM ip address is required for host utility to connect to demo application
186+
187+
#. Run audio-dsp offload demo application from console
188+
189+
.. code-block:: console
190+
191+
root@am62dxx-evm:~# rpmsg_audio_offload_example
192+
193+
#. On host machine launch the :file:`audiomon.py` utility either in IP mode or UART mode
194+
195+
- IP Mode
196+
197+
.. code-block:: console
198+
199+
# python audmon.py ip <EVM IP address>
200+
Ex: # python audmon.py ip 192.168.0.101
201+
202+
- UART mode
203+
204+
.. code-block:: console
205+
206+
# python audmon.py uart <device serial port>
207+
Ex: # python audmon.py uart /dev/ttyUSB1
208+
209+
#. :file:`audiomon.py` utility GUI will be launched and it will automatically connect to demo application which supports below features:
210+
211+
- Real-time visualization of:
212+
213+
- Frame-level average amplitude (dBFS)
214+
215+
- latency tracking
216+
217+
- Avg load
218+
219+
- Input/output FFT spectrum (only in IP mode)
220+
221+
- Command interface to toggle features (e.g., enabling/disabling FFT filter)
222+
223+
- Ctrl+S based save for graphs and log summaries
224+
225+
- Summary labels for min/max/avg stats per run
226+
227+
- For more information refer: `README <https://github.com/TexasInstruments/rpmsg-dma/blob/scarthgap/example/audio_offload/host%20utility/README.md>`_.
228+
229+
.. note::
230+
231+
Input/output audio spectrum plotting is only supported in ip mode. UART mode supports only metrics and command interface, not audio data streams.
232+
233+
Below is sample snapshot:
234+
235+
.. figure:: /images/AM62D_host_utility_snapshot.png
236+
:height: 600
237+
:width: 1200
238+
239+
- For more information on demo application & it's configuration, refer: `DSP Offload Example <https://github.com/TexasInstruments/rpmsg-dma/blob/scarthgap/example/audio_offload/host%20utility/README.md>`__.
240+
241+
242+
How to build Audio DSP offload Demo
243+
====================================
244+
245+
Building Audio DSP offload wic image from Yocto
246+
-----------------------------------------------
247+
248+
- To build the Audio DSP offload wic image, please refer :ref:`Processor SDK - Building the SDK with Yocto <building-the-sdk-with-yocto>`
249+
250+
Building the Linux Demo binary from sources
251+
-------------------------------------------
252+
253+
#. The source code for Audio DSP offload demo is available as part of the `rpmsg-dma <https://github.com/TexasInstruments/rpmsg-dma/tree/scarthgap>`__.
254+
255+
.. code-block:: console
256+
257+
host# git clone https://github.com/TexasInstruments/rpmsg-dma.git -b scarthgap
258+
259+
#. Download and Install the AM62D Linux SDK from |__SDK_DOWNLOAD_URL__| following the steps mentioned at :ref:`Download and Install the SDK <download-and-install-sdk>`.
260+
261+
#. Prepare the environment for cross compilation.
262+
263+
.. code-block:: console
264+
265+
host# source <path-to-linux-installer>/linux-devkit/environment-setup
266+
267+
#. Compile the sources
268+
269+
.. code-block:: console
270+
271+
[linux-devkit]:> cd <path-to-rpmsg-dma-sources>
272+
[linux-devkit]:> cmake -S . -B build; cmake --build build
273+
274+
- This will build:
275+
276+
- The example application :file:`rpmsg_audio_offload_example`
277+
278+
- Transfer the generated files to evm sdcard:
279+
280+
- The example binary :file:`rpmsg_audio_offload_example` to :file:`/usr/bin`
281+
282+
- The configuration file :file:`dsp_offload.cfg` to :file:`/etc`
283+
284+
- The sample audio file :file:`sample_audio.wav` to :file:`/usr/share/`
285+
286+
- The C7 DSP firmware file :file:`dsp_audio_filter_offload.c75ss0-0.release.strip.out` to :file:`/usr/lib/`
287+
288+
- Optional:
289+
290+
- To build only the library or only the example, use:
291+
292+
.. code-block:: console
293+
294+
cmake -S . -B build -DBUILD_LIB=OFF # disables library build
295+
cmake -S . -B build -DBUILD_EXAMPLE=OFF # disables example build
296+
297+
298+
Building the C7 Firmware from sources
299+
--------------------------------------
300+
301+
- Please refer to the `MCU+ SDK Documentation <https://software-dl.ti.com/mcu-plus-sdk/esd/AM62DX/11_00_00_16/exports/docs/api_guide_am62dx/GETTING_STARTED_BUILD.html>`__

source/linux/Demo_User_Guides/index_Demos.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The SDK supports the following Out-Of-Box demo-applications
1616
Benchmark_Demo_User_Guide
1717
Display_Cluster_User_Guide
1818
TI_LVGL_Demo_User_Guide
19+
AM62D_Dsp_Offload_User_Guide.rst
1920

2021
.. ifconfig:: CONFIG_sdk in ('j7_foundational')
2122

0 commit comments

Comments
 (0)