Kodi Community Forum

Full Version: Philips Hue Service & Ambilight
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
(2019-09-05, 18:07)Snapcase Wrote: [ -> ]@Cinephile 

I've never used CV, but it's the Hue service that's crashing because it can't figure out the duration of these two video files:

Code:
smb://NASDDB2A8/Multimedia/XBMC/Media/TV Shows/American Horror Story/Season 8/s08e08.mkv
C:\Users\Rieche\AppData\Roaming\Kodi\addons\script.cinemavision\resources\videos\script.cinemavision.dummy_NEXT.mpeg

I can fix the crash but I'm not 100% sure what's happening. It looks like it's failing on a TV episode but working on a Movie. Can you check if it's all TV episodes that fail and movies work or if it's just this particular file? There doesn't seem to be any difference to the hue service between First Man and A Quiet Place but it actually crashes before it reaches either so it was already unhappy before you hit play on A Quiet Place.
 
I made a test version here which should avoid the crash and give me more logs on the problem: https://github.com/zim514/script.service.hue/releases/tag/v0.7.13dev4
Can you please try manually installing that version from the zip and send new logs, making sure that Kodi is set to debug?

Also there's a log line about bulbs with no colour gamut - this might be perfectly normal if you have white-only lights or non official hue bulbs. It shouldn't be a problem but just want to double check it's expected and not another problem.

Thank you for your prompt reply!

It’s interesting that you mention TV shows. I’ve never had a single problem with them (that I know of anyway). Are you sure they are throwing an error in that log? Sometimes when I’m too eager and immediately start watching after booting into Kodi it skips your add-on because my bridge isn’t detected quickly enough (takes a few seconds after boot and then pops up with a notification). But that is my fault.

I will certainly test your build tonight after work! Out of curiosity, what did you change?

Also, I find it strange that the problem cannot accurately be reproduced. It feels random. If it was related purely to timestamp issues (lack of duration) wouldn’t that be the same every time?

Last night I changed a few settings in Kodi (removed whitelisted resolutions as no longer needed, and switched from full screen window to exclusive full screen) and haven’t had an issue since. Ran 20+ test sequences with and without CV and no crash. Interestingly, Hue Service doesn’t know a video is playing until the feature film starts when using CV. My Dolby Atmos audio bumper which plays before the movie isn’t recognised by Hue so lights aren’t dimmed until after. I blame CV and can safely say that without using CV I have never encountered any issues.

As for the white-only lights, this should be easy to explain. I have set up 3x Hue Play Bars behind my TV and 1x Hue lightstrip underneath the entertainment unit. When I press play it slowly turns off all lights. When I stop playback it turns them back on to a mix of purple and blue. However, when pausing playback I have configured a scene where it only turns on the lightstrip. It is a dimmed white light (intentionally no colours) which is probably what you saw in the log?
Hi

For the white light I was referring to lights that don't support color at all, like Hue White lights. I say that because there's an error in the logs saying that it can't get the supported colours for one of the lights. It's not a problem, I was just wondering what kind of device it was. 

It's crashing in the section of code that checks if it should activate based on the video settings in the "video activation" settings. It's crashing specifically when it asks Kodi the duration of the video for the setting "minimum video duration". You can see it in the logs if you look for the word "Exception". I only asked about the TV shows because the video file it tries to load before the first crash is american horror story. I don't think it's necessarily related, but just trying to figure out if there's a pattern.

What I changed in the debug version is that instead of crashing if it can't get the video duration, it will ignore the crash and write out more log data that may be able to help me find the problem. I wouldn't call it a fix yet Smile
Interesting, thanks @Snapcase

It’s weird that it reports on white lights. It’s true that I have a bunch of white-only bulbs in the house but these haven’t been selected for my scenes. It’s only the Play Bars and lightstrip which should be capable of the full range of colours. Can it still report on the other bulbs despite them not being part of a scene?

Thanks for explaining the change you made to crashing behaviour. Does that mean it will continue playback regardless of what happens to the lights?
For the white lights it should only check the lights you selected for the ambilight group, so it's a little strange, but it's not related to the crash so it doesn't really matter.

If it can't find the duration now it should just do nothing and write some debug logs, and just check again on the next media that plays. 

If you test it again, please set Kodi log levels to debug, that will give a lot more information on what's happening. I'm also wondering if it's something related to Kodi 19. I haven't tested it at all and because it's an alpha it could be a Kodi bug or changes between versions. If you can try it with an official 18.x Kodi version it will let us know if it's because of the Kodi version. I'll support and test 19 for sure at some point but am waiting for it to be more stable and support Python 3 before I invest time on it
@Snapcase 

I installed the test build and enabled debug logging. Here is the log. It won't do anything to the lights now, CV or not. They no longer react to Hue Service.

EDIT: Going back to 0.7.12 makes it work again.
Hi,

For the white light error, the new logs show that it's trying to get the supported color gamut for a light that doesn't exist. I'm pretty sure this is because you have ambilight enabled but no lights selected for ambilight. I'll have to add a better error message to catch that in the future.

There's useful logs but it only showed that I didn't put enough logging in the right places to catch the problem :/ You'll have to try again with this build: https://github.com/zim514/script.service...0.7.14dev5

Even if the lights don't change like the previous version did, it's still writing logs so it's still useful.
(2019-09-06, 18:43)Snapcase Wrote: [ -> ]Hi,

For the white light error, the new logs show that it's trying to get the supported color gamut for a light that doesn't exist. I'm pretty sure this is because you have ambilight enabled but no lights selected for ambilight. I'll have to add a better error message to catch that in the future.

There's useful logs but it only showed that I didn't put enough logging in the right places to catch the problem :/ You'll have to try again with this build: https://github.com/zim514/script.service...0.7.14dev5

Even if the lights don't change like the previous version did, it's still writing logs so it's still useful.
Thank you! Updated log with new build.

This latest build works again, although after running a CV sequence Kodi locked up on shutdown and had to be force quit (I don't think it is optimised for v19). I ran the movie 8 Mile twice - with and without CV.

I am at a loss in regards to the white light error. Ambilight is definitely turned off and I have no other scenes set up. Perhaps I should delete them all and restart from scratch?

EDIT: I deleted and re-created all scenes. Tested again with and without CV. No crash this time. Log still complaining about missing colour gamut.. Do you suspect this is contributing to any crashing behaviour?
Hi

Thanks for the logs, I was able to identify both problems. For the color gamut, it's a bug on my end. I'm trying to initialize ambilight even if it's disabled, so it's just checking the gamut unnecessarily. I'll fix that in the next version, but that's not what's caused the problem. It's just writing logs for nothing but not actually doing anything.

The other problem looks like a race condition. CV seems to play this file: "addons\\script.cinemavision\\resources\\videos\\script.cinemavision.dummy_NEXT.mpeg" at some point. That in itself shouldn't be a problem, but it's starting and stopping that file so fast my script ends up both trying to start and stop at the same time, so it ends up trying to get the video duration of a video that's no longer playing. Sometimes, maybe because the CPU is doing more stuff at that moment, it happens at a speed "slow" enough that my script doesn't have this problem, and that's why it seems sorta random. It shouldn't actually be causing Kodi to crash but when I added these logs I think I "accidently" made it handle the error better. I'll look into it some more over the weekend, it's a bit of a trickier problem. 

If you look at this section of the logs, you can see that the getDuration is actually after the Stop, and the timestamp shows it's basically within 10ms:

Code:

2019-09-07 08:45:57.312 T:18446744073709551614    INFO: [script.service.hue][KodiGroup][onAVStarted](71): In KodiGroup[0], onPlaybackStarted. Group enabled: True,startBehavior: True , isPlayingVideo: False, isPlayingAudio: False, self.mediaType: 1,self.playbackType(): None
2019-09-07 08:45:57.312 T:18446744073709551614    INFO: [script.service.hue][KodiGroup][onPlayBackStopped](94): In KodiGroup[0], onPlaybackStopped() , mediaType: 1, lastMediaType: None
2019-09-07 08:45:57.312 T:18446744073709551614   DEBUG: [script.service.hue][KodiGroup][checkVideoActivation](182): InfoTag: None
2019-09-07 08:45:57.312 T:18446744073709551614   ERROR: [script.service.hue][KodiGroup][checkVideoActivation](189): Can't read infoTag
                                            Traceback (most recent call last):
                                              File "C:\Users\Rieche\AppData\Roaming\Kodi\addons\script.service.hue\resources\lib\KodiGroup.py", line 184, in checkVideoActivation
                                                duration=infoTag.getDuration() / 60 #returns seconds, convert to minutes
                                            AttributeError: 'NoneType' object has no attribute 'getDuration'
Amazing work, mate!

Thanks so much for looking into this. It feels good to at least know what's happening.
I'm pretty sure you'll be ok with this version, can you give it a shot? https://github.com/zim514/script.service...v0.8.0dev1
(2019-09-07, 18:21)Snapcase Wrote: [ -> ]I'm pretty sure you'll be ok with this version, can you give it a shot? https://github.com/zim514/script.service...v0.8.0dev1

I tested twice with CV. First sequence went without a hitch (A Quiet Place). Second sequence played the intro video and then put me back to the main menu (Alita Battle Angel). No crash as such but something is still not right. My money is on CV not being optimised. It hasn't ever crashed without CV. Perhaps you can confirm that it is CV causing a conflict when looking at this log
Running this on Sony Android TV (Nougat, Kodi 18.4), using an IKEA tradfri hub and bulbs with dyihue hue emulator running on a raspberry pi which allows hue apps to control it - all hue apps work. None of the features in this are working, despite the bridge connecting and being able to pick the bulbs. Turned on the video play/pause features and picked scenes, also activated initial flash but I get nothing. Pasted some parts of the log here

this part keeps repeating:
2019-09-08 17:54:59.684 T:10286   DEBUG: CAddonSettings[plugin.program.hue.controller]: loading setting definitions
2019-09-08 17:54:59.684 T:10286   DEBUG: CAddonSettings[plugin.program.hue.controller]: trying to load setting definitions from old format...
2019-09-08 17:54:59.685 T:10286   DEBUG: CAddonSettings[plugin.program.hue.controller]: loading setting values

Code:
Oh no I pasted the wrong log link, it was another user's log.

Here is mine

Can you not edit posts on this forum?
(2019-09-08, 00:56)Cinephile Wrote: [ -> ]
(2019-09-07, 18:21)Snapcase Wrote: [ -> ]I'm pretty sure you'll be ok with this version, can you give it a shot? https://github.com/zim514/script.service...v0.8.0dev1

I tested twice with CV. First sequence went without a hitch (A Quiet Place). Second sequence played the intro video and then put me back to the main menu (Alita Battle Angel). No crash as such but something is still not right. My money is on CV not being optimised. It hasn't ever crashed without CV. Perhaps you can confirm that it is CV causing a conflict when looking at this log  
Well it looks like hue isn't having an unexpected errors anymore. I don't know CV so I can't really confirm anything, but it does look like it starts bugging out looking for a setting called "save.path.name" over and over. Service.upnext seems to be doing something similar, it also runs whenever a new media file is played. I suspect that the dummy MPEG files CV starts & stops for 1 frame might be part of the issue because every time that happens, service.upnext, my script, and possibly others other add-ons all get triggered and stopped at the same moment. 

Also, because it's an alpha version of Kodi it could just be a bug with Kodi itself and none of the addons. 

There is this log line which is a bit suspicious and might be exactly the same problem my script was having (thinks a video file is playing but none is), but the log line is so vague I have no idea what add-on is writing it.

Code:
2019-09-08 08:48:03.923 T:18446744073709551614 ERROR: EXCEPTION: XBMC is not playing any media file

The only suggestions I can think of at this point is that you try with a fresh install on Kodi 18.x with only CV & the hue script. If that works consistently maybe install your other add-ons gradually.

 A less drastic option is to delete the settings.xml for service.upnext and CV to see if the settings error goes away if you start fresh - maybe there's a settings conflict between the old and new versions.
Hi @zimz

plugin.program.hue.controller isn't actually this addon. The ID for this addon is script.service.hue, so those logs lines are actually from something else. 

The crash in your logs is from my add-on though, but all I can tell is that it's a connection error of some kind. I would need full logs to get more context on what happens before the crash to understand how it's ending up there. I think turning on the libcURL component-specific debugging in kodi's system settings would be helpful as well.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24