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

QT Platform Pluggin - drmModeGetResources Failed #6

Closed
Carbur8tr opened this issue Jul 6, 2024 · 35 comments
Closed

QT Platform Pluggin - drmModeGetResources Failed #6

Carbur8tr opened this issue Jul 6, 2024 · 35 comments
Assignees

Comments

@Carbur8tr
Copy link

Made a couple of small changes and tried to troubleshoot as much as I could but it seems like I'm at the point where I might need to recompile QT. Would appreciate any thoughts you have on the subject.

This is using the following:
Raspberry Pi 5 4gb
Latest "Lite" OS release as of 7/4
image

Adding Sudo to the startup script "/opt/piplay/startup.sh" lands me here:
Jul 06 08:04:27 RTSP systemd[1]: piplay.service: Scheduled restart job, restart counter is at 1.
Jul 06 08:04:27 RTSP systemd[1]: Stopped piplay.service - PIPlay.
Jul 06 08:04:27 RTSP systemd[1]: Started piplay.service - PIPlay.
Jul 06 08:04:27 RTSP sudo[3728]: root : PWD=/opt/piplay ; USER=root ; COMMAND=/usr/bin/python3 /opt/piplay/piplay.py
Jul 06 08:04:27 RTSP sudo[3728]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=0)
Jul 06 08:04:28 RTSP startup.sh[3729]: qt.qpa.xcb: could not connect to display
Jul 06 08:04:28 RTSP startup.sh[3729]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
Jul 06 08:04:28 RTSP startup.sh[3729]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Jul 06 08:04:28 RTSP startup.sh[3729]: Available platform plugins are: linuxfb, minimalegl, offscreen, vnc, xcb, vkkhrdisplay, minimal, eglfs.
Jul 06 08:04:28 RTSP sudo[3728]: pam_unix(sudo:session): session closed for user root
Jul 06 08:04:28 RTSP startup.sh[3727]: /opt/piplay/startup.sh: line 6: 3728 Aborted sudo python3 /opt/piplay/piplay.py
Jul 06 08:04:28 RTSP systemd[1]: piplay.service: Main process exited, code=exited, status=134/n/a
Jul 06 08:04:28 RTSP systemd[1]: piplay.service: Failed with result 'exit-code'.

If I remove sudo from the startup script "/opt/piplay/startup.sh we get the following:
Jul 06 08:16:46 RTSP systemd[1]: piplay.service: Scheduled restart job, restart counter is at 2.
Jul 06 08:16:46 RTSP systemd[1]: Stopped piplay.service - PIPlay.
Jul 06 08:16:46 RTSP systemd[1]: piplay.service: Consumed 1.039s CPU time.
Jul 06 08:16:46 RTSP systemd[1]: Started piplay.service - PIPlay.
Jul 06 08:16:47 RTSP startup.sh[3821]: drmModeGetResources failed (Operation not supported)
Jul 06 08:16:47 RTSP startup.sh[3821]: no screens available, assuming 24-bit color
Jul 06 08:16:47 RTSP startup.sh[3821]: Cannot create window: no screens available
Jul 06 08:16:47 RTSP startup.sh[3820]: /opt/piplay/startup.sh: line 6: 3821 Aborted python3 /opt/piplay/piplay.py
Jul 06 08:16:47 RTSP systemd[1]: piplay.service: Main process exited, code=exited, status=134/n/a
Jul 06 08:16:47 RTSP systemd[1]: piplay.service: Failed with result 'exit-code'.
Jul 06 08:16:47 RTSP systemd[1]: piplay.service: Consumed 1.049s CPU time.

@HussX
Copy link
Owner

HussX commented Jul 6, 2024

@Carbur8tr Off the bat, I'm not sure which changes you made. The error with sudo added is because eglfs was exported in a separate environment than the Python code. It's sudo all or sudo none, but if you're using systemd sudo isn't needed. If you want to add sudo, do it on the systemctl command.
The second bit looks like you don't have a screen connected or turned on. I'll look and make sure I didn't muck something up. Also, was this on the latest push? I ran across this a couple times in testing and it was erring because I had the screen turned off on system start up. If you used the install script and the service is enabled, have you also tried a reboot without the added sudo to see if it kicked off?

@HussX
Copy link
Owner

HussX commented Jul 6, 2024

@Carbur8tr I'm curious if the pi5 has the card0 vs card1 issue with eglfs I see all over Google. I have a 5 to test with at work but I'm hopping a plane to Dallas, Monday. I want this to work on a 5 as well, so I'll dig in as soon as time permits.

@HussX
Copy link
Owner

HussX commented Jul 6, 2024

@Carbur8tr also, try plugging the screen into the other HDMI port to see if it detects. I didn't do any testing whatsoever on multiple port setups.

@Carbur8tr
Copy link
Author

From top to bottom.

I’ve tried it a few different ways using sudo and not. Just trying to find if either makes a difference and obviously it did but to your point I’m not sure it’s making a large difference due to the nature of the failure.

Latest push, fresh start this morning with the OS and pull.

I have rebooted a few times with the monitor still on so I would hope that would be a good baseline for eglfs to capture the screen dimensions. (Could be wrong)

I’m running all the commands via ssh so I’m hoping that’s not possibly a difference that’s causing an issue. Regardless, I think you might be on to something with switching the ports on the pi.

I read up on the card1/card 0 issue and it’s a possibility but I tried a few things that others have reported to remedy the issue and still same issue.

I will test the other port here soon and report back.

Btw, thank you. I’ve been using displaycam for years on a pi3 and finally decided to upgrade not knowing it was no longer supported due to OMX.

@HussX
Copy link
Owner

HussX commented Jul 6, 2024 via email

@Carbur8tr
Copy link
Author

Similar output in a different port:

Jul 06 20:06:18 RTSP systemd[901]: Listening on gpg-agent-ssh.socket - GnuPG cryptographic agent (ssh-agent emulation).
Jul 06 20:06:18 RTSP systemd[901]: Listening on gpg-agent.socket - GnuPG cryptographic agent and passphrase cache.
Jul 06 20:06:18 RTSP systemd[901]: Listening on dbus.socket - D-Bus User Message Bus Socket.
Jul 06 20:06:18 RTSP systemd[901]: Reached target sockets.target - Sockets.
Jul 06 20:06:18 RTSP systemd[901]: Reached target basic.target - Basic System.
Jul 06 20:06:18 RTSP systemd[901]: Reached target default.target - Main User Target.
Jul 06 20:06:18 RTSP systemd[901]: Startup finished in 129ms.
Jul 06 20:06:18 RTSP systemd[1]: Started user@1000.service - User Manager for UID 1000.
Jul 06 20:06:18 RTSP systemd[1]: Started session-1.scope - Session 1 of User pi.
Jul 06 20:06:21 RTSP systemd[1]: systemd-fsckd.service: Deactivated successfully.
Jul 06 20:06:22 RTSP systemd-timesyncd[638]: Contacted time server 108.61.73.244:123 (2.debian.pool.ntp.org).
Jul 06 20:06:22 RTSP systemd-timesyncd[638]: Initial clock synchronization to Sat 2024-07-06 20:06:22.550469 CDT.
Jul 06 20:06:22 RTSP systemd[1]: systemd-hostnamed.service: Deactivated successfully.
Jul 06 20:06:28 RTSP systemd[1]: piplay.service: Scheduled restart job, restart counter is at 2.
Jul 06 20:06:28 RTSP systemd[1]: Stopped piplay.service - PIPlay.
Jul 06 20:06:28 RTSP systemd[1]: piplay.service: Consumed 1.046s CPU time.
Jul 06 20:06:28 RTSP systemd[1]: Started piplay.service - PIPlay.
Jul 06 20:06:29 RTSP startup.sh[938]: drmModeGetResources failed (Operation not supported)
Jul 06 20:06:29 RTSP startup.sh[938]: no screens available, assuming 24-bit color
Jul 06 20:06:29 RTSP startup.sh[938]: Cannot create window: no screens available
Jul 06 20:06:29 RTSP startup.sh[937]: /opt/piplay/startup.sh: line 7: 938 Aborted python3 /opt/piplay/piplay.py
Jul 06 20:06:29 RTSP systemd[1]: piplay.service: Main process exited, code=exited, status=134/n/a
Jul 06 20:06:29 RTSP systemd[1]: piplay.service: Failed with result 'exit-code'.
Jul 06 20:06:29 RTSP systemd[1]: piplay.service: Consumed 1.029s CPU time.
Jul 06 20:06:39 RTSP systemd[1]: piplay.service: Scheduled restart job, restart counter is at 3.
Jul 06 20:06:39 RTSP systemd[1]: Stopped piplay.service - PIPlay.
Jul 06 20:06:39 RTSP systemd[1]: piplay.service: Consumed 1.029s CPU time.
Jul 06 20:06:39 RTSP systemd[1]: Started piplay.service - PIPlay.
Jul 06 20:06:40 RTSP startup.sh[950]: drmModeGetResources failed (Operation not supported)
Jul 06 20:06:40 RTSP startup.sh[950]: no screens available, assuming 24-bit color
Jul 06 20:06:40 RTSP startup.sh[950]: Cannot create window: no screens available
Jul 06 20:06:40 RTSP startup.sh[949]: /opt/piplay/startup.sh: line 7: 950 Aborted python3 /opt/piplay/piplay.py
Jul 06 20:06:40 RTSP systemd[1]: piplay.service: Main process exited, code=exited, status=134/n/a
Jul 06 20:06:40 RTSP systemd[1]: piplay.service: Failed with result 'exit-code'.
Jul 06 20:06:40 RTSP systemd[1]: piplay.service: Consumed 1.045s CPU time.

@Carbur8tr
Copy link
Author

I've tried a few things attempting to get around this:

Jul 06 20:06:40 RTSP startup.sh[950]: drmModeGetResources failed (Operation not supported)

Really not sure at this point.

@Carbur8tr
Copy link
Author

Dumb question, did you do your testing on 64 and 32 bit images?

@HussX
Copy link
Owner

HussX commented Jul 7, 2024 via email

@Carbur8tr
Copy link
Author

Tried a different screen and same outcome.

Random thought, I wonder if for some reason the 5's handle the screen resolution different from the 3s or 4s. Surely it's not the adapter I'm using to go from micro-hdmi to hdmi.

Will try a fresh OS and pull and report back hopefully here soon.

@HussX
Copy link
Owner

HussX commented Jul 7, 2024 via email

@Carbur8tr
Copy link
Author

Started fresh and same outcome:

Jul 07 13:59:54 RTSP systemd[1]: piplay.service: Scheduled restart job, restart counter is at 2.
Jul 07 13:59:54 RTSP systemd[1]: Stopped piplay.service - PIPlay.
Jul 07 13:59:54 RTSP systemd[1]: piplay.service: Consumed 1.050s CPU time.
Jul 07 13:59:55 RTSP systemd[1]: Started piplay.service - PIPlay.
Jul 07 13:59:56 RTSP startup.sh[6586]: drmModeGetResources failed (Operation not supported)
Jul 07 13:59:56 RTSP startup.sh[6586]: no screens available, assuming 24-bit color
Jul 07 13:59:56 RTSP startup.sh[6586]: Cannot create window: no screens available
Jul 07 13:59:56 RTSP startup.sh[6585]: /opt/piplay/startup.sh: line 6: 6586 Aborted python3 /opt/piplay/piplay.py

I'm assuming you were referring to changing the VNC resolution in Raspi-Config, in which case I set it to the native resolution of the screen and still same result.

At this point I'm thinking that I need to look a little further into recompiling QT. Not really sure how at this point but from most of what I read it's pointing back to a potential issue in that area.

@HussX
Copy link
Owner

HussX commented Jul 7, 2024 via email

@Carbur8tr
Copy link
Author

Tried both X11 and Wayfire, same result.

@HussX
Copy link
Owner

HussX commented Jul 7, 2024 via email

@Carbur8tr
Copy link
Author

IMG_0317

@HussX
Copy link
Owner

HussX commented Jul 8, 2024 via email

@Carbur8tr
Copy link
Author

No worries, I really do appreciate you entertaining this.

In the meantime I might start fresh and play with a couple of the imports. I was reading on an opencv-headless and contrib that seemed interesting but need to read more.

@HussX
Copy link
Owner

HussX commented Jul 16, 2024

I thought about trying out headless and using a venv, but I felt better about using apt-packages despite being more likely to change. And apologies, I haven't had a chance to attempt to look at this yet. I've been hammered with remote issues.

@Carbur8tr
Copy link
Author

I haven't had time to mess with it myself either. I'll be curious to see if you can find anything anything.

My luck it would be something simple and stupid on my end.

@HussX
Copy link
Owner

HussX commented Jul 30, 2024

Verified this. I pulled my working SD and dropped it in a 5, I see the exact same thing. Digging into it now while I have a short chance.

@HussX HussX self-assigned this Jul 30, 2024
@HussX
Copy link
Owner

HussX commented Jul 30, 2024

Tested this on a 5 and then moved the SD back to 4 to verify it didn't break anything. Please test!

@HussX HussX closed this as completed Jul 30, 2024
@Carbur8tr
Copy link
Author

I read through the startup file. Easy enough, will test tonight and report back.

@HussX
Copy link
Owner

HussX commented Jul 30, 2024

Sorry for all the delays. A ton of work projects took priority.

@Carbur8tr
Copy link
Author

To confirm, everything appears to be working now as it should. Many thanks!

Question, have you noticed that the grid likes to resize quite a bit over a period of time? I have a 3x3 grid currently and at first launch all squares look equally sized. After running for some time now I noticed that the top and middle row are growing and the bottom row is shrinking. (If that makes any sense). Just curious if this a configuration issue on my end?

@HussX
Copy link
Owner

HussX commented Aug 1, 2024

@Carbur8tr Actually I haven't noticed that. I've had this running on my desk for weeks and everything looked normal, mind you that's on a 4. I'll have to do some more extensive testing on a 5. Glad it's working, though!

The only time I've seen any odd sizing is if a resolution was changed mid stream or when a camera was reconnecting. Is there anything odd in the logs?

@Carbur8tr
Copy link
Author

Interesting you should ask, I am getting quite a few disconnects and reconnects "using backend 1900."

@HussX
Copy link
Owner

HussX commented Aug 1, 2024

I had to look that up.. :) 1900 is FFMPEG.

@HussX
Copy link
Owner

HussX commented Aug 1, 2024 via email

@Carbur8tr
Copy link
Author

Looks great when it first launches and it doesn't look bad when it's been up for a bit and resizes, but rather just odd because it will compress the bottom row.

In total there are 9 cameras I'm displaying but I can try less or more if you would like. I think the disconnects are mainly why this is happening. The odd part is that all of the streams seem to play great at their native frame rates (30fps) until there's a disconnect. Then it will quickly reconnect and sometimes resize.

@HussX
Copy link
Owner

HussX commented Aug 8, 2024 via email

@HussX
Copy link
Owner

HussX commented Aug 20, 2024

@Carbur8tr I pushed another slight change for static panel sizes which should stop the resizing over time. I'm still digging in on what I can do to optimize things a bit.

@Carbur8tr
Copy link
Author

Sorry for the lapse in time, work has been busy as I'm sure you understand.

I just dropped the changes in and will try to report back over the next couple of days to see if I notice the same behavior.

@HussX
Copy link
Owner

HussX commented Sep 2, 2024 via email

@Carbur8tr
Copy link
Author

Reporting back. Seems like the sizing issues have been resolved. I've tweaked a couple of small things for my setup but overall great progress!

Thanks for all the help in getting this resolved.

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