I m working on iMX6 custom board running Freescale (BSP with Android JB version) in which HDMI audio is not working sometimes. Audio data is originated from a phone app (which supports HDMI and ear jack out). When I use the Phone app HDMI audio works fine for most of the time but audio is not coming for 1 out of 10 calls.
I have never seen any failure logs from the ALSA part right from opening of pcm card and writing data and also there is no error logs from the driver side.
When HDMI is connected the audio doesn't comes 1 out of 10 times and when I switch to ear phone out and then to HDMI (in Android UI) audio is coming in HDMI.
I have added delay in pcm_write part of the tinyalsa code to reproduce this issue. Still issue is reproduced 1 out of 25 times.
Further enabled dumpregs part in [sound/soc/imx/imx-hdmi-dma.c] to see the DMA status register, after enabling this the issue is not reproduced at all. Just enabled the macros to print dumpregs which is not reproducing this issue.
Here I m not able to concluded on the root cause of the issue. If I remove the dumpregs (prints) from kernel log the issue is reproduced again. It seems there is issue with respect to delays but why its produced and what is the proper fix for this will really be helpful.