dgatwood / ndi_camera_control

An NDI-based and VISCA-based pan-tilt-zoom controller for Raspberry Pi or Rock Pi (with limited support for debugging on macOS).
BSD 3-Clause "New" or "Revised" License
21 stars 2 forks source link

PI 5 support #9

Closed gilliangoud closed 5 months ago

gilliangoud commented 5 months ago

Hi! First, thank you so much for your time and effort for making this.

The Pi5 seems to, due to hardware architecture, no longer support the pigpio library. I have yet to delve into your code to see how much effort replacing this pibrary could be.

Have you thought about this yet or looked into it?

dgatwood commented 5 months ago

I'm one step ahead of you. The code actually supports two different GPIO libraries, switchable with a #define — MRAA and pigpio. I added the MRAA support a while back, because I couldn't get a Raspberry Pi 4, and had to substitute a Rock Pi. Chances are, enabling the USE_MRAA flag will make it "just work" (ignoring any GPIO pin number changes that you might need to make).

gilliangoud commented 5 months ago

Brilliant!

After some struggles to build MRAA, I can confirm it does work on the Pi 5. It still struggles to decode 1080p NDI|HX3, but works on both h264 and h265 encoding with the fast preset smoothly. I've actually noticed that, wether it's MRAA or the Pi5, the PTZ feels a lot more smooth.

To get it to work I had move the "#endif" on line 2631 of cameracontroller.cpp below the led init block to line 2651, as that code was not happy without pigpio. Haven't looked into adding leds to my janky test setup anyhow :).

To replicate:

Thanks for your quick reaction, this got me so excited.

dgatwood commented 5 months ago

Feel free to send a patch for the #endif if that's causing a build failure. If it is just hanging, that might be a pin number problem or something, in which case that's going to end up probably requiring a third set of pin numbers (unless they happen to match the Rock Pi pins). Either way, feel free to send a patch when you get something working.