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

Unable to stream images from a Basler camera #21

Closed
smitesh-sutaria opened this issue Jun 5, 2020 · 5 comments
Closed

Unable to stream images from a Basler camera #21

smitesh-sutaria opened this issue Jun 5, 2020 · 5 comments

Comments

@smitesh-sutaria
Copy link

Hello,
Using gc_info able to query the camera details.
But when gc_stream is used, images are not getting saved.

Output of gc_stream

$ ./gc_stream 22034422

Package size: 1500
Received buffers:   5
Incomplete buffers: 0
Buffers per second: 1.89

Further debugging this shows, getBufferBool() is returning false in file rc_genicam_api/buffer.cc

So added the below code for debug:

diff --git a/rc_genicam_api/buffer.cc b/rc_genicam_api/buffer.cc
index 7a2afea..eacb634 100644
--- a/rc_genicam_api/buffer.cc
+++ b/rc_genicam_api/buffer.cc
@@ -71,7 +71,8 @@ inline bool getBufferBool(const std::shared_ptr &gentl,

if (stream != 0 && buffer != 0)
{

  • GenTL::GC_ERROR ret_val = gentl->DSGetBufferInfo(stream, buffer, cmd, &type, &ret, &size);
  • std::cout << ret_val <<"\n";
    }

return ret != 0;

Output with snippet added for debug

$ ./gc_stream 22034422

Package size: 1500

0
-1014
0
-1014
0
-1014 
0
-1014
0
-1014

Received buffers:   5
Incomplete buffers: 0
Buffers per second: 1.89

**Please note that, -1014 is GC_ERR_NOT_AVAILABLE.

Output of gc_info

$ ./gc_info -l
Transport Layer ProducerGEV.cti
Vendor:         Basler
Model:          GEV GenTL Producer
Vendor version: 1.0.0.0
TL type:        GEV
Name:           ProducerGEV-1.3.2.cti
Pathname:       /opt/pylon5/lib64/gentlproducer/gtl/ProducerGEV-1.3.2.cti
Display name:   Basler GEV GenTL Producer
GenTL version   1.5

    Interface     Basler GEV GenTL Interface Module
    Display name: GigE Vision
    TL type:      GEV

        Device             Basler acA1300-30gc (22034422)
        Vendor:            Basler
        Model:             acA1300-30gc
        TL type:           GEV
        Display name:      acA1300-30gc (22034422)
        User defined name:
        Access status:     Unknown
        Serial number:     22034422
        Version:           104846-20
        TS Frequency:      0

@heikohimu
Copy link
Contributor

The output of gc_stream shows that it successfully received buffers. gc_stream should either store images and show this on standard output, or produce an error message, e.g. if the image format is unknown. The only reason for not seeing either of it is that there is no image data contained in the buffer. I think that you should check if your camera is properly configured.

@smitesh-sutaria
Copy link
Author

@heikohimu Thank you for the inputs.

When we change the settings for "ChunkModeActive" to 'False', get the below error :

$ ./gc_stream 22034422 ChunkModeActive=0
Package size: 1500

Exception: Invalid layout of buffer attached to chunk parser! : RuntimeException thrown (file 'ChunkAdapterGEV.cpp', line 97)

Does gc_stream work only when ChunkModeActive is 'True' ? If so, what should be the config value for "ChunkSelector"

@heikohimu
Copy link
Contributor

Is there a reason for disabling chunks if they are available?

gc_stream checks if chunks a available and enables them if possible. This happens in this line https://github.com/roboception/rc_genicam_api/blob/master/tools/gc_stream.cc#L401 The user parameters are applied afterwards, so gc_stream expects chunks, but buffers do not contain any. I should change the code to check if the user explicitly disables chunks.

For the moment, you could just initialize chunkadapter with 0 in the code.

@smitesh-sutaria
Copy link
Author

That worked. Thank you for the inputs.

Here is the diff for the reference :

diff --git a/tools/gc_stream.cc b/tools/gc_stream.cc
index e26191f..7a67560 100644
--- a/tools/gc_stream.cc
+++ b/tools/gc_stream.cc
@@ -398,8 +398,9 @@ int main(int argc, char *argv[])
         // get chunk adapter (this switches chunk mode on if possible and
         // returns a null pointer if this is not possible)

-        std::shared_ptr<GenApi::CChunkAdapter> chunkadapter=rcg::getChunkAdapter(nodemap, dev->getTLType());
+        //std::shared_ptr<GenApi::CChunkAdapter> chunkadapter=rcg::getChunkAdapter(nodemap, dev->getTLType());

+        std::shared_ptr<GenApi::CChunkAdapter> chunkadapter=0;
         // set values as given on the command line

         int n=1;

@heikohimu
Copy link
Contributor

The problem with Basler cameras is fixed in rc_genicam_api release 2.5.0.

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

No branches or pull requests

2 participants