Context Switches on Ubuntu

Posted to linux/ubuntu on 2005-12-07 14:08:00

After trying a new motherboard and all that jazz to get my HDTV tuner card working properly I decided to try a new operating system. The thing that prompted this was the notice that some people thought it might be a buffer related issue that was causing some of the reception problems with the card. I also noticed that my system was consistently above 2000 context switches a second even when idle. There was usually around 1100 interrupts a second. I compared this to my RHEL AS box which was around 30/s when idle and running a lot more stuff.

So, today I set out to test this theory some. I dropped in a FC4 x86_64 dvd and installed it on a blank partition on my hard disk. Sure enough, preliminary tests indicate that I'm not loosing data and reception remains clear even when I'm under heavy IO load, such as copying a file over.

So here's my theory. Ubuntu uses a kernel that switches tasks more often to create a more interactive computing experience. However, for devices that produce large amounts of streaming bandwidth, such as HDTV tuner cards (and to a lesser degree SDTV tuner cards), the tasks switch too fast and the buffers never can be completely emptied. By switching to a higher minimum time slice the processor has enough time to empty out the buffers.

Now, the question is this: is there a simple way to change the minimum time slice for tasks under Ubuntu? I remember seeing something where I could set the timer at 10, 100, or 1000 and seeing that it was set to 1000, but I can't find it in the kernel configuration anymore.

Anyway, if you're having HDTV reception problems, I strongly suggest looking at this as an issue. I'm not 100% certain, but the preliminary tests are good. Unfortunately, I can't do the full battery yet because I don't have time and I don't even have video working on MythTV box under Fedora.


MythTV, Ubuntu, Athlon64, WinTVPVR, Comcast Digital Cable, and a pcHDTV HD-3000 in a pear tree!

Posted to linux/mythtv on 2005-11-17 11:08:00

I've been writing a nice tutorial on setting up MythTV on Ubuntu x86_64 over the course of the past few weeks. Please feel free to browse it and give feedback. It still is a work in progress and I could certainly use some help in some spots. I should clarify this by explaining that I've got my system more or less working, with the exception of static on my pcHDTV which I understand is an electro-magnetic interference issue that I can't do anything about. When I move that card into another computer, I'll add details about that too.

For those that are concerned, I'll eventually put up a TRAC site for managing the project and and providing access to the repository of revisions. My goal is to provide a slightly more up-to-date and Ubuntu centric version of Jarod Wilson's Fedora MythTV Guide. I know, that's a lot of hoping. Come on magic google juice, lead people to me.


Comcast Says Screw You!

Posted to linux/mythtv on 2005-09-28 15:09:00

The title sums it up quite nicely. Instead of making it easy for me to watch HDTV, they're making it quite difficult. I called them last week to inquire about HDTV support on cable. I was told that I needed to get a cable box, that would run me $5.99 a month. For another few bucks I could get the digital classic package. Not too bad I guess. Anyway, today the guy arrived. Was a little shocked to see that I didn't have a box but he had one in his truck, a Motorola DCT 6200 to be exact. This is the nicer one with firewire outputs.

Anyway, we hooked it up pretty quickly and I was getting the stations. The problem is that I didn't have any menu support, so I had no guide information. Furthermore, I couldn't actually get HDTV to display on my DVI output. That blew. Instead, I got a nice message saying that it couldn't authenticate me. What the fuck? I can barely understand this message, I could hardly imagine what would happen to grandma reading it.

What was happening is that box was trying to authenticate using HDCP to my monitor which doesn't support it. It's not like I can copy the digital signal from the monitor, but I digress. Basically, when the DVI is plugged in or powered on it waits a few seconds to get a handshake back from the monitor saying that it won't let you copy stuff. If it doesn't get it, it blacks out. So much for fair use. To make things worse, it appeared that I could only get the display when using the DVI, so I had to any settings or browsing for video on demand in the few seconds before the cable box decided I couldn't see that anymore. What the hell?

After some digging around, I found the DCT 6200 User Guide on Motorola's site. It still didn't provide any information about how to get to the uber setup screen that the tech who installed the box got to, but it did tell me that if it was set up to output HDTV then it would not be able to overlay the graphics on the SVideo or composite outputs. Wow, what crappy American engineering. There is hope, you can get to the setup by turning the box off, then hitting the menu key when the box is off. This will let you do some menu stuff using the LED displays on the front of the cable box. Basically, set all outputs to 480i and you'll be able to get your display back.

So now I decided to play with HDTV. It turns out that I can use the box to tune HDTV, but it will downgrade the coax output to SD. Bullshit. That's retarded. So, I tried hooking up my cable line directly to my pcHDTV card. Running some fun scanning software shows me that indeed I'm getting lots of signals. 221 of them to be exact. That can't be right I thought. Running the file command on a single dump didn't prove helpful, it just said data. Mplayer was choking on the first few. Still, it seemed odd. So, I decided to write a little script to scan all 221 channels. Voila, I've got some HDTV channels coming in. Fear Judge Hatchett in HD.

Now I'm left wondering if I need the box at all. I can probably just cancel it because it doesn't work as advertised. But then I would loose Sci-Fi, basically the only good new channel I get. We'll have to see. I may also decide to pick up another tuner card and a firewire cable to control the box and just record programs from that. Could be a lot of fun. More updates later.

Update: One of my helpful readers pointed me to the DVI Magic device, which is sold as an HDCP compatible DVI amplifier. Looks very interesting, but a but too expensive for me at 399 euro's. Pity.


More MythTV Fun

Posted to linux/mythtv on 2005-09-23 11:40:00

I've been having some fun with MythTV as of late. I found out that Comcast now offers HDTV in my neighborhood, so I placed the call. It was going to cost me an extra $5.99 a month for HDTV, as I'd need a receiver box. Bullocks. Luckily, Evan told me a nifty trick I could try. We have just the basic level of cable, costs us $14 or so a month. Mainly we have it because it ends up saving us $1 off the cable modem bill ($56 for cable modem and basic cable, $57 for cable modem alone). He said that he added digital classic to his basic cable for $10 a month, and then got standard cable with it. Probably this is due to the use of filters on the line and the need to remove the filters for digital. Hmm.

Surprisingly enough, the lady on the other end of the line offered me the digital class for another $4 a month, bringing the total to $9.99 more a month. I asked this several times to make sure we weren't getting signed up for something huge, and she confirmed it. We'll see if the Evan trick works. I also specifically requested a DCT-6200 cable box, with firewire for my installation, this should still allow me to use an antenna to get CBS, which I understand is not carried on HDTV on Comcast. No Steelers in HD sucks.

To complement this, and our upcoming deluge of programs, I realized that the current 200GB would just not cut it. Luckily, the folks at FatWallet found a scorching deal on a 200GB hard drive from Outpost for only $50 after $50 rebate. Score. So, we should soon have 400GB of storage on the MythTV box and HDTV, well we'll have HDTV but not on Myth because I still can't pick up a new computer yet (for that reason, see my progress on reading the Bible). Anyway, here's to what will hopefully be a nice upgrade.

I also go ambitious and installed Mythweb finally, no you can't see it. But to make people happy, I did create a virtual host where you can see what's coming up on my MythTV box. Be sure to check out http://mythweb.wagstrom.net/ for all your useless info about my box. If I could figure out how to make Mythweb read only, I might make that point to my mythweb install, but not for right now. Thank you Apache mod_proxy.


My Parent's TV Runs Linux

Posted to linux on 2005-08-26 17:44:00

My parents recently purchased a new house in the exurbs. So far out that Google maps doesn't have any photos for the four highest settings. It's 44 miles one-way to the nearest mall. Yup, that's the middle of nowhere. My Dad built a nice set of cabinets for their living room. Including a a mantle over the natural gas fireplace. When they moved in, unfortunately, their old TV didn't fit. It hung over the front edge about half an inch. Clearly this was not acceptable. The only rememdy, go out and buy a big badass flat panel TV. And they got a nice good one, I believe its the Panasonic TH-37PX50U; a 37 inch widescreen plasma screen. I'm jealous.

Unfortunately, it's stuck in the stretch aspect ratio, which means that all 4:3 content gets stretch to its 16:9 dimensions, kinda strange. Anyway, I was trying to fix this by playing around in the menus when I found that there was option for "license". Naturally I clicked on it.

Here's the full text of the license, transcribed by me:

This product utilizes the following so called
"open source" software:
(1)the software which is licensed under the
  GNU GENERAL PUBLIC LICENSE,
(2)the software which is licensed under the
  GNU LESSER GENERAL PUBLIC LICENSE,
and
(3)software developed by the third parties and
available under certain terms and conditions.
For the software categorized as (1) and (2),
please refer to the terms and conditions of
GNU GENERAL PUBLIC LICENSE and GNU LESSER GENERAL
PUBLIC LICENSE in the following screen.
If you wish to get further information as to
the software, please contact the web site below.
http://ww.am-linux.jp/dl/DTV05U

The problem is, I could not figure out how to get the screen to pull up the GPL or LGPL, which would have been kinda cool. But alas, no dice. Furthermore, when visiting http://www.am-linux.jp/dl/DTV05U one is greeted with a nice 404 error. That's just not cool. I even tried switching the model from DTV05U to DTVO5U, but it still didn't work. Crapola. So then I visited http://www.am-linux.jp/ which makes me wonder again, WTF is wrong with Japaneese people. Really, why do those bunnies need to be there?! I even followed the click stream looking for the USA software and couldn't find anything. Sigh. The Japaneese stuff is there at least.