{"id":4359,"date":"2021-04-10T11:25:11","date_gmt":"2021-04-09T23:25:11","guid":{"rendered":"http:\/\/www.zoyinc.com\/?p=4359"},"modified":"2021-04-10T11:25:25","modified_gmt":"2021-04-09T23:25:25","slug":"kodi-mythtv-addon-fails-to-load","status":"publish","type":"post","link":"http:\/\/www.zoyinc.com\/?p=4359","title":{"rendered":"Kodi MythTV addon fails to load"},"content":{"rendered":"\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter  wp-image-4360\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2020\/11\/KodiMythTVAddonFailsLoad01.jpg\" alt=\"\" width=\"470\" height=\"149\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2020\/11\/KodiMythTVAddonFailsLoad01.jpg 800w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2020\/11\/KodiMythTVAddonFailsLoad01-300x95.jpg 300w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2020\/11\/KodiMythTVAddonFailsLoad01-150x48.jpg 150w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2020\/11\/KodiMythTVAddonFailsLoad01-768x244.jpg 768w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2020\/11\/KodiMythTVAddonFailsLoad01-500x159.jpg 500w\" sizes=\"auto, (max-width: 470px) 100vw, 470px\" \/>Starting around the 23rd of October 2020 I found that my MythTV add-on was not working in Kodi running on Windows 10. It would hang either on importing guide or it would show nothing but not work either. I had been changing the subtitle and title of some recordings in the DB but I had done this many times before without issue.<\/p>\n<p>I spent a heck of a lot of time over the week and following weekend investigating but could not resolve it. Then magically today it is working fine. So I am little totally frustrated and happy all at once.<\/p>\n<p>So this post mostly serves as a record of what I learned should it come up again.<\/p>\n<h2>Myth back end seems to be ok<\/h2>\n<p>Far as I could tell the back end has been working fine. It does recordings, keeps to the schedule, all fine. I also ran up the front end on the server and it worked fine, no issues. I also ran up Kodi on my phone and Kodi worked fine.<\/p>\n<h2>Kodi local SQLite<\/h2>\n<p>Kodi has a set of SQLite databases it uses for various things. There is a copy of these in each profile in Kodi. So if you only have the default &#8220;Master&#8221; profile then this is:<\/p>\n<p style=\"padding-left: 40px;\">C:\\Users\\Tony\\AppData\\Roaming\\Kodi\\userdata\\Database<\/p>\n<p>In the above the &#8220;Tony&#8221; folder is the Windows user that I am logged in as when I run Kodi, it is not a Kodi profile &#8211; this is still the Kodi master profile. If you had a Kodi profile call &#8220;Fred&#8221; then the folder would be:<\/p>\n<p style=\"padding-left: 40px;\">C:\\Users\\Tony\\AppData\\Roaming\\Kodi\\userdata\\profiles\\Fred\\Database<\/p>\n<p>The databases are:<\/p>\n<p style=\"padding-left: 40px;\">Addons27.db<br \/>CDDB<br \/>Epg12.db<br \/>MyMusic72.db<br \/>MyVideos116.db<br \/>Textures13.db<br \/>TV32.db<br \/>ViewModes6.db<\/p>\n<p>Note each DB has a version number in the name so the base DB names will be the same for you but the versions might be different.<\/p>\n<p>The one that is interesting to us is Epg12.db. This contains the EPG details. It works perfectly fine to shutdown Kodi and delete this DB and it will recreate it.<\/p>\n<p>I found when I was trying things with the EPG it was a good idea to shutdown Kodi and delete this EPG database, otherwise it go really confusing as to whether thing were working or not because it had already loaded some\/all of the EPG details into the running app.<\/p>\n<h2>MythTV program table<\/h2>\n<p>In the main MythTV database, the MariaDB database on the MythTV back end, not the Kodi ones, there is a table called &#8220;program&#8221;.\u00a0 This contains the EPG data. This can safely be truncated as it will be repopulated. To get the EPG data to populate record a program and once you do this it will start to collect EPG data and within a few minutes it will slowly start to populate.<\/p>\n<p>This table was very important for this problem. For example if I did the following:<\/p>\n<ol>\n<li>Stop Kodi and ensure the process is killed<\/li>\n<li>Stop mythbackend and ensure it is completely down<\/li>\n<li>Truncate the &#8220;program&#8221; table<\/li>\n<li>Delete the Kodi Epg12.db database<\/li>\n<li>Start mythbackend<\/li>\n<li>Monitor MythWeb until recorded programs works to prove Myth is fully up<\/li>\n<li>Immediately start Kodi<\/li>\n<\/ol>\n<p>This always worked. If I watched some live TV and allowed the program table to populate and then restarted Kodi it would hang loading the guide.<\/p>\n<h2>Possible causes<\/h2>\n<p>For this issues there was a suggestion it could be related to certain channels or it could be invalid characters in the title or subtitle.<\/p>\n<p>Another possible theory is it is related to daylight savings times. I don&#8217;t know why this would be the case unless Kodi or the add-on, has problems dealing with daylight savings. The reason for thinking it might be related is mostly due to timing and the fact that the problem magically resolved.<\/p>\n<p>EPG data is somehow likely to be related and this can give misleading time frames. Remembering MythTV will typically have 8 days worth of data. That means that if there is an EPG issue due to dates or text, like title\/subtitle, then the problem could appear 8 days ahead of the actual recording<\/p>\n<p>\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":4769,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[709,708,237,710,707,630,711,539,538,298],"class_list":["post-4359","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mythtv","tag-add-on","tag-addon","tag-epg","tag-hang","tag-importing","tag-kodi","tag-load","tag-mariadb","tag-mysql","tag-mythtv"],"_links":{"self":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/4359","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4359"}],"version-history":[{"count":8,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/4359\/revisions"}],"predecessor-version":[{"id":4770,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/4359\/revisions\/4770"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/media\/4769"}],"wp:attachment":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4359"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}