awawa-dev / HyperHDR

Highly optimized open source ambient lighting implementation based on modern digital video and audio stream analysis for Windows, macOS and Linux (x86 and Raspberry Pi / ARM).
http://www.hyperhdr.eu/
MIT License
968 stars 104 forks source link

lights staying on when tv is turned off #790

Closed reaps101 closed 3 months ago

reaps101 commented 3 months ago

Bug report, debug log and your config file (FULL LOGS ARE MANDATORY)

https://pastebin.com/wiKYmt82 [HyperHDR-20.0.0.0beta2-Backup-2024-03-12.json](https://github.com/awawa-dev/HyperHDR/files/14569212/HyperHDR-20.0.0.0beta2-Backup-2024-03-12.json) #### Steps to reproduce Quickest way to reproduce is to press the setting button on the lg remote then turn the screen off "the screen will go blank but the lights will stay on", then turn off the tv with the power button on the remote and the lights continue to stay on. other wise turning the tv off normally the lights will stay on randomly, didnt have the problem in beta0. #### What is expected? when the tv is turned off the lights should turn off\ #### What is actually happening? lights are staying on #### System

System info None

HyperHDR Server OS:

awawa-dev commented 3 months ago

sorry, I'm sick now and I missed the logs on my phone. but everything is fine there including the black color setting. however, such a situation is possible - although the black colour frames on exit were sent, they were damaged and HyperSerialPico rejected them.

awawa-dev commented 3 months ago

Could you change the led device from adalight to debug(file, do not use refresh time there), set path to some file in /tmp, repeat the process and later check that file if the black colour was set?

awawa-dev commented 3 months ago

Could you change the led device from adalight to debug(file, do not use refresh time there), set path to some path in /tmp, repeat the process and later check that file if the black colour was set?

awawa-dev commented 3 months ago

787 could be related but it applies to situation when HyperHDR was closed (missing proper LED shutdown on driver destruction, only memory was cleaned). Not the situation from your logs where LED device was stopped and the cleanup procedure was performed fine including setting LED strip to black color.

reaps101 commented 3 months ago

hyperhdrtest.txt is this what you wanted

awawa-dev commented 3 months ago

thanks, the black color is not set. do you have logs for this file.

reaps101 commented 3 months ago

pastebin is down for maintance

2024-03-12T22:54:06.666Z [CORE] TTY is not attached to the log output 2024-03-12T22:54:06.860Z [MAIN] Database path: '/home/root/.hyperhdr/db/hyperhdr.db', readonlyMode = disabled 2024-03-12T22:54:06.860Z [MAIN] Starting HyperHdr - 20.0.0.0beta2, (HEAD detached at v20.0.0.0beta2) (awawa-dev-7e3ac3a/c341b4e-1708629717), built: Feb 29 2024:00:35:19 2024-03-12T22:54:06.860Z [MAIN] Set user data path to '/home/root/.hyperhdr' 2024-03-12T22:54:06.861Z [INSTANCE_CFG] Loading instance configuration 2024-03-12T22:54:06.886Z [DB] Database opened: /home/root/.hyperhdr/db/hyperhdr.db 2024-03-12T22:54:07.147Z [INSTANCE_CFG] Settings database initialized 2024-03-12T22:54:07.184Z [SOUND_GRABBER] Sound device is disabled 2024-03-12T22:54:07.288Z [DAEMON] The AVF grabber can not be instantiated, because it has been left out from the build 2024-03-12T22:54:07.288Z [DAEMON] The MF grabber can not be instantiated, because it has been left out from the build 2024-03-12T22:54:07.288Z [DAEMON] !The v4l2 grabber can not be instantiated, because it has been left out from the build 2024-03-12T22:54:07.308Z [DAEMON] The USB grabber was disabled during build. FlatbufferServer now controlls the HDR state. 2024-03-12T22:54:07.309Z [JSONSERVER] (JsonServer.cpp:26) Created new instance 2024-03-12T22:54:07.316Z [JSONSERVER] Started on port 19444 2024-03-12T22:54:07.324Z [SSDP] (SSDPHandler.cpp:31) SSDPHandler is initialized 2024-03-12T22:54:07.295Z [HYPERHDR0] Starting the instance 2024-03-12T22:54:07.297Z [INSTANCE_CFG0] Loading instance configuration 2024-03-12T22:54:07.297Z [DB] Database opened: /home/root/.hyperhdr/db/hyperhdr.db 2024-03-12T22:54:07.398Z [INSTANCE_CFG0] Settings database initialized 2024-03-12T22:54:07.398Z [COMPONENTCTRL0] (ComponentController.cpp:31) ComponentController is initialized. Components are ENABLED 2024-03-12T22:54:07.407Z [MUXER0] (Muxer.cpp:55) Muxer initialized 2024-03-12T22:54:07.408Z [BLACKBORDER] Set mode to: default 2024-03-12T22:54:07.408Z [COMPONENTCTRL0] Blackborder detector: enabled 2024-03-12T22:54:07.409Z [IMAGETOLED_MNG0] (ImageToLedManager.cpp:192) Set LED mapping type to advanced 2024-03-12T22:54:07.409Z [IMAGETOLED_MNG0] (ImageToLedManager.cpp:176) setSparseProcessing to 0 2024-03-12T22:54:07.409Z [IMAGETOLED_MNG0] (ImageToLedManager.cpp:103) ImageToLedManager initialized 2024-03-12T22:54:07.410Z [COLORSPACE_CALIBRATION0] classicMode: no, gammas:[1.50, 1.50, 1.50], saturation: 1.00, luminance: 1.00, backLight: [enabled, threshold: 0, colored: no] 2024-03-12T22:54:07.410Z [LED_CALIBRATION0] (LedCalibration.cpp:101) Calibration config '0' for LED segment: [0, 223] 2024-03-12T22:54:07.417Z [HYPERHDR0] Led strip RGB order is: rgb 2024-03-12T22:54:07.420Z [SMOOTHING0] High resolution clock is NOT STEADY! 2024-03-12T22:54:07.420Z [SMOOTHING0] Creating config (0) => type: Alternative, dirMode: false, pause: false, settlingTime: 150ms, interval: 20ms (50Hz), antiFlickTres: 32, antiFlickStep: 2, antiFlickTime: 250 2024-03-12T22:54:07.420Z [SMOOTHING0] Clearing queued colors before: disabling. Smoothing configuration changed: restarting timer. 2024-03-12T22:54:07.420Z [SMOOTHING0] Smoothing queue is cleared 2024-03-12T22:54:07.420Z [SMOOTHING0] Selecting config (0) => type: Alternative, directMode: false, pause: false, settlingTime: 150ms, interval: 20ms (50Hz), antiFlickTres: 32, antiFlickStep: 2, antiFlickTime: 250 2024-03-12T22:54:07.420Z [SMOOTHING0] Selecting config (0) => type: Alternative, directMode: false, pause: false, settlingTime: 150ms, interval: 20ms (50Hz), antiFlickTres: 32, antiFlickStep: 2, antiFlickTime: 250 2024-03-12T22:54:07.425Z [HYPER_MANAGER] HyperHDR instance 'First LED instance' has been started 2024-03-12T22:54:07.424Z [HYPERHDR0] The instance is running 2024-03-12T22:54:07.424Z [MUXER0] Register new input 'System/VIDEOGRABBER' with priority 240 as inactive 2024-03-12T22:54:07.424Z [COMPONENTCTRL0] Video capture device: enabled 2024-03-12T22:54:07.426Z [FLATBUFSERVER] LUT file is not found here: /home/root/.hyperhdr/flat_lut_lin_tables.3d 2024-03-12T22:54:07.426Z [FLATBUFSERVER] (FlatBufferServer.cpp:259) LUT file found: /media/developer/apps/usr/palm/services/org.webosbrew.hyperhdr.loader.service/hyperhdr/flat_lut_lin_tables.3d 2024-03-12T22:54:07.431Z [WEBSERVER] Initialize Webserver 2024-03-12T22:54:07.458Z [LEDDEVICE0_FILE] Start LedDevice 'file'. 2024-03-12T22:54:07.458Z [LEDDEVICE0_FILE] (LedDevice.cpp:337) deviceConfig: [{"colorOrder":"rgb","currentLedCount":224,"output":"/tmp/hyperhdrtest","printTimeStamp":false,"refreshTime":0,"smoothingRefreshTime":0,"type":"file"}] 2024-03-12T22:54:07.458Z [LEDDEVICE0_FILE] (LedDevice.cpp:433) Refresh interval updated to 0ms 2024-03-12T22:54:07.458Z [LEDDEVICE0_FILE] (LedDeviceFile.cpp:46) Output filename: /tmp/hyperhdrtest 2024-03-12T22:54:07.458Z [LEDDEVICE0_FILE] (LedDevice.cpp:247) Enable the device 2024-03-12T22:54:07.458Z [LEDDEVICE0_FILE] (LedDeviceFile.cpp:56) Open filename: /tmp/hyperhdrtest 2024-03-12T22:54:07.458Z [LEDDEVICE0_FILE] (LedDeviceFile.cpp:60) QIODevice::WriteOnly, /tmp/hyperhdrtest 2024-03-12T22:54:07.462Z [WEBSERVER] Apply Webserver settings 2024-03-12T22:54:07.462Z [WEBSERVER] Set document root to: :/www 2024-03-12T22:54:07.464Z [WEBSERVER] Started: 'HyperHDR WebServer (HTTP)' on port: 8090 2024-03-12T22:54:07.464Z [SSDP] (SSDPHandler.cpp:93) The local address is empty 2024-03-12T22:54:07.464Z [WEBSERVER] Initialize Webserver 2024-03-12T22:54:07.465Z [WEBSERVER] Apply Webserver settings 2024-03-12T22:54:07.465Z [WEBSERVER] Set document root to: :/www 2024-03-12T22:54:07.484Z [WEBSERVER] Setup SSL certificate 2024-03-12T22:54:07.486Z [WEBSERVER] Setup private SSL key 2024-03-12T22:54:07.486Z [WEBSERVER] Started: 'HyperHDR WebServer (HTTPS)' on port: 8092 2024-03-12T22:54:07.486Z [SSDP] (SSDPHandler.cpp:42) SSDPHandler is initializing 2024-03-12T22:54:07.489Z [SSDP] (SSDPHandler.cpp:196) The local address is: 192.168.50.4 2024-03-12T22:54:07.489Z [SSDP] (SSDPServer.cpp:95) Initialize the SSDP server 2024-03-12T22:54:07.491Z [LEDDEVICE0_FILE] (LedDevice.cpp:64) Switch on 2024-03-12T22:54:07.491Z [LEDDEVICE0_FILE] (LedDevice.cpp:140) Power On 2024-03-12T22:54:07.491Z [WEBSERVER] (StaticFileServing.cpp:68) SSDP description is set up 2024-03-12T22:54:07.491Z [COMPONENTCTRL0] LED device: enabled 2024-03-12T22:54:07.493Z [SSDP] Starting the SSDP server 2024-03-12T22:54:07.564Z [FLATBUFSERVER] Found and loaded LUT: '/media/developer/apps/usr/palm/services/org.webosbrew.hyperhdr.loader.service/hyperhdr/flat_lut_lin_tables.3d' 2024-03-12T22:54:07.564Z [FLATBUFSERVER] Started on port 19400 2024-03-12T22:54:07.565Z [FLATBUFSERVER] Started local domain socket server: 'hyperhdr-domain' 2024-03-12T22:54:07.565Z [FLATBUFSERVER] LUT file is not found here: /home/root/.hyperhdr/flat_lut_lin_tables.3d 2024-03-12T22:54:07.565Z [FLATBUFSERVER] (FlatBufferServer.cpp:259) LUT file found: /media/developer/apps/usr/palm/services/org.webosbrew.hyperhdr.loader.service/hyperhdr/flat_lut_lin_tables.3d 2024-03-12T22:54:07.566Z [COMPONENTCTRL0] HDR (global): enabled 2024-03-12T22:54:07.646Z [MUXER0] Set visible priority to 255 2024-03-12T22:54:07.646Z [HYPERHDR0] New priority[255], previous [255] 2024-03-12T22:54:07.646Z [HYPERHDR0] No source left -> switch LED-Device off 2024-03-12T22:54:07.646Z [SMOOTHING0] Clearing queued colors before: disabling 2024-03-12T22:54:07.646Z [SMOOTHING0] Smoothing queue is cleared 2024-03-12T22:54:07.646Z [COLORSPACE_CALIBRATION0] (ColorSpaceCalibration.cpp:225) setBackLightEnabled: 0 2024-03-12T22:54:07.649Z [LEDDEVICE0_FILE] (LedDevice.cpp:297) Disable the device 2024-03-12T22:54:07.649Z [LEDDEVICE0_FILE] (LedDevice.cpp:90) Switch off 2024-03-12T22:54:07.649Z [LEDDEVICE0_FILE] (LedDevice.cpp:126) Power Off 2024-03-12T22:54:07.649Z [LEDDEVICE0_FILE] (LedDevice.cpp:544) Set LED strip to black/power off 2024-03-12T22:54:07.650Z [LEDDEVICE0_FILE] (LedDeviceFile.cpp:86) File: /tmp/hyperhdrtest 2024-03-12T22:54:07.650Z [COMPONENTCTRL0] LED device: disabled 2024-03-12T22:54:07.653Z [FLATBUFSERVER] Found and loaded LUT: '/media/developer/apps/usr/palm/services/org.webosbrew.hyperhdr.loader.service/hyperhdr/flat_lut_lin_tables.3d' 2024-03-12T22:54:07.657Z [NETFORWARDER] Forwarder has changed state to disabled 2024-03-12T22:54:08.432Z [FLATBUFSERVER] (FlatBufferServer.cpp:151) New local domain connection 2024-03-12T22:54:08.449Z [MUXER0] Register new input 'webos@LocalSocket/FLATBUFSERVER' with priority 150 as inactive 2024-03-12T22:54:08.449Z [MUXER0] Priority 150 is now active 2024-03-12T22:54:08.449Z [MUXER0] Set visible priority to 150 2024-03-12T22:54:08.449Z [HYPERHDR0] New priority[150], previous [255] 2024-03-12T22:54:08.449Z [HYPERHDR0] New source available -> switch LED-Device on 2024-03-12T22:54:08.450Z [SMOOTHING0] Clearing queued colors before: enabling 2024-03-12T22:54:08.450Z [SMOOTHING0] Smoothing queue is cleared 2024-03-12T22:54:08.450Z [COLORSPACE_CALIBRATION0] (ColorSpaceCalibration.cpp:225) setBackLightEnabled: 1 2024-03-12T22:54:08.450Z [IMAGETOLED_MNG0] Total index number is: 5616 (memory: 5616). User sparse processing is: disabled, image size: 192 x 108, area number: 224 2024-03-12T22:54:08.450Z [LEDDEVICE0_FILE] (LedDevice.cpp:247) Enable the device 2024-03-12T22:54:08.450Z [LEDDEVICE0_FILE] (LedDeviceFile.cpp:56) Open filename: /tmp/hyperhdrtest 2024-03-12T22:54:08.450Z [LEDDEVICE0_FILE] (LedDeviceFile.cpp:60) QIODevice::WriteOnly, /tmp/hyperhdrtest 2024-03-12T22:54:08.450Z [LEDDEVICE0_FILE] (LedDevice.cpp:64) Switch on 2024-03-12T22:54:08.450Z [LEDDEVICE0_FILE] (LedDevice.cpp:140) Power On 2024-03-12T22:54:08.451Z [IMAGETOLED_MNG0] Total index number is: 5616 (memory: 5616). User sparse processing is: disabled, image size: 192 x 108, area number: 224 2024-03-12T22:54:08.451Z [COMPONENTCTRL0] LED device: enabled 2024-03-12T22:54:09.036Z [NET_DISCOVERY] Found Pico/RP2040 at ttyACM0:-1 (Pico) 2024-03-12T22:54:08.966Z [SERVICE_mDNS] Starting the network discovery thread 2024-03-12T22:54:09.466Z [WEBSOCKET] (WebSocketClient.cpp:39) New connection from ::ffff:192.168.50.3 2024-03-12T22:54:09.728Z [WEBSOCKET] (HyperAPI.cpp:957) log streaming activated for client ::ffff:192.168.50.3

awawa-dev commented 3 months ago

There is no LED device close in these logs at the end, so there wont br black color set in the debug file either. The file is reset each time when the LED driver is open, so you need to take it when the LED device is closed.

reaps101 commented 3 months ago

how do i close the led device, if i turn off the tv i cant get the log until i turn the tv back on as the tv runs hyperhdr which i ssh into to grab the file log, also are my lights suppose to stay static colour

reaps101 commented 3 months ago

saved file to usb then extracted when tv was off, first one is turning tv off without pushing anything else hyperhdrtest.txt

this one i pushed the options button on the remote then turned tv off this is how the lights usally stay on hyperhdrtest1.txt

reaps101 commented 3 months ago

made a little video showing what it does if i turn the tv off when its in a menu, has no signal or on the home screen the lights stay on but if im on the fire tv or pc something with a signal even a built in app then the lights turn off https://youtu.be/5uWc8D_CNxY

awawa-dev commented 3 months ago

I dont know what happens on webos and which remote button does some specific action. This OS is not officially supported. You must ask about specific behaviour of this OS, its service, elsewhere. I based on your logs:

First one

After the start:

2024-03-12T18:59:44.672Z [LEDDEVICE0_ADALIGHT] (LedDevice.cpp:297) Disable the device 2024-03-12T18:59:44.672Z [LEDDEVICE0_ADALIGHT] (LedDevice.cpp:90) Switch off 2024-03-12T18:59:44.672Z [LEDDEVICE0_ADALIGHT] (LedDevice.cpp:544) Set LED strip to black/power off

should stay powered off but immediately after that video source (flatbuffers) is broadcasting. So they are turned on again:

2024-03-12T18:59:45.261Z [MUXER0] Register new input 'webos@LocalSocket/FLATBUFSERVER' with priority 150 as inactive 2024-03-12T18:59:45.261Z [MUXER0] Priority 150 is now active 2024-03-12T18:59:45.261Z [MUXER0] Set visible priority to 150 2024-03-12T18:59:45.261Z [HYPERHDR0] New priority[150], previous [255] 2024-03-12T18:59:45.261Z [HYPERHDR0] New source available -> switch LED-Device on

So LED strip wont be powered off.

Second one (debug file):

2024-03-12T22:54:07.649Z [LEDDEVICE0_FILE] (LedDevice.cpp:297) Disable the device 2024-03-12T22:54:07.649Z [LEDDEVICE0_FILE] (LedDevice.cpp:90) Switch off 2024-03-12T22:54:07.649Z [LEDDEVICE0_FILE] (LedDevice.cpp:126) Power Off 2024-03-12T22:54:07.649Z [LEDDEVICE0_FILE] (LedDevice.cpp:544) Set LED strip to black/power off 2024-03-12T22:54:07.650Z [LEDDEVICE0_FILE] (LedDeviceFile.cpp:86) File: /tmp/hyperhdr

you should take the file then (to see it there is a black color set on exit) after it was closed because it was opened again (rewritten) and it was in progress streaming color based on flatbuffers input (so no black color because it should be set on exit):

2024-03-12T22:54:08.449Z [HYPERHDR0] New priority[150], previous [255] 2024-03-12T22:54:08.449Z [HYPERHDR0] New source available -> switch LED-Device on 2024-03-12T22:54:08.450Z [SMOOTHING0] Clearing queued colors before: enabling 2024-03-12T22:54:08.450Z [SMOOTHING0] Smoothing queue is cleared 2024-03-12T22:54:08.450Z [COLORSPACE_CALIBRATION0] (ColorSpaceCalibration.cpp:225) setBackLightEnabled: 1 2024-03-12T22:54:08.450Z [IMAGETOLED_MNG0] Total index number is: 5616 (memory: 5616). User sparse processing is: disabled, image size: 192 x 108, area number: 224 2024-03-12T22:54:08.450Z [LEDDEVICE0_FILE] (LedDevice.cpp:247) Enable the device 2024-03-12T22:54:08.450Z [LEDDEVICE0_FILE] (LedDeviceFile.cpp:56) Open filename: /tmp/hyperhdrtest 2024-03-12T22:54:08.450Z [LEDDEVICE0_FILE] (LedDeviceFile.cpp:60) QIODevice::WriteOnly, /tmp/hyperhdrtest 2024-03-12T22:54:08.450Z [LEDDEVICE0_FILE] (LedDevice.cpp:64) Switch on 2024-03-12T22:54:08.450Z [LEDDEVICE0_FILE] (LedDevice.cpp:140) Power On

the flatbuffer source (piccap) is sending the video stream so when you take that file when LED device is 'Switched on' you never see black color in the output. Unless you are capturing the black scene on the tv of course.

I hope I made it a little clearer. At the moment, there is no indication that HyperHDR should behave differently and turn off the LED strip. Piccap is running in the background and actively streaming video, so there is a video source.