Page 1 of 2

debian-based Samba Server slows down the TV

Posted: Sat Nov 28, 2009 9:37 pm
by goaskin
Hello,

to get a working Samba server easily, I extracted nmbd and smbd from the 'armel' debian distribution and copied the files together with a custom smb.conf and all necessary libs to an usb stick. After fetching a large list of libraries, both daemons finally started. But when the samba server is running, the TV becomes very slow (about three seconds to switch bethween menu entries, nearly a minute if you want to turn it off etc.)

Does anybody know a source where to download a samba binary with only the really necessary features? The debian binary has a lot of features that are not really required (cups support, kerberos etc.) and loads many megabytes of libraries.

Re: debian-based Samba Server slows down the TV

Posted: Sat Nov 28, 2009 9:57 pm
by arris69
a little curious, for what you need a samba server on tv :?:

arris

Re: debian-based Samba Server slows down the TV

Posted: Sat Nov 28, 2009 10:10 pm
by goaskin
... to share the USB-devices and mtd_tlib+mtd_wiselink. This way, you can copy media files from any computer to the TV via network. In my opinion that is better than mounting network shares from a computer on the TV because the computer does not need to be turned on when you want to play a file.

I will publish the samba package later... before I have to write an usable start script.

Then, I will try generate a custom binary with all printing and authorization features disabled and hope that it needs less memory, less libraries and does not slow down the CPU.

Re: debian-based Samba Server slows down the TV

Posted: Sun Nov 29, 2009 4:17 pm
by arris69
goaskin wrote:... to share the USB-devices and mtd_tlib+mtd_wiselink. This way, you can copy media files from any computer to the TV via network. In my opinion that is better than mounting network shares from a computer on the TV because the computer does not need to be turned on when you want to play a file.

I will publish the samba package later... before I have to write an usable start script.

Then, I will try generate a custom binary with all printing and authorization features disabled and hope that it needs less memory, less libraries and does not slow down the CPU.
hi, may it is smarter to use ftp server?

be careful with media under
/mtd_wiselink/<PHOTO|MOVIE|MUSIC><NNN>
sometimes it won't apear in the file list on tv, may depends on file type.

arris

Re: debian-based Samba Server slows down the TV

Posted: Sun Nov 29, 2009 5:18 pm
by goaskin
I am trying now to compile a small samba daemon using the freetz project. It an enviroment to MOD the firmwares of AVM routers. It builds a samba server that requires nothing else than the smbd and nmbd binaries (beside the smb.conf) and both have a size of less than 10MB in the result.

Freetz usually compiles the stuff for MIPS CPUs, so I am trying to modify it to get an usable ARMEL target. Also interesting (included) stuff:

- dropbear (small SSH server)
- bsftpd (small FTP server)
- a CGI that shows the CPU load using RRDTOOL


I will try to port all the content which is usable for the samsung TVs.

Re: debian-based Samba Server slows down the TV

Posted: Mon Nov 30, 2009 12:14 am
by goaskin
I think I found out the reason why samba slows down the system. The following message repeats the whole time to STDERR:

Code: Select all

Probing module 'CP850'                                                                                                       
Probing module 'CP850': Trying to load from /usr/lib/samba/charset/CP850.so                                                  
Error loading module '/usr/lib/samba/charset/CP850.so': /usr/lib/samba/charset/CP850.so: cannot open shared object file: No such file or directory                                                                                                        
init_iconv: Conversion from ASCII to CP850 not supported                                                                     
init_iconv: Attempting to replace with conversion from ASCII to ASCII                                                        
Failed to load /usr/share/samba/valid.dat - No such file or directory                                                        
creating default valid table                                                                                                 
Substituting charset 'ANSI_X3.4-1968' for LOCALE 
I don't know what is wrong but there isn't any file called CP850.so in any samba package. The debian package search does not know that file in any debian package.

Re: debian-based Samba Server slows down the TV

Posted: Mon Nov 30, 2009 12:42 pm
by arris69
goaskin wrote:I think I found out the reason why samba slows down the system. The following message repeats the whole time to STDERR:

Code: Select all

Probing module 'CP850'                                                                                                       
Probing module 'CP850': Trying to load from /usr/lib/samba/charset/CP850.so                                                  
Error loading module '/usr/lib/samba/charset/CP850.so': /usr/lib/samba/charset/CP850.so: cannot open shared object file: No such file or directory                                                                                                        
init_iconv: Conversion from ASCII to CP850 not supported                                                                     
init_iconv: Attempting to replace with conversion from ASCII to ASCII                                                        
Failed to load /usr/share/samba/valid.dat - No such file or directory                                                        
creating default valid table                                                                                                 
Substituting charset 'ANSI_X3.4-1968' for LOCALE 
I don't know what is wrong but there isn't any file called CP850.so in any samba package. The debian package search does not know that file in any debian package.
hi, two choices.
1. hack into samba to disable iconv (just disable it at compile time via configure parameter not realy works)
2. disable it at runtime as in SamyGO Extension pack ;-) (in smb.conf)

Code: Select all

[global]
wins support = no
unix charset = UTF-8
dos charset = UTF-8
than start smbd -s <configfile>

hth
arris

Re: debian-based Samba Server slows down the TV

Posted: Sun Dec 06, 2009 3:19 pm
by goaskin
After rebuilding samba, the following message appears if you try to access IPC$ (share list) with the smbclient:
Samba:tree connect failed:NT_STATUS_BAD_NETWORK_NAME

Anybody an idea why? Connecting to a real share (if you know the name) works. The whole path to the smbroot and the shares is readable and executable (bad permissions are the main reason for that error). But may be this problem occurs because the TV is a single-user system and the guest account of samba must be mapped to the root user.

Actually, the smbroot is /dtv/usb/sda1/samba. Because the mountpoint of the stick may be different some cases, I am looking for a suitable place in the TV memory. Since recompiled with only small features, the whole samba package has a size around 3MB and requires another 700KB of external libraries.

Re: debian-based Samba Server slows down the TV

Posted: Sun Dec 06, 2009 5:25 pm
by arris69
goaskin wrote:After rebuilding samba, the following message appears if you try to access IPC$ (share list) with the smbclient:
Samba:tree connect failed:NT_STATUS_BAD_NETWORK_NAME

Anybody an idea why? Connecting to a real share (if you know the name) works. The whole path to the smbroot and the shares is readable and executable (bad permissions are the main reason for that error). But may be this problem occurs because the TV is a single-user system and the guest account of samba must be mapped to the root user.

Actually, the smbroot is /dtv/usb/sda1/samba. Because the mountpoint of the stick may be different some cases, I am looking for a suitable place in the TV memory. Since recompiled with only small features, the whole samba package has a size around 3MB and requires another 700KB of external libraries.
hi
start samba like:

Code: Select all

export TMPDIR=/dtv
smbd -s /mtd_tlib/GGame/SamyGO/etc/smb.conf --lockdir=/dtv --piddir=/dtv --private-dir=/dtv
/mtd_tlib/GGame/SamyGO/etc/smb.conf:

Code: Select all

[global]
workgroup = SAMYGO
netbios name = Samsung-TV
server string = Some Server
wins support = no
unix charset = UTF-8
dos charset = UTF-8
load printers = no
printing = bsd
printcap name = /dev/null
disable spoolss = yes
guest account = root
guest ok = yes
guest only = yes
null passwords = yes
smb passwd file = /dtv/pp

[Temp]
  comment = Test Share
  path = /dtv
  public = yes
  writable = no
/dtv/pp:

Code: Select all

root:0:NO PASSWORDXXXXXXXXXXXXXXXXXXXXX:NO PASSWORDXXXXXXXXXXXXXXXXXXXXX:[NU         ]:LCT-00000000:
hth
arris

Re: debian-based Samba Server slows down the TV

Posted: Sun Dec 06, 2009 9:37 pm
by goaskin
Everything works fine now. No changes in the smb.conf were necessary. Only to set the TMPDIR enviroment variable. That was all.

The only bad thing is that if in the smb.conf interfaces = eth0 is set, the nmbd does not respond. That requires to set interfaces = ip-address/subnet-mask - bad for those who have a dhcp server that never lets the TV lease the same IP-address. For that, a startup script may be required that changes the smb.conf before the startup.

Thanks to arris69 for all the tips and the coders from the freetz project for providing a samba patch that fixes some errors that usually appear if you cross-compile samba for mipsel and armel.lx

Tomorrow, I will release it. Before, I will delete all the junk libraries and some other files that are finally not required.

What prefix should be compiled into the final version?

1.) /dtv/usb/sda1/samba
2.) /mtd_wiselink/samba
3.) another rw partition

In my opinion, (2) is the best solution because the path of the usb device is not everytime the same and all the other partitions on the TV have either a free space of less than 10 MB or are required for other things. But because nearly nobody uses the partition that is normally used to save media files, this may be a good place for system extensions.