A Django site.
May 29, 2008

Hans Fugal
no nic
The Fugue :
» XvMC

I bought an MSI NX6200AX-TD256H D2 video card (It's an NVIDIA GeForce 6200 256MB 8x AGP card) to drive the MythTV frontend, since MythTV can't manage to play even the most modest content using my trusty old Radeon 7000 (MythTV doesn't support VIDIX, only XVideo). I hoped that the upgrade would allow me to watch live HD television, which means XvMC.

Before I go any further, the other relevant stats: the computer I'm using (for the purposes of this post, anyway) is an 64-bit AMD Athlon 2800+ running 32-bit Ubuntu 8.04. The motherboard is a VIA K8T800. I'm actually using TwinView to share the Desktop computer with MythTV, but I tested everything with a single-screen (the CRT) to avoid confounding, and using TwinView doesn't seem to make a difference one way or the other.

All the normal stuff works great, but XvMC does not though it should. Whenever I try to use XvMC, the client (mythfrontend or mplayer, for example) freezes up and must be killed. I tried all the standard tweaks that Google could suggest: enable/disable sync on vblank, enable/disable OpenGL vsync, various xorg.conf settings. I tried just about everything I could think of and then some, and the only thing to make any difference at all is this setting in xorg.conf:

Option "NVAGP" "0"

That is, I disabled AGP. When I do this, XvMC works as it should. After a little research, it perhaps shouldn't be too surprising that AGP is the problem on a VIA motherboard. At least it's a lead.

Interestingly, when I downgraded the driver from the latest (173.14.05) to the newer legacy driver (96.43.05), XvMC works fine with AGP enabled. As one would expect, it outperforms the newer driver with AGP disabled. Here's a performance table:

               (% CPU when playing SD/HD in MythTV)
Driver                       Xv     Xv+linear    XvMC+bob
173.14.05 (AGP disabled)  20/100+    30/100+      12/60+ (OSD is too much)
96.43.05                  20/100+    30/100+       8/45

There's a few caveats to XvMC, either way I get it to work. When deinterlacing is on, the OSD gets deinterlaced too. This isn't a pretty sight, though it's functional. The OSD is always grayscale, in spite of setting XvmcUsesTextures to false in xorg.conf and choosing chromakey. But that doesn't bother me much, I don't much like the color schemes of the OSD themes I've seen.

I have one more straw to grasp before I consign myself to using the legacy driver (which I may do if it runs FlightGear and X-Plane ok) or crossing my fingers for a fixed driver before the Olympics (I intend to submit a bug report). I'm going to try poking around with AGP driving strength settings in the BIOS. I tried 0xEA and X wouldn't start at all, but with the same symptoms I get with XvMC. That hints at the same cause, so maybe with some kind of binary search I can stumble on a compatible setting.

So in conclusion, I'm going to try using the legacy driver even though my card is supported by the newer driver, and for OSD reasons only use XvMC for HD.

April 28, 2008

Steve Dibb
beandog
wonkablog
» pimp my mythvideo: navigation patch

Even though I can’t code in C++, or anything more hardcore than bash (and even that’s pretty sketchy), with a push in the right direction from a noble soul in #mythtv, I managed to mangle a patch together for MythVideo that fixes some annoyances that I’ve had for a very long time. They are:

  • Filenames won’t display underscores, but folders would
  • Getting rid of the “cover image” screen in the gallery
  • No page up, page down support with your remote

The patch is here, which should apply cleanly to media-plugins/mythvideo-0.20.2_p15087. Or you could just try and use my overlay directly. If you look at what I’ve changed, it should be really simple to make the same changes to the most recent version for SVN, since I don’t think the file has changed much between releases. Creating patches is also not my favorite thing to do, and in fact actually took me longer to create the actual diff and apply it correctly then it did to hack the code.

Here’s a complete list of what I changed, if you don’t want to go digging around the code and determining what’s happened for yourself:

First, the issue of page up / page down. Sure it’s nice that you can do that with a keyboard, but if you are using a remote, it’s painful scrolling when you have a lot of folders to look through. I remapped 1 and 7 to emulate Home and End, and 3 and 9 to emulate Page Up and Page Down.

Second, for the display of folder names, if it has an underscore in the title, that is replaced with a space. This is consistent with the naming scheme for the actual files.

Third, and always most annoying to me, is that I got rid of the information screen that displays all the metadata about a movie after you select it in gallery mode. I always thought that was pretty useless, because I already know what I want to watch, and didn’t like having to hit enter twice to start playback. There was a shortcut already, you could just hit the Play button and it would skip the screen, but I think this is more effective and natural.

Finally, I disabled the Menu, Filter and Info options by commenting them out, for the only reason that I never used them and sometimes they would pop up when I was debugging stuff with mplayer and my remote.

Needless to say, I’m much happier now with my user experience, since MythVideo is all I’m using right now. I have a really low tolerance for small tweaks that bug me, and I’m glad I finally got these taken care of. Besides, it’s forced me to start learning some C++ (again) so I don’t have to keep relying on people to help me get started.

Now I can go back to watching Roger Ramjet and Knight Rider in navigation harmony. It’s great. :)

January 13, 2008

Steve Dibb
beandog
wonkablog
» mplayer-resume-1.5

A bug in MythVideo inspired me to work on fixing mplayer-resume tonight, so that it can properly handle movies with filenames.  I don’t know why I didn’t think about this before, but it’s simple if the file is properly escaped or quoted.  And so, mplayer-resume v1.5 is released, with support for spaces in filenames, finally, and also one other cool little thing: it works with playlists now, to a degree.

The playlists thing is kind of hard to explain, and it’d be easier to point you to the documentation that I’ve already written.  Instead, I’ll just describe what it is I’m going to use it for.

One thing I’ve been wanting to add to my MythVideo setup is some playlists so that I can randomly play something.  I have a lot of cartoons and videos and movies, and sometimes I don’t feel like picking something myself — one of the nice things about TV in general is you are genuinely surprised when you’re channel surfing and something cool just happens to crop up.  That’s kinda what I like, and what I wanted to do.  But, I wanted to take it a step further.  If I started playing $random_episode, then if I quit, I want to be able to resume playback of that same show.  Up until now, mplayer-resume wouldn’t work that way, since if you’re randomly picking something from a playlist file, there’s no real way to seek back to the same one.

That’s fixed now.  The script will read the filename of the movie you are playing when you exit (once you setup .lircrc correctly), and checks to see if that’s the same file you started playing.  So if I play random.pls and it plays Tarzan.mkv, and I exit, then when I go back to watch Tarzan, it will resume in the same place.  Basically, it saves the file position for Tarzan instead of the playlist file.  Pretty cool. :)

So, there you go.  I’ll put it in portage shortly as well.  Enjoy. :D

January 12, 2008

Steve Dibb
beandog
wonkablog
» comcast cable tv upgrade, part two

Comcast came out on Friday morning and installed my upgraded cable connection. Strictly speaking, I have no idea which tier I’m actually on right now. I know it’s at least expanded digital cable, and I think I get some HDTV channels. To be honest, I haven’t played with the settop box for more than 5 minutes. The real reason I wanted to get cable was so that I could have the Hallmark Channel again. Unfortunately, it looks like that’s not going to happen. I’ve tried everything, and the only way I can get the channel is by using the settop box. In the meantime, I only added 4 channels that I was interested in watching (Food Network, TLC, HGTV and Animal Planet), and am living with that.

There’s a lot more channels that I like to watch, but I’m taking it slow. Another channel I’m mostly interested in is TNT, since they play Without a Trace and Cold Case regularly. I think. Anyway, I’m actually trying to cut *back* on the number of channels I watch (one of my TVs only has all the PBS channels on it, which is a nice change of pace), but the fact is that some channels on cable have a much better and interesting lineup than the local ones.

Onto the cool stuff though. The settop box is a disaster and a half, or at least the menu is. I’m going to have to take screenshots because it really is unfathomable how much of a UI nightmare this is. Here’s my biggest beef with the whole thing: you can’t setup a custom channel list, or even add / delete channels from your lineup. If you want to go channel surfing, you have to go through *every* *single* *channel*. The only option around that is to add a ‘Favorites’ list, for which the remote has a button that will flip through those, but only going up. It’s incredibly annoying because adding / deleting channels has been a standard option for TVs for decades. Comcast’s settop box does let you setup a list of your favorite channels, but to browse it, you have to go through about 3 or 4 actions on the remote to get there, and even then it only displays the list in a guide. If you go back to hitting channel up or down, it just cycles again through every channel you get. And there are a lot of channels. And of coures it doesn’t ignore the ones that you aren’t signed up for, so you get to muddle through about three dozen that you aren’t authorized for.

I *think* that that the DirecTV and Dish Network boxes let you create lists, and then keep you in those channel lists for when you want to channel surf. I’m not sure, since I’ve never given one a good hard look. I’d switch to one of those just for that, though. In fact, I probably will.

In the meantime, I’m going to screw around with this settop box for a bit more before taking it back to Comcast. From what I’ve been reading, MythTV can add the box as an input device, using a firewire connection to control the channel tuner, and of course record TV. Mine is the HDTV DVR (Motorola DCT3416), and I haven’t yet seen much info about connecting one. The anecdotal evidence so far seems to be along the lines of “plug in the cable, and it works great.” We’ll see. I don’t even have a firewire cable.

So that’s where I’m at right now. I’m not gonna use the settop box unless I can get Myth to play around with it. Even then, I don’t need it, since I can tune into all the channels I wanted anyway with my normal TV tuner cards. I still need to see exactly which channels I get. I actually ripped it out from my HDTV since the picture was so horrible to begin with. Even on component output it looked incredibly crappy, not to mention worse than my original coaxial input connection. I plugged it in briefly using HDMI, but that was just as unimpressive.

I’m toying with the idea of getting a Tivo just to see what my options are (yet another area I don’t know anything about, so who knows), but I’m not too optimistic anything good would come out of it. I’ll probably buy one used somewhere just so I can see if its worth it.

The real good thing is that, despite all these interesting issues, is that I’m perfectly happy with my original cable lineup, so if I rip everything out, I won’t miss it one bit. I’m just curious to see what I can accomplish though. It’s fun. :)

October 31, 2007

Scott Paul Robertson
spr
Spr: The Ramblings
» Mythweb Displays Blank Page in ArchLinux

So a while back I upgraded my mythtv installation, and suddenly mythweb was returning a blank page.

It turns out the problem was a PHP upgrade that changed the php.ini to disable sessions. I just needed to copy over the php.ini.pacnew and enable the extensions I'd need (mysql.so) and restart httpd. Then my copy of mythweb was back up and running.

September 13, 2007

Steve Dibb
beandog
wonkablog
» pimp my mythtv

I’ve been having a lot of fun with my mythbox lately. I’ve learned some really cool stuff about Myth, MPlayer, LVM2 and multimedia in general that is really helping to polish my setup. Add to that the fact that I’ve been working on dvd::bend quite a bit lately, and getting some bugs taken care of, and things are really adding up. I also finally took the plunge last week and bought my first 750 GB harddrive. I’m up to 1.6 TB of space in my server now (5 harddrives in one box), and I haven’t even hit 50% capacity yet. I’m sampling a little bit from all my TV series and getting them on there, so I can at least watch something from everything I have. Eventually, somewhere down the road when I have lots more space, I’ll have everything completely archived. For now, I’m still experimenting and getting used to the setup. It’s getting pretty nice.

Here’s some of the cool little stuff I’ve found out recently.

mythtv custom menus

I didn’t know this til just the other week, but the design for the menu layout that Myth uses is all in XML files, and right there in the themes directories (/usr/share/mythtv/themes). That said, you can customize them all you want! Just read the docs, and you’ll be up and running in no time. It’s really simple. It took me just a few minutes to simplify my main menu so I can jump to the TV recordings and MythVideo really easily.

mythvideo gallery view

I’m really having fun with this one. There’s a few things I’d change, but for the most part it works great. Here’s what my layout looks like right now:

mplayer + xvmc + high motion

I just barely discovered this tonight. One of my frontends is a Pentium 4 1.6 gHz, which does plenty well. You really don’t need that much horsepower to play back video. It’s got an older nvidia AGP card in there which works just fine with s-video out. The only problem I have is that there is sometimes a slight stutter on the video with some high-motion scenes. I’ve actually started to get used to it, but then I found out that using the XvMC video out option really makes things much smoother.

At first I was just playing with it to see if I could get the CPU usage down. It was only dropping by about 10%, which wasn’t that great, especially since it was still running high … around 35%. Turns out I had cpufrequtils set to use the powersave governor, so my CPU was only running at 400 mHz. Whoops. I bumped it back up to full speed, and mplayer dropped down to around 10% total.

But, even then, at the lowest speed, the video looked gorgeous. I’ll admit it might have been my imagination, but those motion blur issues seemed to go away. I was so surprised by the results that next I ran it through the Star Trek test (which everything has failed), and played back some Deep Space Nine. Normally I’ll test TNG since I’m extremely picky about the video quality on that one, and I’ve seen them enough that I can notice video artifacts more easily, and this was only the 2nd time I’ve seen this DS9 episode. But, it still looked nice. I could notice some small amounts of blur, but it was pretty minimal. So, who knows, that solution might work well for everything. We’ll see. I’m feeling pretty optimistic about it, and at the very least it works great for my older TV.

mplayer + audio delay

Before that, I was taking a break and watching some A-Team. Great stuff. On one episode, the A/V was off just slightly. This has always plagued me in the past, and it’s one of the reasons I don’t bother with encoding files. Also, this has happened before on another Universal disc (of all the DVDs I have, they have the most problems … they are rare, admittedly, but that studio is still the winner). I remembered reading somewhere about adjusting the audio delay with mplayer, so I checked the man page. You just use + and - keys on the keyboard to adjust it by 1/10th of a second each way, faster or slower. Played around with that, and the A/V was back in perfect sync. So, I mapped my channel up / down keys on my remote to do that in case I ever run into that problem again, and now that’s all fixed too.

matroska saves the day, and disk space

This is another cool one I noticed last week. This is all anecdotal evidence, so YMMV, but I’ve noticed that Matroska files are consistenly smaller than AVIs. About 8% smaller, in fact. I noticed that quite by accident while playing around with some encoding files. At first I figured I had done something wrong, but the results proved the same after quite a few tests. That is a lot of overhead for AVI, sheesh. Just one more reason to love and use Matroska. :)

Seems like there was something else, but I can’t remember now. Ah well. Anyway, I was hoping to get all those random thoughts down sometime, so there you go. Lots of fun playing around with this stuff. I’m pretty blown away by how well it’s working and how polished the whole thing is getting. Once I’m done for good, I’ll be sure to document how to reproduce the entire step in detail. Good times. :D

August 13, 2007

Steve Dibb
beandog
wonkablog
» one htpc, coming right up

So, how long does it take to build an HTPC with Gentoo, from scratch? How about, Gentoo + LVM2 + vesafb + bootsplash + nvidia + LIRC + mplayer + XvMC + IVTV + MythTV? All in all, about eight hours. I think that’s gotta be some sorta record.

Actually, just setting up vesafb plus splashutils took me about three hours. I haven’t played with that stuff in a very long time, and since I’m on amd64, I can’t use vesafb-tng. I did try uvesafb, but didn’t feel like experimenting to see if I could get bootsplash working as well, so just went with plain old vesafb at 800×600 instead. The end result is still really nice. From boot to MythTV’s main screen, the user never sees any text (BIOS is setup to display a VGA image on POST as well).

I mostly set it up again to see if I could do it again. I’ve already got my (original) mythbox in my bedroom, which is just a small Pentium4 with a small 250 GB IDE drive. This new one, though, this is my dual-core Athlon64 with 5 SATA harddrives, totalling 880 GB just for media files. I hadn’t played with LVM2 in a good long while either, and I was cautious since last time I didn’t have much luck. This time, reading the docs, it just clicked and made sense. The thing that always confused me was how the partitioning worked. Once you wrap your brain around the concepts, it starts to work.

I’m also running the latest MythTV that is 0.20, which needs to go real stable here anyway. I’m using 2.6.22 kernel and the 1.0.1 of IVTV which is supposed to have a lotta nice fixes. I’m just glad to see Hans finally got it into the kernel. Good work, man. :) I love the new new MythTV themes in mythtv-themes-extra, too. I’m using a nice widescreen one and it’s gorgeous.

Anyway, I’ve been thinking about it for a while on and off, but I think that this time I’m going to actually write up a good Gentoo doc on how to actually do all the stuff in detail. I still can’t believe I set it all up so fast. I’ll have to post some pictures. :)