[i.MX6] HDMI audio not working sometimes Android JB

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[i.MX6] HDMI audio not working sometimes Android JB

1,377 Views
mohamedfasil
Contributor II

Hi,

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.

Regards

Fasil

Labels (4)
Tags (3)
0 Kudos
4 Replies

972 Views
mohamedfasil
Contributor II

+

igorpadykov

Hi All,

I still have this issue in place. Adding delay is giving side-effect by distorting the original sound at times. Hence adding delay is ruled out. Tested with multiple HDMI cables as well as this issue is reproduced.

This is a sometime reproducible issue. I find few other interesting stuffs which proves that driver side(PCM) data is received by the HDMI audio is not coming.

There is no resolution or video problem in my case. Just by closing the HDMI sound card (from application UI) and opening it again the issue is solved.

Findings:

I played simple wav file from adb shell using tinyplay.

#tinyplay LowBattery.wav -D 0 -d 0 -p 192 -n 8

and observed the hdmi pcm card status using proc entry

root@android:/ # cat /proc/asound/imxhdmisoc/pcm0p/sub0/status

state: RUNNING

owner_pid   : 7288

trigger_time: 1438259679.447798509

tstamp      : 1438259682.389487843

delay       : 6144

avail       : 0

avail_max   : 768

-----

hw_ptr      : 129792

appl_ptr    : 135936

in which hw_ptr and appl_ptr are updated according to the available data.

Likewise I checked the same proc entry in HDMI audio played from phone app. the same pointers are updated but no sound is played via HDMI.

These proc entries are soured from struct snd_pcm_runtime runtime which is used in HDMI DMA as well.

I m clueless in finding the solution for this. Will appreciate the feedback from FSL community.

Thanks & Regards

Fasil

0 Kudos

972 Views
igorpadykov
NXP Employee
NXP Employee

Hi Mohamed

adding delays may point to suggestion

that this is caused by noise, as delays slow down application,

so one can try other hdmi cable.

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

972 Views
mohamedfasil
Contributor II

Hi Igor,

Thanks for the reply, I will check by adding small delay as option 1.

Different HDMI cable as option 2.

Regards

Fasil

0 Kudos

972 Views
angelo_d
Senior Contributor I

Hi Mohamed,

likely have nothing to do, but i had issues with hdmi audio, everything was set appropriately but no audio was played. At the end, it was an issue with fb resolution not set appropriately for the auto-sync / probe of the monitor. With correct resolution, audio started to be played.

0 Kudos