Help regarding TV-Server & FreeNAS

Status
Not open for further replies.

Nindustries

Patron
Joined
Jun 12, 2013
Messages
269
Hello there!

I will need a FreeNAS server, TV Server and htpc(s). I will try to spindown the disks as often as possible using a seperate drive for the plugins. The TV Server can go to sleep mode and Wake On Lan, but Freenas can't. I'm still figuring out wether I will use tvHeadEnd or MediaPortal TV Server.
Now I have the following cases;
  • TV-Server as a plugin in FreeNAS, FreeNAS never powers down leaving up to two devices running when watching TV.
  • TV-Server seperate from FREENAS, leaving up to three devices running when watching TV.
  • TV-Server & Client on one htpc, leaving up to 2 devices running when watching TV. Main HTPC will have to turn on (WOL) when other htpc want to watch TV, leaving min. 3 devices running.
So I was wondering.. has anyone ever tried running tvHeadEnd in a FreeNAS Jail?

Greetings
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
mediaportal TV-Server?
Isn't that a piece of mediaportal? which is windows only? Not sure you could run that as a plugin at all.

as for running either of those in a jail, your jail would need direct access to the hardware (tv tuner) in order to work. as far as i know, nobody has gotten a 100% working setup within FreeNAS or the jail system for TV Tuner cards (i know there was some talk a while back about it on the forums)

personally, save the headache:
run your TV server/tvHeadend on a 'main' htpc, completely separate from FreeNAS
 

BAlGaInTl

Cadet
Joined
Nov 18, 2013
Messages
1
I actually came here looking for the same info...

It seems like it could be possible to run tvheadend with a network tuner card like the silicondust hdhomerun. I was hoping that someone had already created something.
 

jyavenard

Patron
Joined
Oct 16, 2013
Messages
361
hardware TV tuner support in FreeBSD is virtually non-existent.

Most of the digital tuners available these days (be it DVB or ATSC) only come with windows or linux support (via V4L: Video for Linux).

Even using ESXi; my experience is that pci passthrough doesn't work consistently well. It will for some, it completely won't for others: so it's not a path you want to follow.

What you should use instead are networked tuners like an HD HomeRun (short HDHR) from Silicon Dust:
http://www.silicondust.com/products/hdhomerun/dvbt/

they have single, dual and quad-tuners (that last one is very expensive). Single and dual tuner version are available for both US (ATSC) and the rest of the world (DVB) and aren't much more expensive than PCIe or PCI digital tuners.

It works well and is supported by MythTV (www.mythtv.org) which is arguably the best PVR application available on unix (linux or freebsd).
That's for the server.

You can install it using the FreeBSD ports
instructions there: http://doc.freenas.org/index.php/Installing_non-PBI_Software#Compiling_FreeBSD_Ports_with_make
basically you do:

cd /usr/ports/multimedia/mythtv
make

in the configuration screen that will show up, check mysql
(if you have a nvidia graphic card, check VDPAU and make sure you run nvidia official drivers)
then
make install
For the mythtv client (called frontend), solutions are available on most platforms out there: mac, linux, *BSD, Windows ; or as a plugin for xbmc.

you'll get more help on the mythtv user list , IRC (#mythtv-users) or using the web site: www.mythtv.org

Hope that helps.

JY
 

Nindustries

Patron
Joined
Jun 12, 2013
Messages
269
I just realised it would be perfectly possible if you put a FreeBSD install in a jail. That way, MythTV/whatever can profit from the full FreeBSD V4l drivers.
That should work theoretically. FreeBSD (& linux sorta) can be put in jails. You can give access to /dev/<object> into the jail
 

jyavenard

Patron
Joined
Oct 16, 2013
Messages
361
What FreeBSD v4l drivers?

The l in v4l stands for Linux for a reason :P
 

Nindustries

Patron
Joined
Jun 12, 2013
Messages
269
What FreeBSD v4l drivers?

The l in v4l stands for Linux for a reason :p
Woops, noticed that too :D I'm fairly new to this stuff, was reading up about it.
For example, the Hauppauge WinTV-HVR-4000 would work in FreeBSD due to webcamd.
https://wiki.freebsd.org/WebcamCompat

I'll just better wait until jailed linux behaves nicely, to get a dual/quad tuner card working.

EDIT: This should work in theory; use webcamd from the ports tree to access multiple PCTV DVB-S2 Sticks and use oscam for the decryption of the channels, alongside a Smargo cardreader. Edit devfs to allow the jail to work with the USB device. The sticks can be powered from a powered usb hub. (USB 3.0 for the hub connector could come in handy here, but as USB 3.0 gives problems in freenas..)
 

JR Gonzalez

Explorer
Joined
Aug 29, 2014
Messages
64
The problem with that is you can't install webcamd in a jail. I experimented with webcamd on the freenas side and it seemed to half ass work but I was never able to get a functional tuner box. Although, I was using tvheadend. MythTV may have better luck. But a special build with the proper modules and webcamd on the freenas side is necessary. I've been trying to toy with a HDHomerun I received this weekend. Currently the build of tvheadend doesn't properly work with it. I guess they use some sort of hackery to make a virtual dvb device by using a kernel module. I've not even attempted nor have been successful doing this just yet. Hopefully someone comes around with some more information about it. Apparently the newer versions of tvh have static support for the HDHomerun but I'm not seeing it. Thus far though I was unsuccessful with an HVR-850, HVR-950, and a cx88 based card (I built the cx88 module myself a while back). The cx88 came the closest to working. I guess the only alternative is to wait for a working tvheadend + libhdhomerun that can be installed in a jail without the need of kernel module hackery. Right now I'm just going to set up a vbox with ubuntu and see about getting it working.
 

JR Gonzalez

Explorer
Joined
Aug 29, 2014
Messages
64
Good news and bad news. I was able to set up a jail, install MythTV, and get the HDHomerun to work. Bad news is the PVR support in XBMC isn't that great for MythTV. :/ I am able to use mythfrontend just fine with it though so that's progress. Seems like libhdhomerun is built directly into MythTV.

mythtv-working.png
 
Last edited:

JR Gonzalez

Explorer
Joined
Aug 29, 2014
Messages
64
Ok. Just an update:

I just realized that in order to get the backend to work with the frontend on a laptop for testing that I had to change the mysql database to allow 'mythtv'@'%' since the distributed file for mysql uses @'localhost' ... I didn't test xbmc after that. I realized that xbmc now works. So yes. It is indeed possible to configure a freenas box using a HDHomerun in a jail. I still need more testing but so far the hard part is done. I just need to set up schedules direct and try to record things.

Just a warning: I used the pkg repo to install mythtv. It seems lame is flagged as broken so you have to use the ports tree to install it. It is in audio/lame. After that you can use pkg. Using the ports tree to actually build mythtv is like torture since in all it wants to build 221 ports. If that's your thing then good on you but I try to use pkg whenever possible.
 

R3jected

Dabbler
Joined
May 15, 2014
Messages
17
Ok. Just an update:

I just realized that in order to get the backend to work with the frontend on a laptop for testing that I had to change the mysql database to allow 'mythtv'@'%' since the distributed file for mysql uses @'localhost' ... I didn't test xbmc after that. I realized that xbmc now works. So yes. It is indeed possible to configure a freenas box using a HDHomerun in a jail. I still need more testing but so far the hard part is done. I just need to set up schedules direct and try to record things.

Just a warning: I used the pkg repo to install mythtv. It seems lame is flagged as broken so you have to use the ports tree to install it. It is in audio/lame. After that you can use pkg. Using the ports tree to actually build mythtv is like torture since in all it wants to build 221 ports. If that's your thing then good on you but I try to use pkg whenever possible.
That sound pretty good. Please keep us up 2 date if there are any issues or of something does not work correctly.
Thanks again for you work and tell us if recording was successful. What do you think about tvheadend, since this is very well integrated into xbmc (for instance on a raspb. pi).
 

JR Gonzalez

Explorer
Joined
Aug 29, 2014
Messages
64
It was fail. The problem with tvheadend was that it requires a dvb device even for the hdhomerun. This is done in Linux with kernel hackery to make a device by building a module. This isn't practical in FreeNAS since it would require that this was actually part of the distributed build or that you keep building your own updates. Even in a Linux VM I had issues trying to get it to work. I guess newer versions are integrating the HDHomerun support. As far as other tuners go, this is my 4th tuner at an attempt to get this working. I even tried a cx88 which is probably one of the better supported cards for FreeBSD. I couldn't get any of them to work properly in tvheadend. I finally gave up on it and moved onto trying to get mythtv working. So far I have it playing on an XBMC client attached to my TV. MythTV support is in XBMC (so you should be able to use a Pi). There is an add-on for it in the PVR clients section. You just have to make absolutely sure your server is configured properly.

The thing that also sucked about mythtv is the mythtv-setup you have to run to configure the server is X11 ONLY. You have to make sure the jail has vimage enabled otherwise you can't x11forward. Just a warning. I'm going to set up the directories for recording and the schedules direct stuff later and see how that goes. :) So far though it seems incredibly promising. Just getting it to play across the network to the XBMC client was awesome especially with how much work I put into the tvheadend stuff. What a waste of life. I guess someone needs to test this stuff though huh?
 

R3jected

Dabbler
Joined
May 15, 2014
Messages
17
Thanks for your effort and patience. I'd like to keep the contact since I am highly interested in this topic.
Thank you!
 

JR Gonzalez

Explorer
Joined
Aug 29, 2014
Messages
64
Well, I am happy to report that after a little testing it seems like all is working. I managed to connect the hdhomerun to a freenas fbsd jail, install mythtv, set up the directories (using a mount within the jail) to store recordings/live tv, set up schedules direct, and am able to watch it on multiple front ends. It works. So with a hdhomerun + freenas + xbmc you can watch tv and record it onto the nas directly.

Good stuff. Have a lot more testing to do and tweaking I'm sure but so far I'm using it normally and all seems to work. This was done with the 2 tuner US version using ATSC over the air stuff so if you are in EU I'm really not sure how well it will work. I'm sure DVB works differently there. I also haven't really looked into Sat or Cable yet. I just needed it for OTA stuff so I probably won't be doing that. I refuse to pay for sat/cab.

Hope this information helps if anybody is trying to do this.
 

nello

Patron
Joined
Dec 30, 2012
Messages
351

nello

Patron
Joined
Dec 30, 2012
Messages
351
… am able to watch it on multiple front ends. It works. So with a hdhomerun + freenas + xbmc you can watch tv and record it onto the nas directly.

Can you comment on how you connected XBMC to your MythTV recordings?
 

hxall

Dabbler
Joined
Dec 1, 2013
Messages
15
Well, I am happy to report that after a little testing it seems like all is working. I managed to connect the hdhomerun to a freenas fbsd jail, install mythtv, set up the directories (using a mount within the jail) to store recordings/live tv, set up schedules direct, and am able to watch it on multiple front ends. It works. So with a hdhomerun + freenas + xbmc you can watch tv and record it onto the nas directly.

Good stuff. Have a lot more testing to do and tweaking I'm sure but so far I'm using it normally and all seems to work. This was done with the 2 tuner US version using ATSC over the air stuff so if you are in EU I'm really not sure how well it will work. I'm sure DVB works differently there. I also haven't really looked into Sat or Cable yet. I just needed it for OTA stuff so I probably won't be doing that. I refuse to pay for sat/cab.

Hope this information helps if anybody is trying to do this.

Can you provide some direction as to how you got HDHomerun to work with the FreeNAS, trying the same thing...
 

nello

Patron
Joined
Dec 30, 2012
Messages
351
Status
Not open for further replies.
Top