Intel® Edge Software Hub
Get answers from community peers to your questions about building Edge Software Hub solutions for edge compute node.
Announcements
The Edge Software Vision Package for Red Hat Enterprise Linux is now available here.

Learn more about developing on Intel® Hardware and Software here.

EIS_Balser_isseus

Huang__Colin
Beginner
1,821 Views

Hi  Jia-shing

 

We want to connect EIS with BASLER(acA2040-120um) camera and we encounter some issues.

 

Attached images are the issues.

 

Thanks.

Colin

Labels (1)
0 Kudos
3 Replies
Jia-Shing_W_Intel
Moderator
1,820 Views

I'll share with you the steps I took to remotely debug this issue on the customer device and offer some tips.

First of all, a bit of additional information about this issue. Actually, this Basler camera in use was a USB one, so we asked the customer to replace "exposureGigE=3250" with "exposureUsb=3250" in the ETCD settings to reflect the fact. With this, the issue persisted...

By looking at the logs, for example, the gstreamer one below, they don't really tell us much.

Attaching to ia_video_ingestion
ia_video_ingestion    | [setupvars.sh] OpenVINO environment initialized
ia_video_ingestion    | /EIS/fpga_env.sh: line 30: /opt/altera/aocl-pro-rte/aclrte-linux64/init_opencl.sh: No such file or directory
ia_video_ingestion    | [setupvars.sh] OpenVINO environment initialized
ia_video_ingestion    | I0505 13:08:47.096662      18 init.go:32] initializing configuration manager...
ia_video_ingestion    | I0505 13:08:47.096764      18 util.go:30] Waiting for Port: 2379 on hostname: localhost 
ia_video_ingestion    | I0505 13:08:47.098459      18 util.go:34] Port: 2379 on hostname: localhost is up.
ia_video_ingestion    | I0505 13:08:47.101837      18 cgo.go:40] Register user callback
ia_video_ingestion    | I0505 13:08:47.101860      18 cgo.go:138] Register the key: /VideoIngestion/config for watch key
ia_video_ingestion    | I0505 13:08:47.101871      18 EtcdClient.go:153] Watching on key: /VideoIngestion/config
ia_video_ingestion    | [Tue May  5 13:08:47 2020]  WARN:get_config_value:138: JSON does not contain key: queue_size
ia_video_ingestion    | [Tue May  5 13:08:47 2020]  INFO:VideoIngestion:131: "queue_size" key missing, so using default queue size:                     10
ia_video_ingestion    | [Tue May  5 13:08:47 2020]  WARN:get_config_value:138: JSON does not contain key: udfs
ia_video_ingestion    | [Tue May  5 13:08:47 2020]  INFO:VideoIngestion:157: "udfs" key doesn't exist, so udf output queue is same as                 udf input queue!!
ia_video_ingestion    | [Tue May  5 13:08:47 2020]  INFO:GstreamerIngestor:59: cvt_pipeline initialized
ia_video_ingestion    | [Tue May  5 13:08:47 2020]  INFO:GstreamerIngestor:71: Pipeline: pylonsrc imageformat=yuv422 exposureGigE=3250 interpacketdelay=1500 ! video/x-raw,format=YUY2 ! videoconvert ! video/x-raw,format=BGR ! appsink name="sink"
ia_video_ingestion    | [Tue May  5 13:08:47 2020]  WARN:get_config_value:138: JSON does not contain key: poll_interval
ia_video_ingestion    | [Tue May  5 13:08:47 2020]  INFO:GstreamerIngestor:84: Poll interval: 0.000000
ia_video_ingestion    | 
ia_video_ingestion    | (process:18): GLib-CRITICAL **: 13:08:47.102: g_path_get_basename: assertion 'file_name != NULL' failed
ia_video_ingestion    | [Tue May  5 13:08:47 2020]  WARN:get_config_value:138: JSON does not contain key: zmq_connect_retries
ia_video_ingestion    | [Tue May  5 13:08:47 2020]  WARN:get_config_value:138: JSON does not contain key: camera1_stream
ia_video_ingestion    | [Tue May  5 13:08:47 2020]  INFO:start:205: Publisher thread started...
ia_video_ingestion    | [Tue May  5 13:08:47 2020]  WARN:start:322: Start attempted after stop or after start
ia_video_ingestion    | [Tue May  5 13:08:47 2020]  INFO:start:209: Started udf manager
ia_video_ingestion    | [Tue May  5 13:08:47 2020]  INFO:start:215: Ingestor thread started...
ia_video_ingestion    | [Tue May  5 13:08:47 2020]  INFO:run:150: Gstreamer ingestor thread started
ia_video_ingestion    | 0:00:01.196368439    18 0x7febbc0024d0              pylonsrc gstpylonsrc.c:2381:pylonc_print_camera_info:<pylonsrc0> Status: Using camera "acA2040-120um" (serial number: , id: 0).
ia_video_ingestion    | [Tue May  5 13:08:48 2020] ERROR:bus_call:189: Gst Bus Error: Failed to initialise the camera
ia_video_ingestion    | [Tue May  5 13:08:48 2020]  INFO:run:153: Gstreamer ingestor thread stopped
 

TIP: In the /GlobalEnv/ node of ETCD, you can change the debug log levels for various programming languages. This could give us additional details that might have been helpful. (I regret I didn't do this...) Since this doesn't change at run-time, make sure you restart the containers for the changes to become effective.

{
    "PY_LOG_LEVEL": "INFO",
    "GO_LOG_LEVEL": "INFO",
    "C_LOG_LEVEL": "INFO",
    "GO_VERBOSE": "0",
    "ETCD_KEEPER_PORT": "7070",
    "DEV_MODE": "true"
}

Without useful hints in the logs, I had to add my own debug prints in the code to narrow down the problem. When I tried to do so with the Gstreamer library, I found it wasn't very straightforward, because it's downloaded and built when the video ingestion Docker image was built.

RUN wget -O - ${GST_REPO} | tar xJ && \
    cd /tmp/gstreamer-${GST_VER} && \
    ./autogen.sh \
    --prefix=/usr \
    --libdir=/usr/lib/x86_64-linux-gnu \
    --libexecdir=/usr/lib/x86_64-linux-gnu \
    --enable-shared \
    --enable-introspection \
    --disable-examples  \
    --disable-gtk-doc && \
    make -j$(nproc --ignore=2) && \
    make install DESTDIR=/home/build && \
    make install;
 

Tip: To be able to modify the code, I had to download a copy on the host first (wget https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-1.16.0.tar.gz .), untar it, make changes, and make the following Dockerfile changes so the modified code gets built in the image.

COPY gstreamer-${GST_VER} /tmp/gstreamer-${GST_VER}


RUN    cd /tmp/gstreamer-${GST_VER} && \
    ./autogen.sh \
    --prefix=/usr \
    --libdir=/usr/lib/x86_64-linux-gnu \
    --libexecdir=/usr/lib/x86_64-linux-gnu \
    --enable-shared \
    --enable-introspection \
    --disable-examples  \
    --disable-gtk-doc && \
    make -j$(nproc --ignore=2) && \
    make install DESTDIR=/home/build && \
    make install;
 

Alternatively, you should also be able to execute an interactive shell on a running container, edit the library code in it and rebuild the library in it. Up to you.

With the additional debug prints, I was able to gradually pin point the issue to the gst_pylonsrc_start function in gstpylonsrc.c, that the camera didn't support the yuv422 imageformat. Finally, I had a look at the spec of this acA2040-120um camera... It turned out it's a monochrome camera... By suggesting Colin to replace the camera settings to the monochrome one from the README file, the camera could be configured and started now.

0 Kudos
Huang__Colin
Beginner
1,820 Views

Hi Jia-Shing,

Attached file is the autoexposure time that I have tested in  EIS.

Three methods you provided can display images in EIS but delay almost 7.8 seconds .

It is smoothly in logi camera to connect with EIS and also smoothly basler with pylon .

Is there any parameter I need to adjust in EIS ?

 

Thanks.

0 Kudos
Jia-Shing_W_Intel
Moderator
1,820 Views

Hi Colin,

Do you mean there is a 7-sec+ delay for all three methods? When do you see this delay, the time between a frame is taken and it’s displayed (perhaps you can point the camera at a watch or clock to tell), or at camera initialization?

In the gst_pylonsrc_set_property function in gstpylonsrc.c, if you change g_value_get_float with g_value_get_double, then this issue can be worked around and you can set the exposure time in the ETCD UI.

    case PROP_EXPOSUREUSB:

      pylonsrc->exposureUsb = g_value_get_float(value);

      break;

 

Regards,

Jia-Shing

0 Kudos
Reply