[SOLVED] Guide to record to a network share for H series?

General Forum talking area for H series TVs.

mad_ady
SamyGO Project Donor
Posts: 268
Joined: Sun May 03, 2015 10:42 am

Re: Guide to record to a network share for H series?

Post by mad_ady »

Will do, thanks!
H6400, firmware 2602.2 downgraded to 2130
mad_ady
SamyGO Project Donor
Posts: 268
Joined: Sun May 03, 2015 10:42 am

Re: Guide to record to a network share for H series?

Post by mad_ady »

Sorry, I haven't had time to experiment lately, so I'm short on progress.

I tried something today - I dd'ed the first 32MB from my recording stick to a 32MB SD card I had laying around, in hopes that the filesystem would be tricked to work (go beyond the disk limit). On a linux laptop I am unable to mount the truncated filesystem:

Code: Select all

[  262.928685] usb 1-2: new high-speed USB device number 4 using xhci_hcd
[  263.059127] usb 1-2: New USB device found, idVendor=058f, idProduct=6335
[  263.059133] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  263.059136] usb 1-2: Product: Mass Storage Device
[  263.059139] usb 1-2: Manufacturer: Generic
[  263.059142] usb 1-2: SerialNumber: 058F011111B1
[  263.059798] usb-storage 1-2:1.0: USB Mass Storage device detected
[  263.060058] scsi host6: usb-storage 1-2:1.0
[  264.058182] scsi 6:0:0:0: Direct-Access     SD/MMC   Card  Reader     1.00 PQ: 0 ANSI: 0
[  264.058737] sd 6:0:0:0: Attached scsi generic sg2 type 0
[  264.397827] usb 1-2: reset high-speed USB device number 4 using xhci_hcd
[  264.864165] sd 6:0:0:0: [sdb] 60800 512-byte logical blocks: (31.1 MB/29.6 MiB)
[  264.865874] sd 6:0:0:0: [sdb] Write Protect is off
[  264.865886] sd 6:0:0:0: [sdb] Mode Sense: 03 00 00 00
[  264.867527] sd 6:0:0:0: [sdb] No Caching mode page found
[  264.867536] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[  264.878957]  sdb: sdb1
[  264.878970] sdb: p1 size 15804416 extends beyond EOD, enabling native capacity
[  264.888495]  sdb: sdb1
[  264.888506] sdb: p1 size 15804416 extends beyond EOD, truncated
[  264.897676] sd 6:0:0:0: [sdb] Attached SCSI removable disk
[  270.577939] EXT4-fs (sdb1): bad geometry: block count 1975552 exceeds size of device (7344 blocks)
I will try with a new filesystem limited to 32MB and see if I can convince the TV that it's good enough... Will report back with the results

Edit:

Can anyone tell me their blkid for their PVR partition? I wonder if it's hardcoded or important:

Code: Select all

# blkid | grep sdb1
/dev/sdb1: UUID="605c25c3-6dbc-46d8-852a-c8a7bdf5b65c" TYPE="ext4"
H6400, firmware 2602.2 downgraded to 2130
sectroyer
Official SamyGO Developer
Posts: 6305
Joined: Wed May 04, 2011 5:10 pm

Re: Guide to record to a network share for H series?

Post by sectroyer »

Here, different :)
I do NOT support "latest fw" at ALL. If you have one you should block updates on router and wait for it to STOP being "latest":)
If you want me to help you please paste FULL log(s) to "spoiler"/"code" bbcodes or provide link(s) to pasted file(s) on https://pastebin.com Otherwise "NO HELP"!!!
If you want root DISABLE internet access to your device!!!!
DO NOT EVER INSTALL FIRMWARE UPGRADE !!!!
mad_ady
SamyGO Project Donor
Posts: 268
Joined: Sun May 03, 2015 10:42 am

Re: Guide to record to a network share for H series?

Post by mad_ady »

Thanks for the feedback!

I tried dd-ing on a different target stick (2GB), but ext4 still doesn't want to mount:

Code: Select all

root@stingray:/media/adrianp# mount -t ext4 /dev/sdc1 /media/frost/
mount: wrong fs type, bad option, bad superblock on /dev/sdc1,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
root@stingray:/media/adrianp# dmesg | tail -20
[ 2682.711325] usb 3-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2682.711328] usb 3-1.2: Product: CBM             
[ 2682.711331] usb 3-1.2: Manufacturer:         
[ 2682.711334] usb 3-1.2: SerialNumber: 0115070058513103
[ 2682.711804] usb-storage 3-1.2:1.0: USB Mass Storage device detected
[ 2682.711967] scsi host20: usb-storage 3-1.2:1.0
[ 2683.711843] scsi 20:0:0:0: Direct-Access              CBM              5.00 PQ: 0 ANSI: 2
[ 2683.712568] sd 20:0:0:0: Attached scsi generic sg2 type 0
[ 2683.713048] sd 20:0:0:0: [sdc] 4125696 512-byte logical blocks: (2.11 GB/1.96 GiB)
[ 2683.713756] sd 20:0:0:0: [sdc] Write Protect is off
[ 2683.713760] sd 20:0:0:0: [sdc] Mode Sense: 0b 00 00 08
[ 2683.714505] sd 20:0:0:0: [sdc] No Caching mode page found
[ 2683.714509] sd 20:0:0:0: [sdc] Assuming drive cache: write through
[ 2683.719897]  sdc: sdc1
[ 2683.719906] sdc: p1 size 15804416 extends beyond EOD, enabling native capacity
[ 2683.723930]  sdc: sdc1
[ 2683.723937] sdc: p1 size 15804416 extends beyond EOD, truncated
[ 2683.726881] sd 20:0:0:0: [sdc] Attached SCSI removable disk
[ 2687.319463] EXT4-fs (sdc1): bad geometry: block count 1975552 exceeds size of device (515456 blocks)
[ 2730.193919] EXT4-fs (sdc1): bad geometry: block count 1975552 exceeds size of device (515456 blocks)
So, truncating an ext4 filesystem will not work. This means that lying about USB capacity will not work. I'll do a couple more tests with disks of a lower capacity and see if the TV complains (much) about them.
H6400, firmware 2602.2 downgraded to 2130
mad_ady
SamyGO Project Donor
Posts: 268
Joined: Sun May 03, 2015 10:42 am

Re: Guide to record to a network share for H series?

Post by mad_ady »

Update: I've ran a couple more tests with USB drives:

1. A 32MB SD card formatted ext4 and having an identical filesystem to a working stick (the same files, the same permissions, the same UUID) - is not seen as a PVR device. When I try to record anything it says it needs to format a PVR device and displays only the root device. The SD card is not seen in the OSD, but it's mounted correctly and I can see it via ssh. Most likely PVR devices need to have a minimum size.

2. I took a 2GB stick and formatted it in the TV as a PVR device. I did a small recording. Used SSH, deleted the CONTENTS folder and created a symlink to my NFS share. (Before I copied CONTENTS/NewBoard.ss to my CONTENTS folder on the NFS share). Recording to network share worked correctly.

3. I tried to use the 2GB stick with the dd'ed filesystem from my 8GB PVR device. The TV complained that the filesystem was corrupt and offered to fix it. However it showed disk capacity as 0kb, and it didn't manage to fix anything.

I will try with a 1GB stick, but I expect it to work...
H6400, firmware 2602.2 downgraded to 2130
gogo
SamyGO Project Donor
Posts: 185
Joined: Sat May 17, 2014 9:24 am
Location: Croatia

Re: Guide to record to a network share for H series?

Post by gogo »

mad_ady wrote:Update: I've ran a couple more tests with USB drives:

1. A 32MB SD card formatted ext4 and having an identical filesystem to a working stick (the same files, the same permissions, the same UUID) - is not seen as a PVR device. When I try to record anything it says it needs to format a PVR device and displays only the root device. The SD card is not seen in the OSD, but it's mounted correctly and I can see it via ssh. Most likely PVR devices need to have a minimum size.

2. I took a 2GB stick and formatted it in the TV as a PVR device. I did a small recording. Used SSH, deleted the CONTENTS folder and created a symlink to my NFS share. (Before I copied CONTENTS/NewBoard.ss to my CONTENTS folder on the NFS share). Recording to network share worked correctly.

3. I tried to use the 2GB stick with the dd'ed filesystem from my 8GB PVR device. The TV complained that the filesystem was corrupt and offered to fix it. However it showed disk capacity as 0kb, and it didn't manage to fix anything.

I will try with a 1GB stick, but I expect it to work...
I'm trying to set this for ages.
Can you at least publish here your scripts, to see how you setup this.
I only managed to start NFS on this way https://forum.samygo.tv/viewtopic.php?f ... =10#p50147
Script is started without error, but it won't record anything, some warning about not enough free space
Samsung TV: UE46F6500
mad_ady
SamyGO Project Donor
Posts: 268
Joined: Sun May 03, 2015 10:42 am

Re: Guide to record to a network share for H series?

Post by mad_ady »

Sorry I haven't had time to publish anything because I haven't had time to write the scripts. But here are instructions to do it manually:
1. You must prepare and dedicate a USB stick larger than 2GB for media recording. Format it in the TV and record something as a test. Disks lower than 2GB are not supported by the TV (it complains it's too small), unfortunately. I'm sure somebody like zoelechat can remove that limit. Reboot the TV after doing a recording.
2. Set up your NFS share as usual (edit /mnt/etc/init.d/03_03_nfsmount.init) and make sure you can access those shares from the TV (e.g. play a video from a share). Prepare a directory or a share where you want to save your recordings
3. Log in via telnet/ssh into your TV and identify which is your mount point for the recording stick. You should see two directories CONTENTS and lost+found under a directory in /dtv/usb. Run the command below to find it:

Code: Select all

find /dtv/usb -maxdepth 2 -name CONTENTS
In my case I get this output: /dtv/usb/sdb1/CONTENTS, so the recording stick is sdb1.
4. Rename the CONTENTS directory to CONTENTS.old

Code: Select all

mv /dtv/usb/sdb1/CONTENTS /dtv/usb/sdb1/CONTENTS.old
5. Assuming that the target where you want to record to is located at this path: /dtv/usb/sdc/nfs/192.168.1.5/TVRecordings/CONTENTS, and that this path exists you will need to create a symlink from your recording stick to this new directory

Code: Select all

ln -s /dtv/usb/sdc/nfs/192.168.1.5/TVRecordings/CONTENTS/ /dtv/usb/sdb1/CONTENTS
6. Move over the data from the old CONTENTS.old directory to CONTENTS symlink

Code: Select all

mv /dtv/usb/sdb1/CONTENTS.old/* /dtv/usb/sdb1/CONTENTS/
At this point your new recordings should go directly to your NAS.

The only problem I noticed is that from time to time the TV will say it doesn't have a recording device and you need to redo this whole procedure again.
Let us know if it works for you as well.
H6400, firmware 2602.2 downgraded to 2130
mad_ady
SamyGO Project Donor
Posts: 268
Joined: Sun May 03, 2015 10:42 am

Re: Guide to record to a network share for H series?

Post by mad_ady »

Sorry guys, it's been too long. I kept putting this off, but now I created a startup script that should move your recordings from USB to a network share and set up the symlink as needed.
You need to edit it and set your network recording path (example inside). The code is here: https://github.com/mad-ady/samygo-network-recording, patches and feedback welcome.

You need to edit the file and set the correct path to your share (here is a nfs example, but you can use samba as well):

Code: Select all

NETWORKSHARE=/dtv/usb/sdc/nfs/192.168.1.5/TVRecordings/CONTENTS/
To install it, copy the file to /mnt/etc/init.d/, and make it executable (run it via telnet/ssh on the TV):

Code: Select all

curl -k https://raw.githubusercontent.com/mad-ady/samygo-network-recording/master/99_99_NetworkRecording.init > /mnt/etc/init.d/99_99_NetworkRecording.init 
chmod a+x /mnt/etc/init.d/99_99_NetworkRecording.init
After making the needed changes you should run it manually so that it migrates your existing recordings to the network share:

Code: Select all

/mnt/etc/init.d/99_99_NetworkRecording.init start
Log goes to /dtv/networkrecording.log

Let me know if there are problems and also paste the log.
H6400, firmware 2602.2 downgraded to 2130

Post Reply

Return to “[H] General”