SMB issue since last upgrade

Hello,

since the last upgrade from few days ago i started face an issue while playing over SMB.
after the streaming was working with no issues, however now i’ve noticed few issues:

  • i’ve the shares mounted by FSTAB and they’re reachable

  • When i play a movie after around 20 seconds aproximately the stream get freeze, if i ping the raspberry during this time i get no response.

  • From the logs i see the following:
    20:18:13.817 T:1905259264 NOTICE: Finding audio codec for: 86019
    20:18:13.818 T:1905259264 NOTICE: Creating audio thread
    20:18:13.818 T:1673646848 NOTICE: running thread: CVideoPlayerAudio::Process()
    20:18:13.818 T:1905259264 NOTICE: Opening stream: 2 source: 256
    20:18:13.829 T:1673646848 NOTICE: Creating audio stream (codec id: 86019, channels: 6, sample rate: 48000, no pass-through)
    20:18:48.799 T:1673646848 NOTICE: CVideoPlayerAudio::Process - stream stalled
    20:19:19.323 T:1925437952 NOTICE: Samba is idle. Closing the remaining connections
    20:19:30.022 T:1664733952 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer

i even tried different shares over different computer and even OS but seems issue it’s on SMB on the Kodi probably… any idea :confused: ?

Hi,

Full logs would help:

Also could you please post the fstab entry?

Thanks Tom.

Hello Tom,

sorry i forgot add the link for the kodi.log
https://pastebin.com/suFK8UQa

thanks!

HI,

Doesn’t appear to be a full log, also osmc provides it’s own pastebin; details in link provided.

Please post your fstab entry.

Thanks Tom.

Hello Tom,

i reproduced the issue to gather another fresh log
https://paste.osmc.tv/fecekewupe

regarding FSTAB:

/dev/mmcblk0p1 /boot vfat defaults,noatime,noauto,x-systemd.automount 0 0
#/dev/mmcblk0p2 / ext4 defaults,noatime 0 0
//192.168.2.100/Leningrado/Library/ /mnt/leningrado/ cifs noauto,x-systemd.automount,username=Dummy,password=Dummypassword,uid=1000,gid=1000,iocharset=utf8,vers=2.0 0 0
#//192.168.2.100/Library/ /mnt/leningrado/ cifs username=Dummy,password=Dummypassword,uid=1000,gid=1000,iocharset=utf8,vers=2.0 0 0
#//192.168.2.50/descargas /mnt/test2 cifs credentials=/home/osmc/.smbcreds,iocharset=utf8,gid=1000,uid=1000,file_mode=0777,dir_mode=0777,vers=2.0 0 0

Hi,

I’m not sure if its related but there have been various reports on the forums for users using smb kodi shares (rather than fstab) , having a similar issue; if the smb max protocal isn’t set to 1 or 3.

Does the samba server support smb3? If not (Just for testing) try removing the version tag or setting it to version 1.

I believe Kodi is currently looking into samba issues for kodi 17.6.

Thanks Tom.

Hello Tom,

I was added recently after read around that recent version could have issues while determine which SMB version should use.

My server is a W2016 i enabled for testing purposes SMB 1, also removing the vers= from my FSTAB config and result was the same.

Also for testing i enabled “Enable NetBIOS Over TCP/IP”.
I’m still doing test around but from my point of view looks like if something has changed either on Windows side or Kodi :frowning:

Hi,

I would be surprised if W2016 doesn’t support smbv3 (linux server guy here), I need to pointout I use nfs shares so a lot of this guess work; but you try changing vers=2.0 to vers=3.0 in the fstab entry.

Another thing you could try (for testing) is kodi smb shares, and change the smb max protocal to smbv3; this is under settings, services, smbclient.

Thanks Tom.

Hello Tom,

indeed SMBv3 is fully supported on W2016, regarding the smb.conf settings i’ve the following:

[global]
preferred master = no
local master = no
domain master = no
# client lanman auth = yes
# lanman auth = yes
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
lock directory = /home/osmc/.smb/
# client use spnego = no
client use spnego principal = no
client ntlmv2 auth = no
client min protocol = SMB2
client max protocol = SMB3
name resolve order = bcast host
sec = ntlmv2

I commented the lanman auth lines for testing, currently what i’ve noticed is that the resource don’t get auto mounted but i need to run mount -a and then it get recognized,. did i miss something on the FSTAB parameters?

EDIT:

one strange thing is if i run smbstatus -b or either Get-SmbSession from windows to see the sessions i don’t see any coming from OSMC… seems weird or it’s normal?

Hi,

Like I said nfs guy, please advise are these settings on client or server?

x-systemd.automount - This flag means its gets mounted on access not boot. Are you saying if you try to access it kodi, it doesn’t work unless you issue “mount -a” first?

Not sure about this one, will ask another moderator for there thoughts on this one.

Thanks Tom.

Small correction, it gets mounted on access, not at boot time.

Have you ruled out underlying network issues by testing with iperf3 between the Pi and the server?

Those settings are from client (kodi) smb.conf
From windows i’ve kept enabled SMBv1 as well for testing, but currently Kodi should be using SMBv2 for the connection

Apologies, i did a typo while creating another entry at FSTAB and forgot to add the automount, i corrected it and get mounted with success.

Hi,

I may be wrong, but I don’t think smb.conf has any effect on fstab mounts, I believe its for the kodi shares only.

I would try iperf as bmillham has suggested.

Also did you have any joy with updating the fstab entry to vers=3.0 or trying kodi smb shares?

Thanks Tom.

Hello bmillham below the results:

---- Client

osmc@osmc:~$ iperf3 -c 192.168.2.100
Connecting to host 192.168.2.100, port 5201
[  4] local 192.168.2.67 port 35500 connected to 192.168.2.100 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  3.31 MBytes  27.7 Mbits/sec    0   84.8 KBytes
[  4]   1.00-2.00   sec  3.89 MBytes  32.6 Mbits/sec    0   99.0 KBytes
[  4]   2.00-3.00   sec  3.79 MBytes  31.8 Mbits/sec    0    122 KBytes
[  4]   3.00-4.00   sec  4.17 MBytes  35.0 Mbits/sec    0    127 KBytes
[  4]   4.00-5.00   sec  3.92 MBytes  32.9 Mbits/sec    0    127 KBytes
[  4]   5.00-6.00   sec  4.07 MBytes  34.1 Mbits/sec    0    134 KBytes
[  4]   6.00-7.00   sec  4.10 MBytes  34.4 Mbits/sec    0    153 KBytes
[  4]   7.00-8.00   sec  4.31 MBytes  36.1 Mbits/sec    0    164 KBytes
[  4]   8.00-9.00   sec  4.06 MBytes  34.1 Mbits/sec    0    164 KBytes
[  4]   9.00-10.00  sec  3.98 MBytes  33.4 Mbits/sec    0    164 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec  39.6 MBytes  33.2 Mbits/sec    0             sender
[  4]   0.00-10.00  sec  39.3 MBytes  33.0 Mbits/sec                  receiver

iperf Done.

---- Server

Accepted connection from 192.168.2.67, port 35498
[  5] local 192.168.2.100 port 5201 connected to 192.168.2.67 port 35500
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-1.00   sec  3.04 MBytes  25.5 Mbits/sec
[  5]   1.00-2.00   sec  3.91 MBytes  32.7 Mbits/sec
[  5]   2.00-3.00   sec  3.69 MBytes  31.0 Mbits/sec
[  5]   3.00-4.00   sec  4.18 MBytes  35.1 Mbits/sec
[  5]   4.00-5.00   sec  3.92 MBytes  32.9 Mbits/sec
[  5]   5.00-6.00   sec  4.03 MBytes  33.9 Mbits/sec
[  5]   6.00-7.00   sec  4.11 MBytes  34.5 Mbits/sec
[  5]   7.00-8.00   sec  4.21 MBytes  35.3 Mbits/sec
[  5]   8.00-9.00   sec  4.10 MBytes  34.4 Mbits/sec
[  5]   9.00-10.00  sec  3.99 MBytes  33.5 Mbits/sec
[  5]  10.00-10.04  sec   124 KBytes  27.6 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-10.04  sec  0.00 Bytes  0.00 bits/sec                  sender
[  5]   0.00-10.04  sec  39.3 MBytes  32.8 Mbits/sec                  receiver

I modified the fstab to force SMBv3
I restarted both (server and rpi) now i can see the connection from W2016 and it’s using SMBv3 indeed:

Dialect ClientComputerName
------- ------------------ 
3.0     192.168.2.67 

Right now i will do some test… but somehow i would say situation improved since before any modification / test stopped right after start to play almost.

That’s very low. You should be seeing closer to 90MB. Are you wired or WiFi?

currently i’m using a usb wifi adapter plugged to the raspberry pi (signal is good, not even 1 meter from the router)

in fact after testing and modification of the fstab as Tom suggested seems there is an improvement, i just got a coulple of buffer issue or streaming stopped directly, maybe due buffering (?)

Hi,

<readfactor>4.0</readfactor>

I believe this the default read-factor that kodi uses, you may find it more stable if you try changing this value to 5 or 6.

Thanks Tom.

Please remove the:

TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536

settings. They are voodoo left over from Samba and Linux kernels of the 1990’s. Modern Linux and Samba will only be hurt by forcing these settings.

Jeremy Allison,
Samba Team.

1 Like

Thanks for the info @jra_samba.