Use libmmbd (MakeMKV) to play Blu rays on Windows
#31
Hello, any news to get the libmmbd working with kodi 18 again?
I have the same problem on linux. Linked the libaacs.so and libbdplus.so to libmmbd.so
This was working great in kodi 17. Now in kodi 18 when try to run the disk kodi hangs up.
Reply
#32
Hello,

i am facing the same problem. The last version which is working for me is KodiSetup-20170706-391fab1632-master-x86.exe. The version from 20170707 did not work .

I got it working when reverting the changes from https://github.com/xbmc/xbmc/pull/12339. Unfortunately i had to revert the following commits in this order:

1) Revert "Merge pull request #13107 from ace20022/cache_disc_label" (ID 4d1b640190257c63a1cf1b9d57c8bde6c15718e6)
2) Revert "Merge pull request #12537 from ace20022/bd_PlInfo" (ID 12dc781fb16612b66e8eea1269433d8971e3b30f)
3) Revert "Merge pull request #12540 from notspiff/fix_no_bluray" (ID 7c048f0624c47083105c9d35e93f3c025cf64a13)
4) Revert "Merge pull request #12488 from ace20022/disc_names" (ID 1b5b91609979be09c3b6b68a2fbbf8472847b47b)
5) Revert "Merge pull request #12562 from wsnipex/cmake_fixes" (ID 3370802e644138f7a208d095df954ec36757134e)
6) Revert "Merge pull request #12339 from ace20022/bd_files" (ID 45acc104aab57e7d7161f88640269f1178909d2e)

I do not really understand the code from #12339 but perhaps it helps to find the bug. After reverting these commits and compiling Kodi, bluray with libmmbd is working normally.

With regards

Joniw
Reply
#33
(2017-12-06, 03:14)joniw Wrote: I do not really understand the code from #12339 but perhaps it helps to find the bug. After reverting these commits and compiling Kodi, bluray with libmmbd is working normally.

Try to revert (or comment) only these two lines https://github.com/xbmc/xbmc/blob/master...#L575-L576
Reply
#34
(2017-12-06, 23:12)afedchin Wrote: Try to revert (or comment) only these two lines https://github.com/xbmc/xbmc/blob/master...#L575-L576

This did not help. I debugged this time and the exception occurs in https://github.com/xbmc/xbmc/blob/master...y.cpp#L279 when calling "!m_dll->bd_open_files".

I would like to go on with debugging but i can get only in the header file https://github.com/xbmc/xbmc/blob/master...ibbluray.h.

Any ideas how i can help here?
Reply
#35
(2017-12-07, 02:33)joniw Wrote: I would like to go on with debugging but i can get only in the header file https://github.com/xbmc/xbmc/blob/master...ibbluray.h.
Build libbluray in Debug via tools https://github.com/xbmc/kodi-deps/ copy dll and lib to project/BuildDependencies/(win32|x64) and you will be able to debugging into libbluray
Reply
#36
@afedchin

Not sure if this is relevant to this thread, but just bringing it to your attention... https://forum.kodi.tv/showthread.php?tid...pid2676777
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#37
Hello,

@afedchin: Thank you for the hint!

After some problems debugging worked and i think i found the Problem.

Kodi is using libblurays "bd_open_files" since "Merge pull request #12339 from ace20022/bd_files" (ID 45acc104aab57e7d7161f88640269f1178909d2e).

When playing a bluray disc the variable "root" contains the path to the drive (e.g. "E:") and is casted to a pointer to the string. This is then used here in the struct "fs" and given to _bd_open. In this function the device_path is NULL and later on in disc_open, when initializing the decryption, the path in the struct "dev" is also NULL. This continous here to libaacs_open and there the function "aacs_open_device" of libaacs in libmmbd is called.

The source code for libmmbd shows it does some small checks and calls mmbd_open in mmbd.cpp:

cpp:
MMBD_PUBLIC int __cdecl mmbd_open(MMBD *mmbd,const char *locator)
{
    if (mmbd==NULL) return -1;

    const char* prefix = NULL;
    size_t len = strlen(locator);

    if ((len>5) && (memcmp(locator,"/dev/",5)==0) ) {
        prefix="dev:";
    }
    return ((CMMBDConn*)mmbd)->open(prefix,locator);
}

Line 6 leads to the exception as "locator" is NULL. This is also seen here. The original libaacs checks the variable and is able to handle a NULL value for the path.

I tried to find some documentation for libbluray and libaacs if this is defined behaviour or not but could not find an answer. Does anybody have an idea how this could be fixed? Are we able to fix this in kodi or is a fix needed in libmmbd?

With regards

Joniw
Reply
#38
there are two options:
1) https://forum.kodi.tv/showthread.php?tid...pid2671707
2) fix this in libmmdb and compile your own fixed version.
Reply
#39
I will try to find a solution in libmmbd. The problem is posted here: http://www.makemkv.com/forum2/viewtopic....10&t=15571
Reply
#40
(2017-12-10, 15:54)joniw Wrote: I will try to find a solution in libmmbd. The problem is posted here: http://www.makemkv.com/forum2/viewtopic....10&t=15571

Whatever happened to the Blu-ray player plugin coupled with makemkv. I remember using it in Eden in like 2010-11. If i remember correctly it was fairly easy to play back a Blu-ray. Does anyone remember this, is it still possible? Just getting back into Kodi after a very long absence. In 2011 that was the only way I believe, 7 years later what are my options?
Reply
#41
Hello, any News about this issue? Tried it again with latest nightly build and kodi still crashes when I click on "index.bdmv" with linked lubbdplus/libaacs.so to makemkv.
Kodi 17.6 still working. Kodi 18 crashing.
Reply
#42
There is nothing to fix in Kodi
Reply
#43
ok. So the fix has to be implemented in makemkv?
I already reported the Problem in the makemkv Forum but no one is looking at this issue.
Reply
#44
I already reported the Problem to the makemkv Forum.
See here:
http://makemkv.com/forum2/viewtopic.php?...339#p60339

here´s the answer of an makemkv specialist:

Hi,

Kodi 18 used to crash for me also on Ubuntu 17.10. However, I've implemented a fix that, after preliminary testing, seems to work. The solution points to a Kodi coding problem, not a Makemkv or libbluray problem.

In the Kodi source file ~/xbmc/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp (around line 400) I've replaced (!m_dll->bd_open_files(m_bd, &m_rootPath, DllLibbluray::dir_open, DllLibbluray::file_open)) with (!m_dll->bd_open_disc( m_bd,root.c_str(), NULL)).
And in ~/xbmc/xbmc/filesystem/BlurayDirectory.cpp (around line 280), I've made the same substitution. After a recompile, blurays play without Kodi crashing! This solution works on both macOS and Ubuntu 17.10.

Here's the thinking (and testing) behind this. Because Kodi crashed with libmmbd installed, but did not crash when only the default libaacs was in place, it sure looked like the fault was in libmmbd. On the other hand, for macOS, crash logs seemed to indicate there might be a problem with libbluray.

So I compiled test_libbluray.c that comes with the libbluray distribution and ran the program to see if any errors showed up. But that program ran without error. So I dug into what bd_open_files() in libbluray (the function called in Kodi) is all about. The documentation is sparse, but by following the code, it looks like bd_open_files() is meant to be used by a developer writing code that uses libbluray to dynamically install custom dir_open() and file_open() into libbluray. Why a developer would want to do that is beyond me. If bd_open_files() is not called, then default dir_open() and file_open() are used and libbluray seems to work well that way.

For those of you who can install Kodi from source, does this solution work for you?

dgktkr
Reply
#45
The "fix" above fixes the crash but breaks BD-J menus. @Ace will correct me if I'm wrong
Reply

Logout Mark Read Team Forum Stats Members Help
Use libmmbd (MakeMKV) to play Blu rays on Windows3