awawa-dev / HyperHDR

Highly optimized open source ambient lighting implementation based on modern digital video and audio stream analysis for Windows, macOS and Linux (x86 and Raspberry Pi / ARM).
http://www.hyperhdr.eu/
MIT License
1.12k stars 117 forks source link

Install HyperHDR on Home Assistant OS #245

Closed ihrapsa closed 2 years ago

ihrapsa commented 2 years ago

Feature request

What problem does this feature solve?

Not being able to run HyperHDR server on the same device running HomeAssistant OS

What does the proposed API look like?

N/A

How should this be implemented in your opinion?

Through the Home Assistant Add-on Repository. The Hyperion.ng project was (fairly)recently added so we might look into that as an example.

Are you willing to work on this yourself?

I'm not sure I have the necessary skills for that but I'd be more than happy to help and/or test.

awawa-dev commented 2 years ago

Hi Personally don't use HA and I highly doubt there are enough resources free on the Rpi when HA is running. When I tested HA on Rpi3, there weren't enough resources even for HA running solo on the device and the interface lag was terrible. Maybe on Rpi4 with more available RAM the situation is better, don't have s spare unit to test it. I don't plan on making such a plugin, but maybe some other users would create it as a separate project.

ihrapsa commented 2 years ago

I've actually managed to get HyperHDR up and running today as a hass add-on on a pi4b with 4gb RAM and don't see any issues yet. Will do some performance tests tomorrow. I've followed the Hyperion.ng template I was talking about above so it might be a little sloppy but if someone more competent then I wants to contribute to this I'm more than happy to approve PRs. 😃

awawa-dev commented 2 years ago

If the performance is satisfied then I can provide link on HyperHDR to your fork. Same as it's done for @mjoshd and his HA plugin for HyperHDR. Do you have an access to CPU/RAM statistics when HyperHDR is running and capturing video and how they look like? They are also available in v18beta in the overview tab if there is no direct access to the system.

ihrapsa commented 2 years ago

Hi, CPU and RAM usage are minimal while capturing as far as I can tell (CPU 4.7-6.1%, RAM ~2%) on this pi4B 4GB. However, I'm having issues with flickering. I'm using wled to drive the strip but the flickering happens only when hyperhdr drives the strip. Any idea what might cause this?

What I've tried:

I've also installed HyperHDR on a separate pi3B+ with the same wled driver and psu and there's no flicker/issues

[UPADTE] I've tested with Hyperion.ng on this pi4b running Home Assistant and has the exact same flicker issues.

[UDPATE2] Ok something weird fixed this. I have two identical hdmi capture cards and I was planning to test the working capture card from the pi3b on the pi4b. After I plugged it out from the pi3b the flicker on the other TV (where the pi4b sits) disappeared. I think HyperHDR on the pi3b was still trying to control the wled driver (as I have only one at the moment).

image image

awawa-dev commented 2 years ago

Ok something weird fixed this. I have two identical hdmi capture cards and I was planning to test the working capture card from the pi3b on the pi4b. After I plugged it out from the pi3b the flicker on the other TV (where the pi4b sits) disappeared. I think HyperHDR on the pi3b was still trying to control the wled driver (as I have only one at the moment).

Yes, that's possible that these two units were fighting for the same WLED device. WLED UDP driver is rather ugly and it won't notify user about any trouble. Unfortunately not much can be done here because QT libraries won't throw any error even if the WLED device is powered off (at least for Windows, for Linux it depends).

ihrapsa commented 2 years ago

Hi, I've rebuilt the different arch docker images thanks to bradsjm's scripts and workflow and I think the HyperHDR add-on is ready now. I did some further testing and I see no difference compared to a standalone installation. 🙂

awawa-dev commented 2 years ago

Great! I will provide info about your fork with the next release of HyperHDR and invite everybody to help with testing :)

FransTwisk commented 2 years ago

This is great! Was already running Home Assistant (Supervised) with a manual install of HyperHDR next to it, but this would make it easier to maintain and update. Just switched, imported config and works fine. I might even switch to Home Assistant Operating System now!

ihrapsa commented 2 years ago

This is great! Was already running Home Assistant (Supervised) with a manual install of HyperHDR next to it, but this would make it easier to maintain and update. Just switched, imported config and works fine. I might even switch to Home Assistant Operating System now!

I'm really glad you found it useful.

I might just close this as well since the issue is solved.