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

HyperCon APA102 LED Responsiveness

Discussion in 'Software Support' started by Alpha7, 13 January 2021.

  1. Alpha7

    Alpha7 New Member

    Messages:
    12
    Hardware:
    RPi1/Zero
    So I hate to do this, but I've been messing with software settings for the past day or so and I can't get my LEDs to respond in sync with my TV. No matter what I've tried my LED's will also update about .2 seconds after the TV input changes and especially when scenes change it is noticeable that the LED's are lagging behind.

    One other important thing to mention is my PI never goes above ~50% total CPU utilization even when running the LEDs with some of the lower (better resolution, higher refresh) settings i've tried.

    Running a Pi Zero with ~300 APA102 LEDs via a HDMI to USB Video grabber that is getting split off my PS5 to my TV and to the grabber.

    I made some comments below in the code section about some changes I've made, from what i've googled and read around here and the most important things I think i've found is that smoothing is disabled (currently) or at a very low delay, I've messed with the baudrate, refresh rate of the grabber, resolution and Decimation a ton but the only setting that has any increase was lowering smoothing, disabling it doesn't increase it to a perfect, or near perfect synchronization to the TV.

    If there is anything I missed please let me know or anything more I can try. I removed some of the section below like "LEDs" to make the config smaller on here.

    Code:
    {
        "backgroundEffect": {
            "color": [
                255,
                138,
                0
            ],
            "effect": "Warm mood blobs",
            "enable": false,
            "type": "color"
        },
        "blackborderdetector": {
            "blurRemoveCnt": 1,
            "borderFrameCnt": 50,
            "enable": true,
            "maxInconsistentCnt": 10,
            "mode": "default",
            "threshold": 5,
            "unknownFrameCnt": 600
        },
        "boblightServer": {
            "enable": false,
            "port": 19333,
            "priority": 128
        },
        "color": {
            "channelAdjustment": [
                {
    ...
    ...
    ...
            "imageToLedMappingType": "multicolor_mean"
        },
        "device": {
            "colorOrder": "bgr",
            "hardwareLedCount": 1,
            "invert": false,
            "latchTime": 0,                                ## no clue what this does, Not modified it.
            "output": "/dev/spidev0.0",
            "rate": 3000000,                            ## I've seen this set as low as 50,000 and as high as 40,000,000
            "rewriteTime": 10,                            ## default this is 200 I think? changing it doesn't seem to increase LED responsivness though
            "type": "apa102"
        },
        "effects": {
            "disable": [
                ""
            ],
            "paths": [
                "$ROOT/custom-effects"
            ]
        },
        "flatbufServer": {
            "enable": true,
            "port": 19400,
            "timeout": 5
        },
        "foregroundEffect": {
            "color": [
                0,
                0,
                255
            ],
            "duration_ms": 3000,
            "effect": "Rainbow swirl fast",
            "enable": false,
            "type": "color"
        },
        "forwarder": {
            "enable": false,
            "flat": [
                "127.0.0.1:19401"
            ],
            "json": [
                "127.0.0.1:19446"
            ]
        },
        "framegrabber": {
            "cropBottom": 0,
            "cropLeft": 0,
            "cropRight": 0,
            "cropTop": 0,
            "display": 0,
            "frequency_Hz": 10,
            "height": 45,
            "pixelDecimation": 8,
            "type": "auto",
            "width": 80
        },
        "general": {
            "name": "My Hyperion Configv2",
            "showOptHelp": true,
            "watchedVersionBranch": "Stable"
        },
        "grabberV4L2": {                            #messed with resolution, resolution and FPS a ton nothing seems to increase LED responsiveness
            "available_devices": "/dev/video0",
            "blueSignalThreshold": 5,
            "cecDetection": false,
            "cropBottom": 10,
            "cropLeft": 10,
            "cropRight": 10,
            "cropTop": 10,
            "device": "/dev/video0",
            "device_inputs": "auto",
            "fps": 30,
            "framerates": "30",
            "greenSignalThreshold": 5,
            "height": 648,
            "input": -1,
            "redSignalThreshold": 5,
            "resolutions": "custom",
            "sDHOffsetMax": 0.75,
            "sDHOffsetMin": 0.25,
            "sDVOffsetMax": 0.75,
            "sDVOffsetMin": 0.25,
            "signalDetection": false,
            "sizeDecimation": 18,
            "standard": "NTSC",
            "width": 1152
        },
        "instCapture": {
            "systemEnable": false,
            "systemPriority": 250,
            "v4lEnable": true,
            "v4lPriority": 240
        },
        "jsonServer": {
            "port": 19444
        },
        "ledConfig": {
            "classic": {
    ...
    ...
    ...
            },
            "matrix": {
                "cabling": "snake",
                "ledshoriz": 1,
                "ledsvert": 1,
                "start": "top-left"
            }
        },
        "leds": [
            ...
            ...
            ...
            ...
        "logger": {
            "level": "warn"
        },
        "network": {
            "apiAuth": true,
            "internetAccessAPI": false,
            "ipWhitelist": [],
            "localAdminAuth": true,
            "localApiAuth": false,
            "restirctedInternetAccessAPI": false
        },
        "protoServer": {                            ## Don't think i've seen this setting in the actual web config, not sure what it is or why its enabled
            "enable": true,
            "port": 19445,
            "timeout": 5
        },
        "smoothing": {                                ## Tried enabled or disabled, speeds up responsiveness of the LEDs if at a very low number but disabling doesn't make it perfect
            "continuousOutput": true,
            "decay": 1,
            "dithering": true,
            "enable": false,
            "interpolationRate": 60,
            "outputRate": 60,
            "time_ms": 25,
            "type": "linear",
            "updateDelay": 0,
            "updateFrequency": 60
        },
    }
    
    
     
  2. TPmodding

    TPmodding Administrator Staff Member Administrator

    Messages:
    2,006
    Hardware:
    RPi1/Zero, RPi2, RPi3, +Arduino, +nodeMCU/ESP8266
    do you know which resolutions your grabber can? can see it with "v42l-ctl --all"
     
  3. Alpha7

    Alpha7 New Member

    Messages:
    12
    Hardware:
    RPi1/Zero
    I wasn't able to get that command to work but my HDMI splitter outputs 4k or 1080, I currently have it downscaling my input to 1080 to the PI. I currently, manually have the resolution on the grabber set to 128x72 resolution and that has improved things a little more but still more of a delay than I would like. Also having the resolution so low it can't see smaller things around the edges.
     
  4. Alpha7

    Alpha7 New Member

    Messages:
    12
    Hardware:
    RPi1/Zero
    I took a video, with 127x72 at 3 Decimation Is about as near perfect as I can seem to get it.. but at this point I've got more LEDs behind my TV then pixles the PI is actually reading.

    There has to be some setting or something I am missing right? With a ton of action its not very noticeable but on the hard scene change you can definitely see the LEDs are lagging enough to be noticeable - I just recorded on my phone so the quality isn't perfect.

     
  5. TPmodding

    TPmodding Administrator Staff Member Administrator

    Messages:
    2,006
    Hardware:
    RPi1/Zero, RPi2, RPi3, +Arduino, +nodeMCU/ESP8266
    try it without decimation: 1
     
  6. Alpha7

    Alpha7 New Member

    Messages:
    12
    Hardware:
    RPi1/Zero
    Setting it back to 1 increases the lag quite a bit. It definitely doesn't decrease the lag or help in any way.
     
  7. jeroen warmerdam

    jeroen warmerdam Raspberry 3B / APA102 / Hyperion.NG relaisbox

    Messages:
    410
    Hardware:
    RPi3
    Have you tried to increase the arm in config.txt?

    You can manually change the boost and arm of cpu.
    Looks like your PI is a little short of some cpu power.