# Unable to retrieve the buffer from the 3D device

**URL:** <https://aravis-project.discourse.group/t/unable-to-retrieve-the-buffer-from-the-3d-device/858>\
**Category:** Using Aravis\
**Created:** [January 17, 2025, 3:13am UTC](https://aravis-project.discourse.group/t/unable-to-retrieve-the-buffer-from-the-3d-device/858 "2025-01-17T03:13:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_syh](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/_syh/32/336_2.png) [@\_syh](https://aravis-project.discourse.group/u/_syh)\
**Post date:** [January 17, 2025, 3:13am UTC](https://aravis-project.discourse.group/t/unable-to-retrieve-the-buffer-from-the-3d-device/858/1 "2025-01-17T03:13:14Z")

</div>

Hello,

I am currently encountering some issues with 3D data acquisition and hope to get your assistance. I am using Windows 10, Visual Studio 2019, and aravis-0.8.31, attempting to acquire data from a 3D camera (hik MV-DP3060-01P)(Chunk Data) with the following code.

```auto
#include <stdlib.h>
#include <stdio.h>

#include <iostream>

#include <arv.h>
/*
 * 尝试获取 chunk data
 */

int main(int argc, char** argv)
{
	ArvCamera* camera;
	ArvBuffer* buffer;
	ArvStream* stream;
	ArvChunkParser* parser;
	ArvDevice* device;
	GError* error = NULL;

	device = arv_open_device(NULL, &error);
	if (ARV_IS_DEVICE(device)) {
		printf("Found camera '%s'\n", arv_device_get_string_feature_value(device, "DeviceVersion", &error));

		stream = arv_device_create_stream(device, NULL, NULL, &error);
		gint64 payload_size = arv_device_get_integer_feature_value(device, "PayloadSize", &error);
		arv_stream_push_buffer(stream, arv_buffer_new(payload_size, NULL));
		arv_device_execute_command(device, "AcquisitionStart", &error);  
		buffer = arv_stream_timeout_pop_buffer(stream, 2000000);  

		if (ARV_IS_BUFFER(buffer)) {
			/* Display some informations about the retrieved buffer */
			printf("Acquired buffer -- Sucessful");
			g_clear_object(&buffer);
		}
		else
		{
			printf("Acquired buffer -- Failed");
			g_clear_object(&buffer);
		}

		/* Destroy the camera instance */
		g_clear_object(&device);
	}

	if (error != NULL) {
		/* An error happened, display the correspdonding message */
		printf("Error: %s\n", error->message);
		return EXIT_FAILURE;
	}

	return EXIT_SUCCESS;
}

```

It turned out that the buffer is always NULL. I used a packet capture tool and found that there is data from the 3D camera in the GVSP packets, but I am unable to access this data by aravis.

The result is shown in the image below.

 ![3D相机](https://global.discourse-cdn.com/free1/uploads/aravis_project/original/1X/bb79a5d9a0a79bafaa2b679696f78afdc53b47ef.png)

At first, I thought the issue was with the code, so I tested it using a 2D camera. The 2D camera I used was hik(MV-CS060-10GC). In the manufacturer’s software (MVS), I enabled Chunk mode and added watermark information to switch the data to Chunk Data mode.

The result is shown in the image below.

 ![2D相机](https://global.discourse-cdn.com/free1/uploads/aravis_project/original/1X/3f86328481cce676bb7b8b62b4f2a2d48e42e682.png)

It can be observed that when using the 2D camera, the same Chunk Data and the same code can successfully retrieve the buffer.

This has left me very confused. I am unsure whether the issue lies with my code for retrieving the buffer or if there are differences between the 3D camera and the 2D camera that I am not aware of.

I sincerely look forward to receiving your response.

---

<div class="post-metadata">

**Author:** ![\_syh](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/_syh/32/336_2.png) [@\_syh](https://aravis-project.discourse.group/u/_syh)\
**Post date:** [January 18, 2025, 6:42am UTC](https://aravis-project.discourse.group/t/unable-to-retrieve-the-buffer-from-the-3d-device/858/2 "2025-01-18T06:42:46Z")

</div>

I have used arv-debug=all and found the following problem. How should I deal with this situation？The Aravis routine: arv-chunk-parser-test was used. The results are as follows

 ![3D](https://global.discourse-cdn.com/free1/uploads/aravis_project/original/1X/ee3d61774a19b90b617e6f1b6ddaec788f0d07db.png)

---

<div class="post-metadata">

**Author:** ![eudoxos](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/eudoxos/32/116_2.png) [@eudoxos](https://aravis-project.discourse.group/u/eudoxos)\
**Post date:** [March 17, 2025, 12:07pm UTC](https://aravis-project.discourse.group/t/unable-to-retrieve-the-buffer-from-the-3d-device/858/3 "2025-03-17T12:07:42Z")

</div>

Look into the internals of Aravis here:

> <https://github.com/AravisProject/aravis/blob/90c2fe44d34dd21dfee077e7229ba81bceff9023/src/arvgvdevice.c#L695>

It is a failure at packed size autodetection. You can try disabling it by setting the `packet-size-adjustment` property on the device, to see if that makes any difference.

Inspect also what the camera has in GevSCPSPacketSize, to see why the condition fails — genicam XML dump of the camera could be rather useful for this.

---

<div class="post-metadata">

**Author:** ![\_syh](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/_syh/32/336_2.png) [@\_syh](https://aravis-project.discourse.group/u/_syh)\
**Post date:** [March 28, 2025, 6:54am UTC](https://aravis-project.discourse.group/t/unable-to-retrieve-the-buffer-from-the-3d-device/858/4 "2025-03-28T06:54:41Z")

</div>

I really appreciate you taking the time to respond to my question. The issue has now been resolved—it was caused by a data conversion error when retrieving “ArvGevSCPSPacketSize” at a certain point.
