TDA4VEN-Q1: wave5 decoder driver occur error

Part Number: TDA4VEN-Q1


Tool/software:

sdk ver: ti-processor-sdk-rtos-j722s-evm-11_00_00_06
When I running this demo: ./vx_app_multi_cam_codec.out --cfg ./app_multi_cam_codec.cfg, it occurred  codec driver errors, errors as follow:

app_multi_cam_codec.cfg existed some changes:  changes as follow:

en_encode 0
is_interactive 0
Besides, I using the gst command 'filesrc location=./output_encoder.h264 num-buffers=29 ! queue ! h264parse ! v4l2h264dec ! videoconvert ! video/x-raw,format=NV12 ! tiovxmemalloc pool-size=15 ! appsink name=testappsink drop=true wait-on-eos=false max-buffers=4',
the same error was ocurred.
What are the possible reasons for the decoder's driver error mentioned above?
  • Hi 

    Please provide this output_encoder.h264 you used in this command:

    filesrc location=./output_encoder.h264 num-buffers=29 ! queue ! h264parse ! v4l2h264dec

    Regards,

    Adam

  • Hi Adam,

    Firstly, thank you for your prompt response

     output_encoder.h264 was obtained by intercepting the first 30 frames using the following command:

           

    ffmpeg -i /opt/vision_apps/test_data/psdkra/app_multi_cam_codec/TI_Custom_1920x1080_5secs.264 -frames:v 30 output_encoder.h264

        when I use this command'gst-launch-1.0 filesrc location=./output_encoder.h264 num-buffers=30 ! queue max-size-buffers=4 ! h264parse ! v4l2h264dec ! queue max-size-buffers=4 ! videoconvert ! video/x-raw,format=NV12 ! tiovxmemalloc pool-size=15 ! filesink location=./v4l2_tiovx_decode.yuv', hw decoder can work, but the decoder driver encounters the following error:

    In addition, my decoding input is 30 frames and the output is only 20 frames(expecting 30 frames), and there is a problem with the 19th frame output. The image of the 19th frame is as follows:


    When I use the v4l2 interface to directly operate the decoding driver instead of using gstreamer, the decoding does not work at all. v4l2 is configured with 4 buffer requests for decoding input and output(VIDIOC_REQBUFS reqbuf.count=4), and the driver error is as follows:

  • Hi 

    It will be very beneficial if you share your stream with us "output_encoder.h264". It will help us reproduce your issue on our side. 

    When I use the v4l2 interface to directly operate the decoding driver instead of using gstreamer

    Please try this demo:

    https://github.com/TexasInstruments/edgeai-tiovx-apps/blob/bb50f5ab5765f9b634cd40d744399dcbce296c52/tests/app_tiovx_linux_decode_display_test.c 

    Regards,

    Adam

  • Hi
    I have tested this demo(pipeline: h264_file->decoder->mosaic->display), but it cannot run properly due to the lack of 'tidss' device nodes

    I try insmod tidss.ko, but it can not work, how to load tidss's device node(which locate in /dev/dri/) correctly.


    Regards

    Yu Yun

  • Hi, 

    In order to run the decoding function correctly(not use display node), I modified the pipeline to h264_file->decoder->mosaic->yuv_file in  app_tiovx_linux_decode_display_test.c , decoder can work well. After comparing this demo with the operation decoding driver code I wrote myself using v4l2, I found that the difference lies in the number of buffer requests for decoding output(V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)

    After multiple attempts, it was found that when the number of buffer requests for V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE is less than 12, the decoding driver will experience a panic, panic as follow:

    I think this is a bug for decoder's driver, and the app is not aware that there is a limit on the number of V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE buffers that can be applied for.
    In order to the decoder can work well, I temporarily changed the number of decoder's output buffers to 12.


    Regards

  • Hi,

    I will review this with the development team to let them know and bring this up to our IP vendor if needed.

    Thanks,
    Sarabesh S.

  • Hello Yu Yun, 

    I tested the app_multi_cam_codec demo on 11.01 Linux + RTOS and was able to run the demo capture->encode to decode->display pipeline without the app crashing. There are some performance issues I see with low framerate but you should be able to run the demo without issue. Please ensure you are following all the steps of the Vision-Apps setup guide (here). 

    Let me know if you are still seeing errors from the out of box image. If you are making changes please share them so I can apply the patches. Keep in mind this is a demo not a production level product. There may be bugs and limitations to this demo that can't be resolved due to limitations in the software design.

    I see   shared the edge-ai stack for v4l2-decoding. This can be a possible option but I have not yet verified this on the J722s EVM yet. If you are planning to use the edge-ai demos, most of these are disabled by default in the build. You would need to enable them by modifying the following: https://github.com/TexasInstruments/edgeai-tiovx-apps/blob/bb50f5ab5765f9b634cd40d744399dcbce296c52/tests/main.c#L85

    After enabling, you need to recompile edgeai-tiovx-apps-test for the tests to be included (can be done on target) - https://github.com/TexasInstruments/edgeai-tiovx-apps/tree/develop?tab=readme-ov-file#steps-to-compile

    Thanks,
    Sarabesh S.

  • Hi,

          There maybe exist a limit on the number of V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE buffers,you can use this patch to test it.

       

    diff --git a/modules/src/v4l2_decode_module.c b/modules/src/v4l2_decode_module.c
    index f07d70f..8c3bf1c 100644
    --- a/modules/src/v4l2_decode_module.c
    +++ b/modules/src/v4l2_decode_module.c
    @@ -206,7 +206,8 @@ int v4l2_decode_request_capture_buffers(v4l2DecodeHandle *handle)
         int status = 0;
     
         CLR(&req);
    -    req.count = handle->cfg.bufq_depth + V4L2_DECODE_MAX_BUFQ_DEPTH_OFFSET;
    +    // req.count = handle->cfg.bufq_depth + V4L2_DECODE_MAX_BUFQ_DEPTH_OFFSET;
    +    req.count = 9; // this buffer's count less than 12 which lead to decoder's driver crash
         req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
         req.memory = V4L2_MEMORY_DMABUF;
     
    diff --git a/tests/main.c b/tests/main.c
    index a5a85e9..c9d5be1 100644
    --- a/tests/main.c
    +++ b/tests/main.c
    @@ -82,7 +82,7 @@
     #define APP_MODULES_TEST_DISPLAY (0)
     #define APP_MODULES_TEST_V4L2_CAPTURE (0)
     #define APP_MODULES_TEST_LINUX_CAPTURE_DISPLAY (0)
    -#define APP_MODULES_TEST_LINUX_DECODE_DISPLAY (0)
    +#define APP_MODULES_TEST_LINUX_DECODE_DISPLAY (1)
     #define APP_MODULES_TEST_LINUX_CAPTURE_ENCODE (0)
     #define APP_MODULES_TEST_LINUX_MULTI_CAPTURE_DISPLAY (0)
     #define APP_MODULES_TEST_LINUX_RGB_IR_DISPLAY (0)

    Regards