(2018-09-09, 08:18)tkislan Wrote: (2018-09-08, 12:06)pbarr Wrote: (2018-09-07, 02:17)pbarr Wrote: Tomas,
Hopefully I did this right and you should find the log file here. I switched on DEBUG also.
https://paste.ubuntu.com/p/mtBZkyV2T4/
I registered with [email protected]
As for the description of what's happening.
I start up Kodi and the Kodi Connect pop up appears and says "connected"
Then I just ask Kodi to play a movie:
Alexa, play Interstellar - just as in the cheat sheet.
Alexa says: "getting Interstellar from Kodi Video".
This experience is the same for TV Shows and Movies.
Then nothing happens so I'm guessing there's an unhandled exception occurring somewhere there, either in Kodi or in your server. Looking at those logs I think it's Kodi.
If I am in a movie or a music video I can still "pause" and "play". Lag is about 2 seconds on both commands and Alexa doesn't respond verbally to those, but they do work. I can also fast forward, etc.
Incidentally I don't know how to use a voice command to "stop" play a video and return to the menu. I still need to use a remote control for that.
Thanks for your efforts.
I did a bit of research on this. There is a line of code in your json rpc call that manages the Unicode. You are set to utf-8. In most cases where only Latin characters are used in file names this should mostly be ok, but I have a bunch of Chinese, Japanese, and Korean titles, it to mention the affectation that some artists have with higher end ASCII characters in their names. I changed this line to ISO-8859-1 and reinstalled the modified plugin. It all works now.
Oh, disregard my previous reply.
But what approach you suggest here? is there a way to know the encoding upfront? or should I just add failover to try with other encodings?
Unfortunately its almost impossible to identify the specific piece of data that is problematic. When I looked this error up there have been two schools of thought regarding its correction.
1. Just change the utf-8 encoding to ISO-8859-1 (but I think that's not always going to work). I did do this on line 7 of File kodi_rpc.py which now looks like this "return json.loads(xbmc.executeJSONRPC(json.dumps(obj)).decode('ISO-8859-1'))"
2. or do as you suggest - try it first with utf-8 and then failover to ISO-8859-1.
You shouldn't need any other encodings as utf-8 should handle all encoding that is multibyte and ISO-8859-1 is Latin 1 which should handle all single byte ASCII encoding. It's actually probably the single byte characters that have ASCII above bit 128 specifically all the special diacritics - umlaut, acute, grave, circumflex, etc. Occasionally some movie titles have these but if they are created in Latin-1 instead of utf-8, then Python's utf-8 encoder/decoder can't seem to recognize them. Fair to say though that this is not an encoding problem as the unicode codes for 0-255 bits are the same as Latin-1 codes - this is probably actually a Python problem that has apparently been around for a long time.
Apparently this is a fairly common issue when translating a voice command to a text command.
I did option 1 and it has worked successfully for me all weekend, but option 2 is probably better practice.