We have developed a custom board using the imx6q CPU together with the CS4299 AC97 audio codec.
We are facing an issue after a variable time of audio reproduction that is always within 24 hours.
At the power on, we start a cyclic play of a wav file sampled at 48Khz which contains a 1KHz pure tone. The length of the file is 1 second and we play it every 5 seconds.
The playback is correct the first hours, but if we check the tone later we get a distorted sound. Sometimes the frequency become 2KHz, sometimes 4KHz. The distortion is variable. We also tried to trap the event with an hardware trigger to capture the AC97 communication and we see that when the sound is correct the slots 3 and 4 are valid and the samples compose a 1KHz sine tone, while when the sound is wrong the slots 3, 4, 7 and 8 are valid and the samples compose a different sine tone despite the input file is always the same.
We have experienced this behaviour with both yocto krogoth (kernel linux-fslc-imx-4.1) and yocto sumo (linux-imx-4.9) together with pulseaudio and alsa-lib.
To play the sound we used QSound::play, paplay and aplay with the same result.
What is the cause of this behaviour? How can I debug and fix it?