1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

IMPROVEMENT V4L2: Add shutdown detection

Discussion in 'Feature Requests' started by Brindosch, 1 June 2016.

  1. Brindosch

    Brindosch Administrator Administrator

    Messages:
    679
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    The V4L2 shuts down properly if the grabber don´t get a signal. Sadly hdmi splitter output often a signal (eg blue)
    Might there a way to "detect" (like blackborder processing) this as a shutdown condition to prevent blue leds in general. And open the possibility for automatically applied effects and static color as a idle state

    @all @penfold42 @redPanther @Paulchen-Panther
    If someone search something to do :)
     
    Last edited: 1 June 2016
  2. Doc.Ex

    Doc.Ex Member

    Messages:
    73
    Hardware:
    RPi2, +PhilipsHue
    I would very much appreciate this feature since my hdmi2av converter outputs a blue screen when there is no input
     
  3. penfold42

    penfold42 Moderator Developer

    Messages:
    742
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    Maybe we could train it for what to search for.

    Do this on the led data will be more efficient than on the farm data as there's less to process

    It needs to be an inexact match over time - if the led pattern is within 1% of the shutdown state 20 times in 3 seconds then do something
     
    • Like Like x 2
  4. Doc.Ex

    Doc.Ex Member

    Messages:
    73
    Hardware:
    RPi2, +PhilipsHue
    That seems to be a nice way of resolving the issue. The "do something" could then be a constant stream of black to the leds. That way the leds stay off, even when theres interference with other devices. (for example, the first 5 leds light up when i turn off my amp)
    And since hyperion keeps processing incoming data it recognises when the there is new input and "reactivates"
     
  5. Brindosch

    Brindosch Administrator Administrator

    Messages:
    679
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    • Agree Agree x 1
  6. Doc.Ex

    Doc.Ex Member

    Messages:
    73
    Hardware:
    RPi2, +PhilipsHue
    Shutting down the grabber definitely saves energy, although not much. But how does it recognise when new input comes in? I for example have my pi always on since it draws only insignificant power. Only the bluescreen prevents me from having hyperion run all the time. A remote control could solve this problem. but that requires user interaction. My perfectionism tells me such things should happen automatically :p
     
    • Like Like x 1
  7. Brindosch

    Brindosch Administrator Administrator

    Messages:
    679
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    The idea behind a shutdown is to prevent the v4l2 keep blocking the priority order. This is just a shutdown on hyperion side, not on device side. This currently works for me with scart, a "blue" detection could kick in here to "shutdown" the hyperion v4l2 grabber. It automatically will be activated if you receive a picture again.

    The send "black" is another part, due to the point we use more than just v4l2 as grabbing source to keep it clean and available to every grabber.
    But we need to figure out first how this should be implemented.
     
  8. redPanther

    redPanther Moderator Developer

    Messages:
    211
    Hardware:
    RPi1/Zero, RPi2, 32/64bit, +Arduino
    why we dont use the signal threshold detection already build in v4l2 grabber?

    "grabber-v4l2" :
    {
    "device" : "/dev/video0",
    "input" : 0,
    "standard" : "no-change",
    "width" : -1,
    "height" : -1,
    "frameDecimation" : 2,
    "sizeDecimation" : 8,
    "priority" : 900,
    "mode" : "2D",
    "cropLeft" : 0,
    "cropRight" : 0,
    "cropTop" : 0,
    "cropBottom" : 0,
    "redSignalThreshold" : 0.0,
    "greenSignalThreshold" : 0.0,
    "blueSignalThreshold" : 0.0
    },
     
  9. Brindosch

    Brindosch Administrator Administrator

    Messages:
    679
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    Not sure if this really fits. You don´t want to ignore color areas in general by default all time? So if you have a bright blue you kill all blue in general?
    But maybe a modification could be used here.
     
  10. redPanther

    redPanther Moderator Developer

    Messages:
    211
    Hardware:
    RPi1/Zero, RPi2, 32/64bit, +Arduino
    for A/D videograbber this is the only chance you have.
    There is a hardcoded framecounter threshold currently set to 50. This means if 50 frames fullfills the threshold condition, no frames send to hyperion core. After priority timeout the used prio channel in priomuxer will be clean and the next prio channel is visible.

    We can make the threshold counter available in config so you can set it to your needs. Default could be current value(50)

    (when my lightberry arrives I will investigate that :) )
     
  11. Wastl

    Wastl New Member

    Messages:
    17
    Hardware:
    RPi2, RPi3, +PhilipsHue
    but not every grabber sends just blue when there is no signal. so this could just be a workaround for some people. brindosch asked for a solution for everybody.
     
  12. redPanther

    redPanther Moderator Developer

    Messages:
    211
    Hardware:
    RPi1/Zero, RPi2, 32/64bit, +Arduino
    you can select the color with that threshold. grabbers sending green, also possible. I know there are some crazy devices out there that send some rainbow pattern ... this would be a bit hard. For all grabbers with a specific color there is a solution
     
  13. Wastl

    Wastl New Member

    Messages:
    17
    Hardware:
    RPi2, RPi3, +PhilipsHue
    yes, i've got such a rainbow-grabber :puke: maybe it's more priceworthy to buy another one than to develop a solution for those
     
  14. redPanther

    redPanther Moderator Developer

    Messages:
    211
    Hardware:
    RPi1/Zero, RPi2, 32/64bit, +Arduino
    sorry for you.

    I can imaginge we extend hyperion-v4l2 with a new function that outputs the settings for the threshold.

    should work like that:

    ./hyperion-v4l2 --getNoSignalThresholds
    > remove signal cable from your grabber and press <enter>
    "redSignalThreshold" : 0.0,
    "greenSignalThreshold" : 0.0,
    "blueSignalThreshold" : 0.8
    > don't forget to reconect your signal cable!

    then you can set the evaluated values in config file. In future we can set the evaluated values directly into config without manual editing.
     
  15. TPmodding

    TPmodding Administrator Staff Member Administrator

    Messages:
    918
    Hardware:
    RPi1/Zero, RPi2, RPi3, +Arduino
    i think i have read somewhere that you can change the "no-signal" pattern, will look when i'm home :)
     
  16. redPanther

    redPanther Moderator Developer

    Messages:
    211
    Hardware:
    RPi1/Zero, RPi2, 32/64bit, +Arduino
    for grabber with blue "signal lost" screen this thresholds worked:

    "redSignalThreshold" : 0.1,
    "greenSignalThreshold" : 0.1,
    "blueSignalThreshold" : 1.0

    I have a lightberry hdmi premium kit converter 3.0
    if this values don't work, try increase red and green value
     
    • Like Like x 1
  17. Brindosch

    Brindosch Administrator Administrator

    Messages:
    679
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    Quote of redPanther to keep the notice.

    good settings for grabber with:

    black no signal picture
    redSignalThreshold" : 0.1,
    "greenSignalThreshold" : 0.1,
    "blueSignalThreshold" : 0.1

    black and/or blue no signal picture
    redSignalThreshold" : 0.1,
    "greenSignalThreshold" : 0.1,
    "blueSignalThreshold" : 1.0

    black and/or green no signal picture
    redSignalThreshold" : 0.1,
    "greenSignalThreshold" : 1.0,
    "blueSignalThreshold" : 0.1


    There is nothing more that could be improved.
    This should result in a "temporary disabled"-state for your v4l2 device and prevent blue or green leds. In case you get a rainbow pattern, there is no chance to get a nice solution
     
  18. Paulchen-Panther

    Paulchen-Panther Ich komme wieder, keine Frage! Developer

    Messages:
    109
    Hardware:
    RPi1/Zero, RPi3, 32/64bit, +Arduino
    Wie wäre es, zum Threshold auch noch eine pixelangabe hinzuzufügen?
    Damit könnte man es eingrenzen welcher Bildschirmbereich überwacht werden soll.
    Wie sieht dieses Rainbow Image eigentlich aus? Kann jemand mal ein Aufnahme von dem Bild machen?
     
  19. Brindosch

    Brindosch Administrator Administrator

    Messages:
    679
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    Is a "RGB" test picture if i am right or even more colors in between.
     
  20. Fabi1080

    Fabi1080 New Member

    Messages:
    4
    Hardware:
    RPi2