Better performance with consolidated frontend/backend, than separate front/backend. Pi2 servers, usb tuner and hard drive.
Added by dad dmac about 9 years ago
I am splitting my configuration from a single Pi2 running OpenELEC front/backend, into two Pi2's with a frontend (OpenELEC) and a backend (Raspbian with tvh from git compiled, packaged, and installed.)
The consolidated, OpenELEC server (front and back on a single Pi2) works well, but the backend in the two Pi2 configuration performs very poorly.
The consolidated configuration (front and back on a single Pi2) performs well, and is running tvh 3.9 which is part of the OpenELEC distribution. The Raspbian backend server which performs poorly has tvh 4.1.
When I use the separate backend the throughput drops to a few hundred packets and eventually to zero with thousands of errors. It is using the same equipment (tuner and antenna) as the single-server setup, and is only a few inches from where there single server setup sits.
I did several pcaps (tcpdump) to try to find a bottleneck, and the network traffic appears to be clean. The cpu's on each pi2 were minimally in use, with tvh using ~15% total.
How can I test to find a usb bus bottleneck? Or, is there something else I should be looking at? Should I test the standalong backend with a lower version (3.9, like the OpenELEC distro)?
Replies (6)
RE: Better performance with consolidated frontend/backend, than separate front/backend. Pi2 servers, usb tuner and hard drive. - Added by dad dmac about 9 years ago
This is how I have been testing:
1. Move the usb tuner to the server being tested.
2. On a third computer, open the tvh webui.
3. On the “Configuration | Channel/EPG | Channels” tab, select play link for one channel.
4. Channel opens in local vlc.
5. Observe the stream in vlc.
6. Observe the information in the “Status | Stream” tab and the “Status | Subscriptions” tab.
RE: Better performance with consolidated frontend/backend, than separate front/backend. Pi2 servers, usb tuner and hard drive. - Added by dad dmac almost 9 years ago
To tie a bow on this...
I only had a license for the MPEG decoder on the backend server. I thought the backend would stream decoded data. Got another license for the frontend and that solved the performance problem.
RE: Better performance with consolidated frontend/backend, than separate front/backend. Pi2 servers, usb tuner and hard drive. - Added by Maury Markowitz almost 9 years ago
Would you say the RPi2 is fine as a backend server?
Do you ever get dropouts or other problems that seem to be performance related?
RE: Better performance with consolidated frontend/backend, than separate front/backend. Pi2 servers, usb tuner and hard drive. - Added by dad dmac almost 9 years ago
When I had both running under OpenElec, I had no problem. Watching live tv, recording, and playing recordings and files worked well. So, yes, I think it is a fine solution. However, I need to mention that I've been working with Linux as an admin since RedHat 6.0, and have 25 years of experience in various IT roles. So, caveat emptor as ymmv.
The only problem I had was getting the xmltv EPG updates to run consistently, and I don't think this was directly related to tvh.
I split the front and back ends because to try all the remedies I read about, I had to add an object to the /usr/bin folder. However, it is part of the squashfs, and I don't want to start having to maintain it due to the complexity and time required to do so.
Clarification: OpenElec uses squashfs, and the /usr/bin folder in the OpenElec distro is contained in the squashfs. squashfs has nothing to do with tvh.
RE: Better performance with consolidated frontend/backend, than separate front/backend. Pi2 servers, usb tuner and hard drive. - Added by Maury Markowitz almost 9 years ago
Thanks for this excellent message!
Some background: I'm trying to figure out the best topology for my home media system. I have over-the-air ATSC broadcasts from two directions, so I need a system that handles multiple tuners (actually, it's not clear I really need that). And one of my clients will be an Apple TV, just to make things confusing.
There are a bewildering array of possible solutions to that problem. TVH with two tuners is one, MythTV front/back is another. Now you've opened my eyes to OpenELEC too. Am I parsing your post correctly: OpenELEC uses TVH internally as its back-end?
RE: Better performance with consolidated frontend/backend, than separate front/backend. Pi2 servers, usb tuner and hard drive. - Added by dad dmac almost 9 years ago
Yes, that is correct.
First, I'm a relative newbie to all of this subject matter. I have heard from folks who use MythTV and are very happy with it. I chose the OpenElec distribution because it was a very complete package. However, there is always a "however", when I started this project I had no knowledge of broadcast technology, and I experienced a learning curve. So, bring your tenacity, and use the TVH irc. That would be a good place to get a qualified answer to your question about how many tuners you need.
The Pi2 is a small project computer on a chip, which was designed to be used to be an affordable solution for learning computer technology without having to invest in a lot of money in it. So, it begs consideration for things like powering a usb hard drive if it doesn't have its own (I use a powered usb hub), bus capacity (the usb and wired network share a bus, but I'm 100% wireless, so it is all usb anyway, and seems to work well), and memory (Pi2 comes with 1G of RAM that is not upgradable). The Pi2 has hardware MPEG decoding, but you need to buy a license from Raspberry and activate it. This is not a disincentive as the cost is 2, um, British Pounds. Activation is trivial, but you will need to know to SSH to the computer, and remount the volume where the file resides to make it writable.
The OpenElec distribution includes the raspbian OS and the Kodi HTPC software. Kodi (renamed XBMC application) includes addons that add function and features. Kodi provides an interface to manage and use the addons and base features, like watching live TV, scheduling and playing recordings, watching video from different sources (like Youtube).
The TVH front and back ends are addons. The front end is fairly simple to use; enable, and configure to connect to the backend.
The backend is a little more complex. A "repository" (source for installing addons) needs to be selected from a menu and then the addon needs to be added and configured. The back end is managed and configured via a webui. So, you connect to the TVH back end and manage it via a browser running on a separate system.
EPG was probably my most significant challenge. Because I'm in North America and for maintainability, I chose to use Schedules Direct ($25 per year) and XMLTV to provide the schedule information. It is not the only solution in North America, and there are many other solutions in EMEA that folks seem very happy with, which are free.
The problem for which I started this post, and that I caused, is now resolved. If you do choose to use the Pi2 as your hardware platform, when you configure the recorder use the Matroska profile and "Don't keep" cache. When you are looking at the form, this will make sense.
Finally, I found the irc to be an excellent resource for information and assistance. I'm in North America and it seems that a lot of the folks in the room are in EMEA, so you may have to make a timezone allowance depending on where you are located.
All of the above is documented on the Raspberry, OpenElec, Kodi, and TVH websites.