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.

AM5718: Unable to achieve 1080p60 encoding

Part Number: AM5718

Hi,

We are running into the same issue as this post on an AM5718 board.  All software is based on latest PSDK v06_03_00_106.  Looking at kernel source, the dra7xx-clocks.dtsi file has the encoder clock DPLL still set to 388MHz:

From "arch/arm/boot/dts/dra7xx-clocks.dtsi":

	dpll_iva_m2_ck: dpll_iva_m2_ck@1b0 {
		#clock-cells = <0>;
		compatible = "ti,divider-clock";
		clocks = <&dpll_iva_ck>;
		ti,max-div = <31>;
		ti,autoidle-shift = <8>;
		reg = <0x01b0>;
		ti,index-starts-at-one;
		ti,invert-autoidle-bit;
		assigned-clocks = <&dpll_iva_m2_ck>;
		assigned-clock-rates = <388333334>;
	};

which results in ~18ms or 19ms of encoding per frame, see gstreamer debug output below:

0:00:04.506654937  3976   0x59c2c0 DEBUG                 ducati gstducatividenc.c:879:gst_ducati_videnc_handle_frame:<ducatih264enc0> VIDENC2_process took   18438267ns (18 ms)
0:00:04.507213371  3976   0x59c2c0 LOG                   ducati gstducatividenc.c:948:gst_ducati_videnc_handle_frame:<ducatih264enc0> free buffer: 0x5e92b8
0:00:04.521476961  3976   0x59c2c0 DEBUG                 ducati gstducatividenc.c:873:gst_ducati_videnc_handle_frame: Calling VIDENC2_process
0:00:04.541183539  3976   0x59c2c0 DEBUG                 ducati gstducatividenc.c:879:gst_ducati_videnc_handle_frame:<ducatih264enc0> VIDENC2_process took   19629149ns (19 ms)
0:00:04.541911310  3976   0x59c2c0 LOG                   ducati gstducatividenc.c:948:gst_ducati_videnc_handle_frame:<ducatih264enc0> free buffer: 0x5e59a0
0:00:04.556856310  3976   0x59c2c0 DEBUG                 ducati gstducatividenc.c:873:gst_ducati_videnc_handle_frame: Calling VIDENC2_process
0:00:04.575660414  3976   0x59c2c0 DEBUG                 ducati gstducatividenc.c:879:gst_ducati_videnc_handle_frame:<ducatih264enc0> VIDENC2_process took   18727488ns (18 ms)
0:00:04.576434707  3976   0x59c2c0 LOG                   ducati gstducatividenc.c:948:gst_ducati_videnc_handle_frame:<ducatih264enc0> free buffer: 0x5e5a40
0:00:04.588280582  3976   0x59c2c0 DEBUG                 ducati gstducatividenc.c:873:gst_ducati_videnc_handle_frame: Calling VIDENC2_process
0:00:04.606655083  3976   0x59c2c0 DEBUG                 ducati gstducatividenc.c:879:gst_ducati_videnc_handle_frame:<ducatih264enc0> VIDENC2_process took   18293819ns (18 ms)
0:00:04.607092494  3976   0x59c2c0 LOG                   ducati gstducatividenc.c:948:gst_ducati_videnc_handle_frame:<ducatih264enc0> free buffer: 0x5e5860
0:00:04.621428632  3976   0x59c2c0 DEBUG                 ducati gstducatividenc.c:873:gst_ducati_videnc_handle_frame: Calling VIDENC2_process
0:00:04.639654782  3976   0x59c2c0 DEBUG                 ducati gstducatividenc.c:879:gst_ducati_videnc_handle_frame:<ducatih264enc0> VIDENC2_process took   18148395ns (18 ms)
0:00:04.641217846  3976   0x59c2c0 LOG                   ducati gstducatividenc.c:948:gst_ducati_videnc_handle_frame:<ducatih264enc0> free buffer: 0x5e5900
0:00:04.656764224  3976   0x59c2c0 DEBUG                 ducati gstducatividenc.c:873:gst_ducati_videnc_handle_frame: Calling VIDENC2_process
0:00:04.675680406  3976   0x59c2c0 DEBUG                 ducati gstducatividenc.c:879:gst_ducati_videnc_handle_frame:<ducatih264enc0> VIDENC2_process took   18839240ns (18 ms)
0:00:04.676444776  3976   0x59c2c0 LOG                   ducati gstducatividenc.c:948:gst_ducati_videnc_handle_frame:<ducatih264enc0> free buffer: 0x5e93f8
0:00:04.688566045  3976   0x59c2c0 DEBUG                 ducati gstducatividenc.c:873:gst_ducati_videnc_handle_frame: Calling VIDENC2_process
0:00:04.706682395  3976   0x59c2c0 DEBUG                 ducati gstducatividenc.c:879:gst_ducati_videnc_handle_frame:<ducatih264enc0> VIDENC2_process took   18037944ns (18 ms)
0:00:04.707250915  3976   0x59c2c0 LOG                   ducati gstducatividenc.c:948:gst_ducati_videnc_handle_frame:<ducatih264enc0> free buffer: 0x5e92b8
0:00:04.721298483  3976   0x59c2c0 DEBUG                 ducati gstducatividenc.c:873:gst_ducati_videnc_handle_frame: Calling VIDENC2_process
0:00:04.739654603  3976   0x59c2c0 DEBUG                 ducati gstducatividenc.c:879:gst_ducati_videnc_handle_frame:<ducatih264enc0> VIDENC2_process took   18277064ns (18 ms)
0:00:04.740164725  3976   0x59c2c0 LOG                   ducati gstducatividenc.c:948:gst_ducati_videnc_handle_frame:<ducatih264enc0> free buffer: 0x5e59a0
0:00:04.756789421  3976   0x59c2c0 DEBUG                 ducati gstducatividenc.c:873:gst_ducati_videnc_handle_frame: Calling VIDENC2_process
0:00:04.775659731  3976   0x59c2c0 DEBUG                 ducati gstducatividenc.c:879:gst_ducati_videnc_handle_frame:<ducatih264enc0> VIDENC2_process took   18794181ns (18 ms)
0:00:04.776250699  3976   0x59c2c0 LOG                   ducati gstducatividenc.c:948:gst_ducati_videnc_handle_frame:<ducatih264enc0> free buffer: 0x5e5a40
0:00:04.788346755  3976   0x59c2c0 DEBUG                 ducati gstducatividenc.c:873:gst_ducati_videnc_handle_frame: Calling VIDENC2_process
0:00:04.806658629  3976   0x59c2c0 DEBUG                 ducati gstducatividenc.c:879:gst_ducati_videnc_handle_frame:<ducatih264enc0> VIDENC2_process took   18230379ns (18 ms)
0:00:04.807222106  3976   0x59c2c0 LOG                   ducati gstducatividenc.c:948:gst_ducati_videnc_handle_frame:<ducatih264enc0> free buffer: 0x5e5860
0:00:04.821186064  3976   0x59c2c0 DEBUG                 ducati gstducatividenc.c:873:gst_ducati_videnc_handle_frame: Calling VIDENC2_process
0:00:04.839654912  3976   0x59c2c0 DEBUG                 ducati gstducatividenc.c:879:gst_ducati_videnc_handle_frame:<ducatih264enc0> VIDENC2_process took   18391907ns (18 ms)
0:00:04.840170402  3976   0x59c2c0 LOG                   ducati gstducatividenc.c:948:gst_ducati_videnc_handle_frame:<ducatih264enc0> free buffer: 0x5e5900

These encoding times prevent achieving 60fps for 1080p video.  Changing the "assigned-clock-rates" parameter has no effect on the encoding times.  Could someone provide a patch that fixes this?  We are uncertain of the required changeset.