Page 4 of 18

Re: Kodi Mediaserver Support

Posted: Friday 25 September 2015 19:43
by Justintime
Ok.... Nothing touched in kodi, left the port on 80
Remote control active.... when i do the "off" command in Domoticz, Kodi goes to sleep mode. But Domoticz gives the message error switch command.
And Domoticz crashes....

Re: Kodi Mediaserver Support

Posted: Friday 25 September 2015 19:59
by Minglarn
A small note... Having the same issuies as Justintime. But as soon as I change the port to 9090 my Domoticz goes down or gets really slow...

Re: Kodi Mediaserver Support

Posted: Saturday 26 September 2015 8:32
by Dnpwwo
I believe I've found the Domoticz crash when a Kodi is shut down.

It was a race condition between two threads where both were disconnecting (and the 2nd one was not going too well :oops:), would only show up on slow systems like RPi.

@Justintime, I added some extra logging around the shutdown because if the Kodi can shut down (which clearly yours can) it should return success to the web browser (and does as far as I can tell). Can you try it with the new build and post the Kodi related log messages?

Re: Kodi Mediaserver Support

Posted: Saturday 26 September 2015 8:43
by Justintime
Dnpwwo wrote:I believe I've found the Kodi crash when a Kodi is shut down.

It was a race condition between two threads where both were disconnecting (and the 2nd one was not going too well :oops:), would only show up on slow systems like RPi.

@Justintime, I added some extra logging around the shutdown because if the Kodi can shut down (which clearly yours can) it should return success to the web browser (and does as far as I can tell). Can you try it with the new build and post the Kodi related log messages?
Can you push an update? Because I am a noob in Linux compiling.

Re: Kodi Mediaserver Support

Posted: Saturday 26 September 2015 11:25
by Justintime
Dnpwwo wrote:I believe I've found the Domoticz crash when a Kodi is shut down.

It was a race condition between two threads where both were disconnecting (and the 2nd one was not going too well :oops:), would only show up on slow systems like RPi.

@Justintime, I added some extra logging around the shutdown because if the Kodi can shut down (which clearly yours can) it should return success to the web browser (and does as far as I can tell). Can you try it with the new build and post the Kodi related log messages?

Here you go... i think this is what you need?? If not please tell. The problem still exists.

Code: Select all

11:22:56 T:139910502377344   DEBUG: ------ Window Init (DialogBusy.xml) ------
11:22:56 T:139908974212864    INFO: JSONRPC Server: Disconnection detected
11:22:56 T:139910502377344   DEBUG: LogindUPowerSyscall: Received PrepareForSleep with arg 1
11:22:56 T:139910502377344   DEBUG: CAnnouncementManager - Announcement: OnSleep from xbmc
11:22:56 T:139910502377344   DEBUG: GOT ANNOUNCEMENT, type: 8, from xbmc, message OnSleep
11:22:56 T:139910502377344  NOTICE: OnSleep: Running sleep jobs
11:22:56 T:139910502377344  NOTICE: OnSleep: Stopping lirc
11:22:56 T:139910502377344    INFO: LIRC setUsed: disabled
11:22:56 T:139910502377344   DEBUG: CApplication::CloseNetworkShares: Closing all network shares
11:22:56 T:139910502377344   DEBUG: LogindUPowerSyscall - delay lock released
11:22:56 T:139910502377344    INFO: LIRC setUsed: disabled
11:23:02 T:139910502377344   DEBUG: Keyboard: scancode: 0x40, sym: 0x0134, unicode: 0x0000, modifier: 0x100
11:23:02 T:139910502377344   DEBUG: OnKey: alt-leftalt (0x4f0d4) pressed, action is
11:23:02 T:139910502377344   DEBUG: Keyboard: scancode: 0x85, sym: 0x0137, unicode: 0x0000, modifier: 0x100
11:23:02 T:139910502377344   DEBUG: OnKey: alt-leftwindows (0x4f0d6) pressed, action is
11:23:02 T:139910502377344   DEBUG: Keyboard: scancode: 0x6c, sym: 0x0133, unicode: 0x0000, modifier: 0x180
11:23:02 T:139910502377344   DEBUG: OnKey: ctrl-alt-164 (0x5f0a4) pressed, action is
11:23:02 T:139910502377344   DEBUG: Keyboard: scancode: 0x24, sym: 0x000d, unicode: 0x000d, modifier: 0x180
11:23:02 T:139910502377344   DEBUG: OnKey: ctrl-alt-return (0x5f00d) pressed, action is
11:23:02 T:139910502377344    INFO: LIRC Initialize: using: /run/lirc/lircd
11:23:02 T:139910502377344    INFO: LIRC Initialize: successfully started
11:23:03 T:139910502377344   DEBUG: LogindUPowerSyscall: Received PrepareForSleep with arg 0
11:23:03 T:139910502377344  NOTICE: OnWake: Running resume jobs
11:23:03 T:139910502377344  NOTICE: OnWake: Restarting lirc
11:23:03 T:139910491821824    INFO: CAESinkALSA - Unable to open device "default" for playback
11:23:03 T:139910491821824   DEBUG: CAESinkALSA - HDMI device "hdmi:CARD=HDMI,DEV=1" may be unconnected (no ELD data)
11:23:03 T:139910491821824   DEBUG: CAESinkALSA - HDMI device "hdmi:CARD=HDMI,DEV=2" may be unconnected (no ELD data)
11:23:03 T:139910491821824    INFO: CAESinkALSA - Unable to open device "surround21:CARD=PCH,DEV=0" for playback
11:23:03 T:139910491821824  NOTICE: Found 1 Lists of Devices
11:23:03 T:139910491821824  NOTICE: Enumerated ALSA devices:
11:23:03 T:139910491821824  NOTICE:     Device 1
11:23:03 T:139910491821824  NOTICE:         m_deviceName      : hdmi:CARD=HDMI,DEV=0
11:23:03 T:139910491821824  NOTICE:         m_displayName     : HDA Intel
11:23:03 T:139910491821824  NOTICE:         m_displayNameExtra: ONK TX-NR709 on HDMI #0
11:23:03 T:139910491821824  NOTICE:         m_deviceType      : AE_DEVTYPE_HDMI
11:23:03 T:139910491821824  NOTICE:         m_channels        : FL,FR,LFE,FC,BL,BR,BLOC,BROC
11:23:03 T:139910491821824  NOTICE:         m_sampleRates     : 32000,44100,48000,88200,96000,176400,192000
11:23:03 T:139910491821824  NOTICE:         m_dataFormats     : AE_FMT_LPCM,AE_FMT_AC3,AE_FMT_DTS,AE_FMT_EAC3,AE_FMT_DTSHD,AE_FMT_TRUEHD,AE_FMT_S32NE,AE_FMT_S16NE,AE_FMT_S16LE,AE_FMT_AAC
11:23:03 T:139910491821824  NOTICE:     Device 2
11:23:03 T:139910491821824  NOTICE:         m_deviceName      : hdmi:CARD=HDMI,DEV=1
11:23:03 T:139910491821824  NOTICE:         m_displayName     : HDA Intel
11:23:03 T:139910491821824  NOTICE:         m_displayNameExtra: HDMI #1
11:23:03 T:139910491821824  NOTICE:         m_deviceType      : AE_DEVTYPE_HDMI
11:23:03 T:139910491821824  NOTICE:         m_channels        : FL,FR,LFE,FC,BC,BL,BR,FLOC,FROC,BLOC,BROC,TFC,TC,TFL,TFR,UNKNOWN1
11:23:03 T:139910491821824  NOTICE:         m_sampleRates     : 32000,44100,48000,88200,96000,176400,192000
11:23:03 T:139910491821824  NOTICE:         m_dataFormats     : AE_FMT_S32NE,AE_FMT_S16NE,AE_FMT_S16LE,AE_FMT_LPCM,AE_FMT_DTSHD,AE_FMT_TRUEHD,AE_FMT_EAC3,AE_FMT_DTS,AE_FMT_AC3,AE_FMT_AAC
11:23:03 T:139910491821824  NOTICE:     Device 3
11:23:03 T:139910491821824  NOTICE:         m_deviceName      : hdmi:CARD=HDMI,DEV=2
11:23:03 T:139910491821824  NOTICE:         m_displayName     : HDA Intel
11:23:03 T:139910491821824  NOTICE:         m_displayNameExtra: HDMI #2
11:23:03 T:139910491821824  NOTICE:         m_deviceType      : AE_DEVTYPE_HDMI
11:23:03 T:139910491821824  NOTICE:         m_channels        : FL,FR,LFE,FC,BC,BL,BR,FLOC,FROC,BLOC,BROC,TFC,TC,TFL,TFR,UNKNOWN1
11:23:03 T:139910491821824  NOTICE:         m_sampleRates     : 32000,44100,48000,88200,96000,176400,192000
11:23:03 T:139910491821824  NOTICE:         m_dataFormats     : AE_FMT_S32NE,AE_FMT_S16NE,AE_FMT_S16LE,AE_FMT_LPCM,AE_FMT_DTSHD,AE_FMT_TRUEHD,AE_FMT_EAC3,AE_FMT_DTS,AE_FMT_AC3,AE_FMT_AAC
11:23:03 T:139910491821824  NOTICE:     Device 4
11:23:03 T:139910491821824  NOTICE:         m_deviceName      : @:CARD=PCH,DEV=0
11:23:03 T:139910491821824  NOTICE:         m_displayName     : HDA Intel PCH
11:23:03 T:139910491821824  NOTICE:         m_displayNameExtra: ALC283 Analog
11:23:03 T:139910491821824  NOTICE:         m_deviceType      : AE_DEVTYPE_PCM
11:23:03 T:139910491821824  NOTICE:         m_channels        : FL,FR
11:23:03 T:139910491821824  NOTICE:         m_sampleRates     : 48000
11:23:03 T:139910491821824  NOTICE:         m_dataFormats     : AE_FMT_S32NE
11:23:03 T:139910483429120    INFO: CActiveAESink::OpenSink - initialize sink
11:23:03 T:139910483429120   DEBUG: CActiveAESink::OpenSink - trying to open device ALSA:hdmi:CARD=HDMI,DEV=0
11:23:03 T:139910483429120    INFO: CAESinkALSA::Initialize - Attempting to open device "hdmi:CARD=HDMI,DEV=0"
11:23:03 T:139910483429120    INFO: CAESinkALSA::Initialize - Opened device "hdmi:CARD=HDMI,DEV=0,AES0=0x04,AES1=0x82,AES2=0x00,AES3=0x00"
11:23:03 T:139910483429120    INFO: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats
11:23:03 T:139910483429120    INFO: CAESinkALSA::InitializeHW - Using data format AE_FMT_S32NE
11:23:03 T:139910483429120   DEBUG: CAESinkALSA::InitializeHW - Request: periodSize 2048, bufferSize 8192
11:23:03 T:139910483429120   DEBUG: CAESinkALSA::InitializeHW - Got: periodSize 2048, bufferSize 8192
11:23:03 T:139910483429120   DEBUG: CAESinkALSA::InitializeHW - Setting timeout to 186 ms
11:23:03 T:139910483429120   DEBUG: CAESinkALSA::GetChannelLayout - Input Channel Count: 2 Output Channel Count: 2
11:23:03 T:139910483429120   DEBUG: CAESinkALSA::GetChannelLayout - Requested Layout: FL,FR
11:23:03 T:139910483429120   DEBUG: CAESinkALSA::GetChannelLayout - Got Layout: FL,FR (ALSA: FL FR)
11:23:03 T:139910483429120   DEBUG: CActiveAESink::OpenSink - ALSA Initialized:
11:23:03 T:139910483429120   DEBUG:   Output Device : HDA Intel
11:23:03 T:139910483429120   DEBUG:   Sample Rate   : 44100
11:23:03 T:139910483429120   DEBUG:   Sample Format : AE_FMT_S32NE
11:23:03 T:139910483429120   DEBUG:   Channel Count : 2
11:23:03 T:139910483429120   DEBUG:   Channel Layout: FL,FR
11:23:03 T:139910483429120   DEBUG:   Frames        : 2048
11:23:03 T:139910483429120   DEBUG:   Frame Samples : 4096
11:23:03 T:139910483429120   DEBUG:   Frame Size    : 8

Re: Kodi Mediaserver Support

Posted: Saturday 26 September 2015 19:27
by jake
I updated Domoticz to the #V2.3183 and right away I get the following errors in my log:

Code: Select all

2015-09-26 19:25:30.245 Error: Kodi: (Kodi Media Center) Exception: Invalid argument
2015-09-26 19:25:30.245 Kodi: (Kodi Media Center) Exiting work loop.
2015-09-26 19:26:00.754 Kodi: (Kodi Media Center) - Restarting thread.
2015-09-26 19:26:00.754 Kodi: Restarting I/O service thread.
2015-09-26 19:26:00.755 Error: Kodi: (Kodi Media Center) Exception: Invalid argument
2015-09-26 19:26:00.756 Kodi: (Kodi Media Center) Exiting work loop.
Kodi Mediaserver support has been working well for weeks.

Re: Kodi Mediaserver Support

Posted: Saturday 26 September 2015 20:38
by Raspberry Piet
jake wrote:I updated Domoticz to the #V2.3183 and right away I get the following errors in my log:

Code: Select all

.
Kodi Mediaserver support has been working well for weeks.
Change port in the settings menu to 9090.
I experienced the same: http://www.domoticz.com/forum/viewtopic.php?f=6&t=8193

Re: Kodi Mediaserver Support

Posted: Saturday 26 September 2015 22:03
by jake
Raspberry Piet wrote:
jake wrote:I updated Domoticz to the #V2.3183 and right away I get the following errors in my log:

Code: Select all

.
Kodi Mediaserver support has been working well for weeks.
Change port in the settings menu to 9090.
I experienced the same: http://www.domoticz.com/forum/viewtopic.php?f=6&t=8193
Thanks, that was it. To sum up in detail the solution (I did everything wrong, before it worked for me):

Go to Setup > Hardware >
Click on 'Setup' button of the Kodi Media Server entry
Click on your entry for the Kodi Media Server
Update Port from 8080 to 9090
Update IP address: Remove usernameImageassword@ (only if you use username and password to open Kodi)

Do NOT change the 'Kodi Notification' port 9777 in Setup > Settings > Notifications >

Re: Kodi Mediaserver Support

Posted: Tuesday 29 September 2015 13:21
by cjnicholl
I have just rebuilt my server after a crash and am having problems with the latest Kodi Mediaserver (the old version worked fine).
Kodi is the latest version of OpenElec.

If I set the port number to 9090 I get the following error:

Code: Select all

2015-09-29 12:14:29.464 Kodi: (Kodi Living Room) Connected.
2015-09-29 12:14:29.464 Kodi: (Kodi Living Room) Event: 'On'.
2015-09-29 12:14:29.564 Error: Kodi: (Kodi Living Room) Async Read Exception: 125, Operation canceled
2015-09-29 12:14:29.564 Kodi: (Kodi Living Room) Event: 'Off'.
If I change the port to 80 (which used to work) I get:

Code: Select all

2015-09-29 12:08:31.447 Kodi: (Kodi Living Room) Missed 1 pings, assumed off.
2015-09-29 12:08:31.447 Kodi: (Kodi Living Room) Event: 'Off'.
2015-09-29 12:08:31.447 Kodi: (Kodi Living Room) Disonnected.
2015-09-29 12:08:32.448 Kodi: (Kodi Living Room) Connected.
2015-09-29 12:08:32.448 Kodi: (Kodi Living Room) Event: 'On'.
2015-09-29 12:09:24.678 Kodi: Restarting I/O service thread.
2015-09-29 12:10:33.462 Kodi: (Kodi Living Room) Missed 1 pings, assumed off.
2015-09-29 12:10:33.462 Kodi: (Kodi Living Room) Event: 'Off'.
2015-09-29 12:10:33.462 Kodi: (Kodi Living Room) Disonnected.
2015-09-29 12:10:34.463 Kodi: (Kodi Living Room) Connected.
2015-09-29 12:10:34.463 Kodi: (Kodi Living Room) Event: 'On'.
2015-09-29 12:11:25.711 Kodi: Restarting I/O service thread.
2015-09-29 12:12:35.477 Kodi: (Kodi Living Room) Missed 1 pings, assumed off.
2015-09-29 12:12:35.478 Kodi: (Kodi Living Room) Event: 'Off'.
2015-09-29 12:12:35.478 Kodi: (Kodi Living Room) Disonnected.
2015-09-29 12:12:36.478 Kodi: (Kodi Living Room) Connected.
2015-09-29 12:12:36.478 Kodi: (Kodi Living Room) Event: 'On'.
2015-09-29 12:13:26.738 Kodi: Restarting I/O service thread.
This will repeat until I disable the hardware in settings. I have read the wiki and checked my Kodi settings which are ok.

Thanks

Re: Kodi Mediaserver Support

Posted: Tuesday 29 September 2015 16:20
by cjnicholl
Just read back through the thread and noticed that Justintime is also using OpenElec and having similar problems. Could there be something different in the implementation between OpenElec & standard Kodi??
I know OpenElec uses port 9090 for JSON commands/requests as my Total Control system successfully IP controls my Kodi box using this.
I can also telnet my Openelec box on port 9090 successfully.

Re: Kodi Mediaserver Support

Posted: Tuesday 29 September 2015 19:07
by sincze
cjnicholl wrote:Just read back through the thread and noticed that Justintime is also using OpenElec and having similar problems. Could there be something different in the implementation between OpenElec & standard Kodi??
I know OpenElec uses port 9090 for JSON commands/requests as my Total Control system successfully IP controls my Kodi box using this.
I can also telnet my Openelec box on port 9090 successfully.
After updating to V2.3207 I receive the following error.
As we speak only KODI in KEUKEN is running the rest is switched off.

All KODI machines run on windows (7 or 10). It all worked without in v2.2982. And no complaints in the log for swtiched of KODI machines.
I can do further investigation if necessary.

Re: Kodi Mediaserver Support

Posted: Wednesday 30 September 2015 17:28
by krazny
I've got the same error messages in the logging since the last 2 updates (I believe since v2.3202)

Someone has changed something in the code?

Re: Kodi Mediaserver Support

Posted: Wednesday 30 September 2015 22:13
by sincze
krazny wrote:I've got the same error messages in the logging since the last 2 updates (I believe since v2.3202)

Someone has changed something in the code?
Unfortunately v2.3213 still same error messages.

Re: Kodi Mediaserver Support

Posted: Thursday 01 October 2015 9:37
by CodeItAway
After disabling username and password the 'invalid argument' message dissapears but now the ping fails, so still not working properly.

Re: Kodi Mediaserver Support

Posted: Friday 02 October 2015 7:43
by Dnpwwo
Okay, I need some more information so I've pushed an update to allow per Kodi debugging.

If you are having issues, go back to the device set up page (under Hardware) and make the port number negative for (one of) your kodi, e.g if using the default port 9090, make the port -9090 and your log will be spammed with messages.

Use the Kodi to stream some media then Cut and Paste the logged details for the device into a post under this topic.

From what I have seen so far, anyone seeing 'Invalid argument' errors has not updated the Kodi port number as specified here: http://www.domoticz.com/wiki/Kodi#Domoticz_Settings

I occasionally see 'Operation canceled' messages when unloading & reloading Kodi devices after updating but for me Domoticz recovers and reconnects.

For people not building from source you will need to wait for the next beta before doing this obviously.

Re: Kodi Mediaserver Support

Posted: Friday 02 October 2015 10:54
by salvation
Hi,

great work so far!
Is it possible to set the status off Kodi by a lua script? For example, I want to pause the video stream when the doorbell rings. Or pause the video or music when phone rings.

So I'd like to know:
- which status of Kodi can be checked on?
- which status of kodi can be set via the commandarray?

Re: Kodi Mediaserver Support

Posted: Saturday 03 October 2015 9:36
by Dnpwwo
The event functionality is still under development but today I pushed an update that should allow events to be fired from Blocky (tested) and Lua (untested) for any player state (On, Off, Video, Audio & Paused).

This will allow you to ring your doorbell when a video stream pauses but not the other way around :lol:

This means that:
Untitled.png
Untitled.png (12.55 KiB) Viewed 4809 times
Messages will be written to the log when the Lounge Kodi starts playing music but the Set command won't do anything (yet).

I haven't done any coding with Domoticz events so I'm on a journey of discovery, if you want to take the next beta and test the lua that would be helpful.

Re: Kodi Mediaserver Support

Posted: Saturday 03 October 2015 10:24
by salvation
Great, I will test it in my Lua scripts on the next beta.

Re: Kodi Mediaserver Support

Posted: Saturday 03 October 2015 10:28
by salvation
cjnicholl wrote:I have just rebuilt my server after a crash and am having problems with the latest Kodi Mediaserver (the old version worked fine).
Kodi is the latest version of OpenElec.

If I set the port number to 9090 I get the following error:

Code: Select all

2015-09-29 12:14:29.464 Kodi: (Kodi Living Room) Connected.
2015-09-29 12:14:29.464 Kodi: (Kodi Living Room) Event: 'On'.
2015-09-29 12:14:29.564 Error: Kodi: (Kodi Living Room) Async Read Exception: 125, Operation canceled
2015-09-29 12:14:29.564 Kodi: (Kodi Living Room) Event: 'Off'.
If I change the port to 80 (which used to work) I get:

Code: Select all

2015-09-29 12:08:31.447 Kodi: (Kodi Living Room) Missed 1 pings, assumed off.
2015-09-29 12:08:31.447 Kodi: (Kodi Living Room) Event: 'Off'.
2015-09-29 12:08:31.447 Kodi: (Kodi Living Room) Disonnected.
2015-09-29 12:08:32.448 Kodi: (Kodi Living Room) Connected.
2015-09-29 12:08:32.448 Kodi: (Kodi Living Room) Event: 'On'.
2015-09-29 12:09:24.678 Kodi: Restarting I/O service thread.
2015-09-29 12:10:33.462 Kodi: (Kodi Living Room) Missed 1 pings, assumed off.
2015-09-29 12:10:33.462 Kodi: (Kodi Living Room) Event: 'Off'.
2015-09-29 12:10:33.462 Kodi: (Kodi Living Room) Disonnected.
2015-09-29 12:10:34.463 Kodi: (Kodi Living Room) Connected.
2015-09-29 12:10:34.463 Kodi: (Kodi Living Room) Event: 'On'.
2015-09-29 12:11:25.711 Kodi: Restarting I/O service thread.
2015-09-29 12:12:35.477 Kodi: (Kodi Living Room) Missed 1 pings, assumed off.
2015-09-29 12:12:35.478 Kodi: (Kodi Living Room) Event: 'Off'.
2015-09-29 12:12:35.478 Kodi: (Kodi Living Room) Disonnected.
2015-09-29 12:12:36.478 Kodi: (Kodi Living Room) Connected.
2015-09-29 12:12:36.478 Kodi: (Kodi Living Room) Event: 'On'.
2015-09-29 12:13:26.738 Kodi: Restarting I/O service thread.
This will repeat until I disable the hardware in settings. I have read the wiki and checked my Kodi settings which are ok.

Thanks
I experience comparable troubles on my Kodi instances, also Openelec based. But I it seems that it only occur if I add more than 1 Kodi node to the Kodi Media Server setup. Is it possbile those problems are somehow related to multiple instances?

Re: Kodi Mediaserver Support

Posted: Saturday 03 October 2015 11:10
by Dnpwwo
Can you follow these instructions and post the output? http://www.domoticz.com/wiki/Kodi#Troubleshooting