Kodi Community Forum

Full Version: BluRay disc stuttering
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
1) debug log (cut out from when an actual stutter occurs)
http://xbmclogs.com/pr8xif609

3&4) Software running
OpenElec 6 beta 1 using kodi 15.0-rc2 0aa930b compiled from source

5) Hardware
http://www.asrock.com/nettop/Intel/ION%203D%20Series/
(Atom D525 x86_64 build with Nvidia GT218-ION, using nvidia-legacy 340.xxx)

9) detailed instructions

I'm guessing direct playback of encrypted bluray discs is not officially supported, regardless i'm not sure if this necessarily is due to encryption or not. But i'm using makemkv 1.9.5 using its libmmbd.so instead of supplied libaacs and libbdplus.

I use "play disc" menu from kodi, and playback works fine most of the time, but in certain places (same places every time) the video stutters and skips frames and then starts playback again, and it looks like some kind of data starvation. If i rip the disc offline using makemkv (on the same computer) and playback from the raw rip, it does not show these issues.

So I started thinking that perhaps the reading speed of the bluray was problematic (disc is fairly new and without visible dirt or scratches), and means of increasing read buffer from optical drive. But i found that buffering of optical drives is disabled (why?). So I did a quick test to patch DVDInputStreamFile.cpp ->

diff -Naur kodi-15.0-rc2-0aa930b.orig/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFile.cpp kodi-15.0-rc2-0aa930b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFile.cpp
--- kodi-15.0-rc2-0aa930b.orig/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFile.cpp 2015-08-07 13:35:36.704782849 +0200
+++ kodi-15.0-rc2-0aa930b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFile.cpp 2015-08-07 13:51:54.674658399 +0200
@@ -61,8 +61,6 @@
* 2) Only buffer true internet filesystems (streams) (http, etc.)
* 3) No buffer
*/
- if (!URIUtils::IsOnDVD(strFile) && !URIUtils::IsBluray(strFile)) // Never cache these
- {
if (g_advancedSettings.m_networkBufferMode == 0 || g_advancedSettings.m_networkBufferMode == 2)
{
if (URIUtils::IsInternetStream(CURL(strFile), (g_advancedSettings.m_networkBufferMode == 0) ) )
@@ -72,7 +70,6 @@
{
flags |= READ_CACHED; // In buffer mode 1 force cache for (almost) all files
}
- }

if (!(flags & READ_CACHED))
flags |= READ_NO_CACHE; // Make sure CFile honors our no-cache hint
******

In an effort to see if i could enable caching (also setting network buffermode = 1 in advancedsettings.xml), but the issue is the same.

I could not see any cpu spikes or low memory during playback.
So any hints on where to look would be greatly appreciated.

Thanks!
Andreas
No one got any hints, or means of buffering optical discs just to make sure that THAT is not the issue.

No one experienced the same issue?

As the ripped version plays without these hickups i'm assuming the system specs shouldn't be an issue. I want to try and nail down where the issue occurs. How would a typical dataflow be for an encrypted BD?
I'll add some more debug log messages soon. But nevertheless we need a full debug log, never cut out parts. Does the same stuttering happen when you play the m2ts file directly? You should navigate via the file manager to the streams folder.
I'll see if i can grab some logs later tonight for both "play disc" and direct playout from m2ts and upload and give approximate timings when issue occurs
Here are the complete logs from boot up until the problem shows. after scanning library is finished, i insert the disc, and open it up. Once it starts playing i jump to 2:24:22 and shortly (1min?) after the actual video disturbance comes. But before that subtitles seems to be out of sync as well, just flashes by for a split second.

There are a few interesting outputs from ffmpeg, like there's a discontinuity in the stream, but i still don't think it comes from the actual content, but some buffers overflow or starve and gets thrown away leading to the visual symptoms.

http://pastebin.com/xeU5Zqcm
it also seems to be a new chapter change close to the time of the error.. how is the player designed to work around chapter changes, restart the streamer and start anew, or assume the stream is continuous and keep on playing (haven't read up on bluray structure, but i'm guess a whole movie is within one separate file with just special access points acting as chapters).
Chapters aren't a problem per se, I guess it's the clip/m2ts change happening right before the error ( seamless branching?). Maybe I find a disc with that behaviour in my collection.
Hmm that is interesting, i didn't even there was such a thing as seamless branching (thought there were several version of the film, wasting space). Either way i'm guessing that the streamer is aware of this and the positions it jumps to starts with an iframe, and the clocks are set accordingly.

One thing that makes me a bit curious is that a short time before the video disturbance and dropped frames, some subtitles are just flashing/blinking , just like if the playback clock is drifted away from the pts of the subtitles. I can't see log traces around playback clocks (i'm not so familiar with kodi code), but if the playback clock drifts from the stream, it would trigger a resync? Or will the playback clock adjust itself slightly in an effort to follow the pcr's ? Or is this sync behavior configurable (syncing audio to video or vice versa?)

Unfortunately i don't have a bluray collection, so this disc (Avatar extended) is borrowed to see whether i can have a fully functional setup (so that i can start a collection)
I had a thought, and just tried to copy the whole disc (not rip it with makemkv) and see if playing those file would make a difference, but it didn't play unfortunately.

My thoughts was that since disc playback with libmmbd had problems, while a ripped copy on the hard drive didn't, i wanted to see if a hard drive playback using libmmdb would work (as it could give thoughts about if it was the storage type or the fact that it had to be decrypted that causes the issues. I can't see why it would be different to playback from the folder when its on the harddrive as opposed to doing it while it's on the disc. Any ideas on that?
You need a special software to copy a bd disc to the hd. I have not found the time to dig deeper, sorry.
Maybe libmmdb is only used if you play from disc?! Maybe it's possible to mount an ISO to a virtual drive. Never tired such a task
(2015-08-29, 23:43)David1977 Wrote: [ -> ]Maybe libmmdb is only used if you play from disc?! Maybe it's possible to mount an ISO to a virtual drive. Never tired such a task

I was thinking about that as well, i never looked at the logs when trying to playback from the plain "file copy" but i'll see if i can just create an iso and loopback mount it and see if it makes any difference. Just trying to look at this from all possible perspectives
I had a try in just mountint the iso as a loopback but i didn't get kodi to recognise it as a disc (and it failed playback if just opened the iso). The normal optical discs seems to be mounted in arbitrary location (folder name based on the ID of the disc), so for the iso i just loopback mounted it to the same folder, but without being recognized by kodi, so there might be something else needed.

Ace: Where you able to find a similar disc and see if you got the same issue?