PVR Recording over NFS for C-Series


From SamyGO
Revision as of 18:05, 27 July 2011 by Erdem ua (talk | contribs) (Fixed old forums links.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Introduction

This has been tested on C-Model UE46C6500UP.

Original forum post: SamyGo Extension Pack modified for NFS recording

Some init script (/etc/init.d) of the SamyGO Extensions Pack has been modified to support PVR recording over NFS share and to support multiple fixed NFS share from different servers.

Features

  • Support for multiple fixed NFS server with multiple share
  • Support for PVR recording over dedicated NFS share
  • Logging on file (for the moment only for the recording part, for debugging purpose)

Bugs and limitations

  • Extension Pack must be run from a USB stick of at least 2GB size (because it must contain a XFS File System image file). Probably it's possible to run from the internal flash of the TV, however the stick is needed for the FS image file (1.5GB minimum for recording). This require other script modification.
  • This mod. has been tested only over NFS share on Linux machines. Probably works also over NFS on Windows. Feel free to try.

Requirements

Modifications from the original version

  • Based on SamyGO Extension Pack v0.03.6-r12-for-T-VALDEUC
  • Script 02_04_vusb.init : support for a second virtual usb device for recording (if XFS image exist on the USB stick and image size is >= 1.5GB)
  • Script 03_03_nfsmount.init: support for multiple fixed NFS server
  • Script 80_80_record_to_nwshare.init: completely rewritten
  • Script rcsGO: modified to include log file path in /dtv/SGO.env

Installation

  1. Make sure you have configured correctly your NFS servers and shares and no network problem exist between servers and TV. For recording, write permission on the dedicated share is needed by the TV. I suggest the following entry in exports file:

    <MEDIA SHARED FOLDER> <TV HOSTNAME or IP>(rw,async,no_subtree_check,root_squash,anonuid=<USER ID>,anongid=<GROUP ID>)
    <RECORD SHARED FOLDER> <TV HOSTNAME or IP>(rw,async,no_subtree_check,root_squash,anonuid=<USER ID>,anongid=<GROUP ID>)

    • USER ID and GROUP ID must match a user/group with write permission on the SHARED FOLDER
    • For recording <RECORD SHARED FOLDER> entry may be on a different exports file of a different NFS server.
  2. Move to your Linux machine ;)
  3. Format the USB stick (single partition, FAT32 FS)
  4. Explode the SamyGO Extension Pack v0.03.6-r12-for-T-VALDEUC.zip file on the USB stick and configure it as usual (see:SamyGO_Extensions_Pack#General_usage)
  5. From the 1083 revision page download the files:
  6. Copy downloaded rcSGO file on the USB key into the SamyGO folder (replace the original one)
  7. Copy downloaded 02_04_vusb.init.remi71 file on the USB key into the SamyGO/etc/init.d folder (rename as 02_04_vusb.init and replace the original one)
  8. Copy downloaded 03_03_nfsmount.init.remi71 file on the USB key into the SamyGO/etc/init.d folder (rename as 03_03_nfsmount.init and replace the original one)
  9. Copy downloaded 80_80_record_to_nwshare.init.remi71 file on the USB key into the SamyGO/etc/init.d folder (rename as 80_80_record_to_nwshare.init and replace the original one)
  10. Under the SamyGO folder create the XFS file image with the following command (make sure you have support tools for XFS FS --> package xfsprogs under Ubuntu):
    mkfs.xfs -f -d file,name=pvrimage,size=1536m
    • Ignore error message like:
    existing superblock read failed: Inappropriate ioctl for device
  11. Mount the image:
    mount -t xfs -o loop pvrimage <MOUNT POINT>
  12. Create the empty file .PlaceHolderDO-NOT-REMOVE:
    touch <MOUNT POINT>/.PlaceHolderDO-NOT-REMOVE
    • This file must be never removed!
  13. Edit the file etc/init.d/03_03_nfsmount.init and modify the following parameters:
    SHARE_1='<SERVER NAME or IP>:<SHARE>'
    SHARE_2='<SERVER NAME or IP>:<SHARE>'
    ..
    ..
    SHARE_n='<SERVER NAME or IP>:<SHARE>'
    • Example:
    SHARE_1='mediaserver01.shareskills.org:/home/remi/localdata/media'
    SHARE_2='fileserver01.shareskills.org:/var/landata/photo'
  14. Edit the file etc/init.d/80_80_record_to_nwshare.init and modify the following parameters:
    # Remote NFS fileserver for recording
    PVRSERVER='<SERVER NAME or IP>'
    # Remote NFS share for recording
    PVRPATH='<SHARE>'
    # Number of second to wait for pvrimage mount point to be ready.
    # If you experience problem like "No virtual device found ready for PVR or already mounted" message in samygo.log then try to increase this.
    WAIT=25
  15. Turn off your TV, insert the USB stick and power on. Wait for 35-40sec then connect via SSH
  16. Verify NFS mount via df -h command. Verify also the log file /dtv/usb/sda1/SamyGO/samygo.log


If all is ok, from your TV go under Media: you must see two additional device named SamyGo Virt. USB: one is for media NFS share and one for recording. Select one whose size is 1.5GB (corresponding to the XFS image size) and try record: the recording must begin with no error message. If a message appear that say "Format USB device" do not proceed because something went wrong.

NOTE: Although the media screen report that the SamyGo Virt. USB device for recording is 1.5GB, don't worry because the NFS share is remounted into the original mount point of the XFS image so the real size is the free space on your server.

Performance issue

Performance of the USB stick it's not so important, because the NFS share is re-mounted into the mount point of the XFS image, so the real device to record to is the NFS share over network. If you have slow performance problem during recording check:

  • Network link (speed, full/half duplex). 100MBit FD through a good switch like 3COM or HP is recommended.
  • Use of a real Linux server with the NFS Kernel server (more fast and reliable than user-space NFS servers) is recommended. I have not tested Pre-build NAS: I prefer build it by myself so i can fine tune each parameter.
  • Very important is the server parameters for share exports. My /etc/exports settings are:
    rw,async,no_subtree_check,root_squash,anonuid=1000,anongid=1000
    The most important is the "async" option: allows the NFS server to violate the NFS protocol and reply to requests before any changes made by that request have been committed to stable storage (e.g. disc drive). Using this option usually improves performance, but at the cost that an unclean server restart (i.e. a crash) can cause data to be lost or corrupted.
  • A fast disk array is also very important: my little media server is an old PIV with 1.2GB of RAM but with a fast RAID0 SATA disk array --> 700Mbit/sec

--Remi71 23:55, 26 January 2011 (UTC)