I am trying to execute some tests using the speaker sample code and the Audio Personality Card. After following the instructions in Motorola Developer site, the Speaker is working as expected.
However, I was trying to do some changes in the firmware and check the behaviour. To guarantee that my changes were built and MuC is calling them, I added several logs in the stm32_audio_tfa9890.c and in tfa9890.c files.
1) I had noticed that tfa9890_aud_dev_set_sys_volume is called when an audio is being played and I change the Android Audio Volume. As the Mod volume is changed according to Android volume, I understood that this is the function that configures its volume. To confirm that, I had executed the following changes:
a) Firstly, I had hardcoded the sys_volume to -1200 (one of the values returned by Android);
b) Secondly, I had removed the whole code in the function;
Tested... For my surprise, after each of the changes, the Mod Speaker continues playing the audio according to the Android Audio Volume. How?
2) I don't want to have all the use cases being played by the Mod. I would like to play only music by it. By checking the code I found the tfa9890_aud_dev_get_supported_use_cases function in the stm32_audio_tfa9890.c. I thought that this function is called by the Moto Z in order to allow Moto Z to route the audio correcty. I had changed the TFA9890_SUPPORTED_PLAYBACK_USE_CASES to set just the DEV_AUDIO_PLAYBACK_MUSIC_USE_CASE.
Tested... No lucky! The ringtones continue being played by the Moto Mod Speaker
I am not familiar with the I2S. Am I missing something? How the Mod is aware about the volume set in the Moto Z? Why the ringtones continue being played by the Moto Mod even if the Ringtone cases was removed from the supported use cases?
Thanks