BlogCadre users see no ads!  Popular topics: humor, video, links, cool, wtf.  Go create an account!




MythTV & High Definition...minimum requirements

Polar Express 720p Frame

Why have you forsaken me?

My MythTV box has been chugging along nicely, playing DVDs and recording two shows off of a 2-tuner standard definition hardware MPEG encoder card (doing all at once). Just before Thanksgiving, I purchased a projector that can do 720p and had been enjoying the finer detail of my DVDs at full resolution. However, standard definition material really looks like crap when displayed on a 69" screen. Enter: High Definition. I bought a HDTV tuner card, thinking that I had prepared myself for this moment. According to the MythTV documentation, the minimum recommended processor speed for recording and playing off of one HD Tuner card is about 2.4GHz. So I built my box with an Athlon XP 2800+ (2083MHz clock speed) thinking it would be up to the task. Think again...

To get my CPU usage to a managable level while playing HD content, I had to change the MPEG2 decoder to XvMC, which brought it from an utterly useless 90% to a more managable 50%. I then had to deal with tearing issues on HD programs. While researching I discovered the older 5 series nvidia cards apparently don't have the tearing problem (because they work correctly with the OpenGL software), so I switched out my 6200 for a 5200. This solved my tearing and still plays HD with about 50% cpu usage, however... if even the slightest process starts, ends, operates or even so much breathes there can be issues.

Mostly these issues stem from doing too many things at once. Recording/Buffering/Playing HD with a 2 channel audio stream will work as long as there's nothing going on (listing the guide on-screen, browsing channels, etc.). Where it really falls apart is when you add in AC3 passthrough. Yesterday on ABC, Polar Express was being broadcast in HD. It was a sight (and sound) to behold, 1280x720 with Dolby Digital 5.1 sound -- all over the airwaves. The scene where the train stops at the boy's house was amazing! It rattled the cups in the cupboard... until the audio started dropping out. Then, as South Park started to record later, it got worse, much worse. I had to stop that recording, cancel three more 1/2 hour recordings as well as suspend all commercial flagging just so I could finish Polar Express. This is when I realized I simply need to upgrade. To everyone else, learn from my mistake: when you read that 2.4GHz is a minimum, remember: this is the bare minimum. If you want to do DD5.1, deinterlacing, and have video without tearing go read the benchmarks and buy the fastest thing you can afford.

This is the approach that is sometimes looked down upon by software developers: throw some more hardware at it. I think this is usually a bad approach because it probably indicates that the software isn't as efficient as it should be. This may be the case of the nvidia drivers or even MythTV itself. But right now, what my box requires to do high definition is some more horsepower. It seems doing 1920x1080 video at 30fps requires quite a bit of processing power. It reminds me of when MP3s first became popular. My poor Cyrix 6x86 120MHz (marketed as 166+) could barely play a MP3 without stuttering... I had to run my MP3 player with setuid root, and dare not doing anything else on the computer! Similarly with HD, the 1920x1080 video can only be rendered by pretty expensive display devices -- seems that it also goes for processing HD too.

So I ordered a new Intel Core 2 Duo E6600. Two cores at 2.4GHz, 4MB cache. Yes I know the clock speed is slower than "the recommended" but now that we're onto a new instruction set and 64 bit words the numbers are a bit different (I believe the MythTV docs reference P4s and Athlon XPs). I'm kind of excited as this is the first desktop/server class Intel processor I've ever bought

All this is to really do away with XvMC and let the new, powerful processor handle all the MPEG decoding with standard libaries. Without the (broken) XvMC / nvidia interaction, there should be no tearing, plus I can have color menus, get Picture-in-Picture back, and hopefully be able to record 3 shows (2 SD, 1HD), commercial flag, and watch a HD program all at once. If I can't, you'll surely hear back from me...

Disk activity?

Jason Striegel's picture

Could some of the slowdown be coming from disk access and throughput issues? I'm assuming the file stream has a much higher bitrate in HD, and when you're recording and playing at the same time, you're asking that drive to shuffle all over the place while laying down a lot of data.

Also, don't some of those video cards have onboard mpeg2 encoder and decoder hardware so you can offload all the heavy lifting?

Re: Disk activity?

I am running just one big SATA drive right now, but I get 75MB/sec from reads, and just from watching output from top I can tell that my problems are CPU related -- especially when the commercial flagging runs. That is a highly computationally intensive operation and it is the worst offender.

There is MPEG2 decoding built into the video cards, but I'm not sure if the software and/or drivers are broken (stuff seems to generally work fine w/ nvidia and MCE). I've heard about certain cards that have a window of 1024x1024 that can do MPEG2 decoding, however this falls just outside 1280x720 and farther outside 1920x1080.

However, I'm willing to try any suggestions (my new hardware probably won't arrive until Tuesday).

One option

Jason Striegel's picture

You could dump the full HD stream to disk and transcode it later to shrink it down. What's the HD card you are using? I wonder if these cards even do onboard encoding and transcoding since the signal is already encoded at the broadcaster's end.

Nice is your friend..

I had some issues with certain programs trying to compete with the currently playing show, so I made sure that commercial flagging, tv listing updates and some other things were all niced. That way they don't take priority over the current encoding or decoding processes.

-Ryan Larson
Junster.com

too many concessions

I'd already set the commercial flagging to low cpu usage (niced) and then additionally I had to make it so jobs were only run from Midnight to 10AM so it wouldn't (usually) interfere with watching (HD) programs. I snapped.. I couldn't take it anymore!

I could follow the advise of Jason and Brandon Beattie by transcoding all of my HD programs and just watch them the next day. Brandon of course has a lot to say about MythTV and processor choice since he's written some of the HD related code in MythTV.

option 3: render farm

Jason Striegel's picture

do your capture and display on one box, and have a second machine that watches an incoming folder and compresses stuff down to high res mp4, etc. you can still watch the live streams, because your display machine isn't bothering with de-interlacing and doing other transcoding cpu-intensive hoohaa. plus you get your ultra-compressed files as they become available, no need to wait till the midnight run.

Already planned, if the core 2 can't tough it...

MythTV is engineered so that the backend (with the tuner cards, program guide, database, commercial-flagging, transcoding, & major disk IO) can be installed on a seperate (backend) server. If the Core 2 can't handle everything, I'll be taking my 2800+ building a backend with it and putting it in the closet. Honestly this is the best choice because this box can be as loud as ever since it's in another room. I could load it up with many disks (and fans) and also more tuner cards.

The front end then basically deals with getting the stream over the network, rendering video & sound. All my boxes are Gb-Ethernet, so I should be well-prepared for this as well.

Sage TV

I currently use sage tv, and run it on my main computer, I have an athalon 64 3000+ running at 1.83 GHz, 2 Full Speed 250 GB SATA Drives running in a Striped Raid configuration. A standard Definition hauppauge Dual Tuner card with hardware MPEG2. I know its not HD But I record 2 programs, Run Visio, Outlook, Word, and Play high end DirectX Games all at the same time. Oh and I have ZoneAlarm Monitoring everything and that takes up some processing too since everything runs through it.

Oh, and I don't even run my athalon 64 with 64 bit software, I am still using 32bit.