some questions on how MakeMKV works

Everything related to MakeMKV
Post Reply
jemima
Posts: 52
Joined: Fri Oct 06, 2023 1:16 am

some questions on how MakeMKV works

Post by jemima »

Hey.

I recently bought a LibreFriendly device (Pioneer BDR-XS07TUHD, FW 1.02) from @asmcom in order to play&backup my UHD BluRays on Linux.

I've been used to being able to play normal (non-UHD) BluRays directly under Linux (e.g. with mpv) as long as the key was already present in the well-known KEYDB.cfg, with libaacs doing the magic to decrypt the files on the fly).


Now I tried the same with that Pioneer device and a UHD, for which the key was already present in KEYDB.cfg (checked it via the SHA1 of that one file) but that failed.
At first I thought it might be some Linux/mpv issue, but I guess now it wasn't.

When I had tested this, I had my LibreFriendly device connected to my Linux, mounted the UHD BD and simply tried to play back via mpv bd:// .... As said, that didn't work.

Subsequently I backuped&decrypted the UHD BD on Windows using MakeMKV (the drive attached to the host running the Windows). That did work.
And when I sshfs-mounted the backuped&decrypted BluRay directory tree on my Linux, I could also play it via mpv (with and without KEYDB.cfg being present).

No I tried the following:
Attached the LibreFriendly device to the running Windows, inserted the UHD BD, started the MakeMKV programm (but didn't start any backup or conversion process), sshfs-mounted the Bluray drive to my Linux, started playback and... it worked (but only when the KEYDB.cfg was present - as expected).


So question:
1) I'd now assume, that having the key in KEYDB.cfg alone is not enough and even the LibreFrienly drive would return some garbage data (and not the real encrypted data) when reading the files from the BD.
And MakeMKV somehow patches the drive firmware (while MakeMKV) is running, then the drive gives me the right (but still encrypted) data,... but now my mpv/libaacs can decrypt it, given they have the key in KEYDB.cfg.

Does that sound right?


2) So if I want to backup *everything*... all I need to do is copy all files *as is* .... but while MakeMKV is running to have the firmware "improved". And as long as I have the key, I can later on use any tool that supports libaacs to play/convert/etc.?

This, AFAIU, is what MakeMKV does, when it makes a backup and the ckeckbox for decrypt is disabled - simply copying all files, right?


3) Alternatively I could also make a backup were the files are already decrypted (this, AFAIU, is what MakeMKV's backup does when the checkbox for decrypt is enabled, right)?

Would that also give me *everything* on the BD (i.e. no quality loss or re-encoding)... just with the difference that the files are already all decrypted?
Or would that cause already some further modifications (like to meta-data, menus, etc.)?

Just out of curiosity, when I have copied the raw/encrypted files, while MakeMKV was running and the device was in LibreMode... are there any OpenSource tools to decrypt the (copied but still encrypted) Bluray structure?


4) Actually making an MKV file (with MakeMKV).
AFAIU, this is not really needed for the purpose of archiving, is it?
As soon as I have copied all files (while the drive was actually in LibreFriendly mode, because MakeMKV was running) and either I have decrypted the files with MakeMKV or have the key in KEYDB.cfg (and the files not decrypted) ... I'm fine - even if MakeMKV would cease to exist or all my LibreDrives became unusable.
Right?


Last but not least...

5) If it's indeed as I presume, that the drive gives garbage data (and not even the encrypted data) when it's not truly in LibreFriendly mode (because MakeMKV is not running)... why does this seem to only happen with UHD? I could just perfectly fine play back non UHD-BDs, without MakeMKV running.
I mean the kernel did not even show any drive errors, but apparently the drive just returned bogus data without even telling (how cheeky).

Did that change from non-UHD to UHD BluRay?



Thanks,
Jemima
Billycar11
Posts: 3882
Joined: Sun Aug 24, 2014 5:49 am

Re: some questions on how MakeMKV works

Post by Billycar11 »

jemima wrote:
Sat Oct 21, 2023 10:17 pm
Hey.

I recently bought a LibreFriendly device (Pioneer BDR-XS07TUHD, FW 1.02) from @asmcom in order to play&backup my UHD BluRays on Linux.

I've been used to being able to play normal (non-UHD) BluRays directly under Linux (e.g. with mpv) as long as the key was already present in the well-known KEYDB.cfg, with libaacs doing the magic to decrypt the files on the fly).


Now I tried the same with that Pioneer device and a UHD, for which the key was already present in KEYDB.cfg (checked it via the SHA1 of that one file) but that failed.
At first I thought it might be some Linux/mpv issue, but I guess now it wasn't.

When I had tested this, I had my LibreFriendly device connected to my Linux, mounted the UHD BD and simply tried to play back via mpv bd:// .... As said, that didn't work.

Subsequently I backuped&decrypted the UHD BD on Windows using MakeMKV (the drive attached to the host running the Windows). That did work.
And when I sshfs-mounted the backuped&decrypted BluRay directory tree on my Linux, I could also play it via mpv (with and without KEYDB.cfg being present).

No I tried the following:
Attached the LibreFriendly device to the running Windows, inserted the UHD BD, started the MakeMKV programm (but didn't start any backup or conversion process), sshfs-mounted the Bluray drive to my Linux, started playback and... it worked (but only when the KEYDB.cfg was present - as expected).


So question:
1) I'd now assume, that having the key in KEYDB.cfg alone is not enough and even the LibreFrienly drive would return some garbage data (and not the real encrypted data) when reading the files from the BD.
And MakeMKV somehow patches the drive firmware (while MakeMKV) is running, then the drive gives me the right (but still encrypted) data,... but now my mpv/libaacs can decrypt it, given they have the key in KEYDB.cfg.

Does that sound right?


2) So if I want to backup *everything*... all I need to do is copy all files *as is* .... but while MakeMKV is running to have the firmware "improved". And as long as I have the key, I can later on use any tool that supports libaacs to play/convert/etc.?

This, AFAIU, is what MakeMKV does, when it makes a backup and the ckeckbox for decrypt is disabled - simply copying all files, right?


3) Alternatively I could also make a backup were the files are already decrypted (this, AFAIU, is what MakeMKV's backup does when the checkbox for decrypt is enabled, right)?

Would that also give me *everything* on the BD (i.e. no quality loss or re-encoding)... just with the difference that the files are already all decrypted?
Or would that cause already some further modifications (like to meta-data, menus, etc.)?

Just out of curiosity, when I have copied the raw/encrypted files, while MakeMKV was running and the device was in LibreMode... are there any OpenSource tools to decrypt the (copied but still encrypted) Bluray structure?


4) Actually making an MKV file (with MakeMKV).
AFAIU, this is not really needed for the purpose of archiving, is it?
As soon as I have copied all files (while the drive was actually in LibreFriendly mode, because MakeMKV was running) and either I have decrypted the files with MakeMKV or have the key in KEYDB.cfg (and the files not decrypted) ... I'm fine - even if MakeMKV would cease to exist or all my LibreDrives became unusable.
Right?


Last but not least...

5) If it's indeed as I presume, that the drive gives garbage data (and not even the encrypted data) when it's not truly in LibreFriendly mode (because MakeMKV is not running)... why does this seem to only happen with UHD? I could just perfectly fine play back non UHD-BDs, without MakeMKV running.
I mean the kernel did not even show any drive errors, but apparently the drive just returned bogus data without even telling (how cheeky).

Did that change from non-UHD to UHD BluRay?



Thanks,
Jemima
1. yes makemkv edit the microcode live in the drives ram to remove buss encryption so its persistent until it has a reset like ejecting the disc the drive sleeping or rebooting.

2.most likely yes because the buss encryption should be removed

3. yes doing a backup with makemkv would be the easiest way to keep everything or other software that uses makemkv as a plugin and make full iso's

4. no you dont need to make an mkv decrypted backups are fine.

5. because then the drive is in aacs 2.x mode the bluray aacs 1.x is much easier to work around.
Buy a UHD drive from the guide and how to video maker: https://www.makemkv.com/forum/viewtopic ... 20&t=17831
UHD Drives Guide: https://www.makemkv.com/forum/viewtopic ... 16&t=19634
Auto flash kit $25 Email me for one Billycar5924@gmail.com
jemima
Posts: 52
Joined: Fri Oct 06, 2023 1:16 am

Re: some questions on how MakeMKV works

Post by jemima »

Thanks.

btw: I just checked it at least on one example, there the files created by MakeMKV's Backup function with decryption disabled, ... were bitwise identical to all files copied from the Bluray with cp -a (while MakeMKV was running, and thus the device in Libre mode).

However, there was one additional file in the MakeMKV created copy, namely in the root a file named discatt.dat ... anyone any idea what that is for?

So it seems the backup without decrypt is indeed merely a copy (apart from that one additional file).
MrPenguin
Posts: 118
Joined: Thu Oct 19, 2023 11:31 pm

Re: some questions on how MakeMKV works

Post by MrPenguin »

Have you tried playing UHD discs on Linux using vlc instead of mpv? AFAIK vlc can use /usr/lib64/libmmbd.so.0 (assuming it's present), which is a "launcher" for the makemvkcon binary, and so should be able to switch your drive into LibreDrive mode for you.

Unfortunately I cannot test this theory myself since I don't have any UHD discs. (Any my drive's firmware is too new anyway.)
dcoke22
Posts: 2668
Joined: Wed Jul 22, 2020 11:25 pm

Re: some questions on how MakeMKV works

Post by dcoke22 »

jemima wrote:
Sun Oct 22, 2023 3:22 am
Thanks.

btw: I just checked it at least on one example, there the files created by MakeMKV's Backup function with decryption disabled, ... were bitwise identical to all files copied from the Bluray with cp -a (while MakeMKV was running, and thus the device in Libre mode).

However, there was one additional file in the MakeMKV created copy, namely in the root a file named discatt.dat ... anyone any idea what that is for?

So it seems the backup without decrypt is indeed merely a copy (apart from that one additional file).
See this post and this post from the program's author for more details about discatt.dat.
jemima
Posts: 52
Joined: Fri Oct 06, 2023 1:16 am

Re: some questions on how MakeMKV works

Post by jemima »

@MrPenguin ... no, haven't tried that yet. But in principle it's even enough for me properly read the still encrypted BluRay structure (as long as the key is known in KEYDB.cfg)... once I have that, I can just play it in Linux, from the copy.

@dcoke22 Ah, thanks for the pointer.
MrPenguin
Posts: 118
Joined: Thu Oct 19, 2023 11:31 pm

Re: some questions on how MakeMKV works

Post by MrPenguin »

@MrPenguin ... no, haven't tried that yet.
Sure, no worries. I have only recently begun experimenting with BluRay on Linux myself, and am finding the "getting it all working on Linux" aspect to be at least as interesting as actually watching the BluRays themselves :wink:.

You appear also to have access to a Windows box. However, I have discovered that

Code: Select all

findvuk synchronize
works just as well from within wineconsole, which is the only way I have found to add new entries to the online VUK database using Linux.
Post Reply