Post Go back to editing

Using multiple ADAU7002 in single DAI for Embedded Linux

Hi all,

I work on a RnD project that is using 2 adau7002 devices with 4 PDM mics. 

My first prototype works electronically in perfect condition. I confirmed this with bare metal boards, scope and logic analyzer observations.

However, I lost outputs of my 3rd and 4th channels on the DMA stage or somewhere in userspace - when I use simple-card and adau7002 driver in my devicetree.

I was able to make the board work with some hardware hacks and ac108 driver, however not with adau7002 driver for linux. Still, I need a proper and reliable solution.

Do you have any recommendation where to look at regarding using multiple adau7002 codecs with a single DAI/platform (I2S) driver? I suspect that either the adau7002 driver file is missing something or that my device tree configuration is wrong. Therefore, my last 2 channels are dumped somewhere in DMA.

Thank you in advance for your support!

Burak 

Parents
  • Hello Burak,

    Are you aware of our newer parts? The aDAU7118 can handle up to 8 channels of PDM signals out onto one TDM line or four I2S lines all at 24 bits of resolution. This might simplify your design. The ADAU7112 is the updated version of the 7002 and goes to a full 24 bits. 

    I support these parts but I am not an expert in Linux. So I will move your post over to that space on the forum where you hopefully will receive some help. 

    Dave T

Reply
  • Hello Burak,

    Are you aware of our newer parts? The aDAU7118 can handle up to 8 channels of PDM signals out onto one TDM line or four I2S lines all at 24 bits of resolution. This might simplify your design. The ADAU7112 is the updated version of the 7002 and goes to a full 24 bits. 

    I support these parts but I am not an expert in Linux. So I will move your post over to that space on the forum where you hopefully will receive some help. 

    Dave T

Children
  • Hello Dave,

    Thank you for your reply! No, I wasn't aware of these newer parts actually. I started this design a bit longer than a year ago. Either I missed them or they are newer than my design. Thank you for letting me know about them! ADAU7118 would definitely simplify things.

    Also thank you for moving the topic to Q&A, I am looking forward to getting some support.

    Burak

  • Hello Burak,

    The adau7002 is a simple driver. There's no register's to config, so it should be pretty straight. Nevertheless, It might have some error in the way we register it with ALSA. Could you share your devicetree? Also, How are you configuring your part regarding the CONFIG pin?

    As far as I'm understanding, things work for the first part but fail for the second?

    Nuno Sá

  • #include "sun8i-h3-nanopi.dtsi"
    
    / {
    	model = "FriendlyARM NanoPi NEO";
    	compatible = "friendlyarm,nanopi-neo", "allwinner,sun8i-h3";
    
    	card {
    		compatible = "simple-audio-card";
    		simple-audio-card,name = "senic";
    		simple-audio-card,mclk-fs = <256>;
    		#address-cells = <1>;
    		#size-cells = <0>;
    
    		simple-audio-card,dai-link@0 {
    			reg = <0>;
    			format = "dsp_a";
    			frame-master = <&link_cpu0>;
    			bitclock-master = <&link_cpu0>;
    
    			link_cpu0: cpu {
    				sound-dai = <&i2s0>;
    			};
    
    			codec {
    				sound-dai = <&codec0>;
    			};
    		};
    
    		simple-audio-card,dai-link@1 {
    			reg = <1>;
    			format = "dsp_a";
    			frame-master = <&link_cpu1>;
    			bitclock-master = <&link_cpu1>;
    
    			link_cpu1: cpu {
    				sound-dai = <&i2s0>;
    			};
    
    			codec {
    				sound-dai = <&codec1>;
    			};
    		};
    	};
    
    	codec0: codec-0 {
    		#sound-dai-cells = <0>;
    		compatible = "adi,adau7002";
    		status = "okay";
    	};
    
    	codec1: codec-1 {
    		#sound-dai-cells = <0>;
    		compatible = "adi,adau7002";
    		status = "okay";
    	};
    };
    
    &i2s0 {
    	status = "okay";
    };
    
    

    Hi Nuno Sá,

    Thank you for your reply! 

    Regarding the simplicity of the driver, I totally agree. I think the issue is at the DT node that I attached above or our SoC's I2S driver has an issue regarding DMA engine. 

    ADAU7002 ICs config pins are at 2nd and 3rd positions on my prototype board, respectively TDM1-2 and TDM3-4.

    Looking forward to hearing from you again! 

    Burak 

  • Hi,

    So, you can try some things. On your cpu dai, I would try to set the following properties:

    • ​dai-tdm-slot-num = <2>;
    • dai-tdm-slot-width = <32>;

    Also, I'm not sure if you need this but I believe you need to set the simple-audio-card,widgets and simple-audio-card,routing properties.

    It would be usefull if you can post your system kernel boot log. I could probably see if the 2 last properties I mentioned are needed... Here are some references that you can look to help you with the devicetree.

    Also, Are you sure your device supports PCM/TDM? Your are setting your cpu DAI as an i2s device but configuring the adau7002 to tdm... Now that I think about it, Im not sure the dai-tdm-slot-num properties will help (although you can always try them). I think you need to point your cpu sound-dai to a tdm capable device. This device will, most likely, have some tdm-slots property that you can set (which should be 2). 

    Hope this helps!

  • Hi,

    Thank you for the tips Nuno! Unfortunately, my hands are full with other projects at the moment. But I will look into your suggestions and come back to you asap with the results. Thank you so much!

    Other than that, according to the datasheet, Allwinner H3 and nanopi-neo support I2S-PDM as well as TDM-PCM. I am quite sure about this. There are other people using nanopi's TDM format on the I2S bus for some ADCs.

    Burak