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

GL-ERROR with VNC Viewer #9755

Closed
didi1150 opened this issue Sep 11, 2021 · 76 comments
Closed

GL-ERROR with VNC Viewer #9755

didi1150 opened this issue Sep 11, 2021 · 76 comments

Comments

@didi1150
Copy link

| Camera Model | { D400 } |
| Operating System & Version | Raspbian OS |
| Platform | Raspberry Pi 3b+ |

Issue Description

I am using VNC Viewer to open the realsense app, according to this tutorial

https://www.youtube.com/watch?v=LBIBUntnxp8&t=166s

But when I run the command realsense-viewer, it opens, and every text in the programm is blurred and pixelated. Why is it this way? I have done everything exactly as in the tutorial.
192 168 178 37 (raspberrypi) – VNC Viewer 11 09 2021 18_49_53

And I also get the error:

GL CALLBACK: ** GL ERROR ** type = 0x824c, severity = 0x9146, message = GL_INVALID_VALUE in glTexImage2D(invalid width=4096 or height=512 or depth=1)

@MartyG-RealSense
Copy link
Collaborator

Hi @didi1150 This distortion effect in the RealSense Viewer is very rare but has been reported to have occurred on Raspberry Pi 3 in the past in #7533

It is thought to be related to a lack of memory in the texture atlas. The above link provides a couple of suggestions for correcting the problem.

The RealSense user in that particular case chose to resolve the problem by upgrading to a Pi 4B instead.

First though, you could check whether the issue on your particular Pi is being caused by the Font Samples setting of the Viewer being set to its maximum value of '8' instead of its default value of '2', as described in #7479 (comment)

@didi1150
Copy link
Author

I tried setting it to 2, but it still is blurred the same way

@MartyG-RealSense
Copy link
Collaborator

Does the same effect occur if launching the Viewer directly on the Pi instead of through a VNC Viewer connection?

@didi1150
Copy link
Author

hmm lemme check

@didi1150
Copy link
Author

yes it is still bugged

@didi1150
Copy link
Author

Ive edited the model-views.cpp file, but I dont know how to rebuild

@MartyG-RealSense
Copy link
Collaborator

A RealSense user in #7450 (comment) who had this distortion problem on Pi indicates that you can use the make instruction to rebuild.

@didi1150
Copy link
Author

didi1150 commented Sep 12, 2021

So I have to do make -j1 and sudo make install?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Sep 12, 2021

You just do the 'make' instruction in the build folder.

@didi1150
Copy link
Author

I still dont understand. What do you mean by make instruction?

@MartyG-RealSense
Copy link
Collaborator

make is a CMake build instruction. Are you familiar with how CMake works, please?

@didi1150
Copy link
Author

cmake .. -DBUILD_EXAMPLES=true -DCMAKE_BUILD_TYPE=Release -DFORCE_LIBUVC=true
U mean this?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Sep 12, 2021

Please input the word make into the Ubuntu terminal when you are in the build folder.

@didi1150
Copy link
Author

im on raspbian

@didi1150
Copy link
Author

I tried it with make and it still didnt work

@didi1150
Copy link
Author

Im now trying with cmake before that

@didi1150
Copy link
Author

Does my micro SD card have anything to do with my problem?

@MartyG-RealSense
Copy link
Collaborator

Once a Raspberry Pi runs out of memory space then it can use a swapfile to use space on the storage as slower 'virtual memory'. Sometimes, increasing the size of the swapfile may therefore improve performance of an application.

https://www.bitpi.co/2015/02/11/how-to-change-raspberry-pis-swapfile-size-on-rasbian/

@didi1150
Copy link
Author

I increased the sawpfile alreeady

@MartyG-RealSense
Copy link
Collaborator

To recap, the known solutions for this problem with distortion of the Viewer's graphics are one of the actions below:

  1. Change the Font Samples setting in the RealSense Viewer

  2. Edit the model-views.cpp file and rebuild the Viewer

  3. Edit the configuration file located at ~/.realsense-config.json

  4. Upgrade from a Pi 3 to Pi 4

You have tried changing the Font Samples and editing model-views.cpp. Have you tried editing the configuration file located at ~/.realsense-config.json as described in #4558 (comment)

@didi1150
Copy link
Author

yes I have tried that too

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Sep 12, 2021

The four methods listed above are the only solutions known so far for this Viewer graphics corruption problem. The only remaining untried option on the list is to upgrade to the Pi 4.

You could also try switching to the Viewer's fullscreen mode and back again to see whether it clears the problem. You can do this by pressing the F8 keyboard key whilst the Viewer is open to go to fullscreen mode, and press F8 again to go back to normal sized view.

@didi1150
Copy link
Author

No it is still bugged

@didi1150
Copy link
Author

'Edit the configuration file located at ~/.realsense-config.json'
What can I edit there? I wanna try again

@didi1150
Copy link
Author

Okay ive tried that again, it still doesnt work

@didi1150
Copy link
Author

GL CALLBACK: ** GL ERROR ** type = 0x824c, severity = 0x9146, message = GL_INVALID_VALUE in glTexImage2D(invalid width=4096 or height=512 or depth=1)
What does this mean?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Sep 12, 2021

I only know of one previous occurrence of that GL error in the RealSense Viewer in #8705 and it did not suggest a solution.

I conducted extensive research about this Viewer distortion but could not find any options other than the four listed above, of which changing to a Pi 4 is the only one that has not been attempted.

Let's instead look at the possibility that there is a problem in the librealsense SDK installation on your Pi. Which method did you use to install the SDK on Raspbian OS on your Pi 3B+, please?

@didi1150
Copy link
Author

I followed the tutorial by acrobotic: https://www.youtube.com/watch?v=LBIBUntnxp8&t=166s
which means I first cloned the git repo and then compiled it

@didi1150
Copy link
Author

why are there black areas/mist all over the place? And the cam is also veryyyy slow. I was expecting maybe 30 fps but it is 1 fps

@MartyG-RealSense
Copy link
Collaborator

Would it be possible to provide an image of the black areas and mist that you are seeing, please?

@didi1150
Copy link
Author

raspberrypi (raspberrypi) – VNC Viewer 25 09 2021 12_21_58

@didi1150
Copy link
Author

raspberrypi (raspberrypi) – VNC Viewer 25 09 2021 12_23_36

@didi1150
Copy link
Author

first one is 3d, second one is 2d

@didi1150
Copy link
Author

25/09 12:21:13,554 WARNING [2866795584] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: No data available, number: 61
25/09 12:21:24,489 WARNING [2754602048] (sensor.cpp:337) Frame received with streaming inactive,Depth0, Arrived,0.000000 1632565284476.807617
25/09 12:22:46,861 WARNING [2866795584] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: No data available, number: 61
25/09 12:23:07,057 WARNING [2866795584] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: No data available, number: 61
25/09 12:23:19,825 WARNING [2866795584] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11

And also these errors

@MartyG-RealSense
Copy link
Collaborator

Is the camera looking at objects that are dark grey or black? If so, a general physics principle for depth cameras (not just RealSense) is that dark grey and black colors absorb light. This makes it hard for the camera to read depth detail from such surfaces unless they have a strong light-source on them. Black surfaces may therefore appear to be rendered on the image but are actually plain black empty areas with no depth detail. The darker the shade, the harder it is for light to be reflected.

An example is depth-sensing a black cable. It may appear on the image to be rendered as a black cable but is actually a cable-shaped empty area (an effect very similar to your second depth image above).

@didi1150
Copy link
Author

ok....

@didi1150
Copy link
Author

how do I add scripts or code to the camera? any good beginner tutorials you would recommend? Because I can only find intermediate tutorials

@MartyG-RealSense
Copy link
Collaborator

If you are going to be programming in C++ but are not using Visual Studio then the Getting Started guide at the link below may be helpful.

https://github.com/zivsha/librealsense/tree/getting_started_example/examples/getting-started

If you are using Python then there is the SDK's Tutorial 1 example Python program.

https://github.com/IntelRealSense/librealsense/blob/master/wrappers/python/examples/python-tutorial-1-depth.py

@MartyG-RealSense
Copy link
Collaborator

Hi @didi1150 Do you require further assistance with this case, please? Thanks!

@didi1150
Copy link
Author

didi1150 commented Oct 2, 2021

My cam is still showing black mist, even if I have have a light shining onto an object, it is still being displayed as black mist if it is not white @MartyG-RealSense

@didi1150
Copy link
Author

didi1150 commented Oct 2, 2021

For example if im holding my hand towards the cam, everything around it is turned black

@didi1150
Copy link
Author

didi1150 commented Oct 2, 2021

And all these tutorials dont explaine one thing: How do I setup the coding environment? And do I need to code on my computer or the raspberry pi? And if I'm writing everything on my pc, how do I export the code to the raspberry? Also none of these tutorials seem to be made for visual studio

If you are going to be programming in C++ but are not using Visual Studio then the Getting Started guide at the link below may be helpful.

https://github.com/zivsha/librealsense/tree/getting_started_example/examples/getting-started

If you are using Python then there is the SDK's Tutorial 1 example Python program.

https://github.com/IntelRealSense/librealsense/blob/master/wrappers/python/examples/python-tutorial-1-depth.py

This doesn't explain how to write code yourself.

@MartyG-RealSense
Copy link
Collaborator

Can you confirm which programming language you are using so that I can find compatible guides for you, please. Thanks!

@didi1150
Copy link
Author

didi1150 commented Oct 2, 2021

C#

@MartyG-RealSense
Copy link
Collaborator

There is a limited amount of references for C# at the introductory level, unfortunately. For installing the C# wrapper on Windows and setting up a first application in Visual Studio, a RealSense user shared a very good guide that they created at #5022

I am not aware of any beginner-level references for doing so on Raspberry Pi.

Intel provide a starter script called Hello World.

https://dev.intelrealsense.com/docs/csharp-wrapper#section-hello-world

Further examples of pieces of C# code can be found in Intel's C# Cookbook page.

https://github.com/IntelRealSense/librealsense/blob/master/wrappers/csharp/Documentation/cookbook.md

@didi1150
Copy link
Author

didi1150 commented Oct 2, 2021

ok... maybe a guide for C++ with the whole setup thing, because I dont want to use an aspect that only has limited tutorials

@didi1150
Copy link
Author

didi1150 commented Oct 2, 2021

I mean C/C++ guide for setting up the environment and creating projects @MartyG-RealSense

@didi1150
Copy link
Author

didi1150 commented Oct 3, 2021

Ok I have followed this tutorial https://github.com/IntelRealSense/librealsense/tree/master/wrappers/csharp to setup my workspace, but how do I create a project? Do I modify the realsense2.sln file or do I need to create a new project?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Oct 3, 2021

The C# wrapper documentation says that once the realsense2.sln file has been built in the build folder then you can open the file with Visual Studio, and C# examples and library will be available in the solution under Wrappers/csharp.

https://github.com/IntelRealSense/librealsense/tree/master/wrappers/csharp#with-cmake-and-visual-studio

The link below suggests a Step 2 to perform after the sln file has been opened in Visual Studio.

https://stackoverflow.com/questions/51248121/vs2017-linking-realsense-camera/51963781#51963781

@didi1150
Copy link
Author

didi1150 commented Oct 3, 2021

I have a question, once I have written a file, how do I transfer it to the raspberry pi? Just copy paste?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Oct 3, 2021

It does not look as though it is as straightforward as copy and paste, though the link below has a good guide for a method of transferring a C# Visual Studio project from a PC to Raspberry Pi.

https://tutorials-raspberrypi.com/write-raspberry-pi-gui-apps-c-sharp-dot-net/

Another guide suggests using the main computer such as a PC to host the code and connecting remotely via Visual Studio Code to the Pi to run the code as though it is on the Pi.

https://www.raspberrypi.org/blog/coding-on-raspberry-pi-remotely-with-visual-studio-code/

@didi1150
Copy link
Author

didi1150 commented Oct 3, 2021

ok how much easier would it be to do everything with python and pycharm?

@MartyG-RealSense
Copy link
Collaborator

You could certainly develop a RealSense application with PyCharm, and pyrealsense2 is a bit more straightforward to program than C#. The Python wrapper also does not have many beginner level references though. C++ is the most well-supported for availability of such guides.

@didi1150
Copy link
Author

didi1150 commented Oct 4, 2021

ye, but python is more supported on the raspberrypi than C I think

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Oct 4, 2021

At its most basic level, creating a runnable Python script is very simple because you can write the script in a simple text editor program (creating your own script or pasting an existing one into the text editor) and then save it as a .txt file with a name that has the extension .py on the end, such as 'test.py'.

image

The saved text file should then be recognized as a Python script file.

image

That script can then be launched with a text command in the Python interface with python3 <name of script file> - for example: python3 test.py

https://realpython.com/run-python-scripts

@MartyG-RealSense
Copy link
Collaborator

Hi @didi1150 Do you require further assistance with this case, please? Thanks!

@MartyG-RealSense
Copy link
Collaborator

Case closed due to no further comments received.

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

No branches or pull requests

2 participants