Skip to content

Commit 565eb18

Browse files
committed
feat(demos): AM62D Audio-DSP-Offload Linux example
Documentation for the AM62D out-of-box GP DSP offload example. Signed-off-by: Vishnu Singh <v-singh1@ti.com>
1 parent c61b21a commit 565eb18

9 files changed

Lines changed: 311 additions & 0 deletions

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: 302 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,302 @@
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 has multichannel audio data (Ch 1–8).
20+
21+
- Step 2: Copy Data to Shared DMABuffer (DDR)
22+
- DSP offload example application read raw audio data from the SDCard and copy 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+
54+
- Once DSP processing is complete, the output (filtered/processed audio) is copied back into the same section of the shared DMA buffer.
55+
56+
- 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.
57+
58+
- Step 7: A53 Reads Back Processed Data from DMABuffer
59+
- A53 copies the processed audio data from the shared buffer, send this to audio output and forward to a host for visualization.
60+
61+
- Step 8: Audio Output (Playback)
62+
- The processed 8-channel audio is routed to DACs ports to speakers (Ch 1–8).
63+
64+
- Step 9: Host GUI Utility (Over RJ45 or Serial)
65+
66+
- A53 communicates with a Host PC GUI utility over Ethernet (RJ45) or Serial.
67+
68+
- Live display of input/output spectrum (if using IP mode).
69+
70+
- Latency graphing (measuring round-trip delay).
71+
72+
- ON/OFF control for filters.
73+
74+
- DSP/CPU load monitoring.
75+
76+
Hardware Prerequisites
77+
----------------------
78+
79+
- `AM62D-EVM <https://www.ti.com/tool/AUDIO-AM62D-EVM>`__
80+
81+
- Any audio device with output speaker and 3.5mm audio jack (Needed for running audio offload examples)
82+
83+
- SD card (minimum 16GB)
84+
85+
- USB Type-C 20W power supply (make sure to use type-C to type-C cable).
86+
87+
- USB-to-UART cable for console access
88+
89+
- PC (Windows or Linux) to flash image onto an SD Card
90+
91+
- Ethernet cable for audio offload examples host utility
92+
93+
- The ethernet expansion board `DP83867-EVM-AM <https://www.ti.com/tool/DP83867-EVM-AM>`__
94+
95+
- Host PC Requirements:
96+
97+
- operating system:
98+
99+
- Windows: Windows 11 64-bit
100+
101+
- Linux: Ubuntu 22.04 64-bit or higher
102+
103+
- Memory: Minimum 4GB RAM (8GB or more recommended)
104+
105+
- Storage: At least 10GB of free space
106+
107+
Software and Tools
108+
------------------
109+
110+
- TI Processor SDK Linux RT (AM62Dx)
111+
112+
- MCU+ SDK for AM62Dx
113+
114+
- `C7000-CGT <https://www.ti.com/tool/C7000-CGT#downloads>`__ compiler
115+
116+
- `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>`__
117+
118+
- `TI Clang Compiler Toolchain <https://www.ti.com/tool/download/ARM-CGT-CLANG>`__
119+
120+
- CMake, GCC, make, git, scp, minicom, Python3
121+
122+
- `rpmsg-dma library <https://github.com/TexasInstruments/rpmsg-dma/tree/scarthgap>`__
123+
124+
125+
EVM Setup
126+
---------
127+
128+
#. Cable Connections
129+
130+
- The figure below shows some important cable connections, ports and switches.
131+
132+
- Take note of the location of the "BOOTMODE" switch, this is used to switch between different boot modes like SD, MMC SD mode
133+
134+
.. figure:: /images/AM62D_evm_setup.png
135+
:height: 600
136+
:width: 1000
137+
138+
#. Setup UART Terminal
139+
140+
- First identify the UART port as enumerated on the host machine.
141+
142+
- Make sure that the EVM and UART cable connected to UART to USB port as shown in Cable Connections
143+
144+
- In windows, you can use the "Device Manager" to see the detected UART ports
145+
- Search "Device Manager" in Windows Search Box in the Windows taskbar.
146+
147+
- 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>`__.
148+
149+
- For A53 Linux console select UART boot port (ex: COM34 in below screenshot), keep other options to default and set 115200 baud rate.
150+
151+
#. Setup SDCard Boot Mode
152+
153+
- This mode is used to boot applications via SD card on the EVM.
154+
155+
- BOOTMODE [ 8 : 15 ] (SW3) = 0100 0000
156+
157+
- BOOTMODE [ 0 : 7 ] (SW2) = 1100 0010
158+
159+
.. figure:: /images/AM62D_evm_sdcard_boot_mode.png
160+
:height: 300
161+
:width: 600
162+
163+
Steps to validate Audio DSP offload Demo
164+
----------------------------------------
165+
166+
#. 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.
167+
168+
#. 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.
169+
170+
#. Make sure the EVM boot mode switches are set properly for SD card boot as described earlier
171+
172+
#. Connect the USB-C cable from the power adapter to one of the two USB-C ports on the EVM.
173+
174+
#. Download Host Utility `audmon.py <https://github.com/TexasInstruments/rpmsg-dma/blob/scarthgap/example/audio_offload/host%20utility/audmon.py>`__.
175+
176+
#. 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.
177+
178+
#. Get the EVM ip address
179+
180+
.. code-block:: console
181+
182+
root@am62dxx-evm:~# ifconfig
183+
184+
.. note::
185+
186+
EVM ip address is required for host utility to connect to demo application
187+
188+
#. Run audio-dsp offload demo application from console
189+
190+
.. code-block:: console
191+
192+
root@am62dxx-evm:~# rpmsg_audio_offload_example
193+
194+
#. On host machine launch the :file:`audiomon.py` utility either in IP mode or UART mode
195+
196+
- IP Mode
197+
198+
.. code-block:: console
199+
200+
# python audmon.py ip <EVM IP address>
201+
Ex: # python audmon.py ip 192.168.0.101
202+
203+
- UART mode
204+
205+
.. code-block:: console
206+
207+
# python audmon.py uart <device serial port>
208+
Ex: # python audmon.py uart /dev/ttyUSB1
209+
210+
#. :file:`audiomon.py` utility GUI will be launched and it will automatically connect to demo application which supports below features:
211+
212+
- Real-time visualization of:
213+
214+
- Frame-level average amplitude (dBFS)
215+
216+
- latency tracking
217+
218+
- Avg load
219+
220+
- Input/output FFT spectrum (only in IP mode)
221+
222+
- Command interface to toggle features (e.g., enabling/disabling FFT filter)
223+
224+
- Ctrl+S based save for graphs and log summaries
225+
226+
- Summary labels for min/max/avg stats per run
227+
228+
- For more information refer: `README <https://github.com/TexasInstruments/rpmsg-dma/blob/scarthgap/example/audio_offload/host%20utility/README.md>`_.
229+
230+
.. note::
231+
232+
Input/output audio spectrum plotting is only supported in ip mode. UART mode supports only metrics and command interface, not audio data streams.
233+
234+
Below is sample snapshot:
235+
236+
.. figure:: /images/AM62D_host_utility_snapshot.png
237+
:height: 600
238+
:width: 1200
239+
240+
- 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>`__.
241+
242+
243+
How to build Audio DSP offload Demo
244+
====================================
245+
246+
Building Audio DSP offload wic image from Yocto
247+
-----------------------------------------------
248+
249+
- To build the Audio DSP offload wic image, please refer :ref:`Processor SDK - Building the SDK with Yocto <building-the-sdk-with-yocto>`
250+
251+
Building the Linux Demo binary from sources
252+
-------------------------------------------
253+
254+
#. The source code for Audio DSP offload demo is available as part of the `rpmsg-dma <https://github.com/TexasInstruments/rpmsg-dma/tree/scarthgap>`__.
255+
256+
.. code-block:: console
257+
258+
host# git clone https://github.com/TexasInstruments/rpmsg-dma.git -b scarthgap
259+
260+
#. 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>`.
261+
262+
#. Prepare the environment for cross compilation.
263+
264+
.. code-block:: console
265+
266+
host# source <path-to-linux-installer>/linux-devkit/environment-setup
267+
268+
#. Compile the sources
269+
270+
.. code-block:: console
271+
272+
[linux-devkit]:> cd <path-to-rpmsg-dma-sources>
273+
[linux-devkit]:> cmake -S . -B build; cmake --build build
274+
275+
- This will build:
276+
277+
- The example application :file:`rpmsg_audio_offload_example`
278+
279+
- Transfer the generated files to evm sdcard:
280+
281+
- The example binary :file:`rpmsg_audio_offload_example` to :file:`/usr/bin`
282+
283+
- The configuration file :file:`dsp_offload.cfg` to :file:`/etc`
284+
285+
- The sample audio file :file:`sample_audio.wav` to :file:`/usr/share/`
286+
287+
- The C7 DSP firmware file :file:`dsp_audio_filter_offload.c75ss0-0.release.strip.out` to :file:`/usr/lib/`
288+
289+
- Optional:
290+
291+
- To build only the library or only the example, use:
292+
293+
.. code-block:: console
294+
295+
cmake -S . -B build -DBUILD_LIB=OFF # disables library build
296+
cmake -S . -B build -DBUILD_EXAMPLE=OFF # disables example build
297+
298+
299+
Building the C7 Firmware from sources
300+
--------------------------------------
301+
302+
- 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)