Re: Grilo addon for Kodi



On Tue, 2018-04-24 at 18:11 -0400, W. Michael Petullo wrote:
I had trouble getting the gi module to import from the
context of
the
Kodi process, so I separated the Grilo functionality into a
daemon
process (grilohttpd) which bridges HTTP and Grilo sources.
Kodi
addons are stateless, so grilohttpd has the nice side effect
of
providing a persistent cache of the things available through
a
Grilo
source. I would be interested to hear any theories on why gi
might
have been malfunctioning in my earlier attempt.

 
What errors did you get trying to import and then use gi in
Kodi?
From what I could tell, the "import gi" statement would never
complete. The Kodi process would continue to respond to input
(e.g.,
I could "esc" out of the plugin), however the plugin itself would
continuously display its progress spinner.

 
Any chance you could get a backtrace from that? Any other errors in
the
journal or in the application's output?

Here is a simplified addon:

import gi

xbmc.log('1', level=xbmc.LOGERROR)

gi.require_version('Soup', '2.4')
xbmc.log('2', level=xbmc.LOGERROR)

gi.require_version('GLib', '2.0')
xbmc.log('3', level=xbmc.LOGERROR)

gi.require_version('Grl',  '0.3')
xbmc.log('4', level=xbmc.LOGERROR)

from gi.repository import Soup
xbmc.log('5', level=xbmc.LOGERROR)

from gi.repository import GLib
xbmc.log('6', level=xbmc.LOGERROR)

from gi.repository import Grl
xbmc.log('7', level=xbmc.LOGERROR)

And the Kodi log which results from clicking on the addon,
exiting, and clicking on it again follows. Notice Kodi prints '1'
--'7'
on the first run, but the second stops at '4'. Does gi rely on a full
exit to release its resources?

21:59:18.447 T:140706892663296  NOTICE: initialize done
21:59:18.447 T:140706892663296  NOTICE: Running the application...
21:59:18.449 T:140706892663296  NOTICE: starting zeroconf publishing
21:59:18.449 T:140706892663296  NOTICE: starting upnp client
21:59:18.450 T:140704781158144  NOTICE: ES: Starting UDP Event server
on port 9777
21:59:18.450 T:140704781158144  NOTICE: UDP: Listening on port 9777
(ipv6 : false)
21:59:21.866 T:140706340919040   ERROR: GetDirectory - Error getting
21:59:21.909 T:140704759109376   ERROR: Previous line repeats 3
times.
21:59:21.909 T:140704759109376   ERROR: 1
21:59:21.909 T:140704759109376   ERROR: 2
21:59:21.910 T:140704759109376   ERROR: 3
21:59:21.910 T:140704759109376   ERROR: 4
21:59:21.926 T:140704759109376   ERROR: 5
21:59:21.926 T:140704759109376   ERROR: 6
21:59:21.926 T:140704759109376   ERROR: 7
21:59:21.935 T:140706892663296   ERROR: GetDirectory - Error getting
plugin://plugin.audio.grilo/
21:59:21.935 T:140706892663296   ERROR:
CGUIMediaWindow::GetDirectory(plugin://plugin.audio.grilo/) failed
21:59:39.331 T:140706892663296   ERROR: Control 55 in window 10502
has been asked to focus, but it can't
21:59:39.363 T:140705272092416   ERROR: 1
21:59:39.363 T:140705272092416   ERROR: 2
21:59:39.363 T:140705272092416   ERROR: 3
21:59:39.363 T:140705272092416   ERROR: 4
21:59:39.372 T:140705272092416   ERROR: EXCEPTION Thrown
(PythonToCppException) : -->Python callback/script returned the
following error<--
                                             - NOTE: IGNORING THIS
CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type
'exceptions.TypeError'>
                                            Error Contents: Error
when calling the metaclass bases
                                                'NoneType' object is
not callable
                                            Traceback (most recent
call last):
                                              File
"/home/mike/.kodi/addons/plugin.audio.grilo/addon.py", line 17, in
<module>
                                                from gi.repository
import Soup


Can you please file a bug against pygobject? It's possible that some
shared libraries are loaded twice instead of being made resident, which
might explain the difference between the runs. It might also be a
problem with gobject-introspection itself, though the developers would
be able to gather more information about this problem.

Cheers


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]