# How to restart after "control-lost" signal

**URL:** https://aravis-project.discourse.group/t/how-to-restart-after-control-lost-signal/109
**Category:** Using Aravis
**Created:** [June 4, 2020, 12:14pm UTC](https://aravis-project.discourse.group/t/how-to-restart-after-control-lost-signal/109 "2020-06-04T12:14:16Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![mirco](https://avatars.discourse-cdn.com/v4/letter/m/9e8a1a/32.png) [@mirco](https://aravis-project.discourse.group/u/mirco)
#### Post date: [June 4, 2020, 12:14pm UTC](https://aravis-project.discourse.group/t/how-to-restart-after-control-lost-signal/109/1 "2020-06-04T12:14:16Z")

</div>

Hello,  
how can I restart my gige camera after “control-lost” signal.  
What I’m doing now is calling:

- arv\_camera\_stop\_acquisition (arvcam-\>camera);
- g\_object\_unref (arvcam-\>stream);
- g\_object\_unref (arvcam-\>camera);  
then restarting all from beginnning:
- arvcam-\>camera = arv\_camera\_new (arv\_get\_device\_id (id));
- arvcam-\>stream = arv\_camera\_create\_stream (arvcam-\>camera, NULL, NULL);
- arv\_stream\_push\_buffer (arvcam-\>stream, arv\_buffer\_new (payload, NULL));
- arv\_camera\_start\_acquisition (arvcam-\>camera);  
(plus other secondary settings…)

The camera seems to work fine: param setting, soft trigger…  
but  
buffer = arv\_stream\_timeout\_pop\_buffer (arvcam-\>stream,timeout);  
always return buffer==NULL;

Any advice?

---

<div class="post-metadata">

### Author: ![Emmanuel](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/emmanuel/32/198_2.png) [@Emmanuel](https://aravis-project.discourse.group/u/Emmanuel)
#### Post date: [June 4, 2020, 2:08pm UTC](https://aravis-project.discourse.group/t/how-to-restart-after-control-lost-signal/109/2 "2020-06-04T14:08:30Z")

</div>

Hi Mirco,

Which version of aravis are you using ?

There is a reference leak in 0.7.4 that prevents the disconnection of the camera. Does the acquisition work if you wait for 10 or 20 seconds after the control-lost signal ?

---

<div class="post-metadata">

### Author: ![mirco](https://avatars.discourse-cdn.com/v4/letter/m/9e8a1a/32.png) [@mirco](https://aravis-project.discourse.group/u/mirco)
#### Post date: [June 4, 2020, 2:19pm UTC](https://aravis-project.discourse.group/t/how-to-restart-after-control-lost-signal/109/3 "2020-06-04T14:19:27Z")

</div>

Hi Emmanuel,  
I’m using version 0.6.4 with a DFK 39 TIS camera.  
The signal “control lost” is due to a breakpoint stop while debugging,  
and if I wait some seconds into the breakpoint the acquisition doesn’t restart (I’m using soft-trigger in TriggerMode)

---

<div class="post-metadata">

### Author: ![Emmanuel](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/emmanuel/32/198_2.png) [@Emmanuel](https://aravis-project.discourse.group/u/Emmanuel)
#### Post date: [July 31, 2020, 6:42am UTC](https://aravis-project.discourse.group/t/how-to-restart-after-control-lost-signal/109/4 "2020-07-31T06:42:34Z")

</div>

Hi mirco,

Try to increase the heartbeat timeout (GevHeartbeatTimeout feature) and set it to a value that lets you enough time before you resume the execution of your software.

---

<div class="post-metadata">

### Author: ![Tshoes](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/tshoes/32/51_2.png) [@Tshoes](https://aravis-project.discourse.group/u/Tshoes)
#### Post date: [September 9, 2020, 8:19am UTC](https://aravis-project.discourse.group/t/how-to-restart-after-control-lost-signal/109/5 "2020-09-09T08:19:05Z")

</div>

Hi Emmanuel  
I’m very interesting in method to increase the heartbeat timeout.But I don’t know how to use API for GevHeartbeatTimeout feature,Could you give me an example or link to show how to call some function to increase the heartbeat timeout.  
Look forward your reply, Thanks!

---

<div class="post-metadata">

### Author: ![Emmanuel](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/emmanuel/32/198_2.png) [@Emmanuel](https://aravis-project.discourse.group/u/Emmanuel)
#### Post date: [October 7, 2020, 6:58am UTC](https://aravis-project.discourse.group/t/how-to-restart-after-control-lost-signal/109/6 "2020-10-07T06:58:21Z")

</div>

Hi,

Sorry for the late reply.

> [@Tshoes](#):
>
> I’m very interesting in method to increase the heartbeat timeout.But I don’t know how to use API for GevHeartbeatTimeout feature,Could you give me an example or link to show how to call some function to increase the heartbeat timeout.

You may try:

```auto
arv_camera_set_integer (camera, "GevHeartbeatTimeout", your_timeout_ms, NULL);

```

If GevHeartbeatTimeout is not a defined feature on your camera, you may try to access the register directly:

```auto
ArvDevice *device;

device = arv_camera_get_device (camera);
arv_device_write_register (device, 0x938, your_timeout_ms, NULL);

```

I’m not sure if this register is supposed to always have read/write access though.

Cheers,

```
Emmanuel.

```
