struggling to get rpmsg audio working on the linux side of the imx7ulp evk

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

struggling to get rpmsg audio working on the linux side of the imx7ulp evk

873 Views
Jonny_T
Contributor II

hi, 

I'm trying to get the imx rpmsg audio kernel module to work on the A7 side so that i can start using it with the M4 side's audio service. I'm using the current release of the linux BSP and 5.10.52 kernel.

on boot up the linux console contains;

[ 3.491882] imx-audio-rpmsg imx-audio-rpmsg: no reserved DMA memory
[ 3.498267] imx-audio-rpmsg imx-audio-rpmsg: snd_soc_register_card failed (-5 17)

and;

[ 3.137586] No soundcards found.

 

so i'm guessing i need to specify a sound card and an area of reserved DMA memory, but i'm struggling to figure out how to get this working (I'm new to embedded linux). 

My current approach has been to add a new dts file to modify the device tree to try and add in a reserved bit of memory, and also tried to add in the rpmsg-i2s as that seems to be what the module is wanting, along with modifying the rpmsg_audio node to contain a memory-region and a codec;

/ {
    compatible = "fsl,imx7ulp-evk""fsl,imx7ulp-evkb""fsl,imx7ulp""Generic DT based system";

    &reserved-memory {
        audio_reserved: audio@0x8FF00000 {
            compatible = "shared-dma-pool";
            reg = <0 0x8FF00000 0 0x10000000>;
            no-map;
        };       
    };


    rpmsg_i2s: rpmsg-i2s {
        compatible = "fsl,imx7ulp-rpmsg-i2s";
        /* the audio device index in m4 domain */
        fsl,audioindex = <0> ;
        fsl,dma-buffer-size = <0x6000000>;
        status = "okay";
    };

    wm8960: codec@1a {
    compatible = "wlf,wm8960";
    reg = <0x1a>;
    wlf,shared-lrclk;
    };
    
};

&rpmsg_audio {
    memory-region = <&audio_reserved>;
    audio-codec = <&wm8960>;
    fsl,enable-lpa;
};

 

This doesn't seem to work but i was wondering if this approach is the correct one and if so what am i doing wrong that is stopping it from working?

I can see the dts file is being compiled and added to the kernel's complied code but doesn't seem to be included in the image as when i boot up and look through the proc/ and sys/ folders in the device-tree sections i can't seem to see the changes. 

cheers

0 Kudos
1 Reply

857 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello @Jonny_T ,

Your idea seems incorrect. A core is responsible for parsing the audio data and putting the data on the DDR, and at the same time giving the first address of the data in the DDR; M core gets the first address of the data, and performs operations such as playback.
Therefore, you need to compile the I2S code in M core, get the .bin file, and load the .bin file in linux. The following are the loading steps of i.MX8MM A core and M core I2S. For i.mx7ulp, the method is similar, for your reference.

1. Buidling sai_low_power example code , get sai_low_power.bin。
sai_low_power can be lined as:
---RAM : Load address --- 0x7e0000
---DDR : Load address --- 0x80000000
---QSPI : Load address --- 0x80000000
2. Program sai_low_power.bin into QSPI/eMMC by uuu tool
3. boot i.MX8MM board and enter into u-boot-imx command line
Load sai_low_power.bin:
--from QSPI:
u-boot > sf probe
u-boot > bootaux 0x8000000
--Load from eMMC and DDR version of M4 binary:
(Assume sai_low_power.bin is at 10M offset in eMMC)
u-boot > mmc dev 1
u-boot > mmc read 0x80000000 2800 100 ( 10MB: 0x2800 * 512 = 102400 , read 50K size to DDR)
u-boot > dcache flush
u-boot > bootaux 0x8000000
4. Starting linux kernel and dtb file with rpmsg.
5. copy a audio file (not compressed) to a directory in linux system of board.
6. Using aplay to play audio file, command is like below:
# aplay -Dhw:3 --period-time=500000 --buffer-time=60000000 audio48k24b2c.wav -N &
(audio48k24b2c.wav is audio file's name; Dhw:3 is the number of sound card, probably it should be
changed according to different board)

 

Try it, please!

Regards,

weidong

0 Kudos