This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Decode with HDMI audio output is bad after changing output mode to 480p

Other Parts Discussed in Thread: DM385

We have observed a problem with both DM816x EVM and DM814x EVM, with EZSDK 5_04_00_11.  After changing the kernel configuration to enable HDMI audio output, we are able to hear audio on the HDMI output when running at 1080p-60 (the SDK's default output setting).  But if we change the output to 480p-60, any attempt to decode the same video results in no HDMI audio output, and video decodes very slowly.  However, decode with analog audio output works okay.  We are wondering if it is a problem with the HDMI auto mode configuration, described in http://processors.wiki.ti.com/index.php/TI81XX_HDMI_User_Guide#HDMI_Auto_Mode_Configuration.

Steps to reproduce with the SDK:

1. Change the start-up to load firmware using load-hd-v4l2-firmware.sh.

2. Reboot

3. Type:

# Prep
/etc/init.d/matrix-gui-e stop
echo 0 > /sys/devices/platform/vpss/graphics0/enabled

# Demonstrate correctly functioning HDMI audio @ default 1080p-60 output
gst-launch -v filesrc location=/media/sda1/big_buck_bunny_1080p_h264.mov ! \
qtdemux name=demux demux.audio_00 ! queue ! faad ! alsasink device="plughw:0,1" \
demux.video_00 ! queue ! h264parse access-unit=true ! omx_h264dec ! omx_scaler \
! 'video/x-raw-yuv,width=(int)1920,height=(int)1080' ! v4l2sink

# Change to 480p output
echo 0 > /sys/devices/platform/vpss/display0/enabled
echo "480p-60" > /sys/devices/platform/vpss/display0/mode
fbset -xres 720 -yres 480 -vxres 720 -vyres 1440
echo 1 > /sys/devices/platform/vpss/display0/enabled

# Demonstrate bad decode when attempting HDMI audio
gst-launch -v filesrc location=/media/sda1/big_buck_bunny_1080p_h264.mov ! \
qtdemux name=demux demux.audio_00 ! queue ! faad ! alsasink device="plughw:0,1" \
demux.video_00 ! queue ! h264parse access-unit=true ! omx_h264dec ! omx_scaler \
! 'video/x-raw-yuv,width=(int)720,height=(int)480' ! v4l2sink

# Demonstrate good decode when *not* attempting HDMI audio
gst-launch -v filesrc location=/media/sda1/big_buck_bunny_1080p_h264.mov ! \
qtdemux name=demux demux.audio_00 ! queue ! faad ! alsasink device="plughw:0,0" \
demux.video_00 ! queue ! h264parse access-unit=true ! omx_h264dec ! omx_scaler \
! 'video/x-raw-yuv,width=(int)720,height=(int)480' ! v4l2sink

Are we missing something here?

  • Daniel,

    The HDMI audio is transmitted using  the TMDS clock values which will vary based on the video resolutions selected. Currently we are only supporting HDMI audio with the following video resolutions 1080P@60,1080I@60,720P@60 and 1080P@30. This is mentioned in the HDMI user guide.

    We have taken the necessary actions to add support for the rest of  video resolutions and will post a patch here as soon as we completed it.

    Regards,

    Deepu Raj

  • Daniel,

    We have added the HDMI audio support  for all standard video resolutions and the patches are pushed to the arago tree.

    Please find the bellow link for the latest code base which contains the patches

    http://arago-project.org/git/projects/?p=linux-omap3.git;a=shortlog;h=refs/heads/TI81XXPSP_04.04.00.01

    Regards,

    Deepu Raj


  • Deepu,

    I got the TI81XXPSP_04.04.00.01 code, applied the kernel patches the come with the EZSDK 5.04, rebuilt the whole EZSDK, and make-install with EXEC_DIR pointing to the targetfs.  Unfortunately, even without changing away from the default 1080p60 output resolution, I find that I only get a few seconds of playback before operation stops.  No command line, not even ping works.

    FYI, after boot the EZSDK, I did:

    /etc/init.d/matrix-gui-e stop
    echo 0 > /sys/devices/platform/vpss/graphics0/enabled
    gst-launch -v filesrc location=/media/sda1/big_buck_bunny_480p_h264.mov ! qtdemux name=demux demux.audio_00 ! queue ! faad ! alsasink device="plughw:0,1" demux.video_00 ! queue ! h264parse ! omx_h264dec ! omx_scaler ! gstperf ! v4l2sink

  • Daniel,

    Can you please provide more information about the issue and the logs for the same.  I have only  verified the HDMI using the patches on top of the PSP Release 04.04.00.01 code.  

    Regards,

    Deepu Raj

  • Deepu,

    To make things as close to TI-normal as possible, I undid the video4linux change described above, and used omx_videosink instead. I'll try to describe in as much detail as I can:

    1. I reset my whole targetfs, by deleting it, and untarring from EZSDK 5.04:

    $ sudo rm -rf ~/targetfs
    $ sudo mkdir ~/targetfs
    $ sudo tar -C ~/targetfs/ -xzf ~/ti-ezsdk_dm814x-evm_5_04_00_11/filesystem/ezsdk-dm814x-evm-rootfs.tar.gz

    2. I git-cloned TI81XXPSP_04.04.00.01, from TODAY:

    $ cd board-support
    $ git clone git://arago-project.org/git/projects/linux-omap3.git
    remote: Counting objects: 2207962, done.
    remote: Compressing objects: 100% (410827/410827), done.
    remote: Total 2207962 (delta 1827433), reused 2155979 (delta 1776005)
    Receiving objects: 100% (2207962/2207962), 502.11 MiB | 2.61 MiB/s, done.
    Resolving deltas: 100% (1827433/1827433), done.
    Checking out files: 100% (35515/35515), done.
    $ cd linux-omap3
    $ git checkout TI81XXPSP_04.04.00.01
    Branch TI81XXPSP_04.04.00.01 set up to track remote branch TI81XXPSP_04.04.00.01 from origin.
    Switched to a new branch 'TI81XXPSP_04.04.00.01'

    3. I applied the patches that came with EZSDK 5.04, since they apparently aren't part of the git repo:

    $ ls board-support/linux-2.6.37-psp04.04.00.01/patches/ -1
    0001-ti814x-added-code-for-disabling-the-least-significan.patch
    0002-mmc-skip-detection-of-nonremovable-cards-on-rescan.patch
    0003-mmc-sdio-don-t-reinitialize-nonremovable-powered-res.patch
    0004-mmc-sdio-don-t-power-up-cards-on-system-suspend.patch
    0005-mmc-fix-division-by-zero-in-MMC-core.patch
    0006-wl12xx-Backport-wl12xx-platform-data.patch
    0007-wl12xx-Fix-out-of-tree-build-issues.patch
    0008-ARM-ti81xx-Fix-ti8148-s-mmc-indices.patch
    0009-omap_hsmmc-Work-around-lack-of-mmc0-card-detection-p.patch
    0010-arm-ti8148evm-Add-wl12xx-wlan-support.patch
    0011-PATCH-ti8148evm-fix-of-mmc-array.patch

    There were a couple of rejections at the end that were easy to fix. I used "git diff" to print out the final differences. Please see attached file: git-diff-output.txt.

    4. I changed my Rules.make to point to the cloned repo from git:

    LINUXKERNEL_INSTALL_DIR=$(DVSDK_INSTALL_DIR)/board-support/linux-omap3

    5. I updated the ti8148_evm_defconfig for audio, tiler, some fs support, inotify, etc. Please see attached file: ti8148_evm_defconfig.

    6. I remade the EZSDK:

    $ make clean
    $ make

    7. I installed the EZSDK on top of targetfs:

    $ sudo make install EXEC_DIR=~/targetfs/

    8. I removed the module.dep, so that first start-up will recreate a module.dep based on the new kernel:

    $ sudo rm ~/targetfs/lib/modules/2.6.37/modules.dep

    9. I copied the new uImage to my tftpboot:

    $ cp ~/targetfs/boot/uImage /tftpboot/uImage-dm814x-evm.bin

    10. I booted. Please see attached file:  ti_hdmi_crash_dm814x.txt

    11. Notice in the log:

    root@dm814x-evm:~# /etc/init.d/matrix-gui-e stop
    root@dm814x-evm:~# echo 0 > /sys/devices/platform/vpss/graphics0/enabled
    root@dm814x-evm:~# gst-launch -v filesrc location=/media/sda1/big_buck_bunny_1080p_h264.mov ! \
    qtdemux name=demux demux.audio_00 ! queue ! faad ! alsasink device="plughw:0,1" \
    demux.video_00 ! queue ! h264parse access-unit=true ! omx_h264dec ! omx_scaler \
    ! omx_ctrl ! gstperf ! omx_videosink

    As soon as video starts, the target fails to respond to ping. After maybe 50 seconds of playback, everything freezes, mid gperf-print-out, without any errors or warnings. A Ctrl-C starts the gst-launch shutdown, but I never get back to a prompt. Waiting a while, I start to see:

    nfs: server XXXXXXXXXXXX not responding, still trying


    Repent, reboot, retry.

    Dan -

    e2e_files.tar.gz
  • Daniel,

    I have gone through the logs you shared and not able to find any driver or kernel related crashes . I suspect the problem is due to EZSDK changes or from the GST layer.

    I will forward this query to the concerned person in the EZSDK team so that they can provide more input on the same.

    Regards,

    Deepu Raj

  • Deepu,

    This problem now seems to be in the new EZSDK 5_05_01_04.  Is the EZSDK not really supporting HDMI audio output?

    Dan -

  • Deepu,

    I think that the cause of the crash is in ti-ezsdk_dm814x-evm_5_05_01_04/board-support/linux-2.6.37-psp04.04.00.01/sound/soc/davinci/davinci-hdmi.c.  In EZSDK 5.04. there were four places where HW ACR packet generation was selected with a test like this:

    /*
    * free MCLK for HW ACR packet generation
    */
    if (cpu_is_ti816x() && TI8168_REV_ES2_0 == omap_rev()) {
        clk_disable(dev->clk);
        clk_put(dev->clk);
        dev->clk = NULL;
    }

    In EZSDK 5.05, those tests were changed to:

    /*
    * free MCLK for HW ACR packet generation
    */
    if (CTS_MODE_HW == hdmi_acr_mode()) {
        clk_disable(dev->clk);
        clk_put(dev->clk);
        dev->clk = NULL;
    }

    And the following function was added:

    static int hdmi_acr_mode(void)
    {
    #ifdef HDMI_FORCE_SW_ACR
        return CTS_MODE_SW;
    #else
        if (cpu_is_ti816x() && TI8168_REV_ES2_0 > omap_rev())
            return CTS_MODE_SW;
        else
            return CTS_MODE_HW;
    #endif
    }

    For DM814x, this function is returning CTS_MODE_HW, because cpu_is_ti816x() returns 0.  But to behave like the 5.04 code, this function needs to return CTS_MODE_SW when using a DM814x.  So I think this function needs to be changed to something like:

    static int hdmi_acr_mode(void)
    {
    #ifdef HDMI_FORCE_SW_ACR
        return CTS_MODE_SW;
    #else
        if (cpu_is_ti816x() && TI8168_REV_ES2_0 <= omap_rev())
            return CTS_MODE_HW;
        else
            return CTS_MODE_SW;
    #endif
    }

    Please advise.

    Dan -

  • Daniel,

    Thanks for the update.

    The TI81XX HDMI audio support both Auto CTS mode( hardware) and Manual CTS mode(Software) where the software CTS mode is only used for debugging purpose. We have to use the Hardware CTS mode to get the HDMI audio working reliable . The software CTS ,mode may cause a drift in the clock due to the temperature variations which affects audio playback. The Hardware CTS mode need an additional hdmi_i2s mclk for generation the ACR packets.

    There was a bug in the initial TI8168 silicon sample which does not support Hardware CTS mode and all the other TI8168 and TI814X platforms must be configured to work with hardware cts support. 

    There is a know issue in the PSP release which prevents using the HDMI hardware cts mode(TI814X) and the ethernet 1Gbps mode where the Ethernet will go down while playing the HDMI audio. This is due to the sharing of the same clock for both the HDMI i2s mclk and Ethernet 1Gbps functionality.

    The  work around is to switch back to the software cts support by defining the macro HDMI_FORCE_SW_ACR in the sound/soc/davinci/davinci-hdmi.c file.

    Regards,

    Deepu Raj

  • Hi,

    I'm using DM385 EVM, It is having on chip HDMI. I'm using latest SDK "ti-ezsdk_dm814x-evm_5_05_02_00 sdk".

    As above link i have followed all the steps, And i have defined HDMI_FORCE_SW_ACR macro in specified file. I have confirmed that, It is using Manual (Software) CTS Mode.

    When I played the audio, It is playing but  no o/p and no error also.

    For info, I can able to play video on HDMI.

    Please help me to solve this issue.

    Let me know if you need any clarification on this.

    Thanks

    Ramappa

  • Ramappa,

    Can you please share the dmesg logs for the same ?

    Is there any reason why you have defined the macro "HDMI_FORCE_SW_ACR" ?

  • Hi Deepu Raj,

    Thanks for your reply..!

    Without adding that Macro i got following dmesg

    aplay -l


    * List of PLAYBACK Hardware Devices **
    card 0: EVM [TI81XX EVM], device 0: AIC3X tlv320aic3x-hifi-0 []
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 0: EVM [TI81XX EVM], device 1: hdmi HDMI-DAI-CODEC-1 []
    Subdevices: 1/1
    Subdevice #0: subdevice #0

    Even when i dmesg | grep hdmi

    i get root@dm814x-evmhome/ti813x#
    dmesg | grep hdmi
    PM: Adding info for platform:hdmi-dai
    PM: Adding info for platform:hdmi-dummy-codec
    asoc: HDMI-DAI-CODEC hdmi-dai mapping ok
    hdmi: Enter HDMI_W1_StopVideoFrame()
    hdmi: *** Set PHY power mode to 1
    hdmi: *** Set PHY power mode to 2
    hdmi: Enter HDMI_W1_GlobalInitVars()
    hdmi: Enter HDMI_Core_GlobalInitVars()
    hdmi: Enter HDMI_W1_ConfigVideoResolutionTiming()
    hdmi: Enter HDMI_W1_ConfigVideoInterface()
    hdmi: HDMI_WP_AUDIO_CFG = 0x1030006
    hdmi: HDMI_WP_AUDIO_CFG2 = 0x20c0
    hdmi: HDMI_WP_AUDIO_CTRL = 0x20
    hdmi: Enter DSS_HDMI_CORE_SW_RESET_ASSERT ()
    hdmi: Enter DSS_HDMI_CORE_POWER_DOWN_DISABLE()
    hdmi: Enter DSS_HDMI_CORE_SW_RESET_RELEASE()
    hdmi: Enter HDMI_W1_StartVideoFrame ()
    hdmi: Irqenable 60000011
    hdmi: 40 hpd
    hdmi: -------------DEBUG-------------------
    hdmi: 1 hdmi_wp_irqstatus
    hdmi: 1 hdmi_core_intr_state
    hdmi: 40 hdmi_core_intr1
    hdmi: 3 hdmi_core_intr2
    hdmi: f hdmi_core_intr3
    hdmi: 83 hdmi_core_sys_sys_stat
    hdmi: -------------DEBUG-------------------
    hdmi: first hpd
    hdmi: TDMS: hdmi_get_video_timing 16
    hdmi: TMDS: 148500 RATE: 48000
    hdmi: FS: 48000 N: 6144 CTS: 148500
    hdmi: HDMI_WP_AUDIO_CFG = 0x1030006
    hdmi: HDMI_WP_AUDIO_CFG2 = 0x20c0
    hdmi: HDMI_WP_AUDIO_CTRL = 0x20
    hdmi: CTS mode is SW

    Thus : when i play a simple wave file 

    root@dm814x-evmhome/ti813x# aplay -Dhw:0,1 /home/audio/piano2.wav
    Playing WAVE '/hWrapper Enabled...
    ome/audio/piano2.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
    Start audio transfer...
    Wrapper disabled...


    After that i have seen this above ti's blog and added that macro and checked.

    Same debug messages. No change in the audio status.



    Thanks

    Ramappa


  • Hello Deepu,

    Thanks for your support..!

    My HDMI audio is working fine. I have downloaded recent patches and tested, it is working.

    It is playing only 16 and 24 bit audio files as per driver user guide.

    Now I have to provide 32bit audio support for that. Can you able to give information on this..?

    Or is there any patch for 32bit support..?

    If nothing is available, give some idea to add support.

    Regards

    Ramappa

  • Ramappa,

    The HDMI hardware only supports 16 and 24bit word size. You will not be able to support the same directly .

    Alternatively you can use the ASLA "plughw:" options to convert any stream in software based on the support available on the hardware and achieve this.

    Ex:

    aplay -plughw:0,1    -r3200 -fS31_LE <sample file>

    where plughw:0,1 is ur HDMI device  (normal usage is -Dhw:0,1)

  • Hi Deepu,

    My HDMI audio is working fine with almost all streams.

    Thanks for your support..!

    Regards

    Ramappa

  • Hello Deepu,


    As per the discussion, I'm using the DM385 Board. And I'm using the latest EZSDK(ti-ezsdk_dm814x-evm_5_05_02_00).

    This EZSDK kernel is not having the HDMI audio support. So I have downloaded the kernel from "http://arago-project.org/git/projects/?p=linux-omap3.git;a=summary".

    I have tested the HDMI audio by playing .wav file using aplay. It is working and I'm getting crystal clear audio on HDMI.

    when i played with G-streamer pipelines i'm getting the output with some noise, and It is not clear.


    Same file i have played on audio line out using same G-streamer pipeline, I'm getting crystal clear audio on lineout.


    I have used the following G-stremer plugins for testing

    For playing mp4(Video + Audio)
    ===============================
    gst-launch filesrc location=/alvin.mp4 ! qtdemux name=demux demux.audio_00 ! queue ! faad ! alsasink device="plughw:0,1" demux.video_00 ! queue ! h264parse ! omx_h264dec ! omx_scaler ! video/x-raw-yuv,width=1920,height=1080 ! omx_ctrl display-mode=OMX_DC_MODE_1080P_60 ! omx_videosink

    For playing mp3(Audio)
    ===============================
    gst-launch filesrc location= /home/Tum_hi_ho.mp3 ! mad ! alsasink device="plughw:0,1"

    For playing mp3(Audio)
    ===============================
    gst-launch-0.10 -v playbin2 uri=file:///home/Tum_hi_ho.mp




    Please help to resolve this isuue.

  • Hello,

    Ramesh071 said:
    And I'm using the latest EZSDK(ti-ezsdk_dm814x-evm_5_05_02_00).

    Ramesh071 said:

    This EZSDK kernel is not having the HDMI audio support.

    You could check here:

    ti-ezsdk_dm816x-evm_5_05_02_00/board-support/docs

    TI81XX_HDMI_User_Guide.pdf

    chapter: TI81XX HDMI Audio Support


    Regarding gstreamer I will check it.

    Best Regards,

    Margarita

  • Hi Deepu,

    I'm using DM385 board with latest ezsdk(ti-ezsdk_dm814x-evm_5_05_02_00).

    This EZSDK kernel is not having the HDMI audio support(Support is there in the kernel, but it will not work). So I have downloaded the kernel from "http://arago-project.org/git/projects/?p=linux-omap3.git;a=summary".

    I have tested the HDMI audio by playing .wav file using aplay. It is playing without noise.

    when i played with G-streamer pipelines i'm getting the output with some noise, and It is not clear.

    I have used the following G-stremer plugins for testing

    For playing mp4(Video + Audio)
    ===============================
    gst-launch filesrc location=/alvin.mp4 ! qtdemux name=demux demux.audio_00 ! queue ! faad ! alsasink device="plughw:0,1" demux.video_00 ! queue ! h264parse ! omx_h264dec ! omx_scaler ! video/x-raw-yuv,width=1920,height=1080 ! omx_ctrl display-mode=OMX_DC_MODE_1080P_60 ! omx_videosink


    For playing mp3(Audio)
    ===============================
    gst-launch filesrc location= /home/Tum_hi_ho.mp3 ! mad ! alsasink device="plughw:0,1"


    For playing mp3(Audio)
    ===============================
    gst-launch-0.10 -v playbin2 uri=file:///home/Tum_hi_ho.mp

    what could be the problem, is it with g-streamer or driver..?

    Please help me to resolve this issue..!!!!!!!!!

    Thanks & Regards

    Ramappa