I still testing new things.
I getting slow downs on h264 material so I modified the codec for h264 and right now I am testing the modifications. But I am sure the slow downs are related to the Linux kernel.
Something is wrong in driver/amlogic/video_dev/amlogic.c or driver/amlogic/amports/vh264.c
Here a log. You see a long time nothing, than it is starting vidio qbuf skip:
[ 2206.118035@0] codec:invalid h264pts1, reset
[ 2296.354837@0] vidioc_qbuf skip: index:110835:110834
[ 2296.390041@0] vidioc_qbuf skip: index:110838:110837
[ 2296.428950@0] vidioc_qbuf skip: index:110841:110840
[ 2296.467746@0] vidioc_qbuf skip: index:110844:110843
[ 2296.507704@0] vidioc_qbuf skip: index:110848:110847
[ 2296.548036@0] vidioc_qbuf skip: index:110852:110851
[ 2296.588300@0] vidioc_qbuf skip: index:110855:110854
[ 2296.628007@0] vidioc_qbuf skip: index:110859:110858
[ 2296.660833@0] vidioc_qbuf skip: index:110863:110862
[ 2296.681001@0] vidioc_qbuf skip: index:110867:110866
[ 2296.701094@0] vidioc_qbuf skip: index:110869:110868
[ 2296.720929@0] vidioc_qbuf skip: index:110872:110871
[ 2296.740927@0] vidioc_qbuf skip: index:110875:110874
[ 2297.084939@0] vidioc_qbuf skip: index:110890:110889
[ 2297.128282@0] vidioc_qbuf skip: index:110892:110891
[ 2297.167801@0] vidioc_qbuf skip: index:110896:110895
[ 2297.287558@0] vidioc_qbuf skip: index:110900:110899
[ 2297.327866@0] vidioc_qbuf skip: index:110902:110901
[ 2297.368717@7] vidioc_qbuf skip: index:110905:110904
[ 2297.408407@5] vidioc_qbuf skip: index:110908:110907
[ 2297.527909@0] vidioc_qbuf skip: index:110912:110911
[ 2297.567669@0] vidioc_qbuf skip: index:110914:110913
[ 2297.607656@0] vidioc_qbuf skip: index:110917:110916
[ 2297.637998@0] vidioc_qbuf skip: index:110920:110919
[ 2297.672721@7] codec:video_blackout_policy_store(0)
[ 2297.672780@7] [tsync_avevent]event:1, param 1
[ 2297.672782@7] video pause!
[ 2297.680988@4] DI: di_receiver_event_fun , is_bypass() 1 trick_mode 0 bypass_all 0
[ 2297.680990@4] di_receiver_event_fun: vf_notify_receiver unreg
[ 2297.681004@7] DI: di_unreg_process unreg start 1.
[ 2297.681017@7] codec_mm:NULL mem_handle for keeper!!
[ 2297.688970@7] codec:alloced keep buffer yaddr=0000000068200000,u_addr=0000000067700000,v_addr=0000000067800000
[ 2297.688978@7] codec:vf_keep_current keep_y_addr=0000000068200000 65cae800
[ 2297.688983@7] codec:ge2d_store_frame_NV21 cur_index:s:0x626160
[ 2297.688990@7] codec:ge2d_store_frame d:0xd9d8
[ 2297.692499@7] codec:vf_keep_current: VIDTYPE_VIU_NV21
[ 2297.692501@7] codec:vf_keep_current: keep video on with keep
[ 2297.692507@7] [tsync_avevent]event:2, param 0
[ 2297.692512@7] codec:video first pts = 0
[ 2297.692528@7] DI: di_unreg_process vf unreg cost 10 ms.
[ 2297.692531@7] DI: di_unreg_process unreg stop 0.
[ 2297.701110@7] codec:vdec1 video changed to 0 x 0 0 fps clk->200MHZ
[ 2297.702171@7] codec:vdec_create instance ffffff8004948000, total 1
[ 2297.702226@7] codec:Video stbuf alloced at 0000000063700000, size = 10485760
[ 2297.702241@7] codec:vdec_init, dev_name:amvdec_h264, vdec_type=VDEC_TYPE_SINGLE
[ 2297.702247@7] codec:vdec_init set vfm decoder ffffff8004948000
[ 2297.702253@7] codec:vdec_dev_reg.mem[0x64100000 -- 0x670fffff]
[ 2297.703531@7] codec:H264 sysinfo: 1280x720 duration=1920, pts_outside=1,
[ 2297.704236@7] codec:vdec_request_irq ffffffc001547df8, vh264-irq
[ 2297.704281@7] DI: di_receiver_event_fun: vframe provider reg
[ 2297.714331@7] set run_early_proc_fun_flag to 1
[ 2297.714540@7] codec:vdec_init, vf_provider_name =
[ 2297.715047@7] codec:video first pts = 0
[ 2297.715059@7] codec:vdec_request_irq ffffffc001538900, parser
[ 2297.722660@7] codec:video_blackout_policy_store(1)
[ 2298.128526@0] aml_spdif_dai: aiu 958 playback disable
[ 2298.128589@7] aml_spdif_dai: aml_hw_iec958_init,runtime->rate=48000, runtime->channels=2, same source mode(0)
[ 2298.128610@7] aml_spdif_dai: set normal 512 fs /4 fs
[ 2298.128619@7] aml_audio_hw: IEC958 16bit
[ 2298.128624@7] hdmitx: audio: aout notify rate 48000
[ 2298.128626@7] hdmitx: audio: aout notify size 16
[ 2298.128628@7] hdmitx: audio: no update
[ 2299.318500@4] codec:DisableVideoLayer()
[ 2299.331083@4] DI: di_receiver_event_fun , is_bypass() 0 trick_mode 0 bypass_all 0
[ 2299.331085@4] di_receiver_event_fun: vf_notify_receiver unreg
[ 2299.331098@7] DI: di_unreg_process unreg start 1.
[ 2299.331108@7] codec:DisableVideoLayer()
[ 2299.331110@7] codec:disbled keep video before free keep buffer.
[ 2299.331112@7] codec:disbled video for next before free keep buffer!
[ 2299.331113@7] codec:DisableVideoLayer()
[ 2299.331117@7] codec:free_alloced_keep_buffer 0000000068200000.0000000067700000.0000000067800000
[ 2299.331461@7] codec:free_alloced_keep_buffer (null). (null). (null)
[ 2299.331464@7] [tsync_avevent]event:2, param 0
[ 2299.331469@7] codec:video first pts = 0
[ 2299.331478@7] DI: di_unreg_process vf unreg cost 0 ms.
[ 2299.331481@7] DI: di_unreg_process unreg stop 0.
[ 2299.334035@0] codec:VsyncDisableVideoLayer
[ 2299.334037@0] codec:AFBC off now.
[ 2299.341589@6] codec:video_disable_store(1)
[ 2299.341604@6] codec:DisableVideoLayer()
[ 2299.341612@6] codec:free_alloced_keep_buffer (null). (null). (null)
[ 2299.341665@6] vfm_map_store:rm default
[ 2299.341704@6] vfm_map_store:add default decoder ppmgr deinterlace amvideo
[ 2299.354043@0] codec:VsyncDisableVideoLayer
[ 2299.354046@0] codec:AFBC off now.
[ 2300.157031@1] vfm_map_store:rm default
[ 2300.157073@1] vfm_map_store:add default decoder ppmgr deinterlace amlvideo amvideo
[ 2300.157323@1] codec:vdec_create instance ffffff8004979000, total 1
[ 2300.157366@1] codec:Video stbuf alloced at 0000000063700000, size = 10485760
[ 2300.157381@1] codec:vdec_init, dev_name:amvdec_h264, vdec_type=VDEC_TYPE_SINGLE
[ 2300.157387@1] codec:vdec_init set vfm decoder ffffff8004979000
[ 2300.157392@1] codec:vdec_dev_reg.mem[0x0 -- 0x0]
[ 2300.157401@1] codec:vdec base memory alloced [0000000064100000 -- 00000000670fffff]
[ 2300.159321@1] codec:H264 sysinfo: 1440x1080 duration=1920, pts_outside=1,
[ 2300.159900@1] codec:vdec_request_irq ffffffc001547df8, vh264-irq
[ 2300.159939@1] DI: di_receiver_event_fun: vframe provider reg
[ 2300.169983@1] set run_early_proc_fun_flag to 1
[ 2300.170200@1] codec:vdec_init, vf_provider_name =
[ 2300.170689@1] codec:video first pts = 0
[ 2300.170700@1] codec:vdec_request_irq ffffffc001538900, parser
[ 2300.178528@1] [tsync_avevent]event:1, param 1
[ 2300.178531@1] video pause!
[ 2300.179160@1] codec:video_freerun_mode_store(1)
[ 2300.179403@1] codec:video first checkin pts = 3a4e
[ 2300.179405@1] codec:first check in vpts <0x30:0x3a4e> ok!
[ 2300.179569@0] codec:Enter set parameter cmd1.
[ 2300.179602@0] codec:vdec1 video changed to 3840 x 2160 60 fps clk->667MHZ
[ 2300.179607@0] codec:actual_dpb_size 20 max_dpb_size 3
[ 2300.179663@0] codec:start alloc for 19
[ 2300.182152@0] codec:CMA malloc ok 19
[ 2300.182197@0] codec:video first pts = 3a4e
[ 2300.611035@0] pre_de_buf_config: source change: 0x0/0/0/0=>0x8009/1440/1080/0
[ 2300.701580@6] codec:video_disable_store(0)
[ 2300.714054@0] vpts to scr, apts = 0x0, vpts = 0x3a4e
[ 2300.714088@0] codec:[video4osd] first picture {1440,1080} pts:485e,
[ 2300.729505@7] aml_spdif_dai: aiu 958 playback enable
[ 2300.734160@0] codec:VsyncEnableVideoLayer
[ 2302.314094@0] codec:[video4osd] first picture {1440,1080} pts:0,
[ 2302.334192@0] codec:VsyncEnableVideoLayer
[ 2302.573540@0] codec:restart correct frame duration
[ 2302.573541@0] codec:new=3840,old_duration=1920,cnt=25
[ 2303.593661@0] codec:restart correct frame duration
[ 2303.593677@0] codec:new=3840,old_duration=1920,cnt=25
[ 2304.553681@0] codec:finished correct frame dur
[ 2304.553698@0] codec: new=3840,old_duration=3840,cnt=25
[ 2334.595570@0] codec:invalid h264pts1, reset
[ 2997.134475@4] codec:video_blackout_policy_store(0)
[ 2997.134547@4] [tsync_avevent]event:1, param 1
[ 2997.134554@4] video pause!
[ 2997.154528@4] DI: di_receiver_event_fun , is_bypass() 0 trick_mode 0 bypass_all 0
[ 2997.154540@4] di_receiver_event_fun: vf_notify_receiver unreg
[ 2997.164208@5] DI: di_unreg_process unreg start 1.
[ 2997.164237@5] codec:keep exit is di
[ 2997.164244@5] [tsync_avevent]event:2, param 0
[ 2997.164250@5] codec:video first pts = 0
[ 2997.164263@5] DI: di_unreg_process vf unreg cost 0 ms.
[ 2997.164268@5] DI: di_unreg_process unreg stop 0.
[ 2997.164289@0] di_uninit_buf keep cur di_buf 11 (4 8 2)
[ 2997.164783@5] codec:vdec1 video changed to 0 x 0 0 fps clk->200MHZ
[ 2997.165212@5] codec:vdec_create instance ffffff80049aa000, total 1
[ 2997.165264@5] codec:Video stbuf alloced at 0000000063700000, size = 10485760
[ 2997.165279@5] codec:vdec_init, dev_name:amvdec_h264, vdec_type=VDEC_TYPE_SINGLE
[ 2997.165284@5] codec:vdec_init set vfm decoder ffffff80049aa000
[ 2997.165291@5] codec:vdec_dev_reg.mem[0x64100000 -- 0x670fffff]
[ 2997.167367@5] codec:H264 sysinfo: 1440x1080 duration=1920, pts_outside=1,
[ 2997.167735@5] codec:vdec_request_irq ffffffc001547df8, vh264-irq
[ 2997.167772@5] DI: di_receiver_event_fun: vframe provider reg
[ 2997.177828@5] set run_early_proc_fun_flag to 1
[ 2997.178024@5] codec:vdec_init, vf_provider_name =
[ 2997.178542@5] codec:video first pts = 0
[ 2997.178552@5] codec:vdec_request_irq ffffffc001538900, parser
[ 2997.179511@5] codec:video_blackout_policy_store(1)
[ 2997.227324@5] codec:video first checkin pts = 3bcb28e
[ 2997.227337@5] codec:first check in vpts <0x30:0x3bcb28e> ok!
[ 2997.227593@0] codec:Enter set parameter cmd1.
[ 2997.227740@0] codec:vdec1 video changed to 3840 x 2160 60 fps clk->667MHZ
[ 2997.227752@0] codec:actual_dpb_size 20 max_dpb_size 3
[ 2997.227822@0] codec:start alloc for 19
[ 2997.230214@0] codec:CMA malloc ok 19
[ 2997.230297@0] codec:video first pts = 3bcb28e
[ 2997.284337@0] pre_de_buf_config: source change: 0x0/0/0/0=>0x8009/1440/1080/0
[ 2997.354301@0] vpts to scr, apts = 0x0, vpts = 0x3bcb28e
[ 2997.354352@0] codec:[video4osd] first picture {1440,1080} pts:3bcc09e,
[ 2997.374371@0] codec:VsyncEnableVideoLayer
[ 2997.580793@0] aml_spdif_dai: aiu 958 playback disable
[ 2997.580865@7] aml_spdif_dai: aml_hw_iec958_init,runtime->rate=48000, runtime->channels=2, same source mode(0)
[ 2997.580894@7] aml_spdif_dai: set normal 512 fs /4 fs
[ 2997.580905@7] aml_audio_hw: IEC958 16bit
[ 2997.580914@7] hdmitx: audio: aout notify rate 48000
[ 2997.580919@7] hdmitx: audio: aout notify size 16
[ 2997.580923@7] hdmitx: audio: no update
[ 2997.581142@5] aml_spdif_dai: aiu 958 playback enable
[ 2999.714294@0] DI: recycle_keep_buffer recycle keep cur di_buf 11 (
[ 2999.714307@0] DI: 4 DI: 8
[ 2999.714320@0] DI: 2 <7>[ 2999.714324@0] DI: )
[ 2999.926891@0] codec:restart correct frame duration
[ 2999.926907@0] codec:new=3840,old_duration=1920,cnt=25
[ 3000.926875@0] codec:restart correct frame duration
[ 3000.926891@0] codec:new=3840,old_duration=1920,cnt=25
[ 3001.966863@0] codec:finished correct frame dur
[ 3001.966880@0] codec: new=3840,old_duration=3840,cnt=25
[ 3012.767059@0] codec:invalid h264pts1, reset