In the example usb_examples/usb_device_audio_speaker example (from TWR-K22F120M SDK version 2.4.1) how are the volume changes from the host over USB sent to the codec over I2C?
There is a USB audio codec task that prints "Set Cur Volume :" in the debug console when I adjust the volume but I don't see how/where the changes are applied to the codec. Setting a breakpoint in SGTL_SetVolume() is never hit. Shouldn't there be another I2C audio codec task?
Any hints would be appreciated.
Solved! Go to Solution.
Hi Lucas,
Actually the USB_Device_Audio_speaker demo it's not using SGTL_SetVolume() function.
As you can see in the sgtl5000_interface.c file, the demo only has a function to initialize the codec.
If you want to change the volume or mute the audio you will have to create your own functions, for example:
Then you call the function in USB_AudioCodecTask() in the appropriate line.
If you do that you will see now how the debug console hits the breakpoint when you make changes in the volume of your PC.
I hope this helps.
Best regards,
Felipe.
Hi Lucas,
Actually the USB_Device_Audio_speaker demo it's not using SGTL_SetVolume() function.
As you can see in the sgtl5000_interface.c file, the demo only has a function to initialize the codec.
If you want to change the volume or mute the audio you will have to create your own functions, for example:
Then you call the function in USB_AudioCodecTask() in the appropriate line.
If you do that you will see now how the debug console hits the breakpoint when you make changes in the volume of your PC.
I hope this helps.
Best regards,
Felipe.