Use internal - mic in both core - iMX8ULP EVK9

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Use internal - mic in both core - iMX8ULP EVK9

1,334 次查看
dhruvinrajpura
Contributor III

I am using iMX8ULP-EVK9,
In ref. manual I checked that all SAI0-7 can be accessed from both M core and A core,

Suppose I am using internal mic that is capturing audio from M core now at any point of time I want to give control to A core to capture and vice versa, what's method to do that so I can control same mic from both core?

标签 (1)
0 项奖励
回复
8 回复数

1,311 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @dhruvinrajpura 

The evk dts support using Mcore audio with rpmsg. You can refer it's realization

Best Regards,
Zhiming

0 项奖励
回复

1,298 次查看
dhruvinrajpura
Contributor III

Thanks @Zhiming_Liu 

In the dts I found two nodes for rpmsg audio, but in that I didn't get how I can use that in app layer, like for ex Initially I want control on M core side and A core is in deep sleep, after some event M core wakes up A core than I want to give control of mic to A core than what will be steps?

rpmsg_audio: rpmsg-audio {
		compatible = "fsl,imx8ulp-rpmsg-audio";
		model = "wm8960-audio";
		fsl,rpmsg-out;
		fsl,rpmsg-in;
		audio-codec = <&wm8960>;
		memory-region = <&audio_reserved>;
		audio-routing =
			"LINPUT1", "MICB",
			"LINPUT3", "MICB";
		status = "okay";
	};

	rpmsg_micfil: rpmsg_micfil {
		compatible = "fsl,imx8ulp-rpmsg-audio";
		model = "micfil-audio";
		fsl,rpmsg-channel-name = "rpmsg-micfil-channel";
		fsl,rpmsg-in;
		memory-region = <&micfil_reserved>;
		status = "okay";
	};
0 项奖励
回复

1,259 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @dhruvinrajpura 

Dynamic peripheral migration is not supported by the default BSP, which only supports the A-core controlling the sound card in the M-core by means of rpmsg.

Best Regards,
Zhiming

0 项奖励
回复

1,247 次查看
dhruvinrajpura
Contributor III

Thanks @Zhiming_Liu 

I got your point and completely agree with that but as you said
the A-core controlling the sound card in the M-core by means of rpmsg.
I want to know this method step by step.

0 项奖励
回复

1,233 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi,

The Linux BSP has already support it , the audio operations on Linux are same as common audio card. For M33, please use imx8ulp_m33_TCM_sai_low_power_audio.bin

Best Regards,
Zhiming

0 项奖励
回复

1,225 次查看
dhruvinrajpura
Contributor III

@Zhiming_Liu 

I got your point, I checked that when I load sai_low_power_audio.bin I am getting wm8960

root@imx8ulp-9x9-lpddr4-evk:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: imxspdif [imx-spdif], device 0: S/PDIF PCM snd-soc-dummy-dai-0 [S/PDIF PCM snd-soc-dummy-dai-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: btscoaudio [bt-sco-audio], device 0: 2da90000.sai-bt-sco-pcm-wb bt-sco-pcm-wb-0 [2da90000.sai-bt-sco-pcm-wb bt-sco-pcm-wb-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: wm8960audio [wm8960-audio], device 0: rpmsg hifi rpmsg-codec-wm8960.0-001a-0 []
  Subdevices: 1/1

 

And when I flash any other code on M core, card2: wm8960audio is not there, that's correct,

But what my requirement is sometimes I required this mic for M core (for recording) and sometimes for A core, so what are the ways to transfer control, or it is like when I am using it with M core it automatically disable with A core? Or how the hand over will work from M<-->A core and vice versa.

0 项奖励
回复

1,195 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @dhruvinrajpura 

Please refer the readme about the SDK demo. The transfer control should be software based, stopping the M core from writing wav data when it is not in use and telling the A core about it via rpmsg. When the M-core needs to be used, the rpmsg communication also needs to be stopped so that the A-core cannot use the M-core's audio card.

Overview
========
In this demo, A core decoded music data and put it to DDR buffer and informs M core with the related information. 
Then M core will take the ownership of consuming the buffer, it will copy buffer from DDR to TCM, manipulating SDMA to transfer the data to SAI and codec for playback. 
It gives DDR and A core opportunity to do power saving for rather long time frame. M core will also take ownership of codec initialization.
SRTM(Simplified Real Time Messaging) protocol is used to communicate between A core and M core. 
The protocol provides various commands for A core and M core to communicate with each other. 
If there is no audio palyback, M core will enter the STOP mode, and the whole SOC system would enter deep sleep mode(DSM) once A core enter low power status.



Best Regards,
Zhiming

0 项奖励
回复

1,178 次查看
dhruvinrajpura
Contributor III

@Zhiming_Liu 

Currently I checked in code that SRTM is starting APP_SRTM_InitAudioService(); which is responsible to register rpmsg-channel to A core and we get wm8960 card, when I comment APP_SRTM_InitAudioService(); I checked that wm8960 is not appearing as card.

My purpose here is to control this handover, currently when we do SRTM_Init it is by default creating channel, instead of that I want to create that channel at different place,
For example I run M core and A core after that after 1 minute that channel should register and again after 1 minute it should de-register, what's way for that, because If I directly take APP_SRTM_InitAudioService outside, code is getting stuck while registering, what is prerequisite to achieve this?

0 项奖励
回复