Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 401653 - media-tv/xbmc-9999 "Unable to open database" with xbmc-9999-nomythtv.patch
Summary: media-tv/xbmc-9999 "Unable to open database" with xbmc-9999-nomythtv.patch
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Xbox project
URL: http://trac.xbmc.org/ticket/11775
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-31 16:15 UTC by vpiotr
Modified: 2012-02-04 19:49 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
xbmc.log (xbmc.log,16.62 KB, text/plain)
2012-01-31 16:15 UTC, vpiotr
Details
xbmc-9999-nomythtv-v2.patch (xbmc-9999-nomythtv-v2.patch,5.29 KB, patch)
2012-02-03 04:09 UTC, Ben Kohler
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description vpiotr 2012-01-31 16:15:28 UTC
Created attachment 300547 [details]
xbmc.log

xbmc-9999-nomythtv.patch for media-tv/xbmc-9999 causes XBMC to fail while opening sqlite3 databases (see attachment). Additionaly, CPU usage is higher than usual due to infinite database open retries. I'm not sure if this is caused by latest patch update (v 1.2) or if it was like that since 1.1.

If xbmc is compiled without this patch, everything works fine. Also xbmc compiled directly from upstream sources works OK. I've also tried earlier xbmc versions (commits around mid-January I think) with the patch but got the same error.
Comment 1 BT 2012-02-01 11:36:04 UTC
Shouldn't the xbmc-9999-nomythtv patch be conditional on use pvr?
Comment 2 SpanKY gentoo-dev 2012-02-01 15:52:49 UTC
no.  the patch adds a proper configure flag which is then used with econf.
Comment 3 Vladi 2012-02-01 18:08:26 UTC
72 +if test "$use_mythtv" = "yes"; then
 73 +  AC_CHECK_PROG(MYSQL_CONFIG, mysql_config, "yes", "no")
 74 +  if test $MYSQL_CONFIG = "yes"; then
 75 +    INCLUDES="$INCLUDES `mysql_config --include`"
 76 +    MYSQL_LIBS=`mysql_config --libs`
 77 +    LIBS="$LIBS $MYSQL_LIBS"
 78 +    AC_SUBST(MYSQL_LIBS)
 79 +  else
 80 +    AC_MSG_ERROR($missing_program)
 81 +  fi
 82 +  AC_CHECK_LIB([mysqlclient], [main],
 83 +    AC_DEFINE([BUILD_MYTHTV], [1], [Define to 1 to build mythtv.]),
 84 +    AC_MSG_ERROR($mysql_not_found))
 85  else
 86 -  AC_MSG_ERROR($missing_program)
 87 +  AC_MSG_RESULT($mythtv_disabled)
 88  fi

one of the problems is in the patch line 72 which makes links to mysql libs only if u use teh pvr option which causes all sorts of porblems espeically if you use mysql db as you video db. i removed that whole part from xbmc-9999 ebuild and back to normal
Comment 4 SpanKY gentoo-dev 2012-02-01 20:13:57 UTC
so it's only a problem for people who chose to use mysql as their backend db rather than sqlite independent of mythtv.  probably need to tweak the patch like upstream suggested.
Comment 5 vpiotr 2012-02-01 20:28:40 UTC
(In reply to comment #4)
> so it's only a problem for people who chose to use mysql as their backend db
> rather than sqlite independent of mythtv

All of my tests were done with "-pvr". For me it appears that the patch alone causes the problem. Removing it from .ebuild makes thing work again.
Comment 6 Tomasz Golinski 2012-02-01 22:14:26 UTC
I have the same problem as vpiotr. I use sqlite db and with new ebuild I get errors when xbmc tries to open db.
Comment 7 Tiziano Müller (RETIRED) gentoo-dev 2012-02-02 14:04:22 UTC
By default the database type is empty and the fallback is made in Open(...).
The problem is that the patch disables that fallback entirely in the current trunk:

#ifdef BUILD_MYTHTV
  if ( dbSettings.type.Equals("mysql") )
  {
    // check we have all information before we cancel the fallback
    if ( ! (dbSettings.host.IsEmpty() ||
            dbSettings.user.IsEmpty() || dbSettings.pass.IsEmpty()) )
      m_sqlite = false;
    else
      CLog::Log(LOGINFO, "Essential mysql database information is missing. Require at least host, user and pass defined.");
  }
  else
  {
    dbSettings.type = "sqlite3";
    dbSettings.host = _P(g_settings.GetDatabaseFolder());
    dbSettings.name = GetBaseDBName();
  }
#endif /* BUILD_MYTHTV */

which should be something like this instead:

#ifdef BUILD_MYTHTV
  if ( dbSettings.type.Equals("mysql") )
  {
    // check we have all information before we cancel the fallback
    if ( ! (dbSettings.host.IsEmpty() ||
            dbSettings.user.IsEmpty() || dbSettings.pass.IsEmpty()) )
      m_sqlite = false;
    else
      CLog::Log(LOGINFO, "Essential mysql database information is missing. Require at least host, user and pass defined.");
  }
  else
#else /* always fallback to sqlite3 */
  {
    dbSettings.type = "sqlite3";
    dbSettings.host = _P(g_settings.GetDatabaseFolder());
    dbSettings.name = GetBaseDBName();
  }
#endif /* BUILD_MYTHTV */
Comment 8 Ben Kohler gentoo-dev 2012-02-03 04:09:30 UTC
Created attachment 300841 [details, diff]
xbmc-9999-nomythtv-v2.patch

Applying the fix in comment #7 works for me.  Here's a new version of the patch.
Comment 9 SpanKY gentoo-dev 2012-02-04 19:49:54 UTC
i've merged your patch with the existing one, and split the mysql/mythtv logic

http://sources.gentoo.org/media-tv/xbmc/xbmc-9999.ebuild?r1=1.98&r2=1.99
http://sources.gentoo.org/media-tv/xbmc/files/xbmc-9999-nomythtv.patch?r1=1.2&r2=1.3