makemkv on OSMC (Raspberry Pi 4)
Posted: Sat Jul 02, 2022 11:32 am
Hi there,
I would like to share my insights on how to make makemkvcon work on the Open Source Media Center (OSMC). This also enables Kodi to play back Blu-Rays with an external USB drive.
OSMC is a Debian-based Linux distribution with Kodi as its main application. I use it on a Raspberry Pi 4B, but it is also available on the Vero 4K (among others). Regarding OSMC, the challenge is that it uses a 64-bit kernel but userland including Kodi is 32-bit. Basically, both 32-bit armhf and 64-bit arm64 executables work on OSMC.
Prerequisites:
For basic instructions on how to compile and use makemkv on Linux, see viewtopic.php?t=224.
Generally speaking, makemkv binaries for various architectures are contained in the makemkv-bin packages. An armhf version available in the post viewtopic.php?f=3&t=28533
Initial situation:
When executing the armhf binary of makemkvcon out of the box, the following error message appears:
This obviously comes from the attempt to use the 64 bit kernel module sg from a 32 bit executable. sg stands for SCSI generic and is the SCSI kernel interface makemkv uses for accessing Blu-Ray / DVD devices in a low-level generic way.
Approach:
Step 1.: As a basic strategy, we need to make the arm64 binary of makemkvcon work so that it can make use of the 64-bit kernel module sg. It also requires the libraries libdriveio.so.0 and libmakemkv.so.1 in an arm64 version. Step 2.: In the next step, we need an 32-bit armhf version of libmmbd.so.0 so that Kodi can dynamically integrate it when playing Blu-Rays.
Step 1:
To be able to execute the arm64 binary of makemkvcon on OSMC we need to install some basic arm64 libraries which are not available in the standard image of OSMC.
After that, executing the arm64 binary of makemkvcon might yield something like:
This is the case when you compiled makemkv-oss in an armhf version. So we need arm64 versions of the libraries libdriveio.so.0 and libmakemkv.so.1. While it is possible to cross-compile makemkv-oss for arm64, I did this on a separate installation of 64-bit Raspberry OS to not screw up my OSMC installation. Then you need to copy the compiled libdriveio.so.0 and libmakemkv.so.1 files to /usr/lib/aarch64-linux-gnu on OSMC. Then executing should work.
Troubleshooting:
You might encounter the following message.
This error comes from different Debian versions: Debian bullseye uses glibc 2.29 whereas Debian buster uses glibc 2.28. So in the above case, you have two options: Either upgrade to the new (experimental) bullseye port of OSMC (see https://discourse.osmc.tv/t/testing-deb ... seye/93054). Or you need to compile libdriveio.so.0 and libmakemkv.so.1 on Debian buster, i.e. with glibc 2.28.
Step 2:
To enable Kodi to play back Blu-Rays, copy the 32-bit file libmmbd.so.0 to /usr/lib/arm-linux-gnueabihf on OSMC.
Then symlink this file to libaacs.so.0 and libbdplus.so.0:
I hope this helps others who try to make blu-ray playback work in OSMC.
I would like to share my insights on how to make makemkvcon work on the Open Source Media Center (OSMC). This also enables Kodi to play back Blu-Rays with an external USB drive.
OSMC is a Debian-based Linux distribution with Kodi as its main application. I use it on a Raspberry Pi 4B, but it is also available on the Vero 4K (among others). Regarding OSMC, the challenge is that it uses a 64-bit kernel but userland including Kodi is 32-bit. Basically, both 32-bit armhf and 64-bit arm64 executables work on OSMC.
Prerequisites:
For basic instructions on how to compile and use makemkv on Linux, see viewtopic.php?t=224.
Generally speaking, makemkv binaries for various architectures are contained in the makemkv-bin packages. An armhf version available in the post viewtopic.php?f=3&t=28533
Initial situation:
When executing the armhf binary of makemkvcon out of the box, the following error message appears:
Code: Select all
osmc@osmc:~$ makemkvcon info disc:0
...
Bus access error
Approach:
Step 1.: As a basic strategy, we need to make the arm64 binary of makemkvcon work so that it can make use of the 64-bit kernel module sg. It also requires the libraries libdriveio.so.0 and libmakemkv.so.1 in an arm64 version. Step 2.: In the next step, we need an 32-bit armhf version of libmmbd.so.0 so that Kodi can dynamically integrate it when playing Blu-Rays.
Step 1:
To be able to execute the arm64 binary of makemkvcon on OSMC we need to install some basic arm64 libraries which are not available in the standard image of OSMC.
Code: Select all
sudo apt install libc6:arm64 libstdc++6:arm64 libssl1.1:arm64 zlib1g:arm64 libexpat1:arm64 libavcodec58:arm64
Code: Select all
osmc@osmc:~$ makemkvcon info disc:0
...
makemkvcon: error while loading shared libraries: libmakemkv.so.1: wrong ELF class: ELFCLASS32
Code: Select all
makemkvcon info disc:0
Troubleshooting:
You might encounter the following message.
Code: Select all
osmc@osmc:~$ makemkvcon info disc:0
...
makemkvcon: /lib/aarch64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /lib/libmakemkv.so.1)
Step 2:
To enable Kodi to play back Blu-Rays, copy the 32-bit file libmmbd.so.0 to /usr/lib/arm-linux-gnueabihf on OSMC.
Then symlink this file to libaacs.so.0 and libbdplus.so.0:
Code: Select all
sudo ln -s /usr/lib/arm-linux-gnueabihf/libmmbd.so.0 /usr/lib/arm-linux-gnueabihf/libaacs.so.0
sudo ln -s /usr/lib/arm-linux-gnueabihf/libmmbd.so.0 /usr/lib/arm-linux-gnueabihf/libbdplus.so.0