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.

How to change the hdmi output resolution with OMX?

Hi,

With EZSDK 5.03.01.015,  I run the OMX sample "decode_display" with the following command line:

root@dm814x-evm:~# /usr/share/ti/ti-omx/decode_display_a8host_debug.xv5T -i test720.h264 -w 1280 -h 720 -f 60 -g 0 -d 0 -c h264

This works fine: the 1280x720 video is played in the center of the 1920x1080 display.

Now, I want to play the video full screen. So, I change the parameter "OMX_DC_MODE_1080P_60" into "OMX_DC_MODE_720P_60" in "IL_ClientSetDisplayParams" function. By running the sample, I expect to see the monitor resolution changed to 1280x720 but it is still 1920x1080.

So, how can I change the hdmi output resolution with OMX?

Thanks

  • Hi,

    when firmware is loaded HDMI mode is set as 

    modprobe vpss sbufaddr=0xBFB00000 mode=hdmi:1080p-60 debug=1 i2c_mode=1 in the filesystem\etc\rc5.d load script. Could you please try changing this to 720p-60 and let us know if it solves.

    Regards

    Vimal

  • Hi Vimal,

    Thank you for answering. I tried changing 1080p-60 with 720p-60 in the firmware loader script and it works (i.e. the EVM boots in 1280x720@60Hz).

    But I can not change the display mode afterwards, even with the following command lines (I'm sure everything worked fine before EZSDK 5.3):

    root@dm814x-evm:~# echo 0 > /sys/devices/platform/vpss/display0/enabled
    VPSS_DCTRL: failed to disable the venc.
    VPSS_DCTRL: failed to disable hdmi venc

    root@dm814x-evm:~# echo 1080p-60 > /sys/devices/platform/vpss/display0/mode
    VPSS_DCTRL: stop venc before changing mode
    root@dm814x-evm:~# echo 1 > /sys/devices/platform/vpss/display0/enabled
    Timing Info:
    pixel_clk = 74250
    x_res = 1280
    y_res = 720
    hfp = 110
    hsw = 40
    hbp = 220
    vfp = 5
    vsw = 5
    vbp = 20

    Thanks

  • Stephane,

    Is any app using graphics or video running, while you try to change the mode ? If yes, It wo't work. Please make sure there is no display running while changing the mode. It would work.

    Regards

    Vimal

  • Vimal,

    If I disable the display with the following command line:

      root@dm814x-evm:~# echo 0 > /sys/devices/platform/vpss/display0/enabled

    I can change the display mode with:

      root@dm814x-evm:~# echo 720p-60 > /sys/devices/platform/vpss/display0/mode

    BUT, the OMX display component (OMX.TI.VPSSM3.VFDC) does not execute! Here are the complete command lines and message I have with the OMX demo "decode_display":

    root@dm814x-evm:~# /etc/init.d/matrix-gui-e stop
    Stopping Matrix GUI application.
    root@dm814x-evm:~# /etc/init.d/pvr-init stop
    Stopping PVR
    root@dm814x-evm:~# echo 0 > /sys/devices/platform/vpss/display0/enabled
    root@dm814x-evm:~# echo 0 > /sys/devices/platform/vpss/graphics0/enabled
    root@dm814x-evm:~# /usr/share/ti/ti-omx/decode_display_a8host_debug.xv5T -i test.h264 -w 1920 -h 1080 -f 60 -g 0 -d 0 -c h264
    input file: test.h264
    width: 1920
    height: 1080
    frame_rate: 60
    gfx: fbdev disable
    codec: h264
    display_id: 0
    Decoder-Display example
    ===============================
    OMX_Init completed
    UIAClient is ready to send a UIA configuration command
    UIAClient received UIA_CONFIGURE_ACK
    UIAClient is done sending requests
    UIAClient is ready to send a UIA configuration command
    UIAClient received UIA_CONFIGURE_ACK
    UIAClient is done sending requests
    opening file
    decoder compoenent is created (0x1199b8)
    PADX: 32 PADY: 24
    level set is 12
    scalar compoenent is created (0x11d458)
    set input port params (width = 1920, height = 1080)
    set output port params (width = 1920, height = 1080)
    set number of channels
    set input resolution
    set output resolution
    enable scalar input port
    got eventEnable/Disable Event
    enable scalar output port
    got eventEnable/Disable Event
    found handle 0x120f08 for component OMX.TI.VPSSM3.VFDC
    got display handle
    found handle 0x124a10 for component OMX.TI.VPSSM3.CTRL.DC
    Buffer Size computed: 4147200
    set input port params (width = 1920, height = 1080)
    setting input and output memory type to default
    enable input port
    got eventEnable/Disable Event
    connect call for decoder-scalar
    connect call for scalar-display
    decoder inport buffers allocated
    decoder outport buffers allocated
    got eventState changed to: OMX_StateIdle
    state IDLE
    Scalar input port use buffer done
    scalar outport buffers allocated
    got eventState changed to: OMX_StateIdle
    scalar state IDLE
    got eventState changed to: OMX_StateIdle
    ctrl-dc state IDLE
    got eventState changed to: OMX_StateIdle
    display state IDLE
    got eventState changed to: OMX_StateExecuting
    display control state execute
    got event*** unrecoverable error: OMX_ErrorBadParameter (0x80001005) (comp=0x120f08)
    Press a key to proceed

  • Stephane,

    You need to disable display and then change the mode / parameters you want,  and enable it again. Please try so.

    Thanks

    Vimal

  • Vimal Jain said:

    Stephane,

    You need to disable display and then change the mode / parameters you want,  and enable it again. Please try so.

    Thanks

    Vimal

    I do it as explained in details in the previous post! I can change the display mode with those command lines (please let me know if I'm wrong):

      root@dm814x-evm:~# echo 0 > /sys/devices/platform/vpss/display0/enabled

      root@dm814x-evm:~# echo 720p-60 > /sys/devices/platform/vpss/display0/mode

      root@dm814x-evm:~# echo 1 > /sys/devices/platform/vpss/display0/enabled

    BUT, I cannot change the display mode with OpenMax (OMX).


  • Stephane,

    We need both from Linux and OMX to change the display mode. After doing the change as above, If you set params in OMX it should work. I believe, You are expecting to work it from either side ?

    Regards

    Vimal

  • Vimal,

    I expect that the mode change works with OMX alone, which is not currently the case.

    I am not sure if you understand my problem. When I say "mode change with OMX", it means that OMX can change the display in a mode different from that set by Linux.

    Example: Boot Linux in 1920x1080, start an application and with OMX this application changes the display mode to 1280x720.

    Thanks

  • Hi folks,

    All supported video modes are defined in this header

    ti-ezsdk_dm814x-evm_5_03_00_09/board-support/linux-2.6.37-psp04.01.00.06.patch1/drivers/video/ti81xx/vpss/sysfs.h

    Below I've added the list. I've tested most of modes they seem to be working. I use this simple script for this purpose:

    #!/bin/bash
    #setgm.sh
    # This scripts changes the graphics. Graphic mode must be provided in first
    # parameter:
     
    # setgm 720p-60
    # setgm 1920x1080@60
     
    grmode="$1"
     
    #Disable graphics0 pipeline
    echo 0 > /sys/devices/platform/vpss/graphics0/enabled
    #Disable hdmi VENC
    echo 0 > /sys/devices/platform/vpss/display0/enabled
    
    #Set the new VENC mode
    echo $grmode > /sys/devices/platform/vpss/display0/mode
    
    #Enable HDMI VENC
    echo 1 > /sys/devices/platform/vpss/display0/enabled
    
    #Enable graphics0 pipeline
    echo 1 > /sys/devices/platform/vpss/graphics0/enabled

    Here is the list of supported modes:

    /*used for mode sysfs*/
    static const struct dc_vencmode_info vmode_info[] = {
    	{"ntsc", FVID2_STD_NTSC,
    	    {FVID2_STD_NTSC, 720, 480, FVID2_SF_INTERLACED,
    		216000, 60, 12, 68, 64, 5, 41, 5}
    	},
    	{"pal", FVID2_STD_PAL,
    	    {FVID2_STD_PAL, 720, 576, FVID2_SF_INTERLACED,
    		216000, 50, 16, 58, 64, 6, 31, 6}
    	},
    	{"1080p-60", FVID2_STD_1080P_60,
    	    {FVID2_STD_1080P_60, 1920, 1080, FVID2_SF_PROGRESSIVE,
    		148500, 60, 88, 148, 44, 4, 36, 5}
    	},
    	{"1920x1080@60", FVID2_STD_1080P_60,
    	    {FVID2_STD_CUSTOM, 1920, 1080, FVID2_SF_PROGRESSIVE,
    		148500, 60, 88, 148, 44, 4, 36, 5}
    	},
    	{"1080p-50", FVID2_STD_1080P_50,
    	    {FVID2_STD_1080P_50,  1920, 1080, FVID2_SF_PROGRESSIVE,
    		148500, 50, 528, 148, 44, 4, 36, 5}
    	},
    	{"1920x1080@50", FVID2_STD_1080P_50,
    	    {FVID2_STD_CUSTOM, 1920, 1080, FVID2_SF_PROGRESSIVE,
    		148500, 50, 528, 148, 44, 4, 36, 5}
    	},
    	{"1080p-30", FVID2_STD_1080P_30,
    	    {FVID2_STD_1080P_30, 1920, 1080, FVID2_SF_PROGRESSIVE,
    		74250, 30, 88, 148, 44, 4, 36, 5}
    	},
    	{"1920x1080@30", FVID2_STD_1080P_30,
    	    {FVID2_STD_CUSTOM, 1920, 1080, FVID2_SF_PROGRESSIVE,
    		74250, 30, 88, 148, 44, 4, 36, 5}
    	},
    	{"720p-60", FVID2_STD_720P_60,
    	    {FVID2_STD_720P_60, 1280, 720, FVID2_SF_PROGRESSIVE,
    		74250, 60, 110, 220, 40, 5, 20, 5}
    	},
    	{"1280x720@60", FVID2_STD_720P_60,
    	    {FVID2_STD_CUSTOM, 1280, 720, FVID2_SF_PROGRESSIVE,
    		74250, 60, 110, 220, 40, 5, 20, 5}
    	},
    	{"720p-50", FVID2_STD_720P_50,
    	    {FVID2_STD_720P_50, 1280, 720, FVID2_SF_PROGRESSIVE,
    		74250, 50, 440, 220, 40, 5, 20, 5}
    	},
    	{"1280x720@50", FVID2_STD_720P_50,
    	    { FVID2_STD_CUSTOM, 1280, 720, FVID2_SF_PROGRESSIVE,
    		74250, 50, 440, 220, 40, 5, 20, 5}
    	},
    	{"1080i-60", FVID2_STD_1080I_60,
    	    {FVID2_STD_1080I_60, 1920, 1080, FVID2_SF_INTERLACED,
    		74250, 60, 88, 148, 44, 2, 15, 5}
    	},
    	{"1920x1080@60i", FVID2_STD_1080I_60,
    	    {FVID2_STD_CUSTOM, 1920, 1080, FVID2_SF_INTERLACED,
    		74250, 60, 88, 148, 44, 2, 15, 5}
    	},
    	{"1080i-50", FVID2_STD_1080I_50,
    	    {FVID2_STD_1080I_50, 1920, 1080, FVID2_SF_INTERLACED,
    		742500, 50, 528, 148, 44, 2, 15, 5}
    	},
    	{"1920x1080@50i", FVID2_STD_1080I_50,
    	    {FVID2_STD_CUSTOM, 1920, 1080, FVID2_SF_INTERLACED,
    		742500, 50, 528, 148, 44, 2, 15, 5}
    	},
    	/*VGA*/
    	{"640x480@60", FVID2_STD_VGA_60,
    	    {FVID2_STD_CUSTOM, 640, 480, FVID2_SF_PROGRESSIVE,
    		25175, 60, 16, 48, 96, 10, 33, 2}
    	},
    	{"640x480@72", FVID2_STD_VGA_72,
    	    {FVID2_STD_CUSTOM, 640, 480, FVID2_SF_PROGRESSIVE,
    		31500, 72, 24, 128, 40, 9, 29, 2}
    	},
    	{"640x480@75", FVID2_STD_VGA_75,
    	    {FVID2_STD_CUSTOM, 640, 480, FVID2_SF_PROGRESSIVE,
    		31500, 75, 16, 120, 64, 1, 16, 3}
    	},
    	{"640x480@85", FVID2_STD_VGA_85,
    	    {FVID2_STD_CUSTOM, 640, 480, FVID2_SF_PROGRESSIVE,
    		36000, 85, 56, 80, 56, 1, 25, 3}
    	},
    	/*SVGA*/
    	{"800x600@60", FVID2_STD_SVGA_60,
    	    {FVID2_STD_CUSTOM, 800, 600, FVID2_SF_PROGRESSIVE,
    		40000, 60, 40, 88, 128, 1, 23, 4}
    	},
    	{"800x600@72", FVID2_STD_SVGA_72,
    	    {FVID2_STD_CUSTOM, 800, 600, FVID2_SF_PROGRESSIVE,
    		50000, 72, 56, 64, 120, 37, 23, 6}
    	},
    	{"800x600@75", FVID2_STD_SVGA_75,
    	    {FVID2_STD_CUSTOM, 800, 600, FVID2_SF_PROGRESSIVE,
    		49500, 75, 16, 160, 80, 1, 21, 3}
    	},
    	{"800x600@85", FVID2_STD_SVGA_85,
    	    {FVID2_STD_CUSTOM, 800, 600, FVID2_SF_PROGRESSIVE,
    		56250, 85, 32, 152, 64, 1, 27, 3}
    	},
    	/*XGA*/
    	{"1024x768@60", FVID2_STD_XGA_60,
    	    {FVID2_STD_XGA_60, 1024, 768, FVID2_SF_PROGRESSIVE,
    		65000, 60, 24, 160, 136, 3, 29, 6}
    	},
    	{"1024x768@70", FVID2_STD_XGA_70,
    	    {FVID2_STD_CUSTOM, 1024, 768, FVID2_SF_PROGRESSIVE,
    		75000, 70, 24, 144, 136, 3, 29, 6}
    	},
    	{"1024x768@75", FVID2_STD_XGA_75,
    	    {FVID2_STD_XGA_75, 1024, 768, FVID2_SF_PROGRESSIVE,
    		78750, 75, 16, 176, 96, 1, 28, 3}
    	},
    	{"1024x768@85", FVID2_STD_XGA_85,
    	    {FVID2_STD_CUSTOM, 1024, 768, FVID2_SF_PROGRESSIVE,
    		94500, 85, 48, 208, 96, 1, 36, 3}
    	},
    	/*SXGA*/
    	{"1280x1024@60", FVID2_STD_SXGA_60,
    	    {FVID2_STD_SXGA_60, 1280, 1024, FVID2_SF_PROGRESSIVE,
    		108000, 60, 48, 248, 112, 1, 38, 3}
    	},
    	{"1280x1024@75", FVID2_STD_SXGA_75,
    	    {FVID2_STD_SXGA_75, 1280, 1024, FVID2_SF_PROGRESSIVE,
    		135000, 75, 16, 248, 144, 1, 38, 3}
    	},
    	{"1280x1024@85", FVID2_STD_SXGA_85,
    	    {FVID2_STD_CUSTOM, 1280, 1024, FVID2_SF_PROGRESSIVE,
    		157500, 85, 64, 224, 160, 1, 44, 3}
    	},
    	/*UXGA*/
    	{"1600x1200@60", FVID2_STD_UXGA_60,
    	    {FVID2_STD_UXGA_60, 1600, 1200, FVID2_SF_PROGRESSIVE,
    		162000, 60, 64, 304, 192, 1, 46, 3}
    	},
    	/*WVGA*/
    	{"800x480@60", FVID2_STD_WVGA_60,
    	    {FVID2_STD_CUSTOM, 800, 480, FVID2_SF_PROGRESSIVE,
    		33500, 60, 164, 89, 10, 10, 23, 10}
    	},
     
    	/*480P*/
    	{"480p-60", FVID2_STD_480P,
    	    {FVID2_STD_480P, 720, 480, FVID2_SF_PROGRESSIVE,
    		27000, 60, 16, 60, 62, 9, 20, 6}
    	}
     
    };


  • Hi,

    Here is another problem. Not all the graphic modes which are listed in the DM814x TRM supported by software. For instance 1440x900 but It happened that this mode is very important for our project.

    So I have a question to TI FOLKS:

    Do you have plans to add support of these missed modes to the DSP/Linux driver software? Is this technically possible at all? Or maybe there are some limits/problems?

    It would be nice to hear from you. I really like DM814x SOC but if this mode is not supported when we would need to move to another supplier.

    Andrei 

  • Hi,

    I am assuming here that you are talking about display modes. Yes encoder is capable of supporting all modes and any arbitrary resolution up to 165MHz clock.  Any arbitrary resolution can be set using the timing sysfs entry. So you should be able to set 1440X900 using following entry

    echo "Timing entry" > /sys/devices/platform/vpss/display0/timing.

    You can refer to video driver userguide@http://processors.wiki.ti.com/index.php/DM816X_AM389X_VPSS_Video_Driver_User_Guide

    Regards,

    Hardik Shah

  • Hi Hardik,

    Thanks very much for the hint.

    Although it took some time to decode missed modes into the timing parameters finally I've got all the modes working!

    I used this link to get timing parameters http://wenku.baidu.com/view/b378c2d026fff705cc170a5e.html.

  • Here is the shell script I developed to test some number of video modes on HDMI. I think it's a good example for how to setup the mode or timing.

    4111.test_graphic.sh.zip

    B.R.,

    Andrei

  • Hi Hardik,

    Sorry for bothering you again. Just one question.

    Is it true that VGA output is not supported in DM814x-EVM? I successfully tested HDMI but VGA seems not working.

    Is this software limitation?

    Andrei

  • Andrei,

    DM814X EVM does not have VGA output port.but in your own HW board, you can hook a external DAC to the DVO port of TI814X to support VGA output.

    Regards

     

    yihe

  • Great,

    Link is very good source of reference. Can you please mark thread as answered so others will also come to know about it.

    Regards,

    Hardik Shah

  • Hi,

    How are you testing VGA, there is not VGA connector on board. Are you sure you are using DM8148 and not DM8168, because DM8168 has VGA connector and VGA output.

    Regards,

    Hardik Shah

  • Hi Stephane,

    You must first switch to 1280x720 mode first, look at my bash script (from previous post) for the reference how to do this, then you should be able to run on full-screen.

    Best regards,

    Andrei 

  • Hi Hardik,

    Yes it's there, on Expansion I/O BOARD REV D.

    Andrei

  • Hi,

    That is VGA input not output.

    Regards,

    Hardik Shah

  • Oh, really. Never heard about VGA input in the embedded system.

    Cool :-)

    Thanks,

    Andrei

  • This is for PC input, output of your PC will go here and you can send it over network.

    Regards,

    Hardik Shah

  • It's a great feature!

    Thanks for letting me know, this is fantastic. 

    Andrei

  • Hi Stephane,

    I apologize for hijacking your forum thread. 

    Do you know if there is a way to scale playback of a 1920x1080 encoded video to output on a displays set for another smaller resolution such as 1024 x 768?

    I suppose this would not look good since aspect ratios do not match unless it could be letter-boxed.  Any tips on creating a video file in the *.h264 format?  VLC does not seem to know what the sample.h264 file is.

    Thanks in advance for your time,

    -Ed

     

  • Hello,

    You should change the display mode from both  Linux and OMX. Resolution can be set using the timing sysfs entry.

    echo "Timing entry" > /sys/devices/platform/vpss/display0/timing

    You can refer to video driver userguide http://processors.wiki.ti.com/index.php/DM816X_AM389X_VPSS_Video_Driver_User_Guide

    Ed Sutton said:

    Do you know if there is a way to scale playback of a 1920x1080 encoded video to output on a displays set for another smaller resolution such as 1024 x 768?

    I suppose this would not look good since aspect ratios do not match unless it could be letter-boxed.  Any tips on creating a video file in the *.h264 format?  VLC does not seem to know what the sample.h264 file is.

    You want to create video file, 1920x1080 to 1024x768 resolution, right? If it is yes, you should be able to use ffmpeg command to create the video file on your PC with 1024x768 resolution.

    Best Regards,

    Margarita

  • Hi Margarita,

    Thank you for your reply.

    Margarita Gashova said:
    You want to create video file, 1920x1080 to 1024x768 resolution, right? If it is yes, you should be able to use ffmpeg command to create the video file on your PC with 1024x768 resolution.

    Yes! How?

    Can you please provide an example?  

    The dm816x_1080p_demo.264 file format is not documented.  I know it uses the H.264 codec, however,  the file format, the wrapper, is unknown to me.

    Thank you for your help,

    -Ed

  • Never mind.   I expect this wiki article may answer my question on how to encode a video in the format

    http://processors.wiki.ti.com/index.php/Encoding_and_decoding_DVEVM_clips

    Reading it now....

  • The process of installing ffmpeg, and mplayer, and all the codecs and added tools on OS X required re-enccode a video for playback on the DM8168 using decode_display_a8host_debug.xv5T at 1024 x 768 was exhausting.  I expect it could have taken days and even then I may not have succeeded.  

    I found a lazier and perhaps better way to playback videos that plays back standard video files by using mplayer.  I am not sure if I am using any of the DM8168 hardware decode capabilities are being utilized by mplayer but it seems to work.    

    1. Edit /etc/opkg/opkg.conf to enable installation of Angstrom packages in the DM8168 Arago installation. Insert the following line:

      # Try using Angstrom feed with Z3 DM8168 # Use glibc with Arago
      src/gz angstrom-base http://www.angstrom-distribution.org/feeds/2011.03/ipk/glibc/armv7a/base/

    2. opkg install mplayer

    Playing back 720P movie trailers work fine and mplayer even scales automatically.    Playback with mplayer seems smooth.  I do not know what, if any of the DM8168 hardware is being used for decoding.  This may be where using decode_display_a8host_debug.xv5T to decode may have advantages.  The problem is I can not figure out how to create a video that it can play back at the desired 1024 x 768 resolution.

    mplayer -nosound -vo fbdev:/dev/fb0 /usr/share/ti/data /videos/spiderman.mp4

    Well any mplayer can play back most any video file format EXCEPT the format used by dm816x_1080p_demo.264

    -Ed

     

    decode_display_a8host_debug.xv5T