Play videos from XFS partition, bind XFS into virtual USB

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

unawave
Posts: 11
Joined: Sun Feb 05, 2012 6:39 pm

Play videos from XFS partition, bind XFS into virtual USB

Post by unawave »

Can somebody explain me (linux novice) how to integrate a script into the "SamyGo" initialising process ?

Initial situation:
  • I can't play videos from a XFS partition (Samsung TV doesn't allow this)
  • I can't store videos from my PC via LAN into a NTFS partition (NTFS is read only)
Previous solution:
  • unplug hard disk from Samsung TV
  • plug it to PC
  • copy videos to a NTFS partition
  • plug it to Samsung TV
  • play videos on Samsung TV from NTFS partition
But this is over-elaborate.
I want to play videos direct from XFS partition. Because I can copy videos via LAN direct to XFS partition and don't need to unplug hard disk.

New solution:
  1. Create folder in XFS partition; e.g. "Films"
  2. Fill folder "Films" via LAN with videos
  3. Create folder in "virtual USB partition"; e.g. "Videos"
    Via "Webshell": bind "Films" into "Videos"

    Code: Select all

    mount --bind /dtv/usb/sda1/Films /dtv/usb/sdb/Videos
    (sda1 = XFS partition, sdb = virtual USB partition)
  4. Play videos on Samsung TV by access of "virtual USB partition"
Can somebody explain me (linux novice) how to integrate this script into the "SamyGo" initialising process (after "virtual USB partition" initialising) ?

Code: Select all

mkdir /dtv/usb/sdb/Films
mount --bind /dtv/usb/sda1/Films /dtv/usb/sdb/Videos
Samsung UE37D6500, Glasses: SSG-3050
User avatar
juusso
SamyGO Moderator
Posts: 10129
Joined: Sun Mar 07, 2010 6:20 pm

Re: Play videos from XFS partition, bind XFS into virtual US

Post by juusso »

Hi,
it`s really simply:
you can add your script over ftp to

Code: Select all

/mtd_rwcommon/widget/user/SamyGO/SamyGO/etc/init.d/
and this will be started at TV power up. Just check how other scripts look like, make it is same way, rename to 04_09_xfs_mount.init (or whatever you want, like: xx_xx_your_script.init ...)

This is the script structure you should use:

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: 04_09_xfs_mount.init * 2012-02-06 10:45:15Z arris69 $
#
# TODO: more sysv style, more error handling
#
. /dtv/SGO.env

case $1 in 
    start)
#here is your code for script start - all commands what you use for mount xfs...
		;;
    stop)
#here is your code for script stop - might umount? :)
			;;
    status)
		;;
    *)
    echo "Usage: $0 {start|stop}" 1>&2
    exit 0
    ;;
esac 
LE40B653T5W,UE40D6750,UE65Q8C
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]

DO NOT EVER INSTALL FIRMWARE UPGRADE
unawave
Posts: 11
Joined: Sun Feb 05, 2012 6:39 pm

Re: Play videos from XFS partition, bind XFS into virtual US

Post by unawave »

Thank you - this works perfect.

Problem was that the command

Code: Select all

mkdir /dtv/usb/sdb/Films
nearly needs 4 minutes till folder "Films" show up on Samsung TV in virtual USB.
So I have made many tests with different syntax like

Code: Select all

mkdir "/dtv/usb/sdb/Films"
(with quotation marks) till I recognized that the originally code works correctly.

File name: 95_05_mount_XFS_into_virtual_USB.init

Code: Select all

#!/bin/sh
#
#       donated for the SamyGo Project
#
#       Version: SamyGO svn $Id$

. /dtv/SGO.env
case $1 in 
	start)
		mkdir /dtv/usb/sdb/Films
		mount --bind /dtv/usb/sda1/Videos /dtv/usb/sdb/Films
		;;
	stop)
		umount /dtv/usb/sdb/Films
		;;
	status)
	;;
	*)
	echo "Usage: $0 {start|stop}" 1>&2
	exit 0
	;;
esac
Samsung UE37D6500, Glasses: SSG-3050
unawave
Posts: 11
Joined: Sun Feb 05, 2012 6:39 pm

Re: Play videos from XFS partition, bind XFS into virtual US

Post by unawave »

Problem is when I plugin an additional USB stick or additional hard drive with pictures or movies from a friend.

Exampel:
"Usually," I have only one hard disk with 3 partitions connected (XFS, NTFS, FAT32).

Then the partitions are assigned:
  • sda1=XFS
  • sda2=NTFS
  • sda3=FAT32
  • sdb=virtual USB
When I plugin a USB stick with two partitions while the Samsung is running, these two assignments added:
  • sdc1=1. USB-Stick Partition
  • sdc2=2. USB-Stick Partition
But after a restart - with plugged USB stick - it looks like this:
  • sda1=1. USB-Stick Partition
  • sda2=2. USB-Stick Partition
  • sdb1=XFS
  • sdb2=NTFS
  • sdb3=FAT32
  • sdc=virtual USB
Since then no assignment agrees more with the script: It shifts both the assignment of the XFS partition and the assignment of virtual USB.
Samsung UE37D6500, Glasses: SSG-3050
User avatar
juusso
SamyGO Moderator
Posts: 10129
Joined: Sun Mar 07, 2010 6:20 pm

Re: Play videos from XFS partition, bind XFS into virtual US

Post by juusso »

why dont you add some filesystem checking routines like

Code: Select all

/bin/mount | grep "type" | grep - c "xfs" 
and so on (just example, not true code...)
LE40B653T5W,UE40D6750,UE65Q8C
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]

DO NOT EVER INSTALL FIRMWARE UPGRADE
unawave
Posts: 11
Joined: Sun Feb 05, 2012 6:39 pm

Re: Play videos from XFS partition, bind XFS into virtual US

Post by unawave »

juuso wrote:why dont you add some filesystem checking routines like

Code: Select all

/bin/mount | grep "type" | grep - c "xfs" 
and so on (just example, not true code...)
I can't, because:
unawave wrote:Can somebody explain me (linux novice) ...
Samsung UE37D6500, Glasses: SSG-3050
HeMeZ
Posts: 20
Joined: Wed Feb 08, 2012 7:47 pm

Re: Play videos from XFS partition, bind XFS into virtual US

Post by HeMeZ »

Btw that was my idea 8-) :mrgreen:

And here comes the realization:

Code: Select all

    #!/bin/sh
    #
    # Copyright info needed?
    # Version info needed?
    #
    . /dtv/SGO.env

    case $1 in
        start)
    		for i in $(busybox mount | grep xfs | awk '{print $3}') ; do     #for all xfs partitions (check for multiple starts needed?)
		 		mkdir ${MOUNT_PATH}/$(busybox basename $i)	      #creates a directory on virt. USB using partition name (check if exists needed?)
		 		mount --bind $i ${MOUNT_PATH}/$(busybox basename $i)	    #mount XFS partition in this directory
		done
          ;;
        stop)
        #sometimes doesn't work: device busy
      		 for i in $(busybox mount | grep xfs | awk '{print $3}' | grep ${MOUNT_PATH}) ; do                
		 					umount $i
		 					busybox rmdir $i		  		 					
					 done					
             ;;
        status)
        	echo $(busybox mount | grep xfs | awk '{print $3}' | grep ${MOUNT_PATH})
          ;;
        *)
        echo "Usage: $0 {start|stop}" 1>&2
        exit 0
        ;;
    esac 
    
(had to remove urls)

Works for me (UE46D7090), however it would be nice if sb could doublecheck the code. :roll:
Maybe the script could be included in the next SamyGo release? ;)

BTW: directory listing/updating is pretty slow on virt USB, any possibility to improve speed? does disabling nfs/smb-client help?
unawave
Posts: 11
Joined: Sun Feb 05, 2012 6:39 pm

Re: Play videos from XFS partition, bind XFS into virtual US

Post by unawave »

HeMeZ wrote:Works for me (UE46D7090), however it would be nice if sb could doublecheck the code.
Thank you - works for me (UE37D6500). Even if the device assignment shifted by additional plugged USB sticks.
Samsung UE37D6500, Glasses: SSG-3050
Xorandor
Posts: 6
Joined: Mon Aug 27, 2012 8:20 am

Re: Play videos from XFS partition, bind XFS into virtual US

Post by Xorandor »

HeMeZ wrote:Btw that was my idea 8-) :mrgreen:

And here comes the realization:

Code: Select all

    #!/bin/sh
    #
    # Copyright info needed?
    # Version info needed?
    #
    . /dtv/SGO.env

    case $1 in
        start)
    		for i in $(busybox mount | grep xfs | awk '{print $3}') ; do     #for all xfs partitions (check for multiple starts needed?)
		 		mkdir ${MOUNT_PATH}/$(busybox basename $i)	      #creates a directory on virt. USB using partition name (check if exists needed?)
		 		mount --bind $i ${MOUNT_PATH}/$(busybox basename $i)	    #mount XFS partition in this directory
		done
          ;;
        stop)
        #sometimes doesn't work: device busy
      		 for i in $(busybox mount | grep xfs | awk '{print $3}' | grep ${MOUNT_PATH}) ; do                
		 					umount $i
		 					busybox rmdir $i		  		 					
					 done					
             ;;
        status)
        	echo $(busybox mount | grep xfs | awk '{print $3}' | grep ${MOUNT_PATH})
          ;;
        *)
        echo "Usage: $0 {start|stop}" 1>&2
        exit 0
        ;;
    esac 
    
(had to remove urls)

Works for me (UE46D7090), however it would be nice if sb could doublecheck the code. :roll:
Maybe the script could be included in the next SamyGo release? ;)

BTW: directory listing/updating is pretty slow on virt USB, any possibility to improve speed? does disabling nfs/smb-client help?

This script work for me too. I have an UE46D5500.
An issue is that I must wait almost 4 minutes after SamyGo launched till XFS Partition item (and fusesmb and smb items) in the list of SamyGO Virt. menu are showed.
Why must I so long wait? There sleep any process?

When once items in VirtUSB loaded, browsing is finally fast.

Ciao
User avatar
brunogts77
Posts: 768
Joined: Sat Feb 18, 2012 8:34 pm

Re: Play videos from XFS partition, bind XFS into virtual US

Post by brunogts77 »

in my d5700, don?t work.

Code: Select all

/mtd_down/widgets/user/SamyGO/SamyGO/etc/init.d/95_05_mount_XFS_into_virtual_USB.init: line 6: 
: Invalid argument
+ . /dtv/SGO.env
/mtd_down/widgets/user/SamyGO/SamyGO/etc/init.d/95_05_mount_XFS_into_virtual_USB.init: .: line 7: can't open '/dtv/SGO.env
'

Any sugestion?
UE42F5570 T-MST12DEUC_1119] [OTN=OFF] [OSCAM=ON]
UE55JU6870 T-HKMDEUC-1480 [OSCAM=ON]

Post Reply

Return to “[D] Support”