Release - script.ambibox for ambient lighting [Windows Only]

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
victor1982 Offline
Junior Member
Posts: 7
Joined: Jul 2015
Reputation: 0
Post: #46
Ok thank you. I'm going to go to your link Wink
find quote
Jolltax Offline
Junior Member
Posts: 10
Joined: Jul 2015
Reputation: 0
Post: #47
Hi,

I have messed up the setup of my addon for Kodi and now my lights aren't displaying and I get an Ambibox error when I start Kodi. I am pretty sure its something simple because I had it working before without issue. Can anyone spot the problem?

[Image: ambibox.PNG][Image: addon%202.PNG][Image: Addon1.PNG]

Kodi.log is here

Suspect this is the interesting bit :

RROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.ImportError'>
Error Contents: No module named xbmcsim
Traceback (most recent call last):
File "C:\Users\Jim\AppData\Roaming\Kodi\addons\script.ambibox-master\default.py", line 36, in <module>
import xbmcsim as xbmc
ImportError: No module named xbmcsim
-->End of Python script error report<--

Sorry about this, I have spent ages fiddling with it and its driving me nuts, I'm sure its something basic.

Jolltax
(This post was last modified: 2015-08-11 13:18 by Jolltax.)
find quote
KenV99 Offline
Fan
Posts: 505
Joined: Nov 2013
Reputation: 28
Post: #48
Have you renamed the kodi executable and/or directory to something other than the way it was installed?
The program looks in python's 'sys.executable' path to detect whether it is being run by Kodi by detecting the string 'Kodi' in the execuatble's path.
For me, as the developer, I have a module called 'xbmcsim' that allows me to simulate the Kodi python environment so that I can run and do certain tests directly in python.
find quote
Jolltax Offline
Junior Member
Posts: 10
Joined: Jul 2015
Reputation: 0
Post: #49
No I haven't changed any names or locations its all defaults :

C:\Program Files (x86)\Kodi

Maybe I should reinstall?
find quote
KenV99 Offline
Fan
Posts: 505
Joined: Nov 2013
Reputation: 28
Post: #50
(2015-08-11 14:11)Jolltax Wrote:  No I haven't changed any names or locations its all defaults :

C:\Program Files (x86)\Kodi

Maybe I should reinstall?

Give it a try and repost a log...
find quote
Jolltax Offline
Junior Member
Posts: 10
Joined: Jul 2015
Reputation: 0
Post: #51
I have had a further fiddle and decided to uninstall the addon and use the Ambibox 'Windows 8' capture mode in the main application instead. This seems to work fine and the addon doesn't really offer any advantage and seems a bit buggy.

Appreciate your offer of support though, thanks.

J
(This post was last modified: 2015-08-15 15:21 by Jolltax.)
find quote
KenV99 Offline
Fan
Posts: 505
Joined: Nov 2013
Reputation: 28
Post: #52
(2015-08-15 15:21)Jolltax Wrote:  I have had a further fiddle and decided to uninstall the addon and use the Ambibox 'Windows 8' capture mode in the main application instead. This seems to work fine and the addon doesn't really offer any advantage and seems a bit buggy.

Appreciate your offer of support though, thanks.

J

I'm sorry it didn't work out for you. The two lines of code causing you trouble work very simply. 'sys.executable' retrieves the command line that started the python processor. If started from Kodi, then that string should contain the substring 'Kodi'. If not, the script assumes you are not in Kodi.
This is needed for development because it is much easier to debug outside of Kodi for complex tasks and then later test the code in Kodi once things are working well.

I pushed a new version to git that logs the sys.executable string if it thinks it is not in Kodi: https://github.com/AmbiBox/kodi.script.ambibox which may elucidate whatever your issue is.

If capture mode meets your needs, that's great. The main advantage of the AddOn is that it deals with letterboxing without you having to manually switch profiles and can automatically start a music profile when playing music. It also can turn off the lights when the screensaver activates.
Also for systems that are low on resources, it can be configured to use lower resources than other capture modes and even has a testing suite to assist in finding the right compromise between resource use and quality. If you are experiencing sync issues between the lights and screen content, the addon can introduce a delay to compensate. If none of these feature seem like an advantage to you, then the addon is not for you.

As far as being buggy, you are the only one to report this particular issue. In the free, open source world, developers like myself typically only have one or two systems to test on, so pretty much everything is always in public beta. Without end users willing to help sort out bugs on their own systems, the software remains buggy. Such is life.
find quote
Morphello Offline
Junior Member
Posts: 19
Joined: Oct 2012
Reputation: 0
Post: #53
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
find quote
KenV99 Offline
Fan
Posts: 505
Joined: Nov 2013
Reputation: 28
Post: #54
(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: http://forum.kodi.tv/showthread.php?tid=...pid2004370
(This post was last modified: 2015-09-09 20:05 by KenV99.)
find quote
Piers Offline
Team-Kodi Member
Posts: 3,422
Joined: Jan 2011
Reputation: 95
Location: UK/AT
Post: #55
I also appear to be having an issue with Kodi 15.2 and the current master build o the add-on.

ImportError: No module named xbmcsim (as another user mentioned) is the culprit.

I'm reinstalling now and will provide a debug log, or update, when I see if it works.

(Windows 8 and PlayClaw both work, so it appears to be the add-on).

Please read the online manual (wiki) & FAQ (wiki) before posting.

Skins: Estuary | Xperience1080
Opinion: Never purchase HTC products
find quote
Piers Offline
Team-Kodi Member
Posts: 3,422
Joined: Jan 2011
Reputation: 95
Location: UK/AT
Post: #56
No, that didn't appear to work. Edit, here is a proper log: http://pastey.org/view/9631deb9

Please read the online manual (wiki) & FAQ (wiki) before posting.

Skins: Estuary | Xperience1080
Opinion: Never purchase HTC products
(This post was last modified: 2015-09-15 19:21 by Piers.)
find quote
KenV99 Offline
Fan
Posts: 505
Joined: Nov 2013
Reputation: 28
Post: #57
(2015-09-15 19:19)Piers Wrote:  No, that didn't appear to work. Edit, here is a proper log: http://pastey.org/view/9631deb9

Ok, I pushed a quick fix to github, but even if it works, please, please post a log with it working so I can sort out why this occurred.
find quote
Piers Offline
Team-Kodi Member
Posts: 3,422
Joined: Jan 2011
Reputation: 95
Location: UK/AT
Post: #58
(2015-09-15 19:56)KenV99 Wrote:  
(2015-09-15 19:19)Piers Wrote:  No, that didn't appear to work. Edit, here is a proper log: http://pastey.org/view/9631deb9

Ok, I pushed a quick fix to github, but even if it works, please, please post a log with it working so I can sort out why this occurred.

Hmm, sorry for not replying - I've been testing. The previous master did have that error, however, I reinstalled RC2, completely deleted the add-on directory, and then installed the repository version.

It's superb, there is zero lag - none whatsoever. I tried the software from the lightpack.tv website - I couldn't manage to get SD 25fps video properly playing. With Ambibox and (the important part) your implementation with the add-on, I can now leave all previous settings (true full screen, sync playback to display, change rate, etc.) without it causing any issues.

As you can see from my log, I'm using a lower powered machine with a few extra GB of RAM. The CPU is generally terrible - even Chrome causes lag. I'm really impressed, thank you.

I'm currently 90% away, but I've added a task to my list to include an installation guide for Windows on the Kodi Wiki - I'll make sure you advise people to use this add-on with Ambibox.

Edit: During use:playing Avatar 1080p at 23.976
CPU: ~40% extra
RAM: ~10% extra
That's with "Highest" setting within the add-on, as well as 100 set - also zero delay and other options from Ambibox itself.

Please read the online manual (wiki) & FAQ (wiki) before posting.

Skins: Estuary | Xperience1080
Opinion: Never purchase HTC products
(This post was last modified: 2015-09-15 20:51 by Piers.)
find quote
Piers Offline
Team-Kodi Member
Posts: 3,422
Joined: Jan 2011
Reputation: 95
Location: UK/AT
Post: #59
(2015-09-15 19:56)KenV99 Wrote:  
(2015-09-15 19:19)Piers Wrote:  No, that didn't appear to work. Edit, here is a proper log: http://pastey.org/view/9631deb9

Ok, I pushed a quick fix to github, but even if it works, please, please post a log with it working so I can sort out why this occurred.

OK, I tested your most recent master. Here's a log including the issues (line 357): http://pastey.org/view/635396d4

I've reverted back to the repository version, it works again. So it's definitely an issue with the most recent add-on. Happy to help with further testing.

Please read the online manual (wiki) & FAQ (wiki) before posting.

Skins: Estuary | Xperience1080
Opinion: Never purchase HTC products
(This post was last modified: 2015-09-15 21:01 by Piers.)
find quote
KenV99 Offline
Fan
Posts: 505
Joined: Nov 2013
Reputation: 28
Post: #60
(2015-09-15 21:00)Piers Wrote:  OK, I tested your most recent master. Here's a log including the issues (line 357): http://pastey.org/view/635396d4

I've reverted back to the repository version, it works again. So it's definitely an issue with the most recent add-on. Happy to help with further testing.

I think that new error may be linked to the fact that you are running with 'restricted rights' (see line 9 in your log).
Are you running in portable mode? Does the user that you are running as have rw privileges to the actual addon directory?

The issue is that the addon needs to dynamically set the choices of the names of the profiles on the Settings page that you gave in the Ambibox Windows program since you can name the profiles whatever you want. Kodi does not provide anyway to dynamically change these choices other than programmatically editing the settings.xml file which appears to reside in a directory that the python api no longer has rw privileges. I don't yet understand what has caused the change for some to no longer have rw rights for this file.

I need to do more research on this issue because I can't recreate it on my systems.

I pushed another update to github to provide more logging of why this might fail. Hopefully it will also allow you to move on even if the addon isn't able to add your profiles to the settings screen. This is temporary fix for now...
Please post back a log.

Thanks for your help in squashing this bug.
find quote
Post Reply