Hardware requirements
Micro USB cable
MIMX8MM6-EVK board
J-Link Debug Probe
12V power supply
Personal Computer
Headphone
8MIC-PRI-MX8
Board settings
No special settings are required. Connect the 8MIC-PRI-MX8 Microphone board to J1003 on the base board if sound capture needed.
Note!
This case does not support ddr and flash target.
This case runs together with Linux and the Linux release version should be not lower than 5.10.72-2.2.0.
Prepare the Demo
Connect 12V power supply and J-Link Debug Probe to the board, switch SW101 to power on the board
Connect a USB cable between the host PC and the J901 USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Launch the debugger in your IDE to begin running the demo.
NOTE
The 16/24/32bit for PCM and DSD64/128/256/512( DSD playabck only supported by ak4497 codec) Music stream are supported
The wm8524 codec on the EVK board and the ak4497 codec on the audio board are both supported, but please note that only one codec can be used at the same time which is determained by the macro “APP_SRTM_CODEC_WM8524_USED” and “APP_SRTM_CODEC_AK4497_USED” in app_srtm.h.
Since the DSD files are typically large, users could create a new large size patition in the SD card to place the music files.
After M core running, please boot the linux kernel to create the rpmsg channel between A core and M core. Make sure the FDT file is correctly set before booting the linux kernel. The following command can be used to set FDT file in uboot console: When ak4497 codec is used, u-boot=>setenv fdtfile imx8mm-evk-rpmsg.dtb u-boot=>saveenv When wm8524 codec is used, u-boot=>setenv fdtfile imx8mm-evk-rpmsg-wm8524.dtb u-boot=>saveenv Set the “snd_pcm.max_alloc_per_card” in bootargs, use the following command to print default mmcargs and add “snd_pcm.max_alloc_per_card=134217728” to the end. u-boot=>printenv mmcargs For example, “mmcargs=setenv bootargs ${jh_clk} ${mcore_clk} console=${console} root=${mmcroot}” is printed, then set the mmcargs using the following command. u-boot=>setenv mmcargs ‘setenv bootargs ${jh_clk} ${mcore_clk} console=${console} root=${mmcroot} snd_pcm.max_alloc_per_card=134217728’ u-boot=>setenv prepare_mcore ‘setenv mcore_clk clk-imx8mm.mcore_booted’ u-boot=>saveenv u-boot=>run prepare_mcore
Please make sure here exists xxx.wav file in the SD card. If the music file is placed at the Windows FAT32 paritions, after the linux kernel boot up and logged as root, using the “mount /dev/mmcblk1p1 /mnt” and then go to “/mnt” folder to playabck the music using the playback command. If the music file is placed at the Linux paritions, eg “/home”, could playback the music dirctly using the playback command.
Playback/record command
Note:
Please use the command “cat /proc/asound/cards” to check the ak4497 sound card number. E.g: Type command: ~# cat /proc/asound/cards The available sound cards can be shown: 0 [imxspdif ]: imx-spdif - imx-spdif mx-spdif 1 [imxaudiomicfil ]: imx-audio-micfi - imx-audio-micfil imx-audio-micfil 2 [btscoaudio ]: bt-sco-audio - bt-sco-audio bt-sco-audio 3 [ak4497audio ]: ak4497-audio - ak4497-audio ak4497-audio Then the ak4497 sound number is 3.
If use the WM8524 codec, use the wm8524 sound card number.
If use the MICFIL for sound capture, use the micfi sound card number.
When playback the .wav file:
If want to playabck with pause/resume command, could use command: “aplay -Dhw:3 -i xxx.wav -N”; press space key on the keyboard to pause, and press the space key again to resume.
If want to playback with low power mode and specified period-size, could use command: “aplay -Dhw:3 –buffer-size=xxx –period-size=xxx xxx.wav -N &” or “aplay -Dhw:3 –buffer-time=xxx –period-time=xxx xxx.wav -N &”. E.g: aplay -Dhw:3 –period-time=500000 –buffer-time=10000000 xxx.wav -N & Now please use “echo mem > /sys/power/state” command to make A core enter suspend mode and the playabck work normally. Note, make sure the A core has enough time to fill the audio buffer before going into suspend mode.
When recording sound(RPMSG MICFIL is only supported when WM8524 codec used), could use command: “arecord -Dhw:1,0 -r44100 -fS16_LE -c2 test.wav &” fS16_LE and 1-8 channels are supported.
When playback the .dsd/.dff file (only supported by AK4497 codec):
Enter folder where the DSD execution procedure exists, using command: “cd /unit_tests/ALSA_DSD”
If want to test play back with specified period-size, could use command: “./mxc_alsa_dsd_player -Dhw:0 –buffer-size=xxx –period-size=xxx music path” or “./mxc_alsa_dsd_player -Dhw:0 –buffer-time=xxx –period-time=xxx music path” Please note that the “music path” means where the DSD file exists.
Support music playabck when A core enters suspend.
Running the demo
When the demo runs successfully, the log would be seen on the terminal like:
#################### LOW POWER AUDIO TASK ####################
Build Time: Apr 8 2020--15:27:22
********************************
Wait the Linux kernel boot up to create the link between M core and A core.
********************************
M core is running now, please boot the linux kernel and use the command to playback music.