Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poor AudioADC performance whenever AudioDAC or any DAC channels are enabled. #190

Open
y-sh1 opened this issue Dec 14, 2023 · 1 comment

Comments

@y-sh1
Copy link

y-sh1 commented Dec 14, 2023

Hi,
I was looking at the auadc_audac_loopback example, and noticed that the quality of AudioADC decreases dramatically upon initializing the AudioDAC(!)

Apparently, this problem is associated with the setting of GPDAC_CH_A and / or GPDAC_CH_B.

Specifically, the following lines of code in bflb_audac.c are causing the audac to change its behavior(!?) :
if (config->output_mode & AUDAC_OUTPUT_MODE_GPDAC_CH_A) {
/* gpdac enable ch-A */
regval = getreg32(reg_base + GLB_GPDAC_ACTRL_OFFSET);
regval |= (GLB_GPDAC_A_EN | GLB_GPDAC_IOA_EN);
putreg32(regval, reg_base + GLB_GPDAC_ACTRL_OFFSET);
}

    if (config->output_mode & AUDAC_OUTPUT_MODE_GPDAC_CH_B) {
        /* gpdac enable ch-A */
        regval = getreg32(reg_base + GLB_GPDAC_BCTRL_OFFSET);
        regval |= (GLB_GPDAC_B_EN | GLB_GPDAC_IOB_EN);
        putreg32(regval, reg_base + GLB_GPDAC_BCTRL_OFFSET);
    }
}

It seems that by setting GPDAC_CH_A/B the AudioADC precision decreases from 16 its to 12 bits, and the pga gain is not effective.

Same issue appears whenever enabling any of the DAC Channels, for example using:
bflb_dac_channel_enable(dac, DAC_CHANNEL_A);
bflb_dac_channel_enable(dac, DAC_CHANNEL_B);

Any ideas?

@y-sh1
Copy link
Author

y-sh1 commented Dec 14, 2023

I forgot to mention that I am using BL616

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant