Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teledyne Z-Trak L2PC: payloadSize is miscalculated, due to Genicam standard violation #964

Open
bishoy-g opened this issue Nov 28, 2024 · 3 comments
Labels
1. Device support 5. Genicam Issue in Genicam implementation

Comments

@bishoy-g
Copy link

Describe the bug
When trying to retrieve the PayloadSize (arv_camera_get_payload) using a certain camera (Teledyne Z-Trak L2PC), I always get 0. We have multiple camera models from Teledyne and other makers and all of them report a correct value except this specific model. We have 4 cameras of this model and the behavior is the same. We contacted the manufacturer but they could not help because the payload size is reported correctly in their acquisition software when viewing the features tree and nodes.

To Reproduce
I am attaching the camera's geni features schema xml and hope it can be useful to reproduce. I get the 0 payload size from the arv-camera-test as well and not only from our application.

Expected behavior
A size that is larger than 0 to represent the payload size according the expression formula

Camera description:

  • Manufacturer: Teledyne
  • Model: Z-Trak L2PC
  • Interface: Ethernet 1Gb

Platform description:

  • Aravis version 0.8.0
  • OS: Ubuntu 20.04
  • Hardware: x64

Attachment:
features_ztrack.txt

Thank you for your support and for all the efforts put into this library.

@EmmanuelP EmmanuelP added 1. bug Problems, incorrect behavior or appearance 5. Genicam Issue in Genicam implementation 2. Needs informations Needs additional informations labels Nov 29, 2024
@EmmanuelP
Copy link
Contributor

Hi,

Thanks for the report. Could you attach the output of arv-camera-test-0.8 -d evaluator:4 ?

@bishoy-g
Copy link
Author

Hi Emmanuel,

Thanks for the prompt reply, please find the attached output as requested. Seems like there is an error in parsing the expression by the evaluator.

evaluator_output.txt

@EmmanuelP EmmanuelP removed the 2. Needs informations Needs additional informations label Nov 29, 2024
@EmmanuelP
Copy link
Contributor

EmmanuelP commented Nov 29, 2024

It looks like the IntSwissKnife node is incorrect wrt the Genicam standard. Page 40 of https://www.emva.org/wp-content/uploads/GenICam_Standard_v2_1_1.pdf :

The SwissKnife syntax has some extensions: You can use named constants using the
Constant entry and named sub expressions using the Expression entry as shown in the
following example. The sub expressions may not refer to other sub expressions.

The definition of PayloadSize for this camera is:

      <IntSwissKnife Name="PayloadSizeVal">
         <pVariable Name="PACKET_SIZE">pGevSCPSPacketSizeReg</pVariable>
         <pVariable Name="PIXEL_SIZE">PixelSizeVal</pVariable>
         <pVariable Name="WIDTH">width_user_space</pVariable>
         <pVariable Name="HEIGHT">Height_Convertor</pVariable>
         <pVariable Name="MAX_CHUNK_SIZE">max_chunk_size</pVariable>
         <pVariable Name="IS_AREASCAN">isAreascan</pVariable>
         <pVariable Name="POINTS_PER_PROFILE_WITH_METADATA">width_linescan3d_metadata</pVariable>
         <pVariable Name="PROFILES_PER_SCAN">profilesPerScan_Val</pVariable>
         <Expression Name="DATA_PACKET_SIZE">PACKET_SIZE - 48</Expression>
         <Expression Name="NUM_PIXELS_AREASCAN">WIDTH * HEIGHT</Expression>
         <Expression Name="NUM_PIXELS_LINESCAN">POINTS_PER_PROFILE_WITH_METADATA * PROFILES_PER_SCAN</Expression>
         <Expression Name="DATA_SIZE">((IS_AREASCAN ? NUM_PIXELS_AREASCAN : NUM_PIXELS_LINESCAN) * PIXEL_SIZE / 8)</Expression>
         <!-- #elif //def AVAILABLE -->
         <!--<Expression Name="DATA_SIZE">((IS_AREASCAN ? NUM_PIXELS_AREASCAN : NUM_PIXELS_LINESCAN) * PIXEL_SIZE / 8) + ((CHUNK_MODE) ? MAX_CHUNK_SIZE : 0)</Expression>-->
         <Formula>((DATA_SIZE / DATA_PACKET_SIZE) + ((DATA_SIZE % DATA_PACKET_SIZE) ? 1 : 0)) * DATA_PACKET_SIZE</Formula>
         <Representation>Linear</Representation>
      </IntSwissKnife>

DATA_SIZE makes use of NUM_PIXELS_AREASCAN and NUM_PIXELS_LINESCAN.

Aravis is checking for use of sub-expression from a sub-expression and throws an error if it happens:

aravis/src/arvevaluator.c

Lines 1046 to 1062 in c07e8be

if (sub_expression != NULL) {
char *string;
if (state->in_sub_expression) {
status = ARV_EVALUATOR_STATUS_FORBIDDEN_RECUSRION;
goto CLEANUP;
}
string = g_strdup_printf ("(%s)", sub_expression);
state->in_sub_expression = TRUE;
status = parse_to_stacks (evaluator, string, state);
state->in_sub_expression = FALSE;
g_free (string);
if (status != ARV_EVALUATOR_STATUS_SUCCESS) {
goto CLEANUP;
}

@EmmanuelP EmmanuelP added 1. Device support and removed 1. bug Problems, incorrect behavior or appearance labels Nov 29, 2024
@EmmanuelP EmmanuelP changed the title PayloadSize is zero for a certain camera, possible bug in expression calculation Teledyne Z-Trak L2PC: payloadSize is miscalculated, due to Genicam standard violation Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. Device support 5. Genicam Issue in Genicam implementation
Projects
None yet
Development

No branches or pull requests

2 participants