Record PVR to NAS (NFS)

Here for general support for F series TVs, request and problem solve area.
Post Reply

Joejoe
SamyGO Project Donor
Posts: 55
Joined: Thu Dec 26, 2013 11:47 pm

Record PVR to NAS (NFS)

Post by Joejoe »

Hello everybody,

this is my first post an I hope someone can give me advice and help for the solution of my target.
First I want to thank the operators and all employees of this forum. It's a great work and and I've allready modified the C-Series TV to watch videos directly from my NAS.

Now I have bought a new (F-Series) and would like to try to save the recordings of the PVR on my NAS (nfs).

Can someone show me a way (for little stupid Windows-User) to do this? I've tried to read and understand this article http://wiki.samygo.tv/index.php5/PVR_Re ... r_C-Series but its a little bit to tricky for me even to apply on an F-Series.

My knowledge of Linux is not very good but it was enough for the connection of the NFS drives.

My new TV is a UE46F6470 (Germany) with firmware 1113. SamyGo is installed and ftp-access and also shell-access over phpsysinfo/shell by browser is guaranteed

Greetz Joe
UE46F6470 with T-MST12DEUC @ 2105.0
SamyGo working :D

User avatar
beatfreak
SamyGO Project Donor
Posts: 588
Joined: Tue Aug 23, 2011 9:03 am
Location: Hamburg
Contact:

Re: Record PVR to NAS (NFS)

Post by beatfreak »

ok, do you know where your init.d folder for SamyGo Extensions is located? (usb-disk?)
it should contain some small files that end on .init or .dis
//UE40C6500 @ T-VALDEUC 3011 // rooted manual HotelMode style // PVR to NFS via 18MB on-the-fly sparse XFS //
FYI: you can close your ssh session with SamyGO with

Code: Select all

~.
If you can't fix it using dvct tape, you are not using enough dvct tape.

Joejoe
SamyGO Project Donor
Posts: 55
Joined: Thu Dec 26, 2013 11:47 pm

Re: Record PVR to NAS (NFS)

Post by Joejoe »

Hello beatfreak,

thanks for your reply!
the folder /mnt/etc/init.d I have found and dug me through various scripts.
The script 02_04_vusb.init I progressed a bit. The module g_file_storage.ko can also load ext4 files.
I have now created a directory "/dtv/test" and mount the NAS-directory via NFS. From this directory I call via insmod g_file_storage the file to "vusb" (10GB ext4).
It all works so far.
Unfortunately tells me the TV that the speeds while reading are 0.8 Mbps. Be required to 2.6 MbpsIs it possible to tune the speed or is there even a completely different and better way?

Here's my changed script:
SpoilerShow

Code: Select all

#!/bin/sh
#
# ? Copyright 1996-2010, ZsoltTech.Com
#       by Ser Lev Arris <arris@ZsoltTech.Com>
#
#       donated for the SamyGo Project
#       http://samygo.sourceforge.net/
#
#       Version: SamyGO svn $Id: 02_04_vusb.init 1221 2012-06-25 18:59:29Z arris69 $
#
# TODO: more sysv style, more error handling
#
. /dtv/SGO.env

case $1 in 
	start)
	# on C series: can't open '/proc/scsi/scsi': No such file or directory?
#	if [ `cat /proc/scsi/scsi | grep -c "Type:"` -lt "1" ] ; then
		
		# create unsusable dummy device
		# dd if=/dev/zero of=/dtv/vusb bs=512 count=4

		# create usable vfat image
		# we don't need to mess around with log and usblog
		# also no limits to usb mounts
		# we need to find mount point, on most devices it's sda
		# but it will differ in some situations
		touch /dtv/vusb
		mkdir -p /dtv/test
		/bin/busybox mount -t nfs -o rw,soft,tcp,nolock,async,rsize=32768,wsize=32768 192.168.0.100:/volume1/Samsung-Aufnahme /dtv/test
		# mkfs.vfat -C /dtv/vusb 500
		# mkfs.vfat -C /dtv/vusb $(($(df -k /dtv | grep dtv | sed -e 's,^\(.*\) \(.*\) \( .*% /dtv\),\2,') / 3 ))
		sleep 10
		
		# TODO: for recording on c series xfs stuff.
		# /dev/stl0/21            392.3M    142.9M    249.4M  36% /mtd_rwcommon
		# needs to be adapted:
		# http://sourceforge.net/apps/phpbb/samygo/viewtopic.php?f=12&p=10567#p10567
		#
		# dd if=/dev/zero of=/mtd_rwcommon/vusb bs=1M count=16
		# /sbin/mkfs.xfs -f -d name=/mtd_rwcommon/vusb
		# ln -s /mtd_rwcommon/vusb /dtv/
		# OBSOLETE: gone to 80_80_record_to_nwshare.init 

		# create usable virtual device (don't store data on it what you need tomorrow too!!)
		# dd if=/dev/zero of=/dtv/vusb bs=1M count=2
		# mkfs.ext4 -q -F -m 0 -b 1024 /dtv/vusb

		# insmod $SYSROOT/lib/modules/treasure/dummy_hcd.ko
		insmod $MOD_DIR/kernel/drivers/usb/gadget/dummy_hcd.ko
		sleep 2
	
		# insmod $SYSROOT/lib/modules/treasure/g_file_storage.ko
		# insmod $MOD_DIR/kernel/drivers/usb/gadget/g_file_storage.ko file=/dtv/vusb
		insmod $MOD_DIR/kernel/drivers/usb/gadget/g_file_storage.ko nofua=0 stall=0 file=/dtv/test/vusb
		sleep 3 
		
		# find vusb in /sys
		# and set a variable for mount point
		rdev="sdj" # init state
		dev="sdj" # set fallback if someting wrong with modules
		for i in /sys/block/sd?/device/model ; do
			if [ `cat $i | grep -c "Gadget"` -gt "0" ] ; then
				echo "found gadget at: $i"
				dev=`echo $i | sed 's/^\/.*\(sd.\)\/.*/\1/g'`
				echo "scsidev: $dev"
			else
				# catch last one. hm, really required? 
				rdev=`echo $i | sed 's/^\/.*\(sd.\)\/.*/\1/g'`
				echo "real storage device at: $i ($rdev)"
			fi
		done
#	else
#		echo "Storage Device is present"
#	fi
	# if rdev == dev -> no vusb and no real usb
	# if rdev != dev -> vusb or real usb or both
	# if rdev != dev + check where "sdj" -> vusb or real and "sdj" tels what's not present
	# how to detect that we need to write to log or usblog?
	if [ "$dev" == "sdj" ] ; then
		# make [usb]log
		 $(echo -e "[${dev}]\nVendor : SamyGO Virt.\nProduct : SamyGO Virt.\n\
Serial : Q80VQLFK\nDevpath : 11\nLun : 0\nScsiDevicePath : /dev/${dev}\nMountDir : /dtv/usb/${dev}\nFileSystem : ext4\n" >> /dtv/usb/usblog)
	mkdir -p /dtv/usb/${dev}
	fi
	
	sed -i -e "s,MountPlaceholder,/dtv/usb/$dev," /dtv/SGO.env
	;;
	stop)
	# what's about umount?
	rmmod g_file_storage
	# some troubles if we mess around with dummy_hcd, so not remove on stop
	# rmmod dummy_hcd
	;;
	status)
	cat /sys/block/sd?/device/model
	;;
	*)
	echo "Usage: $0 {start|stop|status}" 1>&2
	exit 0
	;;
esac
Greetz Joe
UE46F6470 with T-MST12DEUC @ 2105.0
SamyGo working :D

User avatar
beatfreak
SamyGO Project Donor
Posts: 588
Joined: Tue Aug 23, 2011 9:03 am
Location: Hamburg
Contact:

Re: Record PVR to NAS (NFS)

Post by beatfreak »

could you post the output of

Code: Select all

/bin/busybox mount
and have a look at the related forum thread,

in vusb we create the virtual usb device and if we can find pvrimage (for xfs filesystem) we create another device with that

in nfsmount we look for available shares and mount them in virt-usb1

in record to nwshare we look for the "placeholder" file to identify the mounted xfs filesystem and mount another nfs-share in there as the tv only wants to record to xfs filesystems but we want the recordings to be on our NAS...

try to keep the original style of the scripts to have the error handling and pre-checking and that you only have to define your specific parameters as mount options, adresses and share names right at the beginning of the scripts and dont have to worry whats happening in the rest if you change anything....

regarding your network speed:
for "tuning" i used to mount a testshare and do a

Code: Select all

dd if=/dev/zero of=/dtv/testshare/ddfile bs=100M count=8192
and measure the time needed to do this, with bs (blocksize) and count you define the size of your testfile

then try to modify the rsize (read size) and wsize (write size) options for your nfs mount
so you can determine the biggest blocksize for a read/write operation without confirmation, use values from about 1024 (2^10) to 65536 (2^16) in n = 2*n steps
size too small = you waste potential
size to big = too much errors during operation
my current setup:

Code: Select all

M_OPTS="soft,udp,nolock,rsize=32768,wsize=8192"
you may also try to add "async" option
//UE40C6500 @ T-VALDEUC 3011 // rooted manual HotelMode style // PVR to NFS via 18MB on-the-fly sparse XFS //
FYI: you can close your ssh session with SamyGO with

Code: Select all

~.
If you can't fix it using dvct tape, you are not using enough dvct tape.

Joejoe
SamyGO Project Donor
Posts: 55
Joined: Thu Dec 26, 2013 11:47 pm

Re: Record PVR to NAS (NFS)

Post by Joejoe »

Output of /bin/busybox mount:
SpoilerShow
root@(none) init.d $ /bin/busybox mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /dev/shm type tmpfs (rw,relatime)
tmpfs on /dtv type tmpfs (rw,relatime,size=40960k)
tmpfs on /tmp type tmpfs (rw,relatime,size=36864k)
tmpfs on /freesia type tmpfs (rw,relatime,size=2048k)
tmpfs on /core type tmpfs (rw,relatime,size=30720k)
none on /sys/kernel/security type securityfs (rw,relatime)
/dev/mmcblk0p19 on /mtd_uncompexe type emmcfs (ro,relatime)
none on /sys/fs/cgroup type cgroup (rw,relatime,cpu)
/dev/mmcblk0p17 on /mtd_exe type squashfs (ro,relatime)
/dev/mmcblk0p16 on /mtd_rwarea type emmcfs (rw,relatime)
/dev/mmcblk0p14 on /mtd_drmregion_a type emmcfs (rw,relatime)
/dev/mmcblk0p15 on /mtd_drmregion_b type emmcfs (rw,relatime)
/dev/mmcblk0p21 on /mtd_rocommon type squashfs (ro,noexec,relatime)
/dev/mmcblk0p24 on /mtd_contents type emmcfs (rw,relatime)
none on /proc/bus/usb type usbfs (rw,relatime)
/dev/mmcblk0p26 on /mtd_rwcommon type emmcfs (rw,relatime)
/dev/mmcblk0p23 on /mtd_emanual type emmcfs (rw,relatime)
/dev/mmcblk0p25 on /mtd_swu type emmcfs (rw,relatime)
/dev/loop0 on /mtd_rwcommon/widgets/manager/10130000000 type squashfs (ro,noexec,relatime)
/dev/sda1 on /dtv/usb/sda1 type vfat (rw,dirsync,noexec,noatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=utf8,shortname=mixed,usefree,flush,errors=continue)
/tmp/loopnone on /mnt type ext4 (rw,sync,relatime,user_xattr,barrier=1,data=ordered)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
/dev/mmcblk0p16 on /etc/profile type emmcfs (rw,relatime)
/dev/mmcblk0p16 on /etc/passwd type emmcfs (rw,relatime)
/dtv/loop4 on /mtd_rwcommon/widgets/normal/111199001564 type squashfs (ro,relatime)
I have found a script with which I have measured the speed:
SpoilerShow

Code: Select all

#!/bin/ash
EXPORT="192.168.0.100:/volume1/Samsung-Aufnahme"
MNTDIR="/dtv/test"
TESTFILE="ddfile"

echo "Testing transfer speed of $NFSPROTO on file $EXPORT/$TESTFILE"
 echo

 for rsize in 8192 16384 32768 65536
 do
 if mount | grep $MNTDIR > /dev/null; then
   umount $MNTDIR
 fi

 /bin/busybox mount -t nfs -o rw,soft,tcp,nolock,async,rsize=$rsize $EXPORT $MNTDIR

 mntedrsize=$(cat /proc/mounts | grep $MNTDIR | grep -oE "rsize=[0-9]{4,6}" | grep -oE "[0-9]{4,6}")

 echo $MNTDIR mounted @ rsize \($((mntedrsize/1024))K\), requested rsize \($((rsize/1024))K\)

 dd if=$MNTDIR/$TESTFILE of=/dev/null | grep "copied"

 echo
 
 umount $MNTDIR
 done
Thats the result for a file with the size of 34Mb:
SpoilerShow
Testing transfer speed of on file 192.168.0.100:/volume1/Samsung-Aufnahme/ddfile

/dtv/test mounted @ rsize (8K), requested rsize (8K)
65536+0 records in
65536+0 records out
33554432 bytes (34 MB) copied, 3.28606 s, 10.2 MB/s

/dtv/test mounted @ rsize (16K), requested rsize (16K)
65536+0 records in
65536+0 records out
33554432 bytes (34 MB) copied, 2.89164 s, 11.6 MB/s

/dtv/test mounted @ rsize (32K), requested rsize (32K)
65536+0 records in
65536+0 records out
33554432 bytes (34 MB) copied, 2.90259 s, 11.6 MB/s

/dtv/test mounted @ rsize (64K), requested rsize (64K)
65536+0 records in
65536+0 records out
33554432 bytes (34 MB) copied, 2.8785 s, 11.7 MB/s
And this the result of the Test with file size 134MB:
SpoilerShow
Testing transfer speed of on file 192.168.0.100:/volume1/Samsung-Aufnahme/ddfile

/dtv/test mounted @ rsize (8K), requested rsize (8K)
262144+0 records in
262144+0 records out
134217728 bytes (134 MB) copied, 13.9103 s, 9.6 MB/s

/dtv/test mounted @ rsize (16K), requested rsize (16K)
262144+0 records in
262144+0 records out
134217728 bytes (134 MB) copied, 12.7319 s, 10.5 MB/s

/dtv/test mounted @ rsize (32K), requested rsize (32K)
262144+0 records in
262144+0 records out
134217728 bytes (134 MB) copied, 11.8821 s, 11.3 MB/s

/dtv/test mounted @ rsize (64K), requested rsize (64K)
262144+0 records in
262144+0 records out
134217728 bytes (134 MB) copied, 11.8775 s, 11.3 MB/s
Tests with the udp protocol went too long. udp is therefore not an option.

To write a 1GB-File on the mounted folder the speed was at 10.2 Mb/s
SpoilerShow
root@(none) init.d $ dd if=/dev/zero of=/dtv/test/ddfile bs=1M count=1028
1028+0 records in
1028+0 records out
1077936128 bytes (1.1 GB) copied, 106.152 s, 10.2 MB/s
This is the /bin/busybox mount output after loading my edited vusb.init
SpoilerShow
root@(none) init.d $ /bin/busybox mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /dev/shm type tmpfs (rw,relatime)
tmpfs on /dtv type tmpfs (rw,relatime,size=40960k)
tmpfs on /tmp type tmpfs (rw,relatime,size=36864k)
tmpfs on /freesia type tmpfs (rw,relatime,size=2048k)
tmpfs on /core type tmpfs (rw,relatime,size=30720k)
none on /sys/kernel/security type securityfs (rw,relatime)
/dev/mmcblk0p19 on /mtd_uncompexe type emmcfs (ro,relatime)
none on /sys/fs/cgroup type cgroup (rw,relatime,cpu)
/dev/mmcblk0p17 on /mtd_exe type squashfs (ro,relatime)
/dev/mmcblk0p16 on /mtd_rwarea type emmcfs (rw,relatime)
/dev/mmcblk0p14 on /mtd_drmregion_a type emmcfs (rw,relatime)
/dev/mmcblk0p15 on /mtd_drmregion_b type emmcfs (rw,relatime)
/dev/mmcblk0p21 on /mtd_rocommon type squashfs (ro,noexec,relatime)
/dev/mmcblk0p24 on /mtd_contents type emmcfs (rw,relatime)
none on /proc/bus/usb type usbfs (rw,relatime)
/dev/mmcblk0p26 on /mtd_rwcommon type emmcfs (rw,relatime)
/dev/mmcblk0p23 on /mtd_emanual type emmcfs (rw,relatime)
/dev/mmcblk0p25 on /mtd_swu type emmcfs (rw,relatime)
/dev/loop0 on /mtd_rwcommon/widgets/manager/10130000000 type squashfs (ro,noexec,relatime)
/dev/sda1 on /dtv/usb/sda1 type vfat (rw,dirsync,noexec,noatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=utf8,shortname=mixed,usefree,flush,errors=continue)
/tmp/loopnone on /mnt type ext4 (rw,sync,relatime,user_xattr,barrier=1,data=ordered)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
/dev/mmcblk0p16 on /etc/profile type emmcfs (rw,relatime)
/dev/mmcblk0p16 on /etc/passwd type emmcfs (rw,relatime)
/dtv/loop4 on /mtd_rwcommon/widgets/normal/111199001564 type squashfs (ro,relatime)
192.168.0.100:/volume1/Samsung-Aufnahme/ on /dtv/test type nfs (rw,relatime,vers=3,rsize=65536,wsize=65536,namlen=1020,soft,nolock,proto=tcp,port=65535,timeo=70,retrans=3,sec=sys,local_lock=all,addr=192.168.0.100)
/dev/sdb on /dtv/usb/sdb type ext4 (rw,relatime,user_xattr,barrier=0,data=ordered)
Unfortunately, even after optimizing the rsize parameter, the reading speed is too low.
It is 0.9 Mbps, measured during the performance test of Samsung.
UE46F6470 with T-MST12DEUC @ 2105.0
SamyGo working :D

User avatar
beatfreak
SamyGO Project Donor
Posts: 588
Joined: Tue Aug 23, 2011 9:03 am
Location: Hamburg
Contact:

Re: Record PVR to NAS (NFS)

Post by beatfreak »

your test script only altered rsize which is for reading, when recording its more about writing -> wsize

as you can see in mount output your mount is still done with rsize and wsize of 65536

the test-script for writing should look like this
SpoilerShow

Code: Select all

    #!/bin/ash
    EXPORT="192.168.0.100:/volume1/Samsung-Aufnahme"
    MNTDIR="/dtv/test"
    TESTFILE="ddfile"

    echo "Testing transfer speed of $NFSPROTO on file $EXPORT/$TESTFILE"
     echo

     for wsize in 8192 16384 32768 65536
     do
     if mount | grep $MNTDIR > /dev/null; then
       umount $MNTDIR
     fi

     /bin/busybox mount -t nfs -o rw,soft,tcp,nolock,async,wsize=$wsize $EXPORT $MNTDIR

     mntedwsize=$(cat /proc/mounts | grep $MNTDIR | grep -oE "rsize=[0-9]{4,6}" | grep -oE "[0-9]{4,6}")

     echo $MNTDIR mounted @ wsize \($((mntedwsize/1024))K\), requested rsize \($((wsize/1024))K\)

     dd if=/dev/null of=$MNTDIR/$TESTFILE bs=1M count=512 | grep "copied"

     echo
     
     umount $MNTDIR
     done
for a 512MB testfile
//UE40C6500 @ T-VALDEUC 3011 // rooted manual HotelMode style // PVR to NFS via 18MB on-the-fly sparse XFS //
FYI: you can close your ssh session with SamyGO with

Code: Select all

~.
If you can't fix it using dvct tape, you are not using enough dvct tape.

Joejoe
SamyGO Project Donor
Posts: 55
Joined: Thu Dec 26, 2013 11:47 pm

Re: Record PVR to NAS (NFS)

Post by Joejoe »

I'll give you right. However, the TV criticizes the reading speed. (You'll see it in the appendix)

Here's the right write-speed-test-script: (not /dev/null instead /dev/zero, also grep -oE "wsize=[0-9]{4,6}")
SpoilerShow

Code: Select all

#!/bin/ash
EXPORT="192.168.0.100:/volume1/Samsung-Aufnahme"
MNTDIR="/dtv/test"
TESTFILE="ddfile"

echo "Testing transfer speed of $NFSPROTO on file $EXPORT/$TESTFILE"
 echo

 for wsize in 8192 16384 32768 65536
 do
 if mount | grep $MNTDIR > /dev/null; then
   umount $MNTDIR
 fi

 /bin/busybox mount -t nfs -o rw,soft,tcp,nolock,async,wsize=$wsize $EXPORT $MNTDIR

 mntedwsize=$(cat /proc/mounts | grep $MNTDIR | grep -oE "wsize=[0-9]{4,6}" | grep -oE "[0-9]{4,6}")

 echo $MNTDIR mounted @ wsize \($((mntedwsize/1024))K\), requested wsize \($((wsize/1024))K\)

 dd if=/dev/zero of=$MNTDIR/$TESTFILE bs=1M count=512 | grep "copied"

 echo
 
 umount $MNTDIR
 done
And here's the result:
SpoilerShow

Code: Select all

Testing transfer speed of  on file 192.168.0.100:/volume1/Samsung-Aufnahme/ddfile

/dtv/test mounted @ wsize (8K), requested wsize (8K)
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 63.2476 s, 8.5 MB/s

/dtv/test mounted @ wsize (16K), requested wsize (16K)
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 53.679 s, 10.0 MB/s

/dtv/test mounted @ wsize (32K), requested wsize (32K)
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 51.4498 s, 10.4 MB/s

/dtv/test mounted @ wsize (64K), requested wsize (64K)
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 50.4124 s, 10.6 MB/s
So it should be enough speed available or?
You do not have the required permissions to view the files attached to this post.
UE46F6470 with T-MST12DEUC @ 2105.0
SamyGo working :D

User avatar
bugficks
Official SamyGO Developer
Posts: 1062
Joined: Tue Jun 25, 2013 3:56 pm

Re: Record PVR to NAS (NFS)

Post by bugficks »

try /viewtopic.php?f=70&t=6566. iirc i ve patched that speed requirement check

Joejoe
SamyGO Project Donor
Posts: 55
Joined: Thu Dec 26, 2013 11:47 pm

Re: Record PVR to NAS (NFS)

Post by Joejoe »

The link is corrupt. I can't access the thread / forum. :roll:
UE46F6470 with T-MST12DEUC @ 2105.0
SamyGo working :D

User avatar
bugficks
Official SamyGO Developer
Posts: 1062
Joined: Tue Jun 25, 2013 3:56 pm

Re: Record PVR to NAS (NFS)

Post by bugficks »

seems like you dont have access to:)
well you can try pvrdecoder->tools-pvranydev or smth like that. lordbyte added it afaik.

Post Reply

Return to “[F] Support”