Comments (9)
Hi @ArtArt0
Are you using Raspberry Pi 4? How is the LCD connected to the board?
from rpi-opengl-without-x.
With the standard cable (for the official 7'' LCD). Why? It shows the console successfully.
from rpi-opengl-without-x.
Are you able to get any OpenGL output if you use only the LCD display without second HDMI screen? (I am trying to figure out if this is DRM device problem or EGL problem).
from rpi-opengl-without-x.
Yes, I have no problem with it.
from rpi-opengl-without-x.
I am not 100% sure because I haven't tried two displays, but I think you may need to call eglInitialize
twice, once for the LCD display and second time for the HDMI display. As seen here: https://github.com/matusnovak/rpi-opengl-without-x/blob/master/triangle_rpi4.c#L48 with the correct EGLDisplay.
The drmModeGetResources
and drmModeGetResources
is used to get the EGLDisplay as shown here: https://github.com/matusnovak/rpi-opengl-without-x/blob/master/triangle_rpi4.c#L48 so I believe you should have two resources for your two displays.
Could you try iterating over the drmModeRes *resources
as shown here: https://github.com/matusnovak/rpi-opengl-without-x/blob/master/triangle_rpi4.c#L28 and check if you have multiple connectors? It may be that you have two connectors that are DRM_MODE_CONNECTED
. When you get the connector C structure then you can iterate over the connector->modes
to get the resolution to identify the display.
from rpi-opengl-without-x.
Finally I think I figured out!
The problem was in the getDisplay(): the gbm_create_device
must call only once, and the second display uses the first gbmDevice
struct.
Anyway the cardX device must open once too.
from rpi-opengl-without-x.
Awesome! You would be willing to share the code? I would like to give it a try and maybe make a sample code out of it and put it here in this repository.
And yeah, the device /dev/dri/card1
is the GPU so selecting card0 would not work. I originally thought the cardX is the HDMI<->GPU port (or something like that) but I was wrong.
from rpi-opengl-without-x.
Sorry, I can not share it, but I hope it easy to implement to anyone now.
Anyway not always the card1 is the right one. You should detect with the following mode:
open card0
if not OK or getdisplay is not OK:
open card1
if OK:
getdisplay
from rpi-opengl-without-x.
That's alright. I will play around with that when I get the chance and will create a sample code as well.
Closing for now.
from rpi-opengl-without-x.
Related Issues (12)
- * failed to add service - already in use? HOT 3
- RPI4: failed to add service - already in use? HOT 4
- Running triangle_rpi4.c does not require HDMI connection HOT 1
- Compiling Error on RPI 3 HOT 2
- "Unable to get connector" when using a Pi Compute Module 4 HOT 2
- Problem with Raspberry PI 2 and Raspbian 11 (bullseye) HOT 2
- raspbian eGL issue HOT 4
- PI4 support? HOT 20
- DRM failed to get resources HOT 5
- Double buffer issue HOT 2
- Pi4 with LCD output has no vsync HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rpi-opengl-without-x.