SMB / Scanning problems

  • You keep saying SMB is the issue, did you analyze the network traffic and find something? Did you debug the code? At the very least did you verify the same issue persists if you access the same share through a different protocol (maybe nfs)?

    Just saying, the OP pointed at SMB too and it turnee out to be the wireless driver. All you really have found is that Kodi does not display everything in a given folder. Sure it could be SMB, but it could be something else entirely as well.


  • At the very least did you verify the same issue persists if you access the same share through a different protocol (maybe nfs)?

    How exactly do you "access the same share through a different protocol"? An SMB share can only be directly accessed by an SMB client just as NFS/SSH need their respective clients to access them. I already stated I connected to the same SMB share using SSH as my server allows me to also browse through to any Windows shares it can see on the network, and the problem goes away. It's just not fast enough for streaming or I would have switched.

    Something on the SMB client as used by Kodi is broken, and as we can only connect to SMB1 via the GUI that's all I've been able to test for SMB. Hopefully tonight I can create a system SMB mount as per the OP and test connecting as it is now, and also when disabling SMB1 on the server.

  • How? You install an NFS server. Kodi itself is an NFS client in the same way it's an SMB client the way you are using it.

    I don't get what you mean by "the same SMB share using SSH", did you install an SSH server on your Windows machine and added that as a video share in Kodi with the SSH protocol?

    I still see 0 indication that SMB is the issue here (although it can't be excluded either).


  • How? You install an NFS server. Kodi itself is an NFS client in the same way it's an SMB client the way you are using it.

    Then that isn't the same share is it - and I know the Kodi is also an NFS client, just like it can connect to SSH/SFTP/FTP.


    I don't get what you mean by "the same SMB share using SSH", did you install an SSH server on your Windows machine and added that as a video share in Kodi with the SSH protocol?

    It's simple really. I have separate SSH server running on another Windows server - I have already mentioned this:


    I also have my SSH server located on another machine but does allow me to access the same share - it works everywhere but it's far slower than direct via SMB otherwise I'd switch over.

    When I connect to that I can also connect to any other Windows share that can be seen on my network. So if for example my SMB share is accessed in Kodi like (and this is just simplified as I can't recall off the top of my head how it's entered in Kodi):

    Code
    smb://myaccount@mysmbserver/mysmbshare

    which fails to see all the folders and files, I then connect on Kodi with

    Code
    ssh://myaccount@mysshserver//mysmbserver/mysmbshare

    I can see the same files via the same SMB share. Doesn't that point to SMB on Kodi being a problem?


  • Then that isn't the same share is it - and I know the Kodi is also an NFS client, just like it can connect to SSH/SFTP/FTP.

    That depends on your definition of share, I mean of course connecting to the same shared folder using a different protocol.

    Quote
    Code
    ssh://myaccount@mysshserver//mysmbserver/mysmbshare

    I can see the same files via the same SMB share. Doesn't that point to SMB on Kodi being a problem?

    Well yes, why didn't you just say that :) This is my point exactly, trying to access the same folder through a different protocol. If that works, then it does indeed look like an SMB issue. Try mounting through the kernel, should be a lot more up to date than the Kodi code even at SMB1. Using SMB3 would require compiling from source.

    Edited once, last by escalade (November 11, 2016 at 1:13 PM).

  • Well I did some more testing.

    First I used a mount command-line to ascertain the correct syntax for the system.d script and then when I got that right I created the folder under "storage" and copied the mount script to my box. I rebooted LE and when I used the file manager I could browse to the new mount under "storage" which I called "test" - I could finally see all the files. Every folder I visited worked as it should showing me the correct number of files and any I tried to view played as expected.

    My next test was to disable SMB1 on the server, "Set-SmbServerConfiguration -EnableSMB1Protocol:$false" if anyone is interested, and I rebooted the LE machine (there is no need to reboot Windows). LE threw a CIFS error during the startup and I was unable to see the share - if there is a way to enable SMB2 with LE I have no clue how to do it.

    So to me it seems:

    • LE via the GUI has some kind of issue with SMB shares
    • LE can see SMB1 shares perfectly if mounted at the command-line or via system.d
    • Neither the main OS or LE can see an SMB share that only supports SMB2 and SMB3 (this will start to become the norm in the future).


    Hope that helps.


  • I use a rpi3 with an external wifi-usb adapter with a rtl8812au chipset. I adjusted the modules parameters as follows:

    Code
    options 8812au rtw_vht_enable=1 rtw_ht_enable=0 rtw_power_mgnt=0 rtw_enusbss=0 rtw_ips_mode=1

    What exact file was this that you edited? My non-USB wireless is having issues needing me to reboot my mini-PC everyday to reconnect, so I'm wondering if something similar is happening in my setup.

  • You have to put it into a conf file in

    /storage/.config/modprobe.d/

    for example

    /storage/.config/modprobe.d/wifi.conf

    And you have to look up the man page of the module your wifi adapter is using. Some of the options I used may be the same, some may not be available.

    Edited once, last by gaelic (November 28, 2016 at 9:24 AM).


  • Taomyn

    linux: enable smb2/3 support for cifs · escalade/LibreELEC.tv@fd17579 · GitHub

    I've enabled SMB2/3 in my extended build if you like to test.

    Sure, but how do I update my box? I use the generic_x86_64 builds.
    [hr]


    You have to put it into a conf file in

    /storage/.config/modprobe.d/

    for example

    /storage/.config/modprobe.d/wifi.conf

    And you have to look up the man page of the module your wifi adapter is using. Some of the options I used may be the same, some may not be available.

    Ah thanks, but I have no clue what I have or where to find it - was hoping it was a file that already existed.

    Edited once, last by Taomyn (November 30, 2016 at 8:44 AM).

  • Ah thanks, but I have no clue what I have or where to find it - was hoping it was a file that already existed.

    You have to figure out which wifi adapter you're using and the respective kernel module. It seems you're using a normal pc for playback?

    Just figure it out using 'lspci', there should be a line such as:

    Code
    03:00.0 Network controller: Intel Corporation Wireless 7260 (rev 6b)

    Or any other manufactorer apart from Intel.

    Afterwards you can do a 'lsmod' (or a search the internet) which module you're adapter is using. Sone that you can start looking for information on the driver and create a file with module options which are applied on startup.

    escalade, I'll maybe give it a try on my box with your builds and switch back from nfs to smb to see what happens. But its quite a pain in the ass to switch library paths :(

  • Just a quick update to keep the thread fresh.

    1. Someone else has now confirmed the same issue as I have, and also provided some packet tracing that may explain what is happening: #17038 (SMB share on Windows 2012 R2 server not finding all files) – Kodi - TRAC
    2. I did eventually figure out my WiFi card and what I hoped would be the correct conf file but it made no difference both the SMB issue and the loss of connection requiring a reboot to fix.

  • In light of this weekend's fun and games with a certain ransomware running rampant everywhere, I have disabled/uninstalled SMBv1 from all my Windows machines.

    I now find myself unable to see any Windows shares (on a Windows 2012 R2 server) from my LE box, whereas the exact same shares can be seen from all my Windows machines (obviously), Android phones/tablets and a few other devices.

    Any idea when LE/Kodi will have SMB fixed properly?

  • I have tested a build of LE9 that has SAMBA v4 and can confirm that SMB v2 and v3 work as I have been able to create CIFS mounts to my shares and they can be accessed, however the main GUI still cannot connect to them until Kodi is updated as well.

    At least things appear to be progressing in the right direction.