Kodi Community Forum

Full Version: [Feature Request] Multiple Backends
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
I know it's not entirely new this request, and in the archives other discussions can be found.
But it has become relevant again recently.
I am running Libreelec nightly;

- Situation

I have 2 different TVheadend (TVH) backends on two different locations
I have 2 clients running, the 2nd client is renamed into pvr2.hts and I also edited the .xml.

This is the trick to do it. It's all stiched nice together in your front end.

My 2nd client is an old version though, I think 2.12 or something. Now in the latest nightlies this has become unsupported.

Now I have two options;

- Update the 2nd client too. (Which is tricky it always sees it as an older version and it requires quite some cumbersome manual actions/

2. Write a feature request here Smile)


What would I like to see?

Please add a button in the client which says "Add another back-end" and let me fill in the details. So people with 2 or more back-ends can easily add more TVH servers with ease. It will also help in "joining" overlapping channels.

If you have BBC on both backends for example one could use this for recording purposes.


If this request is honored, I will never ever have to worry about manual updating any more!

// Anyone can edit my typo in title fEAture
Not entirely sure I understand your specific problem. However, with recent backend versions you can import one TVH server into another, making everything appear as "one" on the latter, which allows combining. Would that work for you?
It would ! I am running 4.1-2104 is that new enough?

// Edit, also my 2nd backend is an external backend not in my house. (I am looking into SAT>IP but it looks like that is only if both reside within the same IP range?)
The version should be recent enough. Pretty sure this is "just" a question of configuration. Unfortunately I don't know how to set is up as I have never used the feature myself. However, you can try to reach somebody via IRC on #hts. Might take some time to get a response but worthwhile trying...
(2016-08-29, 18:52)M4tt0 Wrote: [ -> ]Not entirely sure I understand your specific problem. However, with recent backend versions you can import one TVH server into another, making everything appear as "one" on the latter, which allows combining. Would that work for you?

I'm not the OP but I have the same situation (except I'm not trying to use an older version), but I don't understand what you are saying here. I have two TVHeadEnd backends, one running version 4.0 something and the other version 4.1 something; one is used for terrestrial over-the-air channels and the other for free-to-air satellite channels. I always have to make a duplicate of the TVHeadEnd backend (basically using this process). I'm not at all familiar with what you're talking about - can you explain further? If you are suggesting that the output of one TVHeadEnd server should somehow be routed through another, that defeats the whole purpose of having two servers, which is to spread the load and minimize the traffic on the network interfaces so that congestion doesn't occur.

I would also like to see Kodi provide a better way to use two instances of the same PVR addon (pointing at two different backend servers), because right now ever time Kodi gets updated I have to go back in and redo the process for the second instance of the server. Right now the way PVR addons are implemented, it's kind of like if you could only have all your videos in a single directory only a single hard drive. Sure, that would be sufficient for many people, but for others it would be a real problem.
(2016-08-29, 21:03)birdwatcher Wrote: [ -> ]
(2016-08-29, 18:52)M4tt0 Wrote: [ -> ]Not entirely sure I understand your specific problem. However, with recent backend versions you can import one TVH server into another, making everything appear as "one" on the latter, which allows combining. Would that work for you?

I'm not the OP but I have the same situation (except I'm not trying to use an older version), but I don't understand what you are saying here. I have two TVHeadEnd backends, one running version 4.0 something and the other version 4.1 something; one is used for terrestrial over-the-air channels and the other for free-to-air satellite channels. I always have to make a duplicate of the TVHeadEnd backend (basically using this process). I'm not at all familiar with what you're talking about - can you explain further? If you are suggesting that the output of one TVHeadEnd server should somehow be routed through another, that defeats the whole purpose of having two servers, which is to spread the load and minimize the traffic on the network interfaces so that congestion doesn't occur.

I would also like to see Kodi provide a better way to use two instances of the same PVR addon (pointing at two different backend servers), because right now ever time Kodi gets updated I have to go back in and redo the process for the second instance of the server. Right now the way PVR addons are implemented, it's kind of like if you could only have all your videos in a single directory only a single hard drive. Sure, that would be sufficient for many people, but for others it would be a real problem.


Congestion is a concern? If so update to gigabit networking. Most sat channels in HD hover around the 20Mbp/s mark i.e 1/50th of a gigabit connection.......... If you are hitting a wall with gigabit networking then there is something wrong with your config or you have way too many TVs in your house..............
@birdwatcher:

All depends on your usecase. I'm not familiar with running two (or more) frontends in Kodi. However, bandwidth permitting, you should not be required multiplying frontends JUST because you want to access different TVH backend instances with different adapters at the same time any longer. Example:

Server 1: TVH backend server with DVB-T and DVB-C adapters in the UK
Server 2: TVH backend server with DVB-S2 in the US
Let's assume you just moved from the UK to the US but want to still watch UK TV.

The feature is that recent 4.1.x TVH backend servers can act as a SAT>IP server, i.e. they can appear as a SAT>IP device to other TVH backend instances. So, if you configure Server 1 as a SAT>IP server, you can access the DVB-T and DVB-C adapters of server 1 on server 2 "as if they were local" (just like a SAT>IP device). The DVB-T/C adapters will appear together with the DVB-S2 adapters in the TVH backend on Server 2. Advantage is that if you link your KODI with TVH frontend to the bakend server 2 you can watch all your channels there. No need for multiplying several frontends. That's all, not more, not less...
That s only the case if both are inside the same IP range.
Alll you can do is Discover SAT>IP server.... It willl only look for local servers on your LAN.

Adding the button "Add another TVH backend" in the client Add-on would really help and make life a lot easier!
A general comment: What's funny to me is that people will try to tell you that you only need a single TVHeadEnd Server, yet if you suggested to some of those same people that they only need a single hard drive to store their media they'd howl in protest. People have their reasons for doing what they do. So, okay, maybe if you have gigabit networking you won't have a throughput issue, but the other potential issue is overworking the hard drive. Let's say you're recording six or eight channels at once (it can happen, especially at the hour or half hour mark when some programs are ending and others just starting) AND you have a few people trying to watch recordings from the server all at the same time. That hard drive's heads are going to be jumping around like a grasshopper on a hot fry pan. Maybe some drives can handle that load just fine, but I don't know if I have such a drive, and I'd rather not find out by the drive dying prematurely. The point is that if someone wants to run two different PVR backends (or feels they need to), using the same software for both backends, it would be better if Kodi natively supported adding both.

Would it be really difficult, on the configuration screen for the PVR addon, to have a dropdown for "number of backends" that defaults to 1, but allows you to have 2 or even 3? And if you specify 2 or 3, then extend the page to ask for the details (ip address and port, login info, etc.) for backend #1, backend #2, and backend #3? I'm asking because I don't know if this would be easy or difficult for the PVR addon developers.

I think the reason this problem might be coming to the forefront now is that the method talked about in the link in my earlier post has been working reasonably well until the Krypton beta came along. It appears that that if you have the Krypton beta running under Ubuntu, and you try to use two TVHeadEnd backends, it will crash Kodi immediately at startup. This does not happen in the OS X version, just the Linux version (don't run Windows so don't know about that). Remove the second backend and then it will start and run. This wouldn't be an issue if the TVHeadEnd PVR addon had built-in support for two or more backends. I'm really hoping that will be addressed in some way prior to the final Krypton release.

Also I want to specifically reply to M4tt0: Thank you for the explanation. I can see where that would be useful, particularly if you're trying to pick up over the air signals at one location and send them to a different TVHeadEnd server. However I am wondering if this is all documented anywhere. It's all well and good for the TVHeadEnd developers to add a new capability, but if it's not explained so that people can understand how to use it, it might as well not exist. Also, again, in my case the idea is NOT to overload the hard drive on either system, so if you are saying that Server 1 would simply stream to Server 2, and Server 2 would be responsible for recording the content streamed from Server 1 AND ALSO any content it receives locally, that's not really going to help.

If I am understanding correctly, a SAT>IP server can only stream channels in real time; it does not "record" anything. That's up to the SAT>IP client, in your example Server 2. Now I suppose that in theory, someone could program the TVHeadEnd instance on Server 1 to record a program, then somehow play it as a separate SAT>IP stream at a later time (if TVHeadEnd even has that capability). But that would not all all be helpful in a situation where the Kodi users are watching programs on demand, at no set times (could be two minutes or two days after the actual start of the program). So basically Server 2's hard drive would still be the one potentially getting beat up. If there were a way that clients of Server 2 could request, in real time, a recording from Server 1 and it would simply be streamed through server 2 without touching Server 2's hard drive, that might work (though there would doubtless be other issues) but now you're needlessly increasing the network traffic. If I misunderstand how SAT>IP works, please feel free to enlighten me. I think SAT>IP probably has some very valid use cases, especially for sending over the air signals from one location to another, but I don't really think this is one of them, as it defeats the entire purpose of having a second server and adds new complications.
(2016-08-30, 01:19)menno Wrote: [ -> ]That s only the case if both are inside the same IP range.
Alll you can do is Discover SAT>IP server.... It willl only look for local servers on your LAN.

I wonder if that's partly to keep users from unknowingly blowing through their ISP usage caps? My guess is that there are ways around that (that's what VPN's are for) but you don't want a user to unknowingly blow through their ISP caps in the first week of the month!
VPN would be a solution for me, but a bit cumbersome. In the end I think we fully agree, the easiest by far should be "Add another backend" button in the existing client add-on.
Exactly as you say this problem has resurfaced for me since a week. Earlier beta's accepted the renaming trick of one of your tvheadend client addons to pvr2.hts (or whatever you liked).

This feature request is nothing new, I know. But soon forums will get flooded again because the best solution up until has now stopped working.

I've temporarly fixed it now by using simple-tv pvr client addon as a client for my 2nd server. It isnt ideal since EPG doesnt work.
All in all I can either spend hours making a VPN or get EPG to work in simple-tv, but pvr.hts is a way better client and setting up a VPN is quite a bit of work in regard to the benefit.

I hope we get some developer attention!
If you found a solution that works for you and your happy with until a developer is willing to take this on, that is great and there is nothing to add.

Just for those who will encounter this thread at a later point in time, I would like to clarify that there will be no difference in internet traffic between the situation where you join the backends as compared to whether you have two frontends connecting to the backends separately: The remote backend will not just stream random channels or muxes constantly but just on request, i.e. when you request a specific tuner to stream through the frontend connected to the local backend.
Why not port forward over ssh? Both backends are linux so setup should be easy.
birdwatcher Wrote:Would it be really difficult, on the configuration screen for the PVR addon, to have a dropdown for "number of backends" that defaults to 1, but allows you to have 2 or even 3? And if you specify 2 or 3, then extend the page to ask for the details (ip address and port, login info, etc.) for backend #1, backend #2, and backend #3?

Yes. If it was easy it probably would have been done already. Neither the addon's internal architecture nor the addon architecture of Kodi itself is suited for running multiple instances of the same addon.

birdwatcher Wrote:I wonder if that's partly to keep users from unknowingly blowing through their ISP usage caps?

I agree that it's a bit limiting, but no one would cripple a protocol for this reason only. Tvheadend can use a SAT>IP server that can't be auto-discovered too, you just have to pass the XML manifest of it as a parameter during startup (see tvheadend --help).

Now, if both your servers are in your home then it's by far easiest to set up one of them to act as a SAT>IP server and the other to act as a SAT>IP client. That way you only need to manage a single instance (the SAT>IP server doesn't do much except serve traffic). There is some documentation scattered throughout the web, although I'm not sure if there's a definitive guide. I did it once but can't remember the exact steps. Join #hts on irc.freenode.net if you need any help.

birdwatcher Wrote:If I am understanding correctly, a SAT>IP server can only stream channels in real time; it does not "record" anything

A SAT>IP server can stream as many things as it wants, it all depends on how you configure it.

birdwatcher Wrote:yet if you suggested to some of those same people that they only need a single hard drive to store their media they'd howl in protest

You can configure separate recording profiles that record to separate hard drives, so being limited to a single server isn't that bad. Recording and playing recordings are also constant throughput operations so it's not that easy to hit the disk limits.
(2016-09-03, 23:38)negge Wrote: [ -> ]Now, if both your servers are in your home then it's by far easiest to set up one of them to act as a SAT>IP server and the other to act as a SAT>IP client. That way you only need to manage a single instance (the SAT>IP server doesn't do much except serve traffic). There is some documentation scattered throughout the web, although I'm not sure if there's a definitive guide. I did it once but can't remember the exact steps. Join #hts on irc.freenode.net if you need any help.

Again, I have reasons for not wanting to do it that way, some of which I have stated and some of which I have not and will not. However, the part that I have bolded above is what really gets me. There's no guide for doing this, you can't even remember the steps, and there may be some documentation somewhere on the web. And yet this is what you recommend? I don't use Kodi and TVHeadEnd because I want to be a developer, or because I want to search all over the Internet for instructions that if they exist, are probably written in such a way that there's no hope I could understand them.

I was talking with someone about this the other day and we sort of came to the conclusion that if one of the Kodi developers had two TVHeadEnd backends and wanted this to work, it would probably be coded in a half hour. Sometimes I wonder why you guys ever released Kodi since you seem so hostile toward users and non-developers sometimes. I can only think of one other piece of software I use that's in the same situation, where there are no good alternatives and yet I hate the software with a passion sometimes because of the choices made by the developers, that at times totally ignore what the users would want and only seem to work on stuff that interests them. The problem with something like Kodi is that you have cornered the market - if people are dissatisfied with Kodi, there's really nowhere else to go, especially if you don't run Windows. This is not just about you not natively supporting multiple backends; the workaround has always worked in the past and if necessary I can put up with Kodi crashing occasionally, and if some version of Kodi won't start at all with two of the same type of backend then I just won't use that version. But what really gets me is the type of response given above (the bolded part). If that was an attempt to be helpful, it failed miserably, although if the documentation doesn't exist I suppose there's not much you can do about it. But until such documentation does exist, you might want to stop pushing it as a solution in cases like this - it's not a solution if 99 percent of your users wouldn't stand a prayer of getting it to work because there is no documentation, and because most people don't even know what SAT>IP is (I honestly don't fully understand it; every time I think I have a handle on it someone tells me I'm wrong).

Also, I hate IRC with an unbridled, burning hatred, in part because when people do actually come up with solutions for one person they are not archived, so the next person wanting the same information has to ask again, and so on. And you never know if you are talking to someone who knows what they are talking about, or some joe schmuck who thinks he knows an answer but is spewing garbage. And also, you never know when you are going to offend the delicate sensibilities of some IRC tin badge dictator that has the power to ban you from the group.

If I seem a little hostile it's because I just hate the fact that people seem to act like I should do things a particular way, even if I can see drawbacks to doing it that way. At this point, I need to run two separate, independent backends that do not interact with each other in any way. I will mention ONE other reason - if one fails or has to be taken offline, it doesn't impact the other in any way. That is NOT going to be the case with any scheme that feeds the output of one into the other. So please consider that what may seem to be the ideal solution for you, may not work for everyone. Several people have requested that Kodi natively support multiple backends of the same kind; if you can't or won't do that then please don't rub our noses in it by making suggestions that only a developer, or someone else with an exceptional level of expertise could implement.
Pages: 1 2 3