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

NOISSUE Possible that hyperion do a --clean command always before running video?

Discussion in 'Development' started by iiidefconiii, 6 September 2016.

  1. iiidefconiii

    iiidefconiii Member

    Messages:
    89
    Hardware:
    32/64bit, +Arduino
    How about the priority does it work like if i have an effect running lets say prio 500, and then start a movie (on prio 10). it will override the effect i had loading? cause when i have this effect loaded and then start an movie, the effect keeps going. when i set an --clear suggestion in terminal, the effect kills and then start to output the movie. But im unsure how this priority works and which priority effect has and which prio mplayer has. or kodiVideoChecker priority.

    my final goal is to get rid of the autoxec.py (for hyperion functions)
    Code:
    import xbmc,xbmcgui
    import subprocess,os
    import time
    
    class MyPlayer(xbmc.Player) :
    
            def __init__ (self):
                xbmc.Player.__init__(self)
    
            def onPlayBackStarted(self):
                if xbmc.Player().isPlayingVideo():
                    os.system('/usr/share/hyperion/bin/hyperion-remote --clear')
    
            def onPlayBackEnded(self):
                if (VIDEO == 1):
    
            def onPlayBackStopped(self):
                if (VIDEO == 1):
                  
            def onPlayBackPaused(self):
    
            def onPlayBackResumed(self):
                if xbmc.Player().isPlayingVideo():
                    os.system('/usr/share/hyperion/bin/hyperion-remote --clear')
    
    player=MyPlayer()
    
    while(1):
        if xbmc.Player().isPlayingVideo():
            VIDEO = 1
    
        else:
            VIDEO = 0
    
        xbmc.sleep(3000)
    
    Thank You.
     
  2. Brindosch

    Brindosch Administrator Administrator

    Messages:
    672
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    yes, lower number wins, but your effect still runs, It is just not visible. If you stop the capture it it will come back. Priority system takes effect for effects and grabbers: platform grabbers, v4l, kodi capture addon, windows capture application(screencap), udp receiver, boblight. You could also start the "external" capture binarys (hyperion-x11, hyperion-dispmanx) and send across your network.

    The -clear command should be used with a priority information. So it is possible to kill single effects (with their priority as identifier)
    The -l command will show you more about the current state
     
  3. iiidefconiii

    iiidefconiii Member

    Messages:
    89
    Hardware:
    32/64bit, +Arduino
    It's not. I open an effect then an video and it stays on the effect. Should I define the priority some were in my script? If yes how high does the video grabber is set so I can give this one a higher one i suppose 900 would be ok or can that conflict with others you guys are giving it standard

    I believe I remind a priority setting in the kodi addon. Have to check when I get back home
     
  4. Brindosch

    Brindosch Administrator Administrator

    Messages:
    672
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    hyperion-remote -l will show you the current priorities and their state (scroll down to priorities). Could you post this part?
     
  5. iiidefconiii

    iiidefconiii Member

    Messages:
    89
    Hardware:
    32/64bit, +Arduino
    Will do once back home really love this forum. Glad you have a spammer like me to make lots of post? Haha
     
  6. iiidefconiii

    iiidefconiii Member

    Messages:
    89
    Hardware:
    32/64bit, +Arduino
    oki so workflow is:

    Start machine
    start kodi
    initctl start hyperion automaticly
    then background effect start

    then i press the button, my effect starts
    then start an movie, effect stays on


    the scripts itself send a prio 100 on the effect
    Code:
    def set_effect(effect):
    
        subprocess.Popen('/usr/share/hyperion/bin/hyperion-remote --priority 100 --effect ' + effect, shell=True)
    hyperion-remote -l
    Code:
    root@htpc:~# hyperion-remote -l
    hyperion-remote:
            Version   : 2.0.0 (master (GitHub-04c9af6/4c6a4a1-1473153509))
            build time: Sep  6 2016 22:13:37
    Connected to: "localhost:19444"
    Get server info
    Server info:
    {
       "activeEffects" : [
          {
             "args" : {
                "blobs" : 5,
                "color" : [ 0, 0, 255 ],
                "hueChange" : 60.0,
                "reverse" : false,
                "rotationTime" : 60.0
             },
             "priority" : 100,
             "script" : "/usr/share/hyperion/effects/mood-blobs.py",
             "timeout" : -1
          }
       ],
       "activeLedColor" : [],
       "adjustment" : [
          {
             "blueAdjust" : [ 0, 0, 255 ],
             "greenAdjust" : [ 0, 255, 0 ],
             "id" : "default",
             "redAdjust" : [ 255, 0, 0 ]
          }
       ],
       "effects" : [
          {
             "args" : {
                "color-end" : [ 238, 173, 47 ],
                "color-start" : [ 136, 97, 7 ],
                "fade-time" : 5.0
             },
             "name" : "Cinema brighten lights",
             "script" : "/usr/share/hyperion/effects/fade.py"
          },
          {
             "args" : {
                "color-end" : [ 136, 97, 7 ],
                "color-start" : [ 238, 173, 47 ],
                "fade-time" : 5.0
             },
             "name" : "Cinema dim lights",
             "script" : "/usr/share/hyperion/effects/fade.py"
          },
          {
             "args" : {
                "color" : [ 255, 0, 0 ],
                "fadeFactor" : 0.70,
                "speed" : 1.0
             },
             "name" : "Knight rider",
             "script" : "/usr/share/hyperion/effects/knight-rider.py"
          },
          {
             "args" : {
                "blobs" : 5,
                "color" : [ 0, 0, 255 ],
                "hueChange" : 60.0,
                "reverse" : false,
                "rotationTime" : 60.0
             },
             "name" : "Blue mood blobs",
             "script" : "/usr/share/hyperion/effects/mood-blobs.py"
          },
          {
             "args" : {
                "baseChange" : true,
                "baseColorChangeRate" : 2.0,
                "baseColorRangeLeft" : 160,
                "baseColorRangeRight" : 320,
                "blobs" : 5,
                "color" : [ 0, 0, 255 ],
                "hueChange" : 30.0,
                "reverse" : false,
                "rotationTime" : 60.0
             },
             "name" : "Cold mood blobs",
             "script" : "/usr/share/hyperion/effects/mood-blobs.py"
          },
          {
             "args" : {
                "baseChange" : true,
                "baseColorChangeRate" : 0.20,
                "baseColorRangeLeft" : 0,
                "baseColorRangeRight" : 360,
                "blobs" : 5,
                "colorRandom" : true,
                "hueChange" : 30.0,
                "reverse" : false,
                "rotationTime" : 60.0
             },
             "name" : "Full color mood blobs",
             "script" : "/usr/share/hyperion/effects/mood-blobs.py"
          },
          {
             "args" : {
                "blobs" : 5,
                "color" : [ 0, 255, 0 ],
                "hueChange" : 60.0,
                "reverse" : false,
                "rotationTime" : 60.0
             },
             "name" : "Green mood blobs",
             "script" : "/usr/share/hyperion/effects/mood-blobs.py"
          },
          {
             "args" : {
                "blobs" : 5,
                "color" : [ 255, 0, 0 ],
                "hueChange" : 60.0,
                "reverse" : false,
                "rotationTime" : 60.0
             },
             "name" : "Red mood blobs",
             "script" : "/usr/share/hyperion/effects/mood-blobs.py"
          },
          {
             "args" : {
                "baseChange" : true,
                "baseColorChangeRate" : 2.0,
                "baseColorRangeLeft" : 333,
                "baseColorRangeRight" : 151,
                "blobs" : 5,
                "color" : [ 255, 0, 0 ],
                "hueChange" : 30.0,
                "reverse" : false,
                "rotationTime" : 60.0
             },
             "name" : "Warm mood blobs",
             "script" : "/usr/share/hyperion/effects/mood-blobs.py"
          },
          {
             "args" : {
                "color_one" : [ 255, 0, 0 ],
                "color_two" : [ 0, 0, 255 ],
                "colors_count" : 10,
                "reverse" : false,
                "rotation-time" : 1.50
             },
             "name" : "Police Lights Single",
             "script" : "/usr/share/hyperion/effects/police.py"
          },
          {
             "args" : {
                "color_one" : [ 255, 0, 0 ],
                "color_two" : [ 0, 0, 255 ],
                "reverse" : false,
                "rotation-time" : 1.0
             },
             "name" : "Police Lights Solid",
             "script" : "/usr/share/hyperion/effects/police.py"
          },
          {
             "args" : {
                "brightness" : 1.0,
                "reverse" : false,
                "rotation-time" : 60.0
             },
             "name" : "Rainbow mood",
             "script" : "/usr/share/hyperion/effects/rainbow-mood.py"
          },
          {
             "args" : {
                "brightness" : 1.0,
                "reverse" : false,
                "rotation-time" : 3.0
             },
             "name" : "Rainbow swirl fast",
             "script" : "/usr/share/hyperion/effects/rainbow-swirl.py"
          },
          {
             "args" : {
                "brightness" : 1.0,
                "reverse" : false,
                "rotation-time" : 20.0
             },
             "name" : "Rainbow swirl",
             "script" : "/usr/share/hyperion/effects/rainbow-swirl.py"
          },
          {
             "args" : {
                "saturation" : 1.0,
                "speed" : 1.0
             },
             "name" : "Random",
             "script" : "/usr/share/hyperion/effects/random.py"
          },
          {
             "args" : {
                "colorLevel" : 230,
                "speed" : 1.50,
                "whiteLevel" : 100
             },
             "name" : "Running dots",
             "script" : "/usr/share/hyperion/effects/running_dots.py"
          },
          {
             "args" : {
                "alarm-color" : [ 255, 0, 0 ],
                "post-color" : [ 255, 174, 11 ],
                "shutdown-enabled" : false,
                "speed" : 1.20
             },
             "name" : "System Shutdown",
             "script" : "/usr/share/hyperion/effects/shutdown.py"
          },
          {
             "args" : {
                "color" : [ 255, 0, 0 ],
                "percentage" : 10,
                "rotation-time" : 12.0
             },
             "name" : "Snake",
             "script" : "/usr/share/hyperion/effects/snake.py"
          },
          {
             "args" : {
                "brightness" : 1.0,
                "color" : [ 255, 255, 255 ],
                "random-color" : true,
                "reverse" : false,
                "rotation-time" : 3.0,
                "saturation" : 1.0,
                "sleep-time" : 0.050
             },
             "name" : "Sparks Color",
             "script" : "/usr/share/hyperion/effects/sparks.py"
          },
          {
             "args" : {
                "brightness" : 1.0,
                "color" : [ 255, 255, 255 ],
                "random-color" : false,
                "reverse" : false,
                "rotation-time" : 3.0,
                "saturation" : 1.0,
                "sleep-time" : 0.050
             },
             "name" : "Sparks",
             "script" : "/usr/share/hyperion/effects/sparks.py"
          },
          {
             "args" : {
                "color" : [ 0, 0, 255 ],
                "frequency" : 10.0
             },
             "name" : "Strobe blue",
             "script" : "/usr/share/hyperion/effects/strobe.py"
          },
          {
             "args" : {
                "color" : [ 188, 17, 66 ],
                "frequency" : 10.0
             },
             "name" : "Strobe Raspbmc",
             "script" : "/usr/share/hyperion/effects/strobe.py"
          },
          {
             "args" : {
                "color" : [ 255, 255, 255 ],
                "frequency" : 10.0
             },
             "name" : "Strobe white",
             "script" : "/usr/share/hyperion/effects/strobe.py"
          },
          {
             "args" : {
                "speed" : 1.0
             },
             "name" : "Color traces",
             "script" : "/usr/share/hyperion/effects/traces.py"
          },
          {
             "args" : {
                "ListenIP" : "239.255.28.01",
                "ListenPort" : 2801
             },
             "name" : "UDP multicast listener",
             "script" : "/usr/share/hyperion/effects/udp.py"
          },
          {
             "args" : {
                "ListenPort" : 2391
             },
             "name" : "UDP listener",
             "script" : "/usr/share/hyperion/effects/udp.py"
          },
          {
             "args" : {
                "sleepTime" : 0.750
             },
             "name" : "X-Mas",
             "script" : "/usr/share/hyperion/effects/x-mas.py"
          }
       ],
       "hostname" : "htpc",
       "hyperion" : [
          {
             "build" : "master (GitHub-04c9af6/4c6a4a1-1473153509)",
             "jsonrpc_version" : "1.0.0",
             "time" : "Sep  6 2016 22:12:49",
             "version" : "2.0.0"
          }
       ],
       "ledDevices" : {
          "active" : "adalight",
          "available" : [
             "adalight",
             "adalightapa102",
             "apa102",
             "atmo",
             "atmoorb",
             "e131",
             "fadecandy",
             "file",
             "hyperion-usbasp",
             "lightpack",
             "lpd6803",
             "lpd8806",
             "multi-lightpack",
             "p9813",
             "paintpack",
             "philipshue",
             "piblaster",
             "rawhid",
             "sedu",
             "sk6812rgbw-spi",
             "tinkerforge",
             "tpm2",
             "tpm2net",
             "udpraw",
             "ws2801",
             "ws2812spi"
          ]
       },
       "priorities" : [
          {
             "active" : true,
             "owner" : "EFFECT: mood-blobs.py",
             "priority" : 100,
             "visible" : true
          },
          {
             "active" : true,
             "owner" : "EFFECT: running_dots.py",
             "priority" : 2147483646,
             "visible" : false
          },
          {
             "active" : true,
             "owner" : "Off",
             "priority" : 2147483647,
             "visible" : false
          },
          {
             "active" : false,
             "owner" : "Boblight",
             "priority" : 800,
             "visible" : false
          },
          {
             "active" : false,
             "owner" : "UDPLISTENER",
             "priority" : 800,
             "visible" : false
          }
       ],
       "temperature" : [
          {
             "correctionValues" : [ 255, 255, 255 ],
             "id" : "default"
          }
       ],
       "transform" : [
          {
             "blacklevel" : [ 0.0, 0.0, 0.0 ],
             "gamma" : [ 2.50, 2.50, 2.50 ],
             "id" : "default",
             "luminanceGain" : 1.0,
             "luminanceMinimum" : 0.0,
             "saturationGain" : 1.0,
             "saturationLGain" : 1.0,
             "threshold" : [ 0.0, 0.0, 0.0 ],
             "valueGain" : 1.0,
             "whitelevel" : [ 1.0, 1.0, 1.0 ]
          }
       ]
    }
    
    
    can it be
    Code:
         "boblightServer" :
         {
             "enable"   : true,
             "port"     : 19333,
             "priority" : 800
         },

    EDIT: found solution, in hyperion kodi addon set priority to 10, i think its best to default this, to avoid this kind of situation in future. Thank you for the support. My system start to run almost fully automaticly one more step.
     
    Last edited: 7 September 2016
  7. Brindosch

    Brindosch Administrator Administrator

    Messages:
    672
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    Depending on use case you need different values. In your case your effect is very low. The Kodi Addon ranks lower by default than grabbers (To overwrite grabbers if there are any). Control applications should use a lower value than all grabbers, as you usually expect to overwrite them.
    If you want a effect that is behind your grabbers, set the value accordingly.

    I don't think there is something we can change. With Hyperion you have many choices (which is a problem), the values are defined to get it working by default for common cases.
     
    • Like Like x 1