NFS Server for PVR

TAPs für die SRP- und CRP-Serie
DeltaMikeCharlie
WebController
WebController
Beiträge: 469
Registriert: Di 7. Mai 2013, 05:11
Wohnort: Australia

NFS Server for PVR

#1

Beitrag von DeltaMikeCharlie » Fr 28. Feb 2014, 04:43

I have been working on a project to add NFS Server capabilities to the PVR.

I have 2 Topfield PVRs and I would like to be able to play recordings from one unit on the other unit directly. Currently, I used FTP to copy recordings and that works well, but I need to do this in advance of watching the programme. Being able to access programmes directly from the HDD of the other PVR would be more useful.

http://unfs3.sourceforge.net/

In my research, I discovered "unfs3" which is a user mode NFS server. With the kind assistance of FireBird, I managed to setup a correct cross-compiler environment and compile unfs3 for the Topfield PVR architecture.

unfs3 will run on the PVR, but every time that I try and mount the PVR's NFS share, unfs3 produces a SIGSEGV "segmentation fault" and exits. This is where I am stuck.

I have managed to compile unfs3 for a CentOS linux host and I can use the busybox mount function on the PVR to mount a unfs3 share from the CentOS host. This suggests to me that there is nothing fundamentally wrong with unfs3 and that perhaps the source of the problem is with the PVR architecture and not with unfs3.

Are there any Linux programming gurus lurking on the forum that may be able to help me troubleshoot the problem? I have identified the line of code that causes the SIGSEGV, I just don't understand why the error is occurring.

I selected unfs3 because it should work seamlessly with the existing NASMount TAP. There are several other utilities that I intend to try next (remotefs, nfs-ganesha and samba), but I would like to give unfs3 one last try before abandoning that line of research.

Any assistance would be appreciated.

Benutzeravatar
Twilight
Zauberküchencheflehrling mit extra Butter
Zauberküchencheflehrling mit extra Butter
Beiträge: 64747
Registriert: Fr 9. Dez 2005, 09:17
Receivertyp: 1 x SRP 2100(TMS) TFIR und .1 x SRP 2410 M
Wohnort: Wien Umgebung

AW: NFS Server for PVR

#2

Beitrag von Twilight » Fr 28. Feb 2014, 06:44

nice project...would be a good tool for all srp users :up:
but i am sorry...i can't help you.


twilight

Benutzeravatar
Gerti
Nicht mehr bei Topfield-Europe
<b>Nicht mehr bei Topfield-Europe</b>
Beiträge: 15740
Registriert: Fr 9. Dez 2005, 00:16
Receivertyp: Vu+ Uno 4k
Wohnort: Hürth
Kontaktdaten:

AW: NFS Server for PVR

#3

Beitrag von Gerti » Fr 28. Feb 2014, 20:50

Hi!

Could you post the part of code where the issue happens?

Regards
Gerti

Benutzeravatar
FireBird
Suspekter verdächtiger Zauberküchenchef, TAP & Firmware-Guru
Suspekter verdächtiger Zauberküchenchef, TAP & Firmware-Guru
Beiträge: 28750
Registriert: Fr 9. Dez 2005, 09:59
Receivertyp: SRP-2401CI+ TFIR
vu+ Duo 4k
Wohnort: Wien

AW: NFS Server for PVR

#4

Beitrag von FireBird » Fr 28. Feb 2014, 22:15

Here's an excerpt from a conversation we had:
I have been adding some debug code and identified the offending statement as being in "daemon.c" in function "unfs3_svc_run()" at the "svc_getreqset(&readfds);" statement.

I placed a printf before and after the statement and only the one before gets triggered, never the "after".

When I remove the "-t" (force TCP) the error moves onto another place in the code and I am currently tracing that call.

DeltaMikeCharlie
WebController
WebController
Beiträge: 469
Registriert: Di 7. Mai 2013, 05:11
Wohnort: Australia

AW: NFS Server for PVR

#5

Beitrag von DeltaMikeCharlie » Fr 28. Feb 2014, 22:34

Gerti hat geschrieben:Could you post the part of code where the issue happens?


Thanks Gerti,

In function "unfs3_svc_run()" there is a continuous for loop. Inside the for loop there is a switch statement and the default action of that calls "svc_getreqset(&readfds)" when there is data to process.

This triggers a number of functions to be called: "mountprog_3" then calls "mountproc_mnt_3_svc()" which calls "get_port()". As these functions exit, all is fine until "mountprog_3" exits. At that point the SIGSEGV occurs.

In my debugging attempts, I have done this:

printf("case default: before, %d.\n", fdcount);
svc_getreqset(&readfds); //This statement causes a segmentation fault.
printf("case default: after\n");

"after" never appears. I have "printf" statements within the other functions, here is a nominal trace.

Code: Alles auswählen

# unfsd -s -p -e /mnt/hd/ProgramFiles/exports -n 20100 -m 20101 -d
DMC Debug version.
Entering 'parse_options'.
UNFS3 unfsd 0.9.22 (C) 2006, Pascal Schmidt <unfs3-server@ewetel.net>
Entering 'regenerate_write_verifier'.
Entering 'create_udp_transport'.
Entering 'create_tcp_transport'.
Entering 'register_nfs_service'.
Entering 'create_udp_transport'.
Entering 'create_tcp_transport'.
Entering 'register_mount_service'.
Setting 'sigaction'
Entering 'create_pid_file'.
/mnt/hd/DataFiles: ip 0.0.0.0 mask 0.0.0.0 options 4
Entering 'unfs3_svc_run'.
About to 'select'
case 0
About to 'select'
case default: before, 1.
Entering 'mountprog_3'.
 MOUNTPROC_MNT.
Passing 'mountprog_3' A.
Passing 'mountprog_3' B.
Entering 'mountproc_mnt_3_svc'.
Before IF.
 exports_options = 4.
 authenticated = 0.
 password = 0.
 exports_opts & OPT_INSECURE = 0.
Entering 'get_port'.
Before 'svc_getcaller'.
After 'svc_getcaller' 13059.
 IS_SECURE = 1.
Entering 'get_port'.
Before 'svc_getcaller'.
After 'svc_getcaller' 13059.
After IF.
After fh_comp.
fh_valid.
Passing 'mountprog_3' C.
[color=red]Passing 'mountprog_3' D.[/color]
Entering 'daemon_exit'.
segmentation fault
Entering 'remove_pid_file'.
 #
"Passing 'mountprog_3' D." is literally the line immediately before the "return" at the end of "mountprog_3".

Here are my command line settings:

unfsd -s -p -e /mnt/hd/ProgramFiles/exports -n 20100 -m 20101 -d

busybox mount -w -o rw,nolock,vers=3,port=20100,mountport=20101 -t nfs <PVR_IP>:/mnt/hd/DataFiles/ /mnt/hd/DataFiles/Upstairs/

I chose these crazy port numbers so that I could test on my CentOS host without having to remove NFS functionality from the kernel. Also because the PVR does not have the port mapper "-p" I did this so that the ports manually match up.

I had a thought about this early this morning. I compiled the PVR binary using CYGWIN, but I compiled the CentOS binary in CentOS. Perhaps there is an old/missing/misconfigured library on CYGWIN that allows compilation, but crashes on execution. Perhaps a struct is too short or something. I am currently trying to build a cross-compiler environment in CentOS to test this theory.

DeltaMikeCharlie
WebController
WebController
Beiträge: 469
Registriert: Di 7. Mai 2013, 05:11
Wohnort: Australia

AW: NFS Server for PVR

#6

Beitrag von DeltaMikeCharlie » Mo 17. Mär 2014, 07:29

I finally managed to cross-compile a version of unfsd that will run on the PVR and not crash when accessed remotely.

I have done some very basic testing:
  • From the client PVR, I can "ls" and see the files on the server PVR.
  • I can use TMSArchive on the client PVR to navigate to the mount point and list recordings from the server PVR.
  • I can use TMSArchive to start playback.
  • I can use jdsSkip to navigate throughout the recording.
There still needs to be a lot of testing. For example, if the server PVR also has quad recording happening, is it also still able to respond in a timely manner?

The unfsd binary that I compiled is available here. It is very large because it is statically linked. I have also added a copy of my "exports" file. Copy these to "/mnt/hd/ProgramFiles" and don't forget to "chmod 555 unfsd" before trying this.

Here is the command on the server PVR:

Code: Alles auswählen

unfsd -s -p -e /mnt/hd/ProgramFiles/exports -n 2049 -m 645
Here is the command on the client PVR:

Code: Alles auswählen

busybox mount -w -o rw,nolock,vers=3,port=2049,mountport=645 -t nfs <SERVER_IP>:/mnt/hd/DataFiles/  /mnt/hd/DataFiles/<DIRECTORY>/
You need to create the <DIRECTORY> of your choice befoure mounting.

Feedback from testers welcome.

Benutzeravatar
Twilight
Zauberküchencheflehrling mit extra Butter
Zauberküchencheflehrling mit extra Butter
Beiträge: 64747
Registriert: Fr 9. Dez 2005, 09:17
Receivertyp: 1 x SRP 2100(TMS) TFIR und .1 x SRP 2410 M
Wohnort: Wien Umgebung

AW: NFS Server for PVR

#7

Beitrag von Twilight » Mo 17. Mär 2014, 07:40

thanks !! and gratulation :hello:
i will try to do some tests, but i can't say when i will have time for it...

twilight

Benutzeravatar
Töppi
TöppiHolic der mit dem h tanzt , Anstifter und Möchtegernstatusaufdecker
TöppiHolic der mit dem <font color=ed>h</font> tanzt <font color=#E9E9E9>,  Anstifter und Möchtegernstatusaufdecker</font>
Beiträge: 26843
Registriert: So 27. Aug 2006, 19:22
Receivertyp: 2410M
Receiverfirmware: Feb. 2014
Wohnort: Nähe Mainz

AW: NFS Server for PVR

#8

Beitrag von Töppi » Mo 17. Mär 2014, 16:55

:respekt: :up:
Gruß
Klaus :wink:
................
:topf: SRP-2410M

:respekt:
TAP's (Autostart):
| TMSDisplay | F*Skip TMS 3.xx | SmartEPG | SmartFiler | RebuildNAV | Automove TMS | TMSRemote | Callmonitor | SmartSeriesrename | Switch2FTA |

Benutzeravatar
FireBird
Suspekter verdächtiger Zauberküchenchef, TAP & Firmware-Guru
Suspekter verdächtiger Zauberküchenchef, TAP & Firmware-Guru
Beiträge: 28750
Registriert: Fr 9. Dez 2005, 09:59
Receivertyp: SRP-2401CI+ TFIR
vu+ Duo 4k
Wohnort: Wien

AW: NFS Server for PVR

#9

Beitrag von FireBird » Mo 17. Mär 2014, 17:07

Dozens of Toppies – linked in all directions… :D

Benutzeravatar
macfan
Ex-iTiNa-Promoter
Ex-iTiNa-Promoter
Beiträge: 24968
Registriert: Fr 9. Dez 2005, 10:16
Receivertyp: 2 x TF 2401 CI+, 2100, 5200 C, VU+ Ultimo 4K
Receiverfirmware: SRP-Serie: die neueste, 5k: Jan 07 PTU, VU+ VTi 15.0
Wohnort: Dortmund

AW: NFS Server for PVR

#10

Beitrag von macfan » Mo 17. Mär 2014, 17:22

I believe that this is great, but I don't unterstand where the "normal" user needs it. Can someone explain it?

Gruß, Horst

Benutzeravatar
FireBird
Suspekter verdächtiger Zauberküchenchef, TAP & Firmware-Guru
Suspekter verdächtiger Zauberküchenchef, TAP & Firmware-Guru
Beiträge: 28750
Registriert: Fr 9. Dez 2005, 09:59
Receivertyp: SRP-2401CI+ TFIR
vu+ Duo 4k
Wohnort: Wien

AW: NFS Server for PVR

#11

Beitrag von FireBird » Mo 17. Mär 2014, 17:24

With this tool, a Toppy can play NFS server like a NAS and you can easily play a file from a different Toppy.

Benutzeravatar
Twilight
Zauberküchencheflehrling mit extra Butter
Zauberküchencheflehrling mit extra Butter
Beiträge: 64747
Registriert: Fr 9. Dez 2005, 09:17
Receivertyp: 1 x SRP 2100(TMS) TFIR und .1 x SRP 2410 M
Wohnort: Wien Umgebung

AW: NFS Server for PVR

#12

Beitrag von Twilight » Mo 17. Mär 2014, 17:28

my first test looks good :up:

i have tested with two 2410 and smartfiler.
i have still a nfs mount to my nas...on both receivers. so it is a good idea to switch off the mount on the mounted receiver, if not it could be a performance problem (1900 files and SF writes a database in each direktory :u: )

next step for me: i will try to use nfs mount tap to connect automaticly :rolleyes:

twilight

Benutzeravatar
macfan
Ex-iTiNa-Promoter
Ex-iTiNa-Promoter
Beiträge: 24968
Registriert: Fr 9. Dez 2005, 10:16
Receivertyp: 2 x TF 2401 CI+, 2100, 5200 C, VU+ Ultimo 4K
Receiverfirmware: SRP-Serie: die neueste, 5k: Jan 07 PTU, VU+ VTi 15.0
Wohnort: Dortmund

AW: NFS Server for PVR

#13

Beitrag von macfan » Mo 17. Mär 2014, 17:29

FireBird hat geschrieben:With this tool, a Toppy can play NFS server like a NAS and you can easily play a file from a different Toppy.

So for special reasons (Sky :( ) it might be necessary that I buy a 2401. Now I can put the old 2100 in the attic and use the new 2401 in the living room, but the 2400 can play all the files on the 2100? Cool!

If it would only work… I can't play .rec-files in HD from my NAS on my 2100 because it is too slow.

Gruß, Horst

Benutzeravatar
Twilight
Zauberküchencheflehrling mit extra Butter
Zauberküchencheflehrling mit extra Butter
Beiträge: 64747
Registriert: Fr 9. Dez 2005, 09:17
Receivertyp: 1 x SRP 2100(TMS) TFIR und .1 x SRP 2410 M
Wohnort: Wien Umgebung

AW: NFS Server for PVR

#14

Beitrag von Twilight » Mo 17. Mär 2014, 17:33

macfan hat geschrieben:I believe that this is great, but I don't unterstand where the "normal" user needs it. Can someone explain it?
you still use a nas drive with nfs mount, so you should know what the advance is.. :u: ok i know that it doesn't work so smoothly as it should be ;)

twilight

Benutzeravatar
FireBird
Suspekter verdächtiger Zauberküchenchef, TAP & Firmware-Guru
Suspekter verdächtiger Zauberküchenchef, TAP & Firmware-Guru
Beiträge: 28750
Registriert: Fr 9. Dez 2005, 09:59
Receivertyp: SRP-2401CI+ TFIR
vu+ Duo 4k
Wohnort: Wien

AW: NFS Server for PVR

#15

Beitrag von FireBird » Mo 17. Mär 2014, 17:35

[quote="macfan"]I can't play .rec-files in HD from my NAS on my 2100 because it is too slow.[/quote]
As mentioned in other threads, a network has enough headroom to stream a HD recording without hitting a bandwidth limit. Something must be wrong with your setup or hardware.

Benutzeravatar
Twilight
Zauberküchencheflehrling mit extra Butter
Zauberküchencheflehrling mit extra Butter
Beiträge: 64747
Registriert: Fr 9. Dez 2005, 09:17
Receivertyp: 1 x SRP 2100(TMS) TFIR und .1 x SRP 2410 M
Wohnort: Wien Umgebung

AW: NFS Server for PVR

#16

Beitrag von Twilight » Mo 17. Mär 2014, 17:40

next test: play the same file from both receivers...works perfect!! really great job, thank you!!!

twilight

Benutzeravatar
Twilight
Zauberküchencheflehrling mit extra Butter
Zauberküchencheflehrling mit extra Butter
Beiträge: 64747
Registriert: Fr 9. Dez 2005, 09:17
Receivertyp: 1 x SRP 2100(TMS) TFIR und .1 x SRP 2410 M
Wohnort: Wien Umgebung

AW: NFS Server for PVR

#17

Beitrag von Twilight » Mo 17. Mär 2014, 19:48

and the last for today: delete the file which is in use on both...no reboot, no problem :)

twilight

DeltaMikeCharlie
WebController
WebController
Beiträge: 469
Registriert: Di 7. Mai 2013, 05:11
Wohnort: Australia

AW: NFS Server for PVR

#18

Beitrag von DeltaMikeCharlie » Mo 17. Mär 2014, 20:41

Thanks for testing everyone. I am glad that other people have been able to make it work too.

I have done more testing:
  • Deleting recordings works OK.
  • A last playback position is remembered on both PVRs.
  • Bookmarks are remembered on both PVRs.
  • Chase play a recording-in-progress on the server PVR.
  • Read INFplus data, but only from an "archived" recording.
I am thinking about writing a TAP to control this. Any suggestion would be welcome. How many PVRs? Bi-directional? Auto mount/dismount when a server PVR is powered on/off? Pop-up warnings? Integrated with TMA1?

I have also "stripped" the binary file so that it is much smaller (800k vs 1m), but I have not tested that version yet. I will post it when I am sure that it works.

Benutzeravatar
Twilight
Zauberküchencheflehrling mit extra Butter
Zauberküchencheflehrling mit extra Butter
Beiträge: 64747
Registriert: Fr 9. Dez 2005, 09:17
Receivertyp: 1 x SRP 2100(TMS) TFIR und .1 x SRP 2410 M
Wohnort: Wien Umgebung

AW: NFS Server for PVR

#19

Beitrag von Twilight » Mo 17. Mär 2014, 20:45

just have a look on the nfs mount tap from gerti. i think this must be the "connection" tap for all nfs mounts.
from th other side: we just need a tap which sends the order to start the nfs server, like we do it now by hand, or?

twilight

Benutzeravatar
Töppi
TöppiHolic der mit dem h tanzt , Anstifter und Möchtegernstatusaufdecker
TöppiHolic der mit dem <font color=ed>h</font> tanzt <font color=#E9E9E9>,  Anstifter und Möchtegernstatusaufdecker</font>
Beiträge: 26843
Registriert: So 27. Aug 2006, 19:22
Receivertyp: 2410M
Receiverfirmware: Feb. 2014
Wohnort: Nähe Mainz

AW: NFS Server for PVR

#20

Beitrag von Töppi » Mo 17. Mär 2014, 20:48

I would prefer a standalone TAP, not everyone use TMA in autostart mode....
Automount/dismount is a good option, but you should reduce the popups to a minimum.....
Gruß
Klaus :wink:
................
:topf: SRP-2410M

:respekt:
TAP's (Autostart):
| TMSDisplay | F*Skip TMS 3.xx | SmartEPG | SmartFiler | RebuildNAV | Automove TMS | TMSRemote | Callmonitor | SmartSeriesrename | Switch2FTA |

Antworten

Zurück zu „SRP/CRP TAP-Bereich“