Reduce the "check signal" interval when no signal detected, or provide users to set interval.

  • Just got into Hyperion and it's great. Very easy to use.


    I've put this in feature requests as I believe it's working as intended but I'm seeing high CPU usage (RPI3) even when Hyperion correctly identifies "no signal".

    This is idle/suspended. (no Signal)


    This is active/processing LED's. (signal detected)


    It took some tweaking to identify no signal as my capture card outputs a black screen, but after setting them up it's for sure working fine.


    Code
    2024-02-05T13:03:12.479Z [V4L2] (INFO) Signal detected
    2024-02-05T13:03:12.482Z [LEDDEVICE|Hue Lights] (INFO) Switching device philipshue ON
    2024-02-05T13:04:39.151Z [V4L2] (INFO) Signal lost
    2024-02-05T13:04:40.070Z [LEDDEVICE|Hue Lights] (INFO) Switching device philipshue OFF

    What I think is happening, and I may be wrong, is that Hyperion is still polling the black screen at the same rate it's configured to capture at. So 30fps. The slightly lower CPU usage is probably just because there are less changes to process. Would it better to save CPU resources and poll slower when a no signal state is detected? Even once a second would probably be acceptable for most users. In fact for me, my Firestick takes 10-15 seconds to boot up so every 5 seconds would be fine.


    If I'm wrong then I can post in support. It's no major issue, I was going to use a GPIO pin to trigger start/stop the service, and I can see new update has integrated OS event support so probably something I can use in there.


    Alternatively, if the above is true but the CPU usage is unavoidable as it's locked to the capture settings (1024x768 MJPG 30FPS) then perhaps an option to switch to a lower capture when detecting no signal? 640x480 YUYV 5FPS is a much more respectable 3-4% CPU usage and Hyperion is able to detect signal. Once it detects, switch back to the higher quality user configured settings.

    Einmal editiert, zuletzt von AMJ () aus folgendem Grund: Merged a post created by AMJ into this post.

    • Offizieller Beitrag

    640x480 MJPG 30 FPS Size decimation 6

    Hyperion does not require a high resolution, minimum one pixel per LED, and the CPU load is reduced.


    Have you looked at hyperion-remote or the control options via the Json API

    hyperion-remote --help

    JSON RPC Introduction | Hyperion


    regards pclin

  • I was just testing really, and something I noticed. Using the above reduces loaded CPU to about 25% and idle to around 13-14%, which is in improvement, but can't help think that it's just wasted resources when it seems to be just watching a black screen for activity. It would be more of a problem, say, if I was using my Pi Zero (all my Pi's are multipurpose so on all the time/servicing other tasks & apps) as it's got much more limited CPU resources.


    If there's no appetite to change this (or if I'm wrong entirely) then that's fine. That command line utility looks useful, if the idle CPU usage bothers me in the future I'll throw something together that disables it through a GPIO pin.

    • Offizieller Beitrag

    AMJ As you rightly assumed, the capturing is not throttled currently when a black screen was detected.

    That would be a new feature.


    With 2.0.16 you can also use your Remote and put Hyperion into Suspend mode.

    Just enable CEC events.

    Might be easier and out of the box than a GPIO solution.

  • Zitat

    AMJ As you rightly assumed, the capturing is not throttled currently when a black screen was detected.

    That would be a new feature.


    Thanks for the confirmation/clarification. I believe it's a valid request for new feature then, though seeing as no one else has requested it then it doesn't seem like it'd be very important.


    Zitat

    With 2.0.16 you can also use your Remote and put Hyperion into Suspend mode.

    Just enable CEC events.

    Might be easier and out of the box than a GPIO solution.


    Thanks. I'll look into the remote CLI in more detail and will probably be handy for what I am thinking of doing. I'm a special case due to my setup which is why I'm thinking using a GPIO pin to turn on/off Hyperion when going high/low. CEC is a no (my HDMI splitter doesn't support it) and all my entertainment devices share the same 5v supply, some which come on/off with the TV (Via the TV's USB power & a couple of relays) so it's a ready made source for an on/off trigger.

  • Hi,


    how about that:



    Drops CPU usage from 40% to 3% if no signal detected.


    wbr

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!