# nvidia tx2 camera capture timeout

**URL:** <https://forums.developer.nvidia.com/t/nvidia-tx2-camera-capture-timeout/57941>\
**Category:** Jetson TX2\
**Created:** [February 7, 2018, 2:31am UTC](https://forums.developer.nvidia.com/t/nvidia-tx2-camera-capture-timeout/57941 "2018-02-07T02:31:50Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![cloundliu](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@cloundliu](https://forums.developer.nvidia.com/u/cloundliu)\
**Post date:** [February 7, 2018, 2:31am UTC](https://forums.developer.nvidia.com/t/nvidia-tx2-camera-capture-timeout/57941/1 "2018-02-07T02:31:50Z")

</div>

Hi,

I’m currently developing a camera driver on TX2. Before doing this job, I’ve successfully developed this driver for the Jetson TX1 development kit, so I thought it would be a straightforward job.

However, I was stuck at some errors. When I use yavta tools to test stability，but occasionally, some  
problems occured as follows:

```auto
[42.192947] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[43.196973] tegra-vi4 15700000.vi: ATOMP_FE syncpt timeout!

```

By reading TX1‘s VI driver, I found that there is a error recovery mechanism as follows:

```auto
/* Arm capture and wait for notifier or syncpoint */
err = chan->fops->soc_channel_capture_frame(chan, &ts, thresh);
if (err) {
        state = VB2_BUF_STATE_ERROR;
        /* perform error recovery for timeout */
        tegra_channel_ec_recover(chan);
} else if (!chan->vi->pg_mode) {

```

But this disappear on TX2.

```auto
for (i = 0; i < chan->valid_ports; i++) {
                err = nvhost_syncpt_wait_timeout_ext(chan->vi->ndev,
                                chan->syncpt[i][SOF_SYNCPT_IDX], thresh[i],
                                250, NULL, NULL);
                if (unlikely(err))
                        dev_err(chan->vi->dev,
                                "PXL_SOF syncpt timeout! err = %d\n", err);
                else {
                        struct vi_capture_status status;

                        err = vi_notify_get_capture_status(chan->vnc[i],
                                        chan->vnc_id[i],
                                        thresh[i], &status);
                        if (unlikely(err))
                                dev_err(chan->vi->dev,
                                        "no capture status! err = %d\n", err);
                        else
                                *ts = ns_to_timespec((s64)status.sof_ts);
                }
        }

```

So It runs well on TX1, but unstable on TX2.

thanks.

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [February 7, 2018, 3:27am UTC](https://forums.developer.nvidia.com/t/nvidia-tx2-camera-capture-timeout/57941/2 "2018-02-07T03:27:34Z")

</div>

＠cloundliu  
Please make sure the MIPI output is match the spec and find tun the settle time by modify the T18X\_BYPASS\_LP\_SEQ as 0 \<\< 7 and DEFAULT\_THS\_SETTLE from 0x1 - 0x7f find the detail information from the TRM.

#define T18X\_BYPASS\_LP\_SEQ (0x1 \<\< 7)  
#define DEFAULT\_THS\_SETTLE (0x14 \<\< 0)

…/./camera/csi/csi4\_registers.h

---

<div class="post-metadata">

**Author:** ![cloundliu](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@cloundliu](https://forums.developer.nvidia.com/u/cloundliu)\
**Post date:** [February 8, 2018, 1:38am UTC](https://forums.developer.nvidia.com/t/nvidia-tx2-camera-capture-timeout/57941/3 "2018-02-08T01:38:01Z")

</div>

Hi ShaneCCC,

I have checked the MIPI output, it is match the spec.  
I have modified the settle time, and the situation remains. Sometimes it will run 2 hours more, sometimes it just a few minutes. But when I restart the capture test, It will run a period of time.  
So maybe we should add a error recovery mechanism like TX1, I will do this.

thanks.

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [February 8, 2018, 3:40am UTC](https://forums.developer.nvidia.com/t/nvidia-tx2-camera-capture-timeout/57941/4 "2018-02-08T03:40:57Z")

</div>

@cloundliu  
We are going to implement it.

---

<div class="post-metadata">

**Author:** ![cloundliu](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@cloundliu](https://forums.developer.nvidia.com/u/cloundliu)\
**Post date:** [February 11, 2018, 5:44am UTC](https://forums.developer.nvidia.com/t/nvidia-tx2-camera-capture-timeout/57941/5 "2018-02-11T05:44:06Z")

</div>

@ShaneCCC  
When will the patch be ready?

---

<div class="post-metadata">

**Author:** ![cloundliu](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@cloundliu](https://forums.developer.nvidia.com/u/cloundliu)\
**Post date:** [May 31, 2018, 3:24am UTC](https://forums.developer.nvidia.com/t/nvidia-tx2-camera-capture-timeout/57941/6 "2018-05-31T03:24:49Z")

</div>

@ShaneCCC

Have you add a error recovery mechanism for TX2?

thanks

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [May 31, 2018, 3:29am UTC](https://forums.developer.nvidia.com/t/nvidia-tx2-camera-capture-timeout/57941/7 "2018-05-31T03:29:55Z")

</div>

Yes, next release will have it.

---

<div class="post-metadata">

**Author:** ![cloundliu](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@cloundliu](https://forums.developer.nvidia.com/u/cloundliu)\
**Post date:** [May 31, 2018, 3:42am UTC](https://forums.developer.nvidia.com/t/nvidia-tx2-camera-capture-timeout/57941/8 "2018-05-31T03:42:19Z")

</div>

@ShaneCCC

How long does it take？

Another question:

```auto
void tegra_channel_ring_buffer(struct tegra_channel *chan,
                               struct vb2_v4l2_buffer *vb,
                               struct timespec *ts, int state)
{
...
         /* release buffer N at N+2 frame start event */
         if (chan->num_buffers >= (QUEUED_BUFFERS - 1))
                 free_ring_buffers(chan, 1);

```

I know you had the buffer release mechanism to avoid multiple race conditions as shown above, it is expected that queue 2 frames in the ring buffer， but it will increase the capture-to-display time delay, approximately 1 frame(for 30fps camera is 33.3ms), So could you have some patch to improve this on TX2(R28.1/R28.2)?

thanks.

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [May 31, 2018, 7:00am UTC](https://forums.developer.nvidia.com/t/nvidia-tx2-camera-capture-timeout/57941/9 "2018-05-31T07:00:31Z")

</div>

28.2 already have improve please check 28.2

---

<div class="post-metadata">

**Author:** ![zhaozoz](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@zhaozoz](https://forums.developer.nvidia.com/u/zhaozoz)\
**Post date:** [June 12, 2018, 2:23am UTC](https://forums.developer.nvidia.com/t/nvidia-tx2-camera-capture-timeout/57941/10 "2018-06-12T02:23:34Z")

</div>

@ShaneCCC:

Is there any patch for the error recovery mechanism for TX2?

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [June 12, 2018, 3:05am UTC](https://forums.developer.nvidia.com/t/nvidia-tx2-camera-capture-timeout/57941/11 "2018-06-12T03:05:34Z")

</div>

@zhaozoz  
Should be release in next version.
