The Tx signal falls down as only DMA transmission starts

Hi,

my configuration consists from a custom carrier board based on ZynqMP (I took ADI HDL design 2018_R1 for fmcomms2/zcu102 and adopted it for our board) and ad-fmcomms4-ebz. I also built petalinux with external kernel sources from ADI git repository branch 2018_R1 and libiio.
The screenshot below shows my signal in iio-oscilloscope

But if I start data transmission (cf_axi_dds_datasel function of cf_axi_dds I/O driver is called twice with (0,2) and (1,2) parameters, 0 and 1 are channel numbers and 2=DATA_SEL_DMA) the transmit signal disappears. I see it on a spectrum analyzer connected to the TX1 socket of fmcomms4 module. The signal appears again if streaming application ends up and calls cf_axi_dds_datasel(-1, 0= DATA_SEL_DDS).

I use ad9361-iiostream example application from libiio. I added check of received data and tried it with enabled loopback (echo 1 > /sys/kernel/debug/iio/iio\:device1/loopback). The received data were as expected (transmitted i/q values are shifted 4 bits left and received i/q are not shifted). It means, that DMA transmission functions properly.

My question is: what may be missing or wrong which leads to dropping down the tx signal ?

Best regards,
Timur.

  • Please see here: https://wiki.analog.com/resources/tools-software/linux-drivers/iio-dds/axi-dac-dds-hdl#driver_testing

    In general enabling disabling the buffer transitions between DDS and DMA. 

    By default the DDS tone frequency should be 40MHz. If you don't want that behavior you should set the DDS scales all to 0. The screenshot shows a signal at DC, which I think is a bleeded carrier. 

    Are you seeing the DDS tones in DDS mode? In buffer mode, please be aware that the iostream example is just pushing ZERO to the buffer, so it's expected to not see a signal on TX. 

    -Michael

  • Hi Michael,

     

    thank you for your answer.

    It seems there is still misunderstanding what I'm doing.

     

    Actually I slightly modified ad9361-iiostream and named it ad9361-iiostream-test,

    so that i could easily set up tx/rx lo frequency and send/receive some non-zero data (see attached source file).

    ad9361-iiostream-test.c.txt
    /*
     * libiio - AD9361 IIO streaming example
     *
     * Copyright (C) 2014 IABG mbH
     * Author: Michael Feilen <feilen_at_iabg.de>
     *
     * This library is free software; you can redistribute it and/or
     * modify it under the terms of the GNU Lesser General Public
     * License as published by the Free Software Foundation; either
     * version 2.1 of the License, or (at your option) any later version.
     *
     * This library is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     * Lesser General Public License for more details.
     *
     **/
    
    #include <stdbool.h>
    #include <stdint.h>
    #include <string.h>
    #include <signal.h>
    #include <stdio.h>
    #include <poll.h>
    #include <errno.h>
    
    #ifdef __APPLE__
    #include <iio/iio.h>
    #else
    #include <iio.h>
    #endif
    
    /* helper macros */
    #define MHZ(x) ((long long)((x)*1000000.0 + .5))
    #define GHZ(x) ((long long)((x)*1000000000.0 + .5))
    
    #define ASSERT(expr) { \
    	if (!(expr)) { \
    		(void) fprintf(stderr, "assertion failed (%s:%d)\n", __FILE__, __LINE__); \
    		(void) abort(); \
    	} \
    }
    
    /* RX is input, TX is output */
    enum iodev { RX, TX };
    
    /* common RX and TX streaming params */
    struct stream_cfg {
    	long long bw_hz; // Analog banwidth in Hz
    	long long fs_hz; // Baseband sample rate in Hz
    	long long lo_hz; // Local oscillator frequency in Hz
    	const char* rfport; // Port name
    };
    
    /* static scratch mem for strings */
    static char tmpstr[64];
    
    /* IIO structs required for streaming */
    static struct iio_context *ctx   = NULL;
    static struct iio_channel *rx0_i = NULL;
    static struct iio_channel *rx0_q = NULL;
    static struct iio_channel *tx0_i = NULL;
    static struct iio_channel *tx0_q = NULL;
    static struct iio_buffer  *rxbuf = NULL;
    static struct iio_buffer  *txbuf = NULL;
    
    static bool stop;
    static bool cyclic = false;
    static uint16_t p_i = 0x000b;
    static uint16_t p_q = 0x0005;
    static double lo_ghz = 2.422;
    static double lo_ghz_shift = 0.050;
    
    /* cleanup and exit */
    static void shutdown()
    {
    	printf("* Destroying buffers\n");
    	if (rxbuf) { iio_buffer_destroy(rxbuf); }
    	if (txbuf) { iio_buffer_destroy(txbuf); }
    
    	printf("* Disabling streaming channels\n");
    	if (rx0_i) { iio_channel_disable(rx0_i); }
    	if (rx0_q) { iio_channel_disable(rx0_q); }
    	if (tx0_i) { iio_channel_disable(tx0_i); }
    	if (tx0_q) { iio_channel_disable(tx0_q); }
    
    	printf("* Destroying context\n");
    	if (ctx) { iio_context_destroy(ctx); }
    	exit(0);
    }
    
    static void handle_sig(int sig)
    {
    	printf("Waiting for process to finish...\n");
    	stop = true;
    }
    
    /* check return value of attr_write function */
    static void errchk(int v, const char* what) {
    	 if (v < 0) { fprintf(stderr, "Error %d writing to channel \"%s\"\nvalue may not be supported.\n", v, what); shutdown(); }
    }
    
    /* write attribute: long long int */
    static void wr_ch_lli(struct iio_channel *chn, const char* what, long long val)
    {
    	errchk(iio_channel_attr_write_longlong(chn, what, val), what);
    }
    
    /* write attribute: string */
    static void wr_ch_str(struct iio_channel *chn, const char* what, const char* str)
    {
    	errchk(iio_channel_attr_write(chn, what, str), what);
    }
    
    /* helper function generating channel names */
    static char* get_ch_name(const char* type, int id)
    {
    	snprintf(tmpstr, sizeof(tmpstr), "%s%d", type, id);
    	return tmpstr;
    }
    
    /* returns ad9361 phy device */
    static struct iio_device* get_ad9361_phy(struct iio_context *ctx)
    {
    	struct iio_device *dev =  iio_context_find_device(ctx, "ad9361-phy");
    	ASSERT(dev && "No ad9361-phy found");
    	return dev;
    }
    
    /* finds AD9361 streaming IIO devices */
    static bool get_ad9361_stream_dev(struct iio_context *ctx, enum iodev d, struct iio_device **dev)
    {
    	switch (d) {
    	case TX: *dev = iio_context_find_device(ctx, "cf-ad9361-dds-core-lpc"); return *dev != NULL;
    	case RX: *dev = iio_context_find_device(ctx, "cf-ad9361-lpc");  return *dev != NULL;
    	default: ASSERT(0); return false;
    	}
    }
    
    /* finds AD9361 streaming IIO channels */
    static bool get_ad9361_stream_ch(struct iio_context *ctx, enum iodev d, struct iio_device *dev, int chid, struct iio_channel **chn)
    {
    	*chn = iio_device_find_channel(dev, get_ch_name("voltage", chid), d == TX);
    	if (!*chn)
    		*chn = iio_device_find_channel(dev, get_ch_name("altvoltage", chid), d == TX);
    	return *chn != NULL;
    }
    
    /* finds AD9361 phy IIO configuration channel with id chid */
    static bool get_phy_chan(struct iio_context *ctx, enum iodev d, int chid, struct iio_channel **chn)
    {
    	switch (d) {
    	case RX: *chn = iio_device_find_channel(get_ad9361_phy(ctx), get_ch_name("voltage", chid), false); return *chn != NULL;
    	case TX: *chn = iio_device_find_channel(get_ad9361_phy(ctx), get_ch_name("voltage", chid), true);  return *chn != NULL;
    	default: ASSERT(0); return false;
    	}
    }
    
    /* finds AD9361 local oscillator IIO configuration channels */
    static bool get_lo_chan(struct iio_context *ctx, enum iodev d, struct iio_channel **chn)
    {
    	switch (d) {
    	 // LO chan is always output, i.e. true
    	case RX: *chn = iio_device_find_channel(get_ad9361_phy(ctx), get_ch_name("altvoltage", 0), true); return *chn != NULL;
    	case TX: *chn = iio_device_find_channel(get_ad9361_phy(ctx), get_ch_name("altvoltage", 1), true); return *chn != NULL;
    	default: ASSERT(0); return false;
    	}
    }
    
    /* applies streaming configuration through IIO */
    bool cfg_ad9361_streaming_ch(struct iio_context *ctx, struct stream_cfg *cfg, enum iodev type, int chid)
    {
    	struct iio_channel *chn = NULL;
    
    	// Configure phy and lo channels
    	printf("* Acquiring AD9361 phy channel %d:\n", chid);
    	printf("*    %s port %s freq=%lldHz bw=%lldHz sr=%lldHz\n", (TX == type) ? "TX" : "RX", cfg->rfport, cfg->lo_hz, cfg->bw_hz, cfg->fs_hz);
    	if (!get_phy_chan(ctx, type, chid, &chn)) {	return false; }
    	wr_ch_str(chn, "rf_port_select",     cfg->rfport);
    	wr_ch_lli(chn, "rf_bandwidth",       cfg->bw_hz);
    	wr_ch_lli(chn, "sampling_frequency", cfg->fs_hz);
    
    	// Configure LO channel
    	printf("* Acquiring AD9361 %s lo channel\n", type == TX ? "TX" : "RX");
    	if (!get_lo_chan(ctx, type, &chn)) { return false; }
    	wr_ch_lli(chn, "frequency", cfg->lo_hz);
    	return true;
    }
    
    /* simple configuration and streaming */
    int main (int argc, char **argv)
    {
    	// Streaming devices
    	struct iio_device *tx;
    	struct iio_device *rx;
    
    	// RX and TX sample counters
    	size_t nrx = 0;
    	size_t ntx = 0;
    
    	// Stream configurations
    	struct stream_cfg rxcfg;
    	struct stream_cfg txcfg;
    
    	// Listen to ctrl+c and ASSERT
    	signal(SIGINT, handle_sig);
    
    	// RX stream config
    	rxcfg.bw_hz = MHZ(2.0);   // 2 MHz rf bandwidth
    	rxcfg.fs_hz = MHZ(2.5);   // 2.5 MS/s rx sample rate
    	rxcfg.lo_hz = GHZ(lo_ghz + lo_ghz_shift); // 2.5 GHz rf frequency
    	rxcfg.rfport = "A_BALANCED"; // port A (select for rf freq.)
    
    	// TX stream config
    	txcfg.bw_hz = MHZ(1.5); // 1.5 MHz rf bandwidth
    	txcfg.fs_hz = MHZ(2.5);   // 2.5 MS/s tx sample rate
    	txcfg.lo_hz = GHZ(lo_ghz); // 2.5 GHz rf frequency
    	txcfg.rfport = "A"; // port A (select for rf freq.)
    
    	printf("* Acquiring IIO context\n");
    	ASSERT((ctx = iio_create_default_context()) && "No context");
    	ASSERT(iio_context_get_devices_count(ctx) > 0 && "No devices");
    
    	printf("* Acquiring AD9361 streaming devices\n");
    	ASSERT(get_ad9361_stream_dev(ctx, TX, &tx) && "No tx dev found");
    	ASSERT(get_ad9361_stream_dev(ctx, RX, &rx) && "No rx dev found");
    
    	printf("* Configuring AD9361 for streaming\n");
    	ASSERT(cfg_ad9361_streaming_ch(ctx, &rxcfg, RX, 0) && "RX port 0 not found");
    	ASSERT(cfg_ad9361_streaming_ch(ctx, &txcfg, TX, 0) && "TX port 0 not found");
    
    	printf("* Initializing AD9361 IIO streaming channels\n");
    	ASSERT(get_ad9361_stream_ch(ctx, RX, rx, 0, &rx0_i) && "RX chan i not found");
    	ASSERT(get_ad9361_stream_ch(ctx, RX, rx, 1, &rx0_q) && "RX chan q not found");
    	ASSERT(get_ad9361_stream_ch(ctx, TX, tx, 0, &tx0_i) && "TX chan i not found");
    	ASSERT(get_ad9361_stream_ch(ctx, TX, tx, 1, &tx0_q) && "TX chan q not found");
    
    	printf("* Enabling IIO streaming channels\n");
    	iio_channel_enable(rx0_i);
    	iio_channel_enable(rx0_q);
    	iio_channel_enable(tx0_i);
    	iio_channel_enable(tx0_q);
    
    	printf("* Creating %scyclic IIO buffers with 1 MiS\n", (cyclic) ? "" : "non-");
    	rxbuf = iio_device_create_buffer(rx, 1024*1024, cyclic);
    	if (!rxbuf) {
    		perror("Could not create RX buffer");
    		shutdown();
    	}
    	txbuf = iio_device_create_buffer(tx, 1024*1024, cyclic);
    	if (!txbuf) {
    		perror("Could not create TX buffer");
    		shutdown();
    	}
    
    	printf("* Starting IO streaming (press CTRL+C to cancel)\n");
    	while (!stop)
    	{
    		ssize_t nbytes_rx, nbytes_tx;
    		char *p_dat, *p_end;
    		ptrdiff_t p_inc;
                    uint32_t  ix, jx;
    
    		// WRITE: Get pointers to TX buf and write IQ to TX buf port 0
    		p_inc = iio_buffer_step(txbuf);
    		p_end = iio_buffer_end(txbuf);
    		ix = 0;
    		for (p_dat = (char *)iio_buffer_first(txbuf, tx0_i); p_dat < p_end; p_dat += p_inc, ++ ix) {
    #if 0
    			// Example: fill with zeros
    			// 12-bit sample needs to be MSB alligned so shift by 4
    			// https://wiki.analog.com/resources/eval/user-guides/ad-fmcomms2-ebz/software/basic_iq_datafiles#binary_format
    			((int16_t*)p_dat)[0] = 0 << 4; // Real (I)
    			((int16_t*)p_dat)[1] = 0 << 4; // Imag (Q)
    #else
    			p_i = 0x0001 << (3 & ix);
    			p_q = 0x0008 >> (3 & ix);
    			((int16_t*)p_dat)[0] = p_i << 4; // Real (I)
    			((int16_t*)p_dat)[1] = p_q << 4; // Imag (Q)
    #endif
    		}
    
    		// Schedule TX buffer
    		nbytes_tx = iio_buffer_push(txbuf);
    		if (nbytes_tx < 0) { printf("Error pushing buf %d\n", (int) nbytes_tx); shutdown(); }
    		// Refill RX buffer
    		nbytes_rx = iio_buffer_refill(rxbuf);
    		if (nbytes_rx < 0) { printf("Error refilling buf %d\n",(int) nbytes_rx); shutdown(); }
    
    		// READ: Get pointers to RX buf and read IQ from RX buf port 0
    		p_inc = iio_buffer_step(rxbuf);
    		p_end = iio_buffer_end(rxbuf);
    		ix = jx = 0;
    		for (p_dat = (char *)iio_buffer_first(rxbuf, rx0_i); p_dat < p_end; p_dat += p_inc, ++ ix) {
    			// Example: swap I and Q
    			const int16_t i = ((int16_t*)p_dat)[0]; // Real (I)
    			const int16_t q = ((int16_t*)p_dat)[1]; // Imag (Q)
    #if 0
    			((int16_t*)p_dat)[0] = q;
    			((int16_t*)p_dat)[1] = i;
    #else
    			p_i = 0x0001 << (3 & ix);
    			p_q = 0x0008 >> (3 & ix);
    			if ((false == stop) && ((p_i != i) || (p_q != q)))
    			{
    				printf ("%lu: i=0x%04x (0x%04x) q=0x%04x (0x%04x)\n",
                                            (p_dat - (char *)iio_buffer_first(rxbuf, rx0_i)) / p_inc,
                                            (unsigned) i, p_i, (unsigned) q, p_q);
    				if (6 < (++ jx))
    				{
    					break;
    				}
    			}
    #endif
    		}
    
    		// Sample counter increment and status output
    		nrx += nbytes_rx / iio_device_get_sample_size(rx);
    		ntx += nbytes_tx / iio_device_get_sample_size(tx);
    		printf("\tRX %8.2f MSmp, TX %8.2f MSmp\n", nrx/1e6, ntx/1e6);
    	}
    
    	shutdown();
    
    	return 0;
    } 
    

     

    I send send 1 running forward within bits 4-7 in channel I and in channel Q the same but running backwardly.

    In received data I expect to get 1 running forward in bits 0-3 of channel I and in channel Q - backward respectively.

     

    I connected tx socket of ad-fmcomms4-ebz to a spectrum analyzer, so that I can see the tx signal (see image1).

     

    If I start ad9361-iiostream-test tx signal disappears (see image2) and output1 from the application shows that the application receives some garbage (as expected, because tx socket is connected to the spectrum analyzer).

     

    output1.txt
    root@fmcomms2_aedzu1:~# ad9361-iiostream-test 
    * Acquiring IIO context
    * Acquiring AD9361 streaming devices
    * Configuring AD9361 for streaming
    * Acquiring AD9361 phy channel 0:
    *    RX port A_BALANCED freq=2472000000Hz bw=2000000Hz sr=2500000Hz
    * Acquiring AD9361 RX lo channel
    * Acquiring AD9361 phy channel 0:
    *    TX port A freq=2422000000Hz bw=1500000Hz sr=2500000Hz
    * Acquiring AD9361 TX lo channel
    * Initializing AD9361 IIO streaming channels
    * Enabling IIO streaming channels
    * Creating non-cyclic IIO buffers with 1 MiS
    [ 3962.998671] cf_axi_dds 99024000.cf-ad9361-dds-core-lpc: cf_axi_dds_datasel(0,2)
    [ 3963.007630] cf_axi_dds 99024000.cf-ad9361-dds-core-lpc: cf_axi_dds_datasel(1,2)
    * Starting IO streaming (press CTRL+C to cancel)
    0: i=0xfffffff4 (0x0001) q=0x000c (0x0008)
    1: i=0x0022 (0x0002) q=0xfffffff0 (0x0004)
    2: i=0x002d (0x0004) q=0xffffffd1 (0x0002)
    3: i=0x0016 (0x0008) q=0xffffffde (0x0001)
    4: i=0xffffffe4 (0x0001) q=0x000b (0x0008)
    5: i=0xffffffc3 (0x0002) q=0x0025 (0x0004)
    6: i=0xffffffa9 (0x0004) q=0x000d (0x0002)
    	RX     1.05 MSmp, TX     1.05 MSmp
    0: i=0x01e5 (0x0001) q=0x00b9 (0x0008)
    1: i=0xfffffe1d (0x0002) q=0x008b (0x0004)
    2: i=0x013c (0x0004) q=0xfffffe82 (0x0002)
    3: i=0xffffffdc (0x0008) q=0x0214 (0x0001)
    4: i=0xfffffee1 (0x0001) q=0xfffffe6e (0x0008)
    5: i=0x020e (0x0002) q=0x00bc (0x0004)
    6: i=0xfffffe52 (0x0004) q=0x0091 (0x0002)
    	RX     2.10 MSmp, TX     2.10 MSmp
    0: i=0xffffffdb (0x0001) q=0xffffffec (0x0008)
    1: i=0x0003 (0x0002) q=0x0021 (0x0004)
    2: i=0x000d (0x0004) q=0x0025 (0x0002)
    3: i=0x0010 (0x0008) q=0x0007 (0x0001)
    4: i=0x0012 (0x0001) q=0xfffffffe (0x0008)
    5: i=0x000a (0x0002) q=0xfffffffa (0x0004)
    6: i=0x000e (0x0004) q=0x0012 (0x0002)
    	RX     3.15 MSmp, TX     3.15 MSmp
    0: i=0x0014 (0x0001) q=0x0023 (0x0008)
    1: i=0x0007 (0x0002) q=0x0001 (0x0004)
    2: i=0xffffffe6 (0x0004) q=0x0013 (0x0002)
    3: i=0xfffffffd (0x0008) q=0xfffffff7 (0x0001)
    4: i=0xfffffffc (0x0001) q=0xfffffff1 (0x0008)
    5: i=0xffffffd8 (0x0002) q=0x000a (0x0004)
    6: i=0x0002 (0x0004) q=0xffffffbb (0x0002)
    	RX     4.19 MSmp, TX     4.19 MSmp
    0: i=0x000b (0x0001) q=0xfffffff8 (0x0008)
    1: i=0x000e (0x0002) q=0xfffffffe (0x0004)
    2: i=0xffffffea (0x0004) q=0x0020 (0x0002)
    3: i=0x002e (0x0008) q=0x000f (0x0001)
    4: i=0x0018 (0x0001) q=0x001b (0x0008)
    5: i=0xffffffd8 (0x0002) q=0xfffffff3 (0x0004)
    6: i=0x0002 (0x0004) q=0x0027 (0x0002)
    	RX     5.24 MSmp, TX     5.24 MSmp
    0: i=0xfffffff8 (0x0001) q=0x0010 (0x0008)
    1: i=0xffffffe8 (0x0002) q=0xfffffff5 (0x0004)
    2: i=0xfffffff2 (0x0004) q=0xfffffffc (0x0002)
    3: i=0xfffffff5 (0x0008) q=0x0029 (0x0001)
    4: i=0xffffffef (0x0001) q=0x0007 (0x0008)
    5: i=0x0004 (0x0002) q=0xfffffffc (0x0004)
    6: i=0x0007 (0x0004) q=0x0019 (0x0002)
    	RX     6.29 MSmp, TX     6.29 MSmp
    0: i=0xfffffff8 (0x0001) q=0xfffffffe (0x0008)
    1: i=0xffffffed (0x0002) q=0x002a (0x0004)
    2: i=0x001c (0x0004) q=0x0003 (0x0002)
    3: i=0xfffffff6 (0x0008) q=0x000c (0x0001)
    4: i=0x0011 (0x0001) q=0x000b (0x0008)
    5: i=0x0018 (0x0002) q=0xffffffe6 (0x0004)
    6: i=0xfffffff7 (0x0004) q=0xffffffda (0x0002)
    	RX     7.34 MSmp, TX     7.34 MSmp
    0: i=0xffffffe3 (0x0001) q=0xffffffc8 (0x0008)
    1: i=0x0004 (0x0002) q=0xffffffdb (0x0004)
    2: i=0x0000 (0x0004) q=0xffffffcf (0x0002)
    3: i=0xfffffff1 (0x0008) q=0xffffffd6 (0x0001)
    4: i=0xffffffdb (0x0001) q=0x0003 (0x0008)
    5: i=0xffffffe0 (0x0002) q=0xffffffec (0x0004)
    6: i=0xffffffe8 (0x0004) q=0xffffffe8 (0x0002)
    	RX     8.39 MSmp, TX     8.39 MSmp
    ^CWaiting for process to finish...
    	RX     9.44 MSmp, TX     9.44 MSmp
    * Destroying buffers
    [ 3967.013117] cf_axi_dds 99024000.cf-ad9361-dds-core-lpc: cf_axi_dds_datasel(-1,0)
    * Disabling streaming channels
    * Destroying context
    root@fmcomms2_aedzu1:~#

    If I enable digital loopback within AD9364 (echo 1 > /sys/kernel/debug/iio/iio\:device1/loopback) I see, that the application receives transmitted data (there is some permanent shift in the received data, which changes between power cycles, but it seems dma data transmission/reception works).

     

    I checked some values of iio:device2(cf-ad9361-dds-core-lpc) iio:device3(cf-ad9361-lpc) during running ad9361-iiostream-test without enabling loopback (see output3).

     

    So my question again, what can be the reason for tx signal dropping down ?

    Please let me know if you need any additional indications.

     

    Best regards,

    Timur.

  • Sorry,

    I forgot to insert output2

    output2.txt
    root@fmcomms2_aedzu1:~# ad9361-iiostream-test 
    * Acquiring IIO context
    * Acquiring AD9361 streaming devices
    * Configuring AD9361 for streaming
    * Acquiring AD9361 phy channel 0:
    *    RX port A_BALANCED freq=2472000000Hz bw=2000000Hz sr=2500000Hz
    * Acquiring AD9361 RX lo channel
    * Acquiring AD9361 phy channel 0:
    *    TX port A freq=2422000000Hz bw=1500000Hz sr=2500000Hz
    * Acquiring AD9361 TX lo channel
    * Initializing AD9361 IIO streaming channels
    * Enabling IIO streaming channels
    * Creating non-cyclic IIO buffers with 1 MiS
    [ 4103.989473] cf_axi_dds 99024000.cf-ad9361-dds-core-lpc: cf_axi_dds_datasel(0,2)
    [ 4103.998467] cf_axi_dds 99024000.cf-ad9361-dds-core-lpc: cf_axi_dds_datasel(1,2)
    * Starting IO streaming (press CTRL+C to cancel)
    0: i=0xfffffa0b (0x0001) q=0x0337 (0x0008)
    1: i=0xfffffa0e (0x0002) q=0x0338 (0x0004)
    2: i=0xfffffa11 (0x0004) q=0x0338 (0x0002)
    3: i=0xfffffa14 (0x0008) q=0x0339 (0x0001)
    4: i=0xfffffa17 (0x0001) q=0x033a (0x0008)
    5: i=0xfffffa1a (0x0002) q=0x033b (0x0004)
    6: i=0xfffffa1d (0x0004) q=0x033c (0x0002)
    	RX     1.05 MSmp, TX     1.05 MSmp
    0: i=0x0004 (0x0001) q=0x0002 (0x0008)
    1: i=0x0008 (0x0002) q=0x0001 (0x0004)
    2: i=0x0001 (0x0004) q=0x0008 (0x0002)
    3: i=0x0002 (0x0008) q=0x0004 (0x0001)
    4: i=0x0004 (0x0001) q=0x0002 (0x0008)
    5: i=0x0008 (0x0002) q=0x0001 (0x0004)
    6: i=0x0001 (0x0004) q=0x0008 (0x0002)
    	RX     2.10 MSmp, TX     2.10 MSmp
    0: i=0x0004 (0x0001) q=0x0002 (0x0008)
    1: i=0x0008 (0x0002) q=0x0001 (0x0004)
    2: i=0x0001 (0x0004) q=0x0008 (0x0002)
    3: i=0x0002 (0x0008) q=0x0004 (0x0001)
    4: i=0x0004 (0x0001) q=0x0002 (0x0008)
    5: i=0x0008 (0x0002) q=0x0001 (0x0004)
    6: i=0x0001 (0x0004) q=0x0008 (0x0002)
    	RX     3.15 MSmp, TX     3.15 MSmp
    0: i=0x0004 (0x0001) q=0x0002 (0x0008)
    1: i=0x0008 (0x0002) q=0x0001 (0x0004)
    2: i=0x0001 (0x0004) q=0x0008 (0x0002)
    3: i=0x0002 (0x0008) q=0x0004 (0x0001)
    4: i=0x0004 (0x0001) q=0x0002 (0x0008)
    5: i=0x0008 (0x0002) q=0x0001 (0x0004)
    6: i=0x0001 (0x0004) q=0x0008 (0x0002)
    	RX     4.19 MSmp, TX     4.19 MSmp
    0: i=0x0004 (0x0001) q=0x0002 (0x0008)
    1: i=0x0008 (0x0002) q=0x0001 (0x0004)
    2: i=0x0001 (0x0004) q=0x0008 (0x0002)
    3: i=0x0002 (0x0008) q=0x0004 (0x0001)
    4: i=0x0004 (0x0001) q=0x0002 (0x0008)
    5: i=0x0008 (0x0002) q=0x0001 (0x0004)
    6: i=0x0001 (0x0004) q=0x0008 (0x0002)
    	RX     5.24 MSmp, TX     5.24 MSmp
    0: i=0x0004 (0x0001) q=0x0002 (0x0008)
    1: i=0x0008 (0x0002) q=0x0001 (0x0004)
    2: i=0x0001 (0x0004) q=0x0008 (0x0002)
    3: i=0x0002 (0x0008) q=0x0004 (0x0001)
    4: i=0x0004 (0x0001) q=0x0002 (0x0008)
    5: i=0x0008 (0x0002) q=0x0001 (0x0004)
    6: i=0x0001 (0x0004) q=0x0008 (0x0002)
    	RX     6.29 MSmp, TX     6.29 MSmp
    0: i=0x0004 (0x0001) q=0x0002 (0x0008)
    1: i=0x0008 (0x0002) q=0x0001 (0x0004)
    2: i=0x0001 (0x0004) q=0x0008 (0x0002)
    3: i=0x0002 (0x0008) q=0x0004 (0x0001)
    4: i=0x0004 (0x0001) q=0x0002 (0x0008)
    5: i=0x0008 (0x0002) q=0x0001 (0x0004)
    6: i=0x0001 (0x0004) q=0x0008 (0x0002)
    	RX     7.34 MSmp, TX     7.34 MSmp
    0: i=0x0004 (0x0001) q=0x0002 (0x0008)
    1: i=0x0008 (0x0002) q=0x0001 (0x0004)
    2: i=0x0001 (0x0004) q=0x0008 (0x0002)
    3: i=0x0002 (0x0008) q=0x0004 (0x0001)
    4: i=0x0004 (0x0001) q=0x0002 (0x0008)
    5: i=0x0008 (0x0002) q=0x0001 (0x0004)
    6: i=0x0001 (0x0004) q=0x0008 (0x0002)
    	RX     8.39 MSmp, TX     8.39 MSmp
    0: i=0x0004 (0x0001) q=0x0002 (0x0008)
    1: i=0x0008 (0x0002) q=0x0001 (0x0004)
    2: i=0x0001 (0x0004) q=0x0008 (0x0002)
    3: i=0x0002 (0x0008) q=0x0004 (0x0001)
    4: i=0x0004 (0x0001) q=0x0002 (0x0008)
    5: i=0x0008 (0x0002) q=0x0001 (0x0004)
    6: i=0x0001 (0x0004) q=0x0008 (0x0002)
    	RX     9.44 MSmp, TX     9.44 MSmp
    ^CWaiting for process to finish...
    	RX    10.49 MSmp, TX    10.49 MSmp
    * Destroying buffers
    [ 4108.423808] cf_axi_dds 99024000.cf-ad9361-dds-core-lpc: cf_axi_dds_datasel(-1,0)
    * Disabling streaming channels
    * Destroying context
    root@fmcomms2_aedzu1:~# 
    

    and output3 files

    output3.txt
    root@fmcomms2_aedzu1:~# ls -la /sys/bus/iio/devices/iio\:device2/buffer/ 
    total 0
    drwxr-xr-x 2 root root    0 Jul 30 11:16 .
    drwxr-xr-x 5 root root    0 Jan  1  1970 ..
    -r--r--r-- 1 root root 4096 Jul 30 11:16 data_available
    -rw-r--r-- 1 root root 4096 Jul 30 12:10 enable
    -rw-r--r-- 1 root root 4096 Jul 30 12:10 length
    -r--r--r-- 1 root root 4096 Jul 30 11:16 watermark
    root@fmcomms2_aedzu1:~# cat /sys/bus/iio/devices/iio\:device2/buffer/data_available
    8388608
    root@fmcomms2_aedzu1:~# cat /sys/bus/iio/devices/iio\:device2/buffer/enable        
    1
    root@fmcomms2_aedzu1:~# cat /sys/bus/iio/devices/iio\:device2/buffer/length
    1048576
    root@fmcomms2_aedzu1:~# cat /sys/bus/iio/devices/iio\:device2/buffer/watermark
    2048
    root@fmcomms2_aedzu1:~# ls -la /sys/bus/iio/devices/iio\:device3/buffer/
    total 0
    drwxr-xr-x 2 root root    0 Jul 30 11:16 .
    drwxr-xr-x 5 root root    0 Jan  1  1970 ..
    -r--r--r-- 1 root root 4096 Jul 30 11:16 data_available
    -rw-r--r-- 1 root root 4096 Jul 30 12:10 enable
    -rw-r--r-- 1 root root 4096 Jul 30 12:10 length
    -r--r--r-- 1 root root 4096 Jul 30 11:16 watermark
    root@fmcomms2_aedzu1:~# cat /sys/bus/iio/devices/iio\:device3/buffer/data_available
    0
    root@fmcomms2_aedzu1:~# cat /sys/bus/iio/devices/iio\:device3/buffer/enable        
    1
    root@fmcomms2_aedzu1:~# cat /sys/bus/iio/devices/iio\:device3/buffer/length
    1048576
    root@fmcomms2_aedzu1:~# cat /sys/bus/iio/devices/iio\:device3/buffer/watermark
    2048
    root@fmcomms2_aedzu1:~# cd /sys/bus/iio/devices/iio\:device2
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device2# cat name
    cf-ad9361-dds-core-lpc
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device2# cat out_altvoltage0_TX1_I_F1_frequency
    2499465
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device2# cat out_altvoltage0_TX1_I_F1_phase                                  
    90000
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device2# cat out_altvoltage0_TX1_I_F1_raw
    1
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device2# cat out_altvoltage0_TX1_I_F1_scale
    1.000000
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device2# cat out_altvoltage1_TX1_I_F2_frequency
    2499465
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device2# cat out_altvoltage1_TX1_I_F2_phase
    90000
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device2# cat out_altvoltage1_TX1_I_F2_raw
    1
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device2# cat out_altvoltage1_TX1_I_F2_scale
    0.250000
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device2# cat out_altvoltage2_TX1_Q_F1_frequency
    2499465
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device2# cat out_altvoltage2_TX1_Q_F1_phase
    0
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device2# cat out_altvoltage2_TX1_Q_F1_raw
    1
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device2# cat out_altvoltage2_TX1_Q_F1_scale
    0.250000
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device2# cat out_altvoltage3_TX1_Q_F2_frequency
    2499465
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device2# cat out_altvoltage3_TX1_Q_F2_phase
    0
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device2# cat out_altvoltage3_TX1_Q_F2_raw
    1
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device2# cat out_altvoltage3_TX1_Q_F2_scale
    0.250000
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device2# cat out_voltage_sampling_frequency
    2500000
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device2# cd /sys/bus/iio/devices/iio\:device3
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device3# cat name
    cf-ad9361-lpc
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device3# cat in_voltage0_calibbias
    0
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device3# cat in_voltage0_calibphase
    0.000000
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device3# cat in_voltage0_calibscale
    1.000000
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device3# cat in_voltage1_calibbias
    0
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device3# cat in_voltage1_calibphase
    0.000000
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device3# cat in_voltage1_calibscale
    1.000000
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device3# cat in_voltage_samples_pps
    cat: in_voltage_samples_pps: No such device
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device3# cat in_voltage_sampling_frequency
    2500000
    root@fmcomms2_aedzu1:/sys/bus/iio/devices/iio:device3#