I have an application (based on gstreamer) running on Zedboard, which receives and plays a multicast audio stream from network. I need to validate and deliver the same for a custom board that we are making which has Zynq 7000, ADAU1761 and AXI I2S in PL as in Zedboard. Our hardware team has placed a power amplifier between the codec and headphone so that the board is able to drive a few military headsets. When my application is running and is not receiving packets I can hear lot of noise in the headphone which as per the hardware team is due to the inherent noise of the new power amplifier. By turning off the headphone out signal of the codec this noise can be reduced to some extend and by dynamically turning on/off the external amplifier, the noise can be eliminated fully.
My requirement is :
1. Ability to either turn on/off the external amplifier via gpio based on whether audio data is left to be played or not.
I don't have control to do this in my application since it is based on APIs, the source code of which is not part of our deliverable.
Is there a way to do this at ALSA level?
If yes where should I add this support? ALSA kernel lib or codec/i2s/machine drivers? Is there any reference code available?
Is there a way to do this using ALSA DAPM widgets and events?
2. If this is not possible, is there any option in adau1761 by which the headphone out is automatically turned on/off based on input signal amplitude.
Thanks for reading. Appreciate any help.