AnsweredAssumed Answered

ADAU1452 Safeload Poping

Question asked by emcnicholas on Jun 19, 2018
Latest reply on Jun 20, 2018 by mmmike

Hello I using a rather large ADAU program integrated into a board with a core processor running linux.   At run time we load the device and expose the DSP parameters via a web interface.  We origionaly just loaded the parameters to their coefficient address given in the code export but this was causing a pop when updating parameters with audio playing.  I have since updated to load the parameters via safeload.  In the driver i write to the safeload address given by the code export, MOD_SAFELOADMODULE_DATA_SAFELOAD0_ADDR, then write to the address location, MOD_SAFELOADMODULE_ADDRESS_SAFELOAD_ADDR, and finally i write to the MOD_SAFELOADMODULE_NUM_SAFELOAD_ADDR.  We are doing this 1 parameter at a time as it is just simpler using an IOCTRL interface in the linux driver.  After the write I added a 40uS delay to make sure a new write does not come in on top of the current write which should be more then enough time for the 48kHz rate.  The coefficients seem to be updating since i can change volume and hear noticeable changes in the EQ but i am getting a pop still on parameter updates.  I also tried the default load address from the data sheet with the same results.  Also this is over a SPI interface and each write is separate with the chip select for data, address and number being separate writes.  Any help would be appreciated.  Below is the write source code.


int dsp_safeloadwriteparam(u8 devaddr, u16 addr, u32  data )
    uint32_t addr32 = 0;
    int ret = -1;
    /* Set Address */
    addr32 = addr;
    //printk("Safeload Param\n");
    /* Write Data to safeload address */
    dsp_writeparam(devaddr, MOD_SAFELOADMODULE_DATA_SAFELOAD0_ADDR, data);
    /* Write address for data to be written to */
    dsp_writeparam(devaddr, MOD_SAFELOADMODULE_ADDRESS_SAFELOAD_ADDR, addr32);
    /* Write number of params to be written */
    ret = dsp_writeparam(devaddr, MOD_SAFELOADMODULE_NUM_SAFELOAD_ADDR, 1);
    /* Delay one sample period */
    return ret;


int dsp_writeparam(u8 devaddr, u16 addr, u32  data )
    int ret = -1;
    if(spi_dsp_device != NULL)


        /* Read Header */
        char txdata[7];
        txdata[0] = (devaddr << 1) | SPI_WRITE;
        txdata[1] = (addr >> 8);
        txdata[2] = (addr & 0xFF);
        txdata[3] = (data >> 24);
        txdata[4] = (data >> 16);
        txdata[5] = (data >> 8);
        txdata[6] = (data & 0xFF);


        ret = spi_write( spi_dsp_device, &txdata, sizeof(txdata));
        //printk("Write Param %d \t Value %x \n", addr, data);
    return ret;