ADAU1761 Volume Control
Hello,
I have a question as how to best implement a realtime up/down volume control function with the ADAU1761. We are developing a battery-powered communications product using the ADAU1761 as the main audio DSP, and we have a microcontroller with on-board flash which will boot the ADAU1761. We have push-buttons going to the GPIO of the MCU, and the MCU connects to the DSP via the I2C bus and 4 available GPIO's. Considering that we need to store the last volume setting in flash before power-down, which scenario makes more sense?
1.) ADAU1761 Output Mixers - The button signals would be processed by the MCU, with an up/down volume function and lookup table. When a volume change was detected, the MCU would write to the appropriate DSP output mixer register, such as R31: Playback Line Output Left Volume Control, 16,421 (0x4025). It would also store the last volume setting in flash, so it could be recalled after power-down.
2.) ADAU1761 DSP Volume Block - The button signals would go to the DSP GPIO (either directly or passed on by the MCU), and an Up/Down Control w/ Lookup and Clickless SW Slew volume control would be put in the SigmaStudio schematic.
I read that audio clicks/pops can occur if the control registers are written to in real time, so would the first scenario cause audio artifacts? In the second scenario, the audio performance would be very good, but I do not know how store the DSP volume setting back in the MCU. Is there an addressable register for volume control done within the DSP? In the SigmaStudio help, there is mention of the 'interface registers' and the Interface Read/Write block, but I can't seem to find many design examples.
Thank you,
- Jeremy
Audio Signal Processors
flash
volume
SigmaDSP Audio Processors
adau1761
There is no problem with pops or clicks when updating the volume control registers at run-time. The pop and click warning is applicable to configuration registers that you would typically set up at boot time.
Your second solution isn't the most efficient control. Since you have a microcontroller to write to the ADAU1761, the easiest way to control the volume is to use a standard software volume control, not one that is controlled from a lookup table and external GPIO pins. Your microcontroller can write the volume setting (single 28-bit word) directly to the parameter RAM. In terms of the implementation, the only difference between this and solution #1 is that you're writing to the SigmaDSP parameter RAM instead of the control registers. This will also be a more efficient use of the SigmaDSP code, since a volume control is a simple block and you won't have to waste any DSP cycles reading the GPIO inputs or saving a full lookup table in the parameter RAM.
The primary difference between these two solutions will be the audio performance. The line output volume controls are implemented in analog, while the DSP volume controls are obviously digital. When you decrease the gain in the SigmaDSP, then you are also reducing the noise performance (SNR) by the same amount. This signal is sent to the DAC and if your volume has been turned down then you will be sending a much lower-level digital signal and your SNR will be reduced accordingly. The SNR of the analog volume controls is much greater than that of the DACs, so you have some headroom (I believe it's about 12 dB) to turn down the analog volume controls before you reach their noise floor. This means that you can reduce the volume in the analog domain with better performance than doing it in the DSP core.
Hello Jerad,
Thanks for the reply.
To clarify, did you mean to say that the microcontroller should write directly to the control register for ADAU1761 output mixer volume, not parameter ram, since the mixer volume happens outside the DSP core? The output mixer volume adjustment would be preferrable to a DSP volume adjustment, because of the audio performance advantage you mention.
Regards,
- Jeremy
If you are using the output mixers for your volume control, then yes, you will write to the control registers to set this volume level.
Hello Jerad,
I have an additional question related to using the ADAU1761 analog output mixers as a run-time volume control. When using ROUTVOL (R32), for instance, the control has discrete 1dB steps, according to its function in SigmaStudio and Table 95 of the datasheet, but it does not measure this way. When measuring gain from analog input to analog output of the ADAU1761 at different settings of ROUTVOL, the increments vary roughly between 0.7dB and 1.4dB. Is this behavior normal, and if so, what is the expected tolerance of this analog gain control?
Thank you,
- Jeremy
Hi Jeremy,
Sorry for the long response time. I finally got a chance to look at this today.
I tried a test where I looped the Headphone output back to the line inputs. I changed the headphone gain register in steps of 1 dB and recorded the peak envelope level of the input. That gave me a nice table showing the ideal gain and the actual measured level. I calculated the dB level of each peak readback and created a table that shows the difference between measured and ideal. Here are my results:
Hi Brett,
Thanks for looking into this. What you captured in your chart is typical of what I would see in my measurements on the bench. For our application, which is a user-adjustable volume control, I don't think it is critical. Plus, we want to maximize signal-to-noise on the output, which would suffer at low volume settings if a DSP gain cell was used. If we were depending on the PGA mixers for an accurate gain setting in the overall system, we might have an issue. But it's good to know that what I was seeing was not an anomoly. Perhaps this performance characteristic of the PGA mixers could be quantified and/or captured in the datasheet in the future?
Thanks again,
-Jeremy
Jeremy,
I'm glad to hear it's not a big issue. I agree with you that it would make sense to characterize this value in the datasheet. I will make that suggestion for future product releases.
Please log in to reply.