Skip to content

Communicate module#14

Open
gabs1234 wants to merge 88 commits intomasterfrom
communicate-module
Open

Communicate module#14
gabs1234 wants to merge 88 commits intomasterfrom
communicate-module

Conversation

@gabs1234
Copy link
Copy Markdown
Collaborator

@gabs1234 gabs1234 commented Mar 18, 2024

Still in need of being fixed:

  • get 1Gb working over UCAD
  • Re-test timestamp code once 1Gb connection is working over UCAD
  • improve throtting for less delay
  • convert nanoseconds to seconds directly in the driver

gabs1234 added 10 commits July 14, 2023 14:31
Buffering the camera's output is fully functionnal on the 1Gb output
in 8bit depth. 16bit can also trivially be implemented, but hasn't
been done yet. At normal HD resolution, one may achieve 30fps buffering.

Next steps:
 - buffering on the 10Gb connection
 - Completely remove the Queue-based buffer on 10Gb connection ?
Live view works, but the normal mode is giving weird results.
Also, performance has taken a toll.
… buffer

See [this blog post](https://lo.calho.st/posts/black-magic-buffer/) for the exact details.
Really cool stuff. Few logic flow bugs fixed as well.
Main updates:
 - Improvements on ring buffer
 - Throttle the request_images function: now asks for images once the user grabbed enough of them
 - cleanup random prints

Note: valgrind clean!
This means that one can trigger through uca-phantom-camera without reaching
a dead end in the camera memory.
… naming

The image related variables such as sensor_pixel_width used to designate the
sensor resolution. Conform to libuca, this is now the physical size of the pixel
in m. The same can be said for the related variables.

Moreover, the installation of the properties has been improved to work with ucad.
Although I'm not too sure how they started working; it seems as though overriding
the name base class property as a user property made things work...
Updated and simplified thottle mechanism. Seems to work likr a charm.
@gabs1234 gabs1234 requested a review from MarcusZuber March 18, 2024 10:31
lt0649 and others added 19 commits April 22, 2024 17:26
Timestamps from the camera are tranfered over 1Gb connection.
They are decoded and used to calculate a single gint64 value
that represents a monotonic time since unix EPOCH in microseconds.
Enums are automatically generated via a template + meson build file
Because of how the camera indexes the frames after a trigger, one must wait a little for the cine buffer to fill up before triggering, so that the first few frames are indeed indexed from 0. Without waiting, the first few start at a positive integer and one will have to go back and fetch those images once all the post frames are done.
Users can now fully interact with camera via libuca. Full descriptions are given for each
unit variable.
This is really for readability, I have no other justification. Also fixed minor
bug in the throttleing scheme: sometimes, when there was only 1 frame left to pull
from the cine, the code would get stuck in a loop because of a condition stopping
the code from pulling a single image. This has been changed to making sure the count
positive.
I think this is because whenever live cine is no longer marked
as active, the -1 simply chooses the current active cine.
Not yet functional, but it still does something...
I am not 100% certain of my explaination, but it seems like
since the uca-phantom instance was running in the GMainLoop
of ucad.c, all the signals were caught in this loop. In particular,
I was using g_socket_listener_accept instead of using a signal,
and it seems that ucad was catching this signal and blocking
g_socket_listener_accept indefinitely as it could never get the
connection. Regardless, using the incoming signal works now.
Before I used an intermediate value, to avoid having to ask the camera
every time. But this was a mistake, because the value that you set
on the device can be reinterpreted into something else, if it doesn't
fit the spec.
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.

3 participants