Hi,
I would like to mute the audio port (for some time) on the SC589-MINI during running my app. How should I do that?
Regards,
Reinier
Hi,
I would like to mute the audio port (for some time) on the SC589-MINI during running my app. How should I do that?
Regards,
Reinier
Nishanthi - Moved from Audio to SHARC Audio Module . Post date updated from Monday, May 27, 2024 2:50 PM UTC to Tuesday, May 28, 2024 6:37 AM UTC to reflect the move.
Hi Reinier, there are many ways to mute/unmute the audio in baremetal framework. one of them is by the push buttons. You may add a gain that controls the audio volume. The gain value is then managed by the push buttons.
Hi LLiu,
Thank you for your answer. I realise I should be more specific.
My app is a convolution application running on the SC589-MINI board, which adds reverb to the signal from an electronic organ. During playing one can switch from reverb 'room' (e.g. smaller to larger, thus longer reverb) by giving a code to the running app. To avoid spurious signals the app should switch off the outgoing signal.
Searching the documentation I came across the mute command "ADI_ADAU1962A_REG_DAC_MUTE1" and "_MUTE2" in the ADSP-SC5xx EZ-Kit BSP SSDD API Reference Manual, but this handles the ADAU 1962A DAC, while the SC589-MINI board uses an ADAU1761 Audio Codec. Is such a command available for the MINI board and how should it be used in the C language? I am using CCES 2.11.1.
Thank you for your help.
Regards,
Reinier
bm_adau_device.c has two APIs for accessing ADAU1761 registers. They are adau_write_ctrl_reg and adau_read_ctrl_reg. You may refer to the 1761 manual for what you want. (ADAU1761 (Rev. E) (analog.com))
Thanks for this info. According to the 1761 manual I have to use Control Registers R31 and R32, but I could not find the correct syntaxis for adau_write_ctrl_reg and adau_read_ctrl_reg. I have tried to use function prototype
void adau_write_ctrl_reg(BM_ADAU_DEVICE *adau_device, uint16_t address, uint8_t value);
but got the error 'identifier BM_ADAU_DEVICE undefined.
Then #include "bm_adau_device.h", which yields the error cannot open source file "bm_adau_device.h"
How should I proceed?
You can search SAM baremetal framework CCES project to find out how it calls those APIs.
One example can be found in audio_frameworks\audio_framework_8ch_sam_and_audioproj_fin_arm.c at lines 368 - 380.
// Set the AUX channel gain depending on whether a Audio Project Fin is present, and which version of the board
uint8_t currentRegVal;
// Left channel AUX gain
adau_read_ctrl_reg(&adau1761_local, ADAU1761_REG_REC_MIXER_LEFT_1, ¤tRegVal);
currentRegVal &= 0xF8;
currentRegVal |= auxGain;
adau_write_ctrl_reg(&adau1761_local, ADAU1761_REG_REC_MIXER_LEFT_1, currentRegVal);
// Right channel AUX gain
adau_read_ctrl_reg(&adau1761_local, ADAU1761_REG_REC_MIXER_RIGHT_1, ¤tRegVal);
currentRegVal &= 0xF8;
currentRegVal |= auxGain;
adau_write_ctrl_reg(&adau1761_local, ADAU1761_REG_REC_MIXER_RIGHT_1, currentRegVal);
log_event(EVENT_INFO, " ADAU1761 updated gain settings for the Audio Project Fin being used");
log_event(EVENT_INFO, " Complete");
Both commands adau_read.. and adau_write.. are only available for the core0 (ARM) processor. The app is running on core1, and that app should give the mute command. How could adau_read.. and adau_write.. be used within or from core1?
It is recommended to consider my initial suggestion that mute/unmute audio in software, compared to accessing 1761 in core 1. accessing 1761 in core 1 means to add the driver into core 1 and find a way to let ARM and SHARC cores manage the same peripheral simultaneously. In addition, you have to figure out where to host the code for accessing 1761 in the core 1. This change has been beyond SAM baremetal framework scope.
Your initial suggestion is to use the push buttons. That is not an option to the user, as the MINI board is hidden. The only option is to do it by code.
The ARM driver 'audio_framework_8ch_sam_and_audioproj_fin_arm.c' cannot be added into core 1, that results in a lot of error messages.
Maybe some code is available to directly set bits LOUTM and ROUTM in Control Registers R31 and R32 on their addresses 0x4025 and 0x4026 ?
Push buttons is only an example to control the gain. You can definitely do it by other means. The goal here is to multiply all channels by the gain to mute/unmute audio. Iooks like you have identified when to manipulate the 1761 registers. Why not manage the gain value instead? This happens in software and is easier to implement. Adding the driver into Core 1 results in a lot of software changes and refactoring the FW architecture. Compared to the gain approach, the workload is much higher.
It is clear that the adau_read_ctrl_reg() and adau_write_ctrl_reg() commands cannot be used. So I would like to manage the gain value. Please tell me how to do that. Nothing to find in the documentation.