Skip to content

Add time synchronization support for Basler Ace USB cameras and update default scene#3

Open
bj-s wants to merge 2 commits intoEuropean-XFEL:mainfrom
bj-s:feat/baslerusbcamera_and_updatedefaultscene
Open

Add time synchronization support for Basler Ace USB cameras and update default scene#3
bj-s wants to merge 2 commits intoEuropean-XFEL:mainfrom
bj-s:feat/baslerusbcamera_and_updatedefaultscene

Conversation

@bj-s
Copy link

@bj-s bj-s commented Dec 16, 2025

This request addresses two improvements:

  1. It introduces time synchronization support for Basler Ace USB cameras. So far this feature was only support for Basler Ace Ethernet Cameras. Here the support is added by introducing a new device class for Basler Usb cameras AravisBaslerUsbCamera which is slightly modified variant of AravisBaslerCamera. It might be also possible to address the changes in a common class that in itself recognizes whether a USB oder Ethernet camera is connected und thus applies the appropriate commands.

  2. It updates the default scene with limited float precision for the displayed latency / frame rate and add ability to enable/disable trigger mode besides the trigger input selection

previous scene
Screenshot 2025-12-09 at 21 19 12

updated scene
Screenshot 2025-12-09 at 21 05 21

@aparenti
Copy link
Contributor

First of all thanks for this contribution!

The base class AravisCamera has a variable m_is_gv_device which is true for GEV cameras and false for the USB3 ones. It can also handle both classes thus we don't need a separate class, but just to properly handle the time stamping.

Now that I have seen your code it should not be too difficult. The only problem on my side is that I don't have any camera for testing, but likely we can arrange it somehow that you do the test.

Copy link
Contributor

@aparenti aparenti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me there are not so many USB-specific lines. It shouldn't be difficult to merge them into the generic Basler device.

.commit();

INT32_ELEMENT(expected)
.key("tickFrequency")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me to understand in what this class differs from the standard one, this is a device property you added for USB cameras, but the other ones are exactly the same. Is it correct?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

const std::string message("Timestamp synchronization loss -> reset timestamp");
KARABO_LOG_WARN << message;
this->set("status", message);
arv_camera_execute_command(m_camera, "TimestampReset", nullptr);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also differs for the USB case

// Get current timestamp on the camera.
// It has been verified on an acA640-120gm that this takes 1 ms ca.,
// thus this is the precision we can aim to in the synchronization.
arv_camera_execute_command(m_camera, "TimestampLatch", &error);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one too

// thus this is the precision we can aim to in the synchronization.
arv_camera_execute_command(m_camera, "TimestampLatch", &error);
if (error == nullptr) {
m_reference_camera_timestamp = arv_camera_get_integer(m_camera, "TimestampLatchValue", &error);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this one

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did I miss anything?

}

// m_tick_frequency = this->get<int>("gevTimestampTickFrequency");
m_tick_frequency = this->get<int>("tickFrequency");
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you missed that one

@bj-s
Copy link
Author

bj-s commented Feb 17, 2026

Now that I have seen your code it should not be too difficult. The only problem on my side is that I don't have any camera for testing, but likely we can arrange it somehow that you do the test.

We could alternatively also have a joint remote test session (e.g. via Zoom) if you like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants