zim514 / script.service.hue

Kodi add-on for Philips Hue
MIT License
36 stars 15 forks source link

Ambilight doesn't work on RPi4 Libreelec #44

Closed gotschi closed 3 years ago

gotschi commented 4 years ago

Hi,

thanks for your effort but I can't get any of the available hue plugins to work with a rpi 4, it worked fine on a rpi3 with ambilight


2019-12-23 19:02:28.069 T:2273862512  NOTICE: Creating Demuxer
2019-12-23 19:02:28.070 T:2273862512  NOTICE: Opening stream: 1 source: 256
2019-12-23 19:02:28.306 T:2273862512  NOTICE: Creating video codec with codec id: 27
2019-12-23 19:02:28.306 T:2273862512  NOTICE: CDVDVideoCodecFFmpeg::Open() Using codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
2019-12-23 19:02:28.309 T:2273862512  NOTICE: Creating video thread
2019-12-23 19:02:28.309 T:2304762736  NOTICE: running thread: video_thread
2019-12-23 19:02:28.309 T:2273862512  NOTICE: Opening stream: 2 source: 256
2019-12-23 19:02:28.509 T:2273862512  NOTICE: Finding audio codec for: 86018
2019-12-23 19:02:28.510 T:2273862512  NOTICE: CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder aac
2019-12-23 19:02:28.510 T:2273862512  NOTICE: Creating audio thread
2019-12-23 19:02:28.511 T:2332545904  NOTICE: running thread: CVideoPlayerAudio::Process()
2019-12-23 19:02:28.614 T:2775130992  NOTICE: Librespot: playback started
2019-12-23 19:02:28.614 T:2775130992  NOTICE: Librespot: stop librespot
2019-12-23 19:02:28.794 T:2304762736  NOTICE: CDecoder::Open - fmt:0
2019-12-23 19:02:28.803 T:2332545904  NOTICE: CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder aac
2019-12-23 19:02:28.803 T:2332545904  NOTICE: Creating audio stream (codec id: 86018, channels: 2, sample rate: 44100, no pass-through)
2019-12-23 19:02:28.874 T:2775130992  NOTICE: Librespot: playback started
2019-12-23 19:02:28.895 T:2707989360   ERROR: INFO:script.service.hue:Ambilight AV Started. Group enabled: 1 , isPlayingVideo: 1, isPlayingAudio: 0, self.mediaType: 1,self.playbackType(): 1
2019-12-23 19:02:28.896 T:2707989360   ERROR: INFO:script.service.hue:Ambilight Settings: Interval: 0.002, transitionTime: 2
2019-12-23 19:02:28.959 T:2707989360   ERROR: DEBUG:script.service.hue:Schedule: 0, daylightDiable: 0, daylight: False, startTime: 18:00, endTime: 22:00
2019-12-23 19:02:28.959 T:2707989360   ERROR: DEBUG:script.service.hue:Schedule not enabled
2019-12-23 19:02:28.960 T:2707989360   ERROR: DEBUG:script.service.hue:InfoTag contents: duration: 3, mediaType: video, file:
2019-12-23 19:02:28.961 T:2707989360   ERROR: DEBUG:script.service.hue:Video Activation settings(3): minDuration: 0, Movie: 1, Episode: 1, MusicVideo: 1, Other: 1
2019-12-23 19:02:28.961 T:2707989360   ERROR: DEBUG:script.service.hue:Video Activation (3): Duration: 3, mediaType: video
2019-12-23 19:02:28.961 T:2707989360   ERROR: DEBUG:script.service.hue:Video activation: True
2019-12-23 19:02:28.962 T:2248139632   ERROR: DEBUG:script.service.hue:_ambiLoop started
2019-12-23 19:02:28.963 T:2707989360   ERROR: INFO:script.service.hue:In KodiGroup[0], onPlaybackStarted. Group enabled: 1,startBehavior: 0 , isPlayingVideo: 1, isPlayingAudio: 0, self.mediaType: 1,self.playbackType(): 1
2019-12-23 19:02:28.963 T:2707989360   ERROR: DEBUG:script.service.hue:InfoTag: <xbmc.InfoTagVideo object at 0x936ef710>
2019-12-23 19:02:28.963 T:2707989360   ERROR: DEBUG:script.service.hue:InfoTag contents: duration: 3, mediaType: video, file:
2019-12-23 19:02:28.963 T:2707989360   ERROR: DEBUG:script.service.hue:Video Activation settings(0): minDuration: 0, Movie: 1, Episode: 1, MusicVideo: 1, Other: 1
2019-12-23 19:02:28.964 T:2707989360   ERROR: DEBUG:script.service.hue:Video Activation (0): Duration: 3, mediaType: video
2019-12-23 19:02:28.964 T:2707989360   ERROR: DEBUG:script.service.hue:Video activation: True
2019-12-23 19:02:28.965 T:2248139632   ERROR: DEBUG:script.service.hue:aspect_ratio: 1.77777779102, Capture Size: (400,224), expected_capture_size: 358400
2019-12-23 19:02:28.972 T:2707989360   ERROR: DEBUG:script.service.hue:Schedule: 0, daylightDiable: 0, daylight: False, startTime: 18:00, endTime: 22:00
2019-12-23 19:02:28.973 T:2707989360   ERROR: DEBUG:script.service.hue:Schedule not enabled
2019-12-23 19:02:28.975 T:2775130992  NOTICE: Librespot: playback started
2019-12-23 19:02:29.197 T:2304762736  NOTICE: Previous line repeats 2 times. ```
zim514 commented 4 years ago

What feature exactly doesn't work? Is there an error message? What OS/distrib and Kodi version are you using? The script doesn't even know if its running on an RPI or PC so it must be another factor

gotschi commented 4 years ago

Unfortunately I cannot find more than the lines I already posted, where is the advanced debug log saved?

zim514 commented 4 years ago

You can find information on how to retrieve and post logs here: https://kodi.wiki/view/Log_file/Easy

But you still haven't answered the other questions or said what the problem is.

gotschi commented 4 years ago

The Ambilight feature, the most obvious message just came when i stopped the video:

ERROR: [script.service.hue][AmbiGroup]_ambiLoop: capImage is none or < expected. captured: 0, expected: 358400

Libreelec 9.2 / kodi 18.5 I believe...

your plugin is not the only one that doesn't work with rpi4, the others also don't... it worked on rpi3 though :/

Martasdx commented 4 years ago

I saw same error with rpi4 and ambilight. I can debug if needed.

pá 27. 12. 2019 v 15:52 odesílatel gotschi notifications@github.com napsal:

The Ambilight feature, the most obvious message just came when i stopped the video:

ERROR: [script.service.hue][AmbiGroup]_ambiLoop http://159: capImage is none or < expected. captured: 0, expected: 358400

Libreelec 9.2 / kodi 18.5 I believe...

your plugin is not the only one that doesn't work with rpi4, the others also don't... it worked on rpi3 though :/

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/zim514/script.service.hue/issues/44?email_source=notifications&email_token=AARPHHOLHX5XUHWDPBY4WILQ2YJCRA5CNFSM4J6WV2B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHXJSMI#issuecomment-569284913, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARPHHMMJDYJJI4JNVQGO63Q2YJCRANCNFSM4J6WV2BQ .

--


Martin Polívka

zim514 commented 4 years ago

That log line always shows up when you stop the video even when the addon works. It's only a problem if it's there multiple times. I'll need the full logs to be able to do anything, I don't have a rpi4 so I can't test it.

Martasdx commented 4 years ago

I will provide everything for RPi4 + LibreElec/Kodi after 3rd January. I tried multiple plugins and neither of them worked with Ambilight (lightstrip)

tonyelektro commented 4 years ago

where is the system debug file lokated so i kan use putty to copy it im using a rbp 4 and kodi leia the latest , it sends the debug file to an www.io adres but i understand that i can copy it and paste it here. the prog works almost only the ambilights do not change collor and stay stuk on white/gray ,

i had to chance the config txt to inorder to make the sound working via hdmi

mount -o remount,rw /flash nano /flash/config.txt And add the line: hdmi_drive=2 Ctrl+o to save and Ctrl+x to exit nano. adding the line: hdmi_force_hotplug=1

when i use the vpn (zomboided version) it cant find the hue box but whit vpn off it connects and after it connects u can turn the vpn back on and the lights react if they are connected and connect normaly when i use kodi again.

im dutch so sorry for my inglisch haha:-)

so 90% of the programm works is seems the timing is to fast for the philips hue box to react or the part thats pics the color hangs

when i stop te movie the lights changes back to the programmed scene so thats good when i play files from youtube and frequently chance song nummers kodi sometimes hangs and it takes some time for kodi to unlock somtimes it has to reboot.

so tel me were to look and i sent a log file

gr Tony

zim514 commented 4 years ago

I suspect it's a similar problem with android, where the hardware rendering makes it impossible for the script to grab the video in order to calculate colours. Can you try it with hardware acceleration disabled in the Kodi system settings? It might make the video stutter but it's just a test to confirm the theory.

tonyelektro commented 4 years ago

now setting's / player f allow hw accelaration off

local variable 'new_daylight' referenced before assignment (log report)

http connection pool(host=192.168.2.1 port 80 )read timed out (read timeout=0,5)thats the connection whit the bridge

after rebooting several times there are no more reports but the ambilight stays one color in ambi mode IMG_2492

IMG_2494

tonyelektro commented 4 years ago

hey i tested 0.12.6 ( have now only 1 hue light bulp connected to the hue app) it stil needs a lidle somthing , when the movie starts the bulp changes from its programed color to 100% output for 0.3 sec+- to the color which is most presend on the screen. after that it goos grey/white to the outputlevel which is suposed to do but stays that way and dims up en down a bit i think +_ 2% from that staysionary licht volume when on the schreen the brichtnes goes up en down. but the color stays grey/white. when i stop the movie the color changes back to the programed color of the hue box . that works fine.

i made a clone and lookt ad it whit github\visual studio but programming is not my thing hahaha.

tonyelektro commented 4 years ago

log for 0.12.7 whit kodi leia latest version on rbp 4 T:3011663184 error :Control 55 in window 10025 has been asked to focus,but it can't

Martasdx commented 4 years ago

With plugin enabled and using Ambilight (Rpi4 + Kodi + Hue lightstrip):

Debug logs: 2020-01-03 17:29:00,229 INFO [AmbiGroup]onAVStarted: Ambilight AV Started. Group enabled: 1 , isPlayingVideo: 1, isPlayingAudio: 0, self.mediaType: 1,self.playbackType(): 1 2020-01-03 17:29:00,230 INFO [AmbiGroup]onAVStarted: Ambilight Settings: Interval: 0.002, transitionTime: 2 2020-01-03 17:29:00,254 DEBUG [KodiGroup]checkActiveTime: Schedule: 0, daylightDiable: 0, daylight: False, startTime: 18:00, endTime: 22:00 2020-01-03 17:29:00,255 DEBUG [KodiGroup]checkActiveTime: Schedule not enabled 2020-01-03 17:29:00,255 DEBUG [KodiGroup]checkVideoActivation: InfoTag contents: duration: 120, mediaType: movie, file: 2020-01-03 17:29:00,255 DEBUG [KodiGroup]checkVideoActivation: Video Activation settings(3): minDuration: 2, Movie: 1, Episode: 1, MusicVideo: 1, Other: 1 2020-01-03 17:29:00,256 DEBUG [KodiGroup]checkVideoActivation: Video Activation (3): Duration: 120, mediaType: movie 2020-01-03 17:29:00,256 DEBUG [KodiGroup]checkVideoActivation: Video activation: True 2020-01-03 17:29:00,257 DEBUG [AmbiGroup]_ambiLoop: _ambiLoop started 2020-01-03 17:29:00,257 DEBUG [AmbiGroup]_ambiLoop: aspect_ratio: 2.28571438789, Capture Size: (400,174), expected_capture_size: 278400

Kodi logs: 2020-01-03 17:32:50.866 T:3011751952 DEBUG: Previous line repeats 6 times. 2020-01-03 17:32:50.866 T:3011751952 DEBUG: CMMALRenderer::RenderCapture - 0x993a6d98 2020-01-03 17:32:50.983 T:3011751952 DEBUG: Previous line repeats 6 times. 2020-01-03 17:32:50.983 T:3011751952 DEBUG: CMMALRenderer::RenderCapture - 0x993294c8

hoksilato2 commented 4 years ago

Hi all,

Im interested too for run this awesome service with my Raspbi 4 + libreelec.

The service works ok except for the ambilight. It's a pitty.

Actually I run Hyperion but the result is very poor.

If you need more tests and logs Im here :)