AnsweredAssumed Answered

Alsa ctrl cache behavior in sigmadsp.c

Question asked by DannySmith on Feb 3, 2018
Latest reply on Feb 6, 2018 by DannySmith



We are using an adau1761 and a sigma-dsp design which exposes several metrics through Readbacks. We came across a strange behavior when reading these readbacks using the exposed alsa controls. It seems they only return a cached value, we get the correct value the first time we read it but thereafter we get the exact same value every time. Have traced it to these particular lines (in bold) in sigmadsp.c:


static int sigmadsp_ctrl_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
    struct sigmadsp_control *ctrl = (void *)kcontrol->private_value;
    struct sigmadsp *sigmadsp = snd_kcontrol_chip(kcontrol);
    int ret = 0;




    if (!ctrl->cached) {
        ret = sigmadsp_read(sigmadsp, ctrl->addr, ctrl->cache,


    if (ret == 0) {
        ctrl->cached = true;
        memcpy(ucontrol->, ctrl->cache,




    return ret;


If we disable the cache functionality here we can read the Readbacks correctly. Are there any implications for disabling the "read cache functionality" besides an increase in i2c traffic?