Kodi Community Forum

Full Version: Playback interrupts randomly when using Samba (SMB)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Lately, I've been experiencing an issue with some files. On XBMC 13.2: playback stops repeatedly while watching an episode of a show (accessed through samba), takes me back to the xbmc user interface and gives me a "connection timeout" dialog box. These episodes are around ~500mb each so I don't think it's because of caching. I also watch other HD shows and movies with sizes ranging between ~1.5GB and ~12GB respectively and the issue doesn't happen at all.

Code:
mediainfo 'TroubledTvShow S03E23 (BD 1920x1080 x264 FLAC Eng.subs).mkv'
General
Unique ID                                : 173096219274832500578912549514400193351 (0x82391E83A3C124C995D55D79DE0F5B47)
Complete name                            : TroubledTvShow S03E23 (BD 1920x1080 x264 FLAC Eng.subs).mkv
Format                                   : Matroska
Format version                           : Version 4 / Version 2
File size                                : 482 MiB
Duration                                 : 24mn 32s
Overall bit rate mode                    : Variable
Overall bit rate                         : 2 747 Kbps
Movie name                               : TroubledTvShow III 23
Encoded date                             : UTC 2014-06-13 18:08:31
Writing application                      : mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun  9 2014 15:16:27
Writing library                          : libebml v1.3.0 + libmatroska v1.4.1
Attachements                             : Sketched.ttf / steelfish rg.ttf / StoneHinge.ttf / TheGreatEscape.ttf / TheGreatEscapeBold.ttf / TRACE_.TTF / tt0102m.ttf / tt0102m_.ttf / where stars shine the brightest.ttf / [z] Arista.ttf / akarinop.ttf / ANA-ONEIROPARMENI82.TTF / A-OTF-TakaHandStd-Heavy-haganai.ttf / arnopro-smbdcaption.otf / ArnoPro-SmbdSmText.otf / ArnoPro-SmbdSubhead.otf / AurulentSans-Bold.otf / AurulentSans-Regular.otf / AVGARDNECLIPSE.TTF / Barmeno-Medium.otf / BenguiatITCbyBT-MediumCondensed.otf / Big_Bimbo_NC_Regular.ttf / BlissProOT-Regular.otf / Candara.ttf / Candarab.ttf / CartoGothicStd-Book.otf / CENTURYO.TTF / Cicle Semi.ttf / Clannad_Round_Regular.ttf / Comfortaa-Bold.ttf / coolvetica rg.ttf / corbelb.ttf / COUTURE-Bold.ttf / CronosPro-Disp.otf / Danger Diabolik.ttf / DejaVuSans.ttf / Elegance.TTF / ERASBD.TTF / ERASDEMI.TTF / estre.ttf / HannaHandwriting.ttf / HighlanderStd-Medium.otf / Jennifers Hand Writing.ttf / kalingab.ttf / KGTurningTables.ttf / LBRITED.TTF / LightWrite_Normal.ttf / Linotype_Ordinar_Regular.ttf / LT_CorinthianMedium.ttf / mentone-semibol.otf / mentone-semibold.otf / MorningStress-Regular.ttf / ODENB_.TTF / posthuman.ttf / PTS75F.ttf / PTS76F.ttf / RolandBecker Bold.ttf / Schoolbell.ttf / shimano-squareblack.ttf / Sketchbook Nasty.otf
DURATION                                 : 00:24:29.610000000
NUMBER_OF_FRAMES                         : 1821
NUMBER_OF_BYTES                          : 283752
_STATISTICS_WRITING_APP                  : mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun  9 2014 15:16:27
_STATISTICS_WRITING_DATE_UTC             : 2014-06-13 18:08:31
_STATISTICS_TAGS                         : BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High [email protected]
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 24mn 32s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 10 bits
Scan type                                : Progressive
Writing library                          : x264 core 133 r2334 a3ac64b
Encoding settings                        : cabac=1 / ref=4 / deblock=1:-2:-2 / analyse=0x3:0x133 / me=umh / subme=4 / psy=1 / psy_rd=0.60:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=12 / lookahead_threads=6 / sliced_threads=0 / nr=0 / decimate=0 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc=crf / mbtree=0 / crf=18.4 / qcomp=0.60 / qpmin=10 / qpmax=38 / qpstep=4 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00
Language                                 : Japanese
Default                                  : No
Forced                                   : No
DURATION                                 : 00:24:32.013000000
NUMBER_OF_FRAMES                         : 35293
NUMBER_OF_BYTES                          : 377159321
_STATISTICS_WRITING_APP                  : mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun  9 2014 15:16:27
_STATISTICS_WRITING_DATE_UTC             : 2014-06-13 18:08:31
_STATISTICS_TAGS                         : BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

Audio
ID                                       : 2
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
Codec ID                                 : A_FLAC
Duration                                 : 24mn 32s
Bit rate mode                            : Variable
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 KHz
Bit depth                                : 16 bits
Writing library                          : libFLAC 1.2.1 (UTC 2007-09-17)
Language                                 : Japanese
Default                                  : Yes
Forced                                   : No

Text
ID                                       : 3
Format                                   : ASS
Codec ID                                 : S_TEXT/ASS
Codec ID/Info                            : Advanced Sub Station Alpha
Compression mode                         : Lossless
Default                                  : Yes
Forced                                   : No

Menu
00:00:00.033                             : en:Intro
00:01:12.850                             : en:OP
00:02:43.990                             : en:Part A
00:11:25.860                             : en:Part B
00:22:55.400                             : en:ED
00:24:14.830                             : en:Preview

XBMC 13.2 log: http://xbmclogs.com/p0q4kn58h

During playback this happened around 16:28 with lines like this in the log:
Code:
16:27:46 T:1839186680 WARNING: CDVDMessageQueue(audio)::Get - asked for new data packet, with nothing available
16:27:48 T:1811759040   ERROR: virtual unsigned int XFILE::CSmbFile::Read(void*, int64_t) - Error( -1, 110, Connection timed out )
16:27:48 T:1839186680   ERROR: Previous line repeats 2 times.
16:27:48 T:1839186680   DEBUG: CDVDPlayerAudio - CDVDMsg::GENERAL_EOF
16:27:48 T:1811759040  NOTICE: CDVDPlayer::OnExit()

The issue is a little different on Kodi 16.1: playback stops but it just buffers for a couple of seconds and then resumes playing. Buffering is unheard of on my setup even while playing the previously mentioned ~12GB (and bigger) mkvs. Below are the mediainfo of the file in question and the logs.

Code:
mediainfo 'TroubledTvShow S3E22 (BD 1920x1080 x264 FLAC Eng.subs).mkv'
General
Unique ID                                : 217491343596691929372075187411577594723 (0xA39F4F22FFACA4B3B9B01F790199E363)
Complete name                            : TroubledTvShow S3E22 (BD 1920x1080 x264 FLAC Eng.subs).mkv
Format                                   : Matroska
Format version                           : Version 4 / Version 2
File size                                : 519 MiB
Duration                                 : 24mn 40s
Overall bit rate mode                    : Variable
Overall bit rate                         : 2 941 Kbps
Movie name                               : TroubledTvShow III 22
Encoded date                             : UTC 2014-06-13 18:02:54
Writing application                      : mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun  9 2014 15:16:27
Writing library                          : libebml v1.3.0 + libmatroska v1.4.1
Attachements                             : AVGARDNECLIPSE.TTF / Barmeno-Medium.otf / BenguiatITCbyBT-MediumCondensed.otf / Big_Bimbo_NC_Regular.ttf / BlissProOT-Regular.otf / Candara.ttf / Candarab.ttf / CartoGothicStd-Book.otf / CENTURYO.TTF / Cicle Semi.ttf / Clannad_Round_Regular.ttf / Comfortaa-Bold.ttf / coolvetica rg.ttf / corbelb.ttf / COUTURE-Bold.ttf / CronosPro-Disp.otf / Danger Diabolik.ttf / DejaVuSans.ttf / HannaHandwriting.ttf / Jennifers Hand Writing.ttf / kalingab.ttf / LBRITED.TTF / Linotype_Ordinar_Regular.ttf / LT_CorinthianMedium.ttf / mentone-semibol.otf / mentone-semibold.otf / MorningStress-Regular.ttf / ODENB_.TTF / posthuman.ttf / PTS75F.ttf / PTS76F.ttf / RolandBecker Bold.ttf / Schoolbell.ttf / shimano-squareblack.ttf / Sketchbook Nasty.otf / Sketched.ttf / steelfish rg.ttf / StoneHinge.ttf / TheGreatEscape.ttf / TheGreatEscapeBold.ttf / TRACE_.TTF / tt0102m.ttf / tt0102m_.ttf / ANA-ONEIROPARMENI82.TTF / A-OTF-TakaHandStd-Heavy-haganai.ttf / arnopro-smbdcaption.otf / ArnoPro-SmbdSmText.otf
DURATION                                 : 00:24:40.480000000
NUMBER_OF_FRAMES                         : 17350
NUMBER_OF_BYTES                          : 119388674
_STATISTICS_WRITING_APP                  : mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun  9 2014 15:16:27
_STATISTICS_WRITING_DATE_UTC             : 2014-06-13 18:02:54
_STATISTICS_TAGS                         : BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

Video
ID                                       : 2
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High [email protected]
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 24mn 40s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 10 bits
Scan type                                : Progressive
Writing library                          : x264 core 133 r2334 a3ac64b
Encoding settings                        : cabac=1 / ref=4 / deblock=1:-2:-2 / analyse=0x3:0x133 / me=umh / subme=4 / psy=1 / psy_rd=0.60:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=12 / lookahead_threads=6 / sliced_threads=0 / nr=0 / decimate=0 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc=crf / mbtree=0 / crf=18.4 / qcomp=0.60 / qpmin=10 / qpmax=38 / qpstep=4 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00
Language                                 : Japanese
Default                                  : No
Forced                                   : No

Audio
ID                                       : 3
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
Codec ID                                 : A_FLAC
Duration                                 : 24mn 40s
Bit rate mode                            : Variable
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 KHz
Bit depth                                : 16 bits
Writing library                          : libFLAC 1.2.1 (UTC 2007-09-17)
Language                                 : Japanese
Default                                  : Yes
Forced                                   : No

Text
ID                                       : 1
Format                                   : ASS
Codec ID                                 : S_TEXT/ASS
Codec ID/Info                            : Advanced Sub Station Alpha
Compression mode                         : Lossless
Default                                  : Yes
Forced                                   : No
DURATION                                 : 00:24:40.479000000
NUMBER_OF_FRAMES                         : 35496
NUMBER_OF_BYTES                          : 417973805
_STATISTICS_WRITING_APP                  : mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun  9 2014 15:16:27
_STATISTICS_WRITING_DATE_UTC             : 2014-06-13 18:02:54
_STATISTICS_TAGS                         : BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

Menu
00:00:00.033                             : en:Intro
00:00:23.250                             : en:OP
00:01:52.450                             : en:Part A
00:12:47.450                             : en:Part B
00:22:55.730                             : en:ED
00:24:15.290                             : en:Preview

Kodi 16.1 log : http://xbmclogs.com/pckwiu7gj

In playback the trouble started around time 14:55, that has this kind of lines:
Code:
14:55:38 T:1849890144   ERROR: virtual ssize_t XFILE::CSMBFile::Read(void*, size_t) - Error( -1, 22, Invalid argument ) - Retrying
14:55:43 T:1852204768  NOTICE: CDVDPlayerAudio::OutputPacket skipping a packets of duration 85
14:55:43 T:1852204768  NOTICE: Previous line repeats 62 times.
14:55:43 T:1852204768  NOTICE: CDVDPlayerAudio::OutputPacket duplicate 3 packets of duration 32
14:55:43 T:1852204768  NOTICE: CDVDPlayerAudio::OutputPacket skipping a packets of duration 85

At first this seemed to only happened with the this season of the show in question, I tried downloading a different encode of the show (previous post was tested with one such encode) but the problem still persisted and now this also seems to be happening with other files from other (anime) shows. It seems that the issue is confined to this type of shows right now. It's very weird. I reencoded some of the files to 8bit in order to see if this was the issue but the problem persisted so whatever it is persists reencodes. I'm at my wits end here so any help would be appreciated. Let me know if anything else is needed to debug this.

I have attempted some fixes I found around the net, including changing some settings in smb.conf to no effect.

PS: I had posted about this before using a custom XBMC build that came with my TV box, this post is done after reproducing the issue on official builds.
I have done further testing on this and made several discoveries on 13.2. First, the issue doesn't happen if I access the file via samba but connected via wifi instead of ethernet. Why? Beats me. Second, it seems that this happens with mkvs muxed with SSA subtitles for some reason. I remuxed several offending files and converted the internal sub into srt and the issue hasn't happened again when I played those files. My guess is that through wifi occurs some kind of path encoding before the data reaches xbmc that stops the issue from occurring.

I enabled verbose debugging and there's an additional relevant line in the log:
Quote:11:37:03 T:1941699712 WARNING: CDVDMessageQueue(audio)::Get - asked for new data packet, with nothing available
11:37:05 T:1847674000 ERROR: virtual unsigned int XFILE::CSmbFile::Read(void*, int64_t) - Error( -1, 110, Connection timed out )
11:37:05 T:1847674000 ERROR: ffmpeg[6E214490]: [matroska,webm] Read error
11:37:05 T:1847674000 ERROR: virtual unsigned int XFILE::CSmbFile::Read(void*, int64_t) - Error( -1, 110, Connection timed out )
11:37:05 T:1847674000 ERROR: Previous line repeats 1 times.
11:37:05 T:1847674000 DEBUG: ffmpeg[6E214490]: [NULL] invalid sync code
11:37:05 T:1941699712 DEBUG: CDVDPlayerAudio - CDVDMsg::GENERAL_EOF
11:37:05 T:1847674000 NOTICE: CDVDPlayer::OnExit()
11:37:05 T:1847674000 NOTICE: DVDPlayer: eof, waiting for queues to empty

In my search I've found other people with those kind of errors but none of their proposed fixes work. I really hope someone could at least shed some light if there is some kind of setting I could change to stop this from happening. The issue is very unusual and it happens with almost every anime episode I have (that scene is big on ssa subs).
Hmm, weird, but probably not unheard of. I think I saw something once about improving buffers when it comes to data other than video and audio (such as subs), but I don't remember the details.
(2016-05-28, 03:57)Ned Scott Wrote: [ -> ]Hmm, weird, but probably not unheard of. I think I saw something once about improving buffers when it comes to data other than video and audio (such as subs), but I don't remember the details.

But as in some special setting in advancesettings.xml? It never seemed to me like this was a caching problem but in my desperation I already tried increasing the cache size and the result was the same.
I think the other data wasn't being cached at all, so it could cause issues as Kodi tried to keep everything in sync. It had plenty of video and audio data, but was then waiting on sub data. At least, I think that was a thing (I could be totally off). I don't think there's any currently known issue with that, though.
(2016-05-28, 06:49)Ned Scott Wrote: [ -> ]I think the other data wasn't being cached at all, so it could cause issues as Kodi tried to keep everything in sync. It had plenty of video and audio data, but was then waiting on sub data. At least, I think that was a thing (I could be totally off). I don't think there's any currently known issue with that, though.

I see. Well, I think I'm simply going to access these kind of files via webdavs and see how it goes. So far it seems it's kind of slow to update but that's bearable. Also it seems the autoclean addon doesn't move the files in webdavs which would suck but I guess it's bearable too.
I have come up with another "fix": I updated my Synology NAS to DSM 5.2 (6.0 is available but 5.2 includes all the upgrades and fixes done to SMB to date and is less disruptive than 6.0) and enabled SMB version 3 instead of the version 2 that was the most recent version available on 5.1. If this holds things can go back to normal now Smile

Sadly, this didn't really fix the issue. It seems that it has to do with the powerline adapters I use. Why it only happens with mkv with ssa subs beats me. I tried more up to date units (Homeplug AV2 SISO) and couldn't reproduce the issue. Sadly they performed worst in other aspects so I ended up returning them. I'll try buying AV2 MIMO next. It's sad, my current units work very well if it wasn't because of this weird bug.