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

Is the HUD class instantiation necessary to get successful video stream in controller_pc? #12

Open
smarkoco opened this issue Jun 19, 2023 · 2 comments

Comments

@smarkoco
Copy link
Contributor

smarkoco commented Jun 19, 2023

When I try to run controller_pc after running flight, we are able to establish the sockets across 2020 and 2021 (not 2022, for microphone, which periodically prints "Socket ( 2022 ) connect error : Connection refused" in the controller_pc shell. I think this is not a problem, just documenting what we observed.).

I actually had to comment out the instantiation of hud = HUD{} line in config.lua in order to avoid an error: libpng: Not a PNG file. This libpng error had also caused the whole program to crash, so I had to comment out the instantiation and the calls to the hud:ShowImage() and hud:HideImage() methods in the config.lua script. I was wondering if the HUD not showing is somehow related to the stream also not showing? Maybe a black overlay covering the video feed or something?

I'm not sure what else could cause the black video feed, but I'm happy it seems like everything is connecting well!

When running flight, we get successful latency and telemetry updates (zero'd out ones, which is expected since we are just on the IO board right now), and both applications run without error, but for some reason the display remains black on controller_pc. I tried clicking "Start" under Record, and "Take picture" under Still picture, and no errors occured, but no feedback about why the screen could be black. I tried turning up the brightness too, but it didn't change

Attached outputs are when running sudo ./flight on the CM4 and ./controller_pc on my laptop. I also attached my current config.lua file HERE. If you have the time to take a look -- much appreciated! no rush though

image
image
image
image

@smarkoco
Copy link
Contributor Author

I also just noticed at the bottom of the GUI it reports "Camera: 0 KB/s" and "0 FPS", so I guess I'm having some connection issue? Thx in advance

@dridri
Copy link
Owner

dridri commented Jun 20, 2023

I just tested with your config file and it works as expected, there's probably something network-related. The live feed should just show up without any user action (no need to "Start" or "Take picture")

Maybe try with UDP instead of UDPLite (in both flight and ground settings).

You could also try running tcpdump (with udp, as it seems to not be happy with udp-lite) using sudo tcpdump udp and port 2021 on both PC and rPi and see what happens

edit : the HUD is totally optional and you wouldn't want it anyway as it renders only on physical video output (TV / DSI / HDMI / etc). The ground controller already receives all the necessary data to display a HUD on client side if needed (battery level, throttle speed, link quality & signal strength, CPU load, ...)

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