OpenWrt Forum Archive

Topic: Tp-Link TL1034ND USB Samba miniDLNA Windows

The content of this topic has been archived on 20 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

So far I managed to connect my USB drive to the router:

with the following start-up command for the router:

ntfs-3g /dev/sda1 /mnt/media/ -o rw,sync

Also I've configured to share it with samba with the default template and:

[/etc/config/samba]

config samba
        option 'name'                   'OpenWrt'
        option 'workgroup'              'WORKGROUP'
        option 'description'            'OpenWrt'
        option 'homes'                  '1'

config sambashare
        option 'name' 'media'
        option 'path' '/mnt/media'
        option 'guest_ok' 'yes'
        option 'create_mask' '0700'
        option 'dir_mask' '0700'
        option 'read_only' 'no'

Also my miniDLAN configuration as follows:

[/etc/config/minidlna]
config minidlna config
        option 'enabled' '1'
        option port '8200'
        option interface 'br-lan'
        option friendly_name 'DLNA Server'
        option db_dir '/mnt/media/minidlna'
        option log_dir '/mnt/media/minidlna/log'
        option inotify '1'
        option enable_tivo '0'
        option strict_dlna '0'
        option presentation_url 'http://192.168.1.1:8200/'
        option notify_interval '60'
        option serial '12345678'
        option model_number '1'
        option root_container '.'
        list media_dir 'P,/mnt/media'
        option album_art_names 'Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/th...

Two issues with this:
1) the samba share is very slow, for copying is ~2300kbytes/s (my usb drive is USB3.0 compatible). OS: Windows 8.

2) the minidlna server is not showing any files, although I have Movies, Pictures and Audio in the share.
I was able to view pictures with 'P,/mnt/media/pictures', but 'V,/mnt/media/movies' were not showing up. Is it possible for minidlna to scan the whole root folder and share picture/video/audio automatically?

Attitude Adjustment 12.09

(Last edited by enoon on 5 Jul 2013, 19:36)

Use ext3 (or ext4 but personally I have better experience with ext3)

Change the sync flag to async or remove it completely
Should help with speed

here is my update:

restarted with a fresh install
formatted the USB 3.0 external hdd as ext4
mounted
configured samba
configured dlna

problem #2 seems to be solved, all my files are seen and scanned by the server so I gave only the root dir /mnt/media to miniDLNA config and it successfully lists audio/video/images for the TV

regarding problem #1:

Seems like the flag sync slows down even the ext4 file system, so instead of ~2500k/s it's writing/reading with ~4500 which has exactly as same performance as with the NTFS filesystem.

I've also put the NOTRACK option in the firewall.

It must be something else, only the basic packages were installed like kmod-usb-core kmod-usb-ohci kmod-usb-storage kmod-usb2 samba36-server and minidlna.

The format was made with no_journaling option and is mounted like:
/dev/sda1 on /mnt/media type ext4 (rw,relatime,user_xattr,barrier=1,data=ordered)

Anyone any ideas for the slow USB speed problem?

Great article for fine tuning thanks.

I connected an ethernet cable and tried to use samba got ~8500kilo/sec which is far from normal throughput.
As for the resources Samba is the greediest:

CPU:  19% usr  47% sys   0% nic   0% idle   0% io   0% irq  32% sirq
Load average: 3.31 1.78 0.88 2/53 7272
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
5802  1777 nobody   R     3688  13%  65% /usr/sbin/smbd -D
  477     2 root     SW       0   0%  12% [usb-storage]
    3     2 root     SW       0   0%   6% [ksoftirqd/0]
4068     1 root     S     1432   5%   3% hostapd -P /var/run/wifi-phy0.pid -B
    4     2 root     SW       0   0%   2% [kworker/0:0]
  746     2 root     SW       0   0%   2% [flush-8:0]
   95     2 root     DW       0   0%   1% [kswapd0]
    5     2 root     SW       0   0%   0% [kworker/u:0]
6986  6981 root     R     1500   5%   0% top
1716     1 root     S     1156   4%   0% /usr/sbin/uhttpd -f -h /www -r WiFiGr
1696     1 root     S     9160  31%   0% /usr/bin/minidlna -f /tmp/minidlna.co
4863  1777 root     S     3688  13%   0% /usr/sbin/smbd -D
1779     1 root     S     3196  11%   0% /usr/sbin/nmbd -D
1777     1 root     S     3116  11%   0% /usr/sbin/smbd -D
  745   674 root     S     1620   6%   0% /usr/sbin/pppd nodetach ipparam wan i
  674     1 root     S     1540   5%   0% /sbin/netifd
  619     1 root     S     1508   5%   0% /sbin/syslogd -l 8 -C16
    1     0 root     S     1504   5%   0% init
6981  6848 root     S     1504   5%   0% -ash
^C142  2141 root     S     1504   5%   0% -ash

Something still seems wrong, but can;t figure out what exactly, any ideeas?

Read up on the kind of speeds other people are getting USB HDD (ext4) > LAN on the 1043nd. Are you very far off?

Boompje123 wrote:

Read up on the kind of speeds other people are getting USB HDD (ext4) > LAN on the 1043nd. Are you very far off?

Yes: ~4500kylobytes per second instead of 10MB/s

PS: recently partitioned and formatted as ext4. Same slow speed.

So any thoughts on what should be the issue?

USB 3.0 external hdd connected and mounted as ext3 fs and shared over the network with samba has a terrible slow speed 4500k/s.

have you tried adding swap space to your config?

C007dudz wrote:

have you tried adding swap space to your config?

No.

Swap space on the external drive you mean, I guess.
You think that there is not enough memory to do large transfers on the device, and it should overflow to swap?

yup, that's what I think.. a swap space to the external drive could help in that. The device has a small amount of ram in it and the link that I have posted earlier, well, I checked the other pages in that site and it seems he had modified the device with a larger ram, so I think, to fix the ram issue, why not add a swap space. I did that with a former device of mine (E3000 with DDwrt actually, now dead) running minidlna, samba, and rtorrent, and it survived for a few years running without hiccups (apart from me being a noob who tried to upgrade it through wifi, now it's dead).

C007dudz wrote:

yup, that's what I think.. a swap space to the external drive could help in that. The device has a small amount of ram in it and the link that I have posted earlier, well, I checked the other pages in that site and it seems he had modified the device with a larger ram, so I think, to fix the ram issue, why not add a swap space. I did that with a former device of mine (E3000 with DDwrt actually, now dead) running minidlna, samba, and rtorrent, and it survived for a few years running without hiccups (apart from me being a noob who tried to upgrade it through wifi, now it's dead).

Actually it didn't crash not just because I upgraded the RAM.
I just updated the post to reflect the changes I did to sysctl.conf to ensure that the router will never crash.
It crashes usually because it runs out of memory too fast before it can allocate them.
And it is fine to upgrade openwrt over wifi as long as the MD5 sum match the firmware file and you should run
sysctl -w vm.drop_caches=1
to free up RAM to take in the firmware in /tmp/ directory.

(Last edited by alphasparc on 17 Jul 2013, 11:39)

The discussion might have continued from here.