NFS Server for PVR
-
- WebController
- Beiträge: 470
- Registriert: Di 7. Mai 2013, 05:11
- Wohnort: Australia
NFS Server for PVR
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.
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.
- Twilight
- Zauberküchencheflehrling mit extra Butter
- Beiträge: 64908
- 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
nice project...would be a good tool for all srp users
but i am sorry...i can't help you.
twilight
but i am sorry...i can't help you.
twilight
- Gerti
- Nicht mehr bei Topfield-Europe
- Beiträge: 15740
- Registriert: Fr 9. Dez 2005, 00:16
- Receivertyp: Vu+ Uno 4k
- Wohnort: Hürth
- Kontaktdaten:
AW: NFS Server for PVR
Hi!
Could you post the part of code where the issue happens?
Regards
Gerti
Could you post the part of code where the issue happens?
Regards
Gerti
- FireBird
- Suspekter verdächtiger Zauberküchenchef, TAP & Firmware-Guru
- Beiträge: 28954
- Registriert: Fr 9. Dez 2005, 09:59
- Receivertyp: SRP-2401CI+ TFIR
vu+ Duo 4k - Wohnort: Wien
AW: NFS Server for PVR
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.
-
- WebController
- Beiträge: 470
- Registriert: Di 7. Mai 2013, 05:11
- Wohnort: Australia
AW: NFS Server for PVR
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'.
#
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.
-
- WebController
- Beiträge: 470
- Registriert: Di 7. Mai 2013, 05:11
- Wohnort: Australia
AW: NFS Server for PVR
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:
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:
Here is the command on the client PVR:
You need to create the <DIRECTORY> of your choice befoure mounting.
Feedback from testers welcome.
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.
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
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>/
Feedback from testers welcome.
- Twilight
- Zauberküchencheflehrling mit extra Butter
- Beiträge: 64908
- 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
thanks !! and gratulation
i will try to do some tests, but i can't say when i will have time for it...
twilight
i will try to do some tests, but i can't say when i will have time for it...
twilight
- Töppi
- TöppiHolic der mit dem h tanzt , Anstifter und Möchtegernstatusaufdecker
- Beiträge: 26843
- Registriert: So 27. Aug 2006, 19:22
- Receivertyp: 2410M
- Receiverfirmware: Feb. 2014
- Wohnort: Nähe Mainz
AW: NFS Server for PVR
Gruß
Klaus
................
SRP-2410M
TAP's (Autostart):
| TMSDisplay | F*Skip TMS 3.xx | SmartEPG | SmartFiler | RebuildNAV | Automove TMS | TMSRemote | Callmonitor | SmartSeriesrename | Switch2FTA |
Klaus
................
SRP-2410M
TAP's (Autostart):
| TMSDisplay | F*Skip TMS 3.xx | SmartEPG | SmartFiler | RebuildNAV | Automove TMS | TMSRemote | Callmonitor | SmartSeriesrename | Switch2FTA |
- FireBird
- Suspekter verdächtiger Zauberküchenchef, TAP & Firmware-Guru
- Beiträge: 28954
- Registriert: Fr 9. Dez 2005, 09:59
- Receivertyp: SRP-2401CI+ TFIR
vu+ Duo 4k - Wohnort: Wien
AW: NFS Server for PVR
Dozens of Toppies – linked in all directions…
- macfan
- Ex-iTiNa-Promoter
- Beiträge: 24972
- 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
I believe that this is great, but I don't unterstand where the "normal" user needs it. Can someone explain it?
Gruß, Horst
Gruß, Horst
- FireBird
- Suspekter verdächtiger Zauberküchenchef, TAP & Firmware-Guru
- Beiträge: 28954
- Registriert: Fr 9. Dez 2005, 09:59
- Receivertyp: SRP-2401CI+ TFIR
vu+ Duo 4k - Wohnort: Wien
AW: NFS Server for PVR
With this tool, a Toppy can play NFS server like a NAS and you can easily play a file from a different Toppy.
- Twilight
- Zauberküchencheflehrling mit extra Butter
- Beiträge: 64908
- 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
my first test looks good
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 )
next step for me: i will try to use nfs mount tap to connect automaticly
twilight
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 )
next step for me: i will try to use nfs mount tap to connect automaticly
twilight
- macfan
- Ex-iTiNa-Promoter
- Beiträge: 24972
- 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
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
- Twilight
- Zauberküchencheflehrling mit extra Butter
- Beiträge: 64908
- 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
you still use a nas drive with nfs mount, so you should know what the advance is.. ok i know that it doesn't work so smoothly as it should bemacfan hat geschrieben:I believe that this is great, but I don't unterstand where the "normal" user needs it. Can someone explain it?
twilight
- FireBird
- Suspekter verdächtiger Zauberküchenchef, TAP & Firmware-Guru
- Beiträge: 28954
- Registriert: Fr 9. Dez 2005, 09:59
- Receivertyp: SRP-2401CI+ TFIR
vu+ Duo 4k - Wohnort: Wien
AW: NFS Server for PVR
[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.
- Twilight
- Zauberküchencheflehrling mit extra Butter
- Beiträge: 64908
- 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
next test: play the same file from both receivers...works perfect!! really great job, thank you!!!
twilight
twilight
- Twilight
- Zauberküchencheflehrling mit extra Butter
- Beiträge: 64908
- 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
and the last for today: delete the file which is in use on both...no reboot, no problem
twilight
twilight
-
- WebController
- Beiträge: 470
- Registriert: Di 7. Mai 2013, 05:11
- Wohnort: Australia
AW: NFS Server for PVR
Thanks for testing everyone. I am glad that other people have been able to make it work too.
I have done more testing:
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.
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 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.
- Twilight
- Zauberküchencheflehrling mit extra Butter
- Beiträge: 64908
- 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
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
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
- Töppi
- TöppiHolic der mit dem h tanzt , Anstifter und Möchtegernstatusaufdecker
- Beiträge: 26843
- Registriert: So 27. Aug 2006, 19:22
- Receivertyp: 2410M
- Receiverfirmware: Feb. 2014
- Wohnort: Nähe Mainz
AW: NFS Server for PVR
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.....
Automount/dismount is a good option, but you should reduce the popups to a minimum.....
Gruß
Klaus
................
SRP-2410M
TAP's (Autostart):
| TMSDisplay | F*Skip TMS 3.xx | SmartEPG | SmartFiler | RebuildNAV | Automove TMS | TMSRemote | Callmonitor | SmartSeriesrename | Switch2FTA |
Klaus
................
SRP-2410M
TAP's (Autostart):
| TMSDisplay | F*Skip TMS 3.xx | SmartEPG | SmartFiler | RebuildNAV | Automove TMS | TMSRemote | Callmonitor | SmartSeriesrename | Switch2FTA |