• 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8
  • 13
Release script.ambibox for ambient lighting [Windows Only]
#76
All appears to work as intended. I've test multiples files, both audio and video, in quick succession and can see no errors or problems in the log.

I'd say it's repo-ready (although the 'test' option at the top needs clarification).
Please read the online manual (wiki) & FAQ (wiki) before posting.

Skins: Estuary | Xperience1080
Opinion: Never purchase HTC products
Reply
#77
(2015-09-09, 16:09)KenV99 Wrote:
(2015-09-07, 05:32)Morphello Wrote: Hey Ken,

Thanks for the great addon. Just attempting to run it with Kodi 15.2. Previously had it working perfectly in 15.1 via direct capture, upgraded over the top with 15.2 and now it no longer works. Windows 8 capture works, just not direct. Thought to check your latest updates on github, updated the addon and now it throws this error. If I revert to 15.1 and 1.0.4 of the addon in the repo, everything works correctly again. Below is the log of 15.2 (same for 15.1) and version 1.0.7.1 of the ambibox plugin.

Code:
12:51:01 T:5424  NOTICE: ### [AmbiBox] - Service Started - ver 1.0.7.1
12:51:01 T:5424  NOTICE: ### [AmbiBox] - 1 profile(s) retrieved from program
12:51:01 T:5424   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.IOError'>
                                            Error Contents: file() constructor not accessible in restricted mode
                                            Traceback (most recent call last):
                                              File "C:\AtlasCore\Programs\Kodi\portable_data\addons\kodi.script.ambibox-master\default.py", line 1828, in <module>
                                                main()
                                              File "C:\AtlasCore\Programs\Kodi\portable_data\addons\kodi.script.ambibox-master\default.py", line 1775, in main
                                                startup()
                                              File "C:\AtlasCore\Programs\Kodi\portable_data\addons\kodi.script.ambibox-master\default.py", line 1724, in startup
                                                scriptsettings = ScriptSettings()
                                              File "C:\AtlasCore\Programs\Kodi\portable_data\addons\kodi.script.ambibox-master\default.py", line 358, in __init__
                                                self.refresh_settings()
                                              File "C:\AtlasCore\Programs\Kodi\portable_data\addons\kodi.script.ambibox-master\default.py", line 397, in refresh_settings
                                                self.updateprofilesettings()
                                              File "C:\AtlasCore\Programs\Kodi\portable_data\addons\kodi.script.ambibox-master\default.py", line 540, in updateprofilesettings
                                                doc = ET.parse(__settingsdir__ + "\\settings.xml")
                                              File "<string>", line 62, in parse
                                              File "<string>", line 26, in parse
                                            IOError: file() constructor not accessible in restricted mode
                                            -->End of Python script error report<--

So just to re-iterate, that's two separate issues. Kodi version 15.2 causes ambibox addon to cease functioning in direct mode. Addon version 1.0.7.1 from github produces error and fails to work entirely. Not sure if direct mode is something you've created or part of the ambibox package, I dont know where the issue actually lies.

Thanks

I tested the addon on both 15.1 and 15.2 and I am not getting any errors and it is functioning for me.
From the above log, I am unsure what 'Restricted mode' is... this may have to do with you running it as a portable? The lines where the error is being generated are due to the fact that the addon reads the names of the ambibox profiles from the registry and then writes them into the settings.xml file in order for you to be able to select the profile names from a drop-down box. It seems that in 'restricted mode' that is not allowed. This feature has been enabled for well over a year, so unless you recently went portable or Kodi has changed it's own internal policy only for portable installations, then I don't see a quick workaround.

As far as the previous version not working in Direct mode, I would need a log when that occurs to troubleshoot. One well-known reason that fails is that it won't work if you have a dsplayer build installed.

This addon and 'Direct mode' were originally authored by denmax2000, the author of the Ambibox application. I took over development and have made many big changes over time since about November 2013.

EDIT: Also, what skin are you using? Do you have the above error using Confluence? See here: 2004370 (post)

Hi Ken,

Sorry for the late reply, have been preoccupied.

You guessed correctly with the restricted mode being Portable Mode, something that I need to use for my setup. To answer your edited question, I'm using the Aeon Nox (Silvo edition) skin, and yes, I'm getting the same error everywhere.

At least I was getting it. It seems Piers had a similar situation and problem to myself and you've solved the issue over the last month. I've updated to Isengard 15.2 RC2, and the latest master of your addon, and it works correctly. I had to completely wipe out the addon settings to upgrade, or it didn't work.

As with Piers, I've noticed strange behavior with the addon seemingly to fail periodically. I don't have notifications on, so I don't see a message. But rarely (<5% of the time) I'll start a video, and the lighting wont work. Stopping the video and playing it again fixes it. Once, while playing a bluray rip that my system was struggling to watch, I started and stopped the video in quick succession (during a freeze), and the lights didn't come back on again. In the end I needed to restart Kodi AND ambibox, because restarting either one while the other was running caused issues.

Other than that minor quibble, everything seems to be working great. It's got the same low CPU usage, low latency direct feed, and it works with all aspect ratios without issue. Thanks!

Edit: Actually there is a small issue. There seems to be a slight delay before changing colour now, where as previously there wasn't. It's like the Smoothing option in Ambibox is ramped up to high. I've got the capture quality set to Highest, delay at 0ms, and framerate at 100 (full). Additionally my settings in Ambibox haven't changed. My system also shouldn't be an issue, as it's a 3.8ghz i5, but it is using integrated graphics. I haven't compared the numbers side by side, but I feel like the direct capture is dropping to <10fps where it should at least match the video fps. I have it set to 60 max. I'll do some testing.

Additionally, and not something you'd probably be able to help with, I've got the latest drivers for Intel's integrated graphics. It's Haswell, which means it has partial hardware decode on H265. I can play 4k@30hz@30mbps (downscaled to 1080p tv) h265 video, however if I'm using the lightpack, the video frame rate drops to about 18fps, and the lighting just pauses. CPU ramps up quite high too. Not sure if there's some crazy inefficiency there, or its just because its 4x the resolution and complexity, but Ambibox uses less than 1% cpu to process the entire lightpack system for 1080p, it shouldn't be much different for 4k.

Edit2: Hrm well, it only seems to be capturing at 14-21fps. I haven't seen it climb higher than that. I figure it adjusts based on need, but wouldn't it hit the film's frame rate (24) at some point?
Reply
#78
Now I'm getting crashes. I can't for the life of me, find the ambibox logs. I have it set to log, but I cant actually find the logs.

Here's Kodi's Log as it crashed. http://pastebin.com/KbkMbH6b

I can't really see anything there. I was watching Jurassic park, it crashed about 10 minutes in. I restarted everything and resumed play, crashing again about 15 minutes later. That's the log I captured there.

It crashed one more time after 5 minutes, then it managed to complete the entire movie without crashing. I can't seem to see why.

Running Kodi 15.2 RC2 + Latest Master from Github

I'll report anything more and upload the Ambibox logs if I can find them.
Reply
#79
(2015-09-28, 13:49)Morphello Wrote: Now I'm getting crashes. I can't for the life of me, find the ambibox logs. I have it set to log, but I cant actually find the logs.

Here's Kodi's Log as it crashed. http://pastebin.com/KbkMbH6b

I can't really see anything there. I was watching Jurassic park, it crashed about 10 minutes in. I restarted everything and resumed play, crashing again about 15 minutes later. That's the log I captured there.

It crashed one more time after 5 minutes, then it managed to complete the entire movie without crashing. I can't seem to see why.

Running Kodi 15.2 RC2 + Latest Master from Github

I'll report anything more and upload the Ambibox logs if I can find them.

There is not an ambibox log generated by Kodi. For troubleshooting the addon, it is the kodi log that is needed.
The log you provide does not show any problems. Just a normal exit. No problems with either kodi or ambibox.
Is Kodi crashing or just your lights stop working?
Reply
#80
I pushed another update to github.
Since I don't experience these periodic RenderCapture failures, I can't say whether this will help at all.
In this update, if RenderCapture fails while video is playing, it will try to reset the RenderCapture buffer five times before finally failing.

Hope that helps someone.
Reply
#81
The latest version has two issues, although I doubt anything can be done with one:

1) The light is back to staying on after a file has ended.
2) There is a lag when using the DX11 build of Kodi - this does not happen with the DX9 builds. It's around 100ms - enough to be annoying during scene changes.
Please read the online manual (wiki) & FAQ (wiki) before posting.

Skins: Estuary | Xperience1080
Opinion: Never purchase HTC products
Reply
#82
(2015-09-29, 13:51)KenV99 Wrote: There is not an ambibox log generated by Kodi. For troubleshooting the addon, it is the kodi log that is needed.
The log you provide does not show any problems. Just a normal exit. No problems with either kodi or ambibox.
Is Kodi crashing or just your lights stop working?

Again, sorry for the long period between posts.

The thing that was crashing was ambibox itself, kodi or the addon weren't crashing. Essentially the light would suddenly freeze, the show would continue to play and if i tabbed out, Ambibox in the background had crashed.

According to the information I can find on ambibox, it's meant to create a log file in the root directory where the exe is kept, but I can't seem to get this to happen even though the program is run as admin and there aren't any write issues on the folder.

That said, I haven't had an issue in quite a while. I'm sitting on version 1.0.8.1, and unless it auto updated in the last month, that was the same version I experienced the crashes with.

But I've been blessedly crash or bug free. I've enjoyed dozens of hours of the addon working correctly. The only issue of any note that I could possibly report is that once or twice I noticed that it would take a few minutes to kick in.

Watching a show for ~3-4 minutes, then suddenly the lighting kicks in the back. Didn't particularly notice the lights not working, but there's a dramatic difference when they suddenly start working mid show.

Other than that, no dramas what so ever after the first few days of 1.0.8.1.

Awesome work ken, really appreciate it all.

(2015-10-13, 19:36)Piers Wrote: The latest version has two issues, although I doubt anything can be done with one:

1) The light is back to staying on after a file has ended.
2) There is a lag when using the DX11 build of Kodi - this does not happen with the DX9 builds. It's around 100ms - enough to be annoying during scene changes.

1 only happened to me on versions prior to 1.0.8.1 and hasn't happened since.

2... ah. Nasty. I'm trying to deal with a compromise between the slight delay it has now and some smoothing options, let alone adding another 100ms into it. You're probably right though, what can be done about it when changing the renderer.
Reply
#83
As far as the DX11 lag issue goes, I don't believe that there is anything that can be done from the addon side.

The addon utilizes Kodi's builtin RenderCapture buffer to supply frames to the executable. The addon's python code for those routines has been optimized with multiple threads and ctypes calls. For a video at 60 fps, there is 16.7 msec per frame. The amount of time processing each frame is indicated in the logs. IF the processing time per frame exceeds the time per frame, that can be reduced by throttling the number of frames sent to the executable or by reducing the frame size in the settings (you do not need full frames at full throttle to achieve acceptable lighting). The amount of time spent processing is highly system dependent. Looking through peoples' logs posted here, it can be as high as 9 msec for 720p at 30fps. For my workstation it is 10 microsecs for 1080p at 30fps. I have avoided compiling these routines in c to keep the addon eligible for the repository. And I don't think it would make much difference for most user's systems.

However if the lag is due to delays in the plugin receiving the frames from the buffer, then there is nothing the plugin can do.

You might try using PlayClaw 4 or one of the other ambibox capture modes for capture to see if that eliminates the lag.

Or you can do what I have done. I have an HDCP compliant splitter that goes to a HDMI-to-composite stick and then into a frame capture stick that in turn feeds into a RPi 2 running OpenELEC. Although the RPi is running Kodi in OpenELEC, I still use my HTPC for Kodi.
OpenELEC can in turn use the frames from the capture stick to drive the lights by plugging my Arduino into the USB port. The added benefit is that I have LED lighting for all my video sources, not just Kodi. The drawbacks are the expense, having to set up a system with your remote to turn the lights off with the TV and lastly, the capture stick requires a hard reset when switching from HDMI sources that are formatted differently. The last I achieved using an RF outlet remote.

Good luck.
Reply
#84
anybody made the addon work properly on Windows 10?
I have two problems:

- The plugin doesn't start Ambibox automatically

- Kodi Direct doesn't work properly anymore. So movies with black bars are not being recognized and the horizontal LEDs stay dark.

I just switched from Windows 8.1 to Windows 10.
In Windows 8.1 everything worked fine.
Already tried a fresh Kodi (DX9 and DX11) and Ambibox installation.
Any ideas?
Reply
#85
(2015-12-21, 19:23)horstepipe Wrote: anybody made the addon work properly on Windows 10?
I have two problems:

- The plugin doesn't start Ambibox automatically

- Kodi Direct doesn't work properly anymore. So movies with black bars are not being recognized and the horizontal LEDs stay dark.

I just switched from Windows 8.1 to Windows 10.
In Windows 8.1 everything worked fine.
Already tried a fresh Kodi (DX9 and DX11) and Ambibox installation.
Any ideas?

As usual post kodi.log to pastebin and post link here.
No log = no help

Edit:
Working fine on my W10 system
Reply
#86
sorry, thought maybe there are general compatibilty problems with win10:

http://pastebin.com/Xa5B94Qx
Reply
#87
This line took my attention:
18:45:40 T:1412 NOTICE: ### [AmbiBox] - LEDS - count 50, width 16, height 9

I have 50 LEDs, but don't use the bottom line of the TV. So the correct values should be:
width 24, height 14.
In the Ambibox program the settings are correct.
Reply
#88
(2015-12-21, 20:09)horstepipe Wrote: This line took my attention:
18:45:40 T:1412 NOTICE: ### [AmbiBox] - LEDS - count 50, width 16, height 9

I have 50 LEDs, but don't use the bottom line of the TV. So the correct values should be:
width 24, height 14.
In the Ambibox program the settings are correct.

The width and height values for the LEDs are just estimated and not actually used elsewhere by the addon, so that's not an issue.
The rest of the log doesn't show any errors, so I'm not sure where the issue is there.
Can you post a log where you set it to launch ambibox and it fails?

In the log, the file you tried playing is being seen by Kodi as 16:9 (line 384) so (assuming your display is also 16:9) it would either 1) not have black bars or 2) the black bars are actually part of the video file - the addon can't compensate for that case. Perhaps try picking a different file?
Reply
#89
oh it can be so easy, you were right Big Grin
I only tried my Star Wars Collection and there the black bars are really part of the video.
thank you!

I'm getting no error about starting Ambibox at all...these are the only Ambibox logs when starting Kodi:
Code:
14:56:20 T:2524  NOTICE: ### [AmbiBox] - Service Started - ver 1.0.8.2
14:56:20 T:2524  NOTICE: ### [AmbiBox] - Kodi started from:"c:\program files (x86)\kodi\kodi.exe"
14:56:24 T:2524  NOTICE: ### [AmbiBox] - LEDS - count 50, width 16, height 9
14:56:24 T:2524  NOTICE: ### [AmbiBox] - Profile KodiDirect found and correctly configured for XBMCDirect
14:56:24 T:2524  NOTICE: ### [AmbiBox] - Settings refreshed
Reply
#90
activating the option doesn't trigger an error, either:
Code:
18:48:56 T:6980  NOTICE: ### [AmbiBox] - Settings change detected
18:48:58 T:6980  NOTICE: ### [AmbiBox] - LEDS - count 50, width 15, height 10
18:48:58 T:6980  NOTICE: ### [AmbiBox] - Profile KodiDirect found and correctly configured for XBMCDirect
18:48:58 T:6980  NOTICE: ### [AmbiBox] - Settings refreshed

starting Kodi with admin privileges doesn't work, either.
Maybe in Windows 10 the registry path has changed?
Reply
  • 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8
  • 13

Logout Mark Read Team Forum Stats Members Help
script.ambibox for ambient lighting [Windows Only]0