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.

AM62A7: 10 sdk: Multi Channel Demo does not work

Part Number: AM62A7

Tool/software:

The Multi Channel EdgeAI demo does not work on the latest 10.00.00 release (https://www.ti.com/tool/download/PROCESSOR-SDK-LINUX-AM62A) running on the am62a7 evm. Clicking on the Multi Channel button to launch the demo causes the screen to freeze and the demo does not appear to work. All other demos seem to work fine.

tisdk-edgeai-image-am62a-evm.wic.xz checksum: 09e0447375538a3db12201bc441958cf

Board: am62a SKEVM - HSFS

  • Hi Joshua,

    It is our pleasure to help. I was able to reproduce the issue. We investigating this issue. I will get back to you. 

    Best regards,

    Qutaiba

  • Hello Qutaiba,

        I wanted to check in and see if there has been any update with this.

    Thank you,

        Joshua Bourgeot

  • Hi Joshua,

    Sorry for taking this long time and thank you for checking. Our sdk team is working on it. I will get back to you when I have an update. 

    Thanks for your understanding. 

    Best regards,

    Qutaiba

  • Hello Joshua,

    It seems that this issue is caused by software bug related to the video decode which is used to read the pre-recorded videos in the demo. The attached patches should solve the issue.

    Apply the patches to the Linux SDK 10.0 for AM62A then build the Linux SDK from the top-level makefile. The SDK documentation provide more details about the process: https://software-dl.ti.com/processor-sdk-linux/esd/AM62AX/10_00_00/exports/docs/linux/Overview_Top_Level_Makefile.html

    Please note that you don't need to build the entire SDK. Just the Linux part with:

    host# make linux

    host# make linux_install

    Thank you for your patience.

    Best regards,

    Qutaiba

    diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
    index d0d3d3c23640..edfc4522945b 100644
    --- a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
    +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
    @@ -1667,18 +1667,12 @@ static void wave5_vpu_dec_stop_streaming(struct vb2_queue *q)
     
     	while (check_cmd) {
     		struct queue_status_info q_status;
    -		struct dec_output_info dec_output_info;
     
     		wave5_vpu_dec_give_command(inst, DEC_GET_QUEUE_STATUS, &q_status);
     
     		if (q_status.report_queue_count == 0)
     			break;
     
    -		if (wave5_vpu_wait_interrupt(inst, VPU_DEC_TIMEOUT) < 0)
    -			break;
    -
    -		if (wave5_vpu_dec_get_output_info(inst, &dec_output_info))
    -			dev_dbg(inst->dev->dev, "Getting decoding results from fw, fail\n");
     	}
     
     	v4l2_m2m_update_stop_streaming_state(m2m_ctx, q);
    diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu.c b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
    index 98fa9873e6f6..e3193774eb8b 100644
    --- a/drivers/media/platform/chips-media/wave5/wave5-vpu.c
    +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
    @@ -50,6 +50,7 @@ static void wave5_vpu_handle_irq(void *dev_id)
     	u32 seq_done;
     	u32 cmd_done;
     	u32 irq_reason;
    +	u32 irq_subreason;
     	struct vpu_instance *inst;
     	struct vpu_device *dev = dev_id;
     
    @@ -76,7 +77,13 @@ static void wave5_vpu_handle_irq(void *dev_id)
     		    irq_reason & BIT(INT_WAVE5_ENC_PIC)) {
     			if (cmd_done & BIT(inst->id)) {
     				cmd_done &= ~BIT(inst->id);
    -				wave5_vdi_write_register(dev, W5_RET_QUEUE_CMD_DONE_INST,
    +				if (dev->irq < 0) {
    +					irq_subreason = wave5_vdi_read_register(dev, W5_VPU_VINT_REASON);
    +					if (!(irq_subreason & BIT(INT_WAVE5_DEC_PIC)))
    +						wave5_vdi_write_register(dev, W5_RET_QUEUE_CMD_DONE_INST,
    +									cmd_done);
    +				} else
    +					wave5_vdi_write_register(dev, W5_RET_QUEUE_CMD_DONE_INST,
     							 cmd_done);
     				inst->ops->finish_process(inst);
     			}
    
    diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
    index edfc4522945b..14a7f83850bb 100644
    --- a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
    +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
    @@ -475,6 +475,7 @@ static void wave5_vpu_dec_finish_decode(struct vpu_instance *inst)
     		disp_buf->field = V4L2_FIELD_NONE;
     		dst_vpu_buf->display = true;
     		v4l2_m2m_buf_done(disp_buf, VB2_BUF_STATE_DONE);
    +		inst->queued_buf_count--;
     
     		dev_dbg(inst->dev->dev, "%s: frame_cycle %8u (payload %lu)\n",
     			__func__, dec_info.frame_cycle,
    @@ -1610,6 +1611,7 @@ static int streamoff_output(struct vb2_queue *q)
     
     	/* streamoff on output cancels any draining operation */
     	inst->eos = false;
    +	inst->queued_buf_count = 0;
     
     	return 0;
     }
    @@ -1670,7 +1672,9 @@ static void wave5_vpu_dec_stop_streaming(struct vb2_queue *q)
     
     		wave5_vpu_dec_give_command(inst, DEC_GET_QUEUE_STATUS, &q_status);
     
    -		if (q_status.report_queue_count == 0)
    +		if (q_status.report_queue_count == 0 &&
    +		    q_status.instance_queue_count == 0 &&
    +		    (inst->queued_buf_count-COMMAND_QUEUE_DEPTH) <= 0)
     			break;
     
     	}
    @@ -1862,8 +1866,10 @@ static void wave5_vpu_dec_device_run(void *priv)
     			inst->retry = true;
     		} else {
     			inst->retry = false;
    -			if (!inst->eos)
    +			if (!inst->eos) {
     				inst->queuing_num--;
    +				inst->queued_buf_count++;
    +			}
     		}
     		break;
     	default:
    diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpuapi.h b/drivers/media/platform/chips-media/wave5/wave5-vpuapi.h
    index eab411e560ad..147ff5c39e28 100644
    --- a/drivers/media/platform/chips-media/wave5/wave5-vpuapi.h
    +++ b/drivers/media/platform/chips-media/wave5/wave5-vpuapi.h
    @@ -854,6 +854,7 @@ struct vpu_instance {
     	bool eos;
     	bool retry;
     	int queuing_num;
    +	int queued_buf_count;
     	struct mutex feed_lock; /* lock for feeding bitstream buffers */
     	struct vpu_buf bitstream_vbuf;
     	dma_addr_t last_rd_ptr;
    

  • Hello Qutaiba,

        This resolved the issue, thank you. Do you have an estimate when this patch will be included in the linux-ti repository?

    Thank you,

        Joshua Bourgeot

  • Hello Qutaiba,

         Thank you for the info. I have been testing the multi channel demo and while it appears to be working completely correct, I did see this CPU warning once. It does not appear to be frequant, nor does it seem to effect the actual demo, however as the call trace includes functions that were updated in the patch, I wanted to bring it to your attention.

    Here is the log snippet:

    ------------[ cut here ]------------
    Execution of a job in state STOP illegal.
    WARNING: CPU: 2 PID: 420 at drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c:1865 wave5_vpu_dec_device_run+0x94/0x7f8 [wave5]
    Modules linked in: overlay xhci_plat_hcd cdns_csi2rx rpmsg_ctrl v4l2_fwnode rpmsg_char dwc3 cfg80211 snd_soc_tlv320aic26 bluetooth ecdh_generic ecc rfkill snd_soc_simple_card6
    CPU: 2 PID: 420 Comm: kworker/2:3 Not tainted 6.6.32-01342-g30486aff224a-dirty #107
    Hardware name: Critical Link MitySOM-AM62A (DT)
    Workqueue: events v4l2_m2m_device_run_work [v4l2_mem2mem]
    pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
    pc : wave5_vpu_dec_device_run+0x94/0x7f8 [wave5]
    lr : wave5_vpu_dec_device_run+0x94/0x7f8 [wave5]
    sp : ffff800082a5bcd0
    x29: ffff800082a5bcd0 x28: ffff00080a57c000 x27: ffff800081837000
    x26: ffff0008054f3dc0 x25: ffff0008054f3d80 x24: ffff00080005a405
    x23: ffff000803719228 x22: ffff000976fd7fc0 x21: ffff00080a57dca0
    x20: ffff00080a57d000 x19: 0000000000000000 x18: ffffffffffffffff
    x17: 0000000000000000 x16: 0000000000000000 x15: ffff800102a5b907
    x14: 0000000000000000 x13: 2e6c6167656c6c69 x12: 20504f5453206574
    x11: 617473206e692062 x10: ffff8000818ac988 x9 : ffff8000801a6b20
    x8 : 00000000ffffefff x7 : ffff8000818ac988 x6 : 0000000000000000
    x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000000
    x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff00080571b900
    Call trace:
     wave5_vpu_dec_device_run+0x94/0x7f8 [wave5]
     v4l2_m2m_try_run+0x8c/0x150 [v4l2_mem2mem]
     v4l2_m2m_device_run_work+0x1c/0x30 [v4l2_mem2mem]
     process_one_work+0x148/0x388
     worker_thread+0x338/0x450
     kthread+0x120/0x130
     ret_from_fork+0x10/0x20
    ---[ end trace 0000000000000000 ]---
    

    Thank you, 

        Joshua Bourgeot

  • Joshua,

    Thank you for sharing this feedback. We appreciate it. 

    Bests,

    Qutaiba