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. TPmodding

    TPmodding Administrator Staff Member Administrator

    Messages:
    913
    Hardware:
    RPi1/Zero, RPi2, RPi3, +Arduino
  2. Fabi1080

    Fabi1080 New Member

    Messages:
    4
    Hardware:
    RPi2
    The problem is, that the picture is coming from the HDMI2AV converter and not from the grabber. So the HDMI2AV converter is sending a rainbow or blue picture and the grabber thinks it is a valid signal.
     
  3. redPanther

    redPanther Moderator Developer

    Messages:
    211
    Hardware:
    RPi1/Zero, RPi2, 32/64bit, +Arduino
    As suggested, we can define an area where the threshold is applied. Then you can define the area for a blue stripe and this will be used for detection
     
    • Like Like x 1
  4. Paulchen-Panther

    Paulchen-Panther Ich komme wieder, keine Frage! Developer

    Messages:
    109
    Hardware:
    RPi1/Zero, RPi3, 32/64bit, +Arduino
  5. HeK

    HeK New Member

    Messages:
    2
    Hardware:
    RPi1/Zero
    As another rainbow no-signal sufferer here, what about adding audio capture support to disable LED output after x-seconds of no captured sound?
    Has the added benefit of disabling output when my blueray/mediabox screensaver kicks in.
     
  6. redPanther

    redPanther Moderator Developer

    Messages:
    211
    Hardware:
    RPi1/Zero, RPi2, 32/64bit, +Arduino
    Audio capture is not so easy, because we have no reliable always available api in linux. There is alsa, jack and pulseaudio. We have to implement all of them to get this feature work everywhere. Then comes next prob, hyperion is often used on raspi and there is no audio in (extra hardware is needes).
    I'm sure we will integrate audio in feature, because its needed for audio to lights ....
     
  7. TPmodding

    TPmodding Administrator Staff Member Administrator

    Messages:
    913
    Hardware:
    RPi1/Zero, RPi2, RPi3, +Arduino
    you didnt understand it red, but HeK the idea is very good

    short in german: den audio input vom usbgrabber abgreifen als "kontrolle" ob der usb grabber input bekommt, wenn kein ton anliegt sollte der grabber deaktiv sein also kann man den usbgrabber auf kodi bzw auf kein bild -> leds aus. von der idee richtig gut eigentlich... müsste man schauen wie man sowas implementieren kann
     
  8. Brindosch

    Brindosch Administrator Administrator

    Messages:
    679
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    I think redPanther understood it, but this is not as easy as you may think. Well maybe in future, but the underline phrase is future (As long we are in between so much rework and improvements)
     
    • Like Like x 1
  9. HeK

    HeK New Member

    Messages:
    2
    Hardware:
    RPi1/Zero
    Since the shutdown issues are mainly on V4L2 capture setups, I would assume that most capture devices also have audio inputs. Helps on the raspberry pi at least.

    For the time being, I'm going to see if I can cobble together a transistor on a 555 timer, taking a reset input from my TV's optical audio out. Shut off power to the LED string after x-seconds of no signal.
     
  10. redPanther

    redPanther Moderator Developer

    Messages:
    211
    Hardware:
    RPi1/Zero, RPi2, 32/64bit, +Arduino
    Take audio from grabber is just recording from an alsa device. So we have the problems described. It is possible to tinker with rpi gpio or arduino to detect active sound, but this solution is not the best.
     
  11. Wastl

    Wastl New Member

    Messages:
    17
    Hardware:
    RPi2, RPi3, +PhilipsHue
    maybe you can just take kind of a "screenshot" of the "no-signal-image" and save this as setting to recognize when there is no signal?
     
  12. redPanther

    redPanther Moderator Developer

    Messages:
    211
    Hardware:
    RPi1/Zero, RPi2, 32/64bit, +Arduino
    To complex, a god solution is already suggested some post before.

    'we can define an area where the threshold is applied. Then you can define the area for a blue stripe and this will be used for detection'
     
    Last edited: 29 August 2016
  13. KuiBar

    KuiBar New Member

    Messages:
    2
    Hardware:
    RPi1/Zero, RPi3
    Hello redPanther,

    What is the status for the detection area feature for a "No Signal" image. I also have the problem that I bought 3 different HDMI to AV converters and they all produce a rainbow output when no HDMI input is detected.

    Do you have any other suggestion related to this problem?
     
  14. redPanther

    redPanther Moderator Developer

    Messages:
    211
    Hardware:
    RPi1/Zero, RPi2, 32/64bit, +Arduino
  15. KuiBar

    KuiBar New Member

    Messages:
    2
    Hardware:
    RPi1/Zero, RPi3
    Thnx for your answer. I like to help but i'm not a developer. So I will wait. Do you have a date when you expect it will be ready? And if you search persons to test the new function let me know.
     
  16. peter

    peter Member

    Messages:
    108
    Hardware:
    RPi1/Zero, RPi2, RPi3
    hi friends, could you help me please?
    My hdmi2av sends blue picture when no signal - [​IMG]
    When I checked image in image editor, I found out that there is several pixel values e.g.:
    18,71,255
    19,73,255
    20,71,255 etc

    I tried various settings to set v4l2 grabber to display "no color" on LEDs when there is no signal detected (I found out these values are the most important):
    Code:
        // SMOOTHING CONFIG
            "smoothing" :
            {
                "type"            : "linear",
                "time_ms"         : 200,
                "updateFrequency" : 20.0000,
                "updateDelay"     : 0
            }
        },
    
        // V4L2 GRABBER CONFIG
        "grabber-v4l2" :
        {
            "device" : "/dev/video0",
            "input" : 0,
            "standard" : "PAL",
            "width" : 360,
            "height" : 288,
            "frameDecimation" : 1,
            "sizeDecimation" : 1,
            "priority" : 900,
            "mode" : "2D",
            "cropLeft" : 20,
            "cropRight" : 20,
            "cropTop" : 20,
            "cropBottom" : 20,
            "redSignalThreshold" : 0.9,
            "greenSignalThreshold" : 0.9,
            "blueSignalThreshold" : 1.0
        },
    I tried different settings (red/green thresholds from 0.0 up to 0.9, frameDecimation - 2,8, disable smoothing) but I am not able to get it working when no signal detected. LEDs always are blue when no signal detected and not going to "black"/turn off state. What am I doing wrong please?
     
  17. redPanther

    redPanther Moderator Developer

    Messages:
    211
    Hardware:
    RPi1/Zero, RPi2, 32/64bit, +Arduino
    Set all values to 1.0 Then no signal should be detected permanently. Then start to decrease a value in 0.003 steps. E.g. start with red 0.997 decrease this value until a signal is detected.

    Then take the value before signal was detected.
    Do this again with green value. Blue should stay at 1
     
  18. redPanther

    redPanther Moderator Developer

    Messages:
    211
    Hardware:
    RPi1/Zero, RPi2, 32/64bit, +Arduino
    Btw only frame decimation have impact on signal detection (besides the 3 threshold values of course)
     
  19. redPanther

    redPanther Moderator Developer

    Messages:
    211
    Hardware:
    RPi1/Zero, RPi2, 32/64bit, +Arduino
    • Like Like x 2
  20. peter

    peter Member

    Messages:
    108
    Hardware:
    RPi1/Zero, RPi2, RPi3
    Thank you! :)