zen.org Communal Weblog

May 2, 2005

Nearly fully usable MythTV box now!

Filed under: — brendan @ 12:23 IST

The term “fully usable” is pretty relative, but we’re much happier now than we were a few weeks ago.

We can now:

  • See all parts of what’s being displayed on the TV screen. Before, parts just in from the border were past what the TV could show. This made the Setup stuff really difficult, since the little selection boxes showing checkmarks weren’t even there to tell if something had been turned on. I had to mess with the settings for appearance it ended up where I wanted. It’s still not perfect (a hint of the blue from the Fedora background on the lower right corner of the screen when it’s going from the MythTV front-end to Watch TV mode.
  • Go between recorded TV, live TV, and downloaded AVIs without having to switch the audio between the Shuttle’s L/R line out audio and the audio from the PVR-350 card. I got an RCA-to-headphone jack plug, and plugged the RCA part into the PVR-350’s pair of audio plugs. The headphone part went into the Line-In port on the front of the Shuttle. I ran alsamixer in a terminal window, and enabled (by hitting the ‘M’ key) the LineIn input, and turned it up all the way. This is all it took.
  • Let MythTV change channels on the NTL Digital Cable box all by itself. I got a Red-Eye Serial channel changer and it worked like a charm. Only a few basic steps to make it fully automated.
  • Have a usable system right at startup, just by having /etc/rc.d/rc.local invoke “/etc/init.d/mythbackend restart” after it’s done the load of the ivtv driver. This helps work around the system being unable to show TV because the backend doesn’t know if the driver’s usable yet.
  • Made the green Power button on the Hauppauge remote let us stop and restart the MythTV front-end GUI. This helps a lot when things are stuck.

There’s plenty yet to do, including actually working on the timing problem playing mpegs (audio is ahead of the video). But for day-to-day use, it’s much more helpful and accomplishes the goal of letting us set up to record random shows to watch when it’s convenient for us. (Thus the pile of Oprah and CSI. 🙂 ) I want to make transcoding work so it’s able to take the large recordings in the default MPEG2 format and shrink them down to MPEG4 format so they don’t eat up quite so much disk space. And, finally, listen to the ivtv-devel mailing list where they’re talking about this sort of problem:

Apr 30 10:46:02 shuttlecraft kernel: ivtv: 1000 ms time out waiting for firmware
Apr 30 10:46:02 shuttlecraft kernel: ivtv: Failed api call 0x00000015 with result 0xfffffff0
Apr 30 10:46:02 shuttlecraft kernel: ivtv: DEC: couldnt read clock

These are the messages that appear after the MythTV display has frozen, most often while doing a bunch of fast-forwarding through a recording. I tried the update driver of April 30th, but it did eventually bump into the problem again, though admittedly it seemed to take longer before it happened. They’re doing a cool job of hacking away the problem.

Oh, our NTL box (Pace 4001NC) was rebooting itself at random times, often ending up in some sort of a locked state. NTL came to replace it, and we got this other, silver-colored box (Pace Di300-N). It has only a single SCART output on the back, where the other one had both TV and VCR output ports. I set up a SCART splitter to take the single output from the silver NTL box and let it feed both the TV and the MythTV box. Recorded shows, most of the time, look just fine. But if you’re watching TV thru the MythTV box, it now has this odd brightness problem. It seems to almost pulse from dark to light, and there’s also a stretch of shadow from the top to the bottom, a couple of inches wide, that travels across the screen from the left to the right. I’d only seen it while watching TV thru the box, but in the last couple of days I’ve noticed it appear in a couple of the recordings—but definitely not all of them. It doesn’t happen when you watch the NTL digital box going right into the TV; that, in fact, is a much sharper and clearer picture in comparison to the previous 4100NC box.

We’re going to see if we get the same behavior feeding it into the VCR, and if it occurs there too, we’ll try to get NTL to give us yet another box (this is #5 in about 3 years). If the VCR doesn’t have the same problem, then it’s a question of the S-Video coming into the PVR-350 card, and then the S-Video (or RCA video) from the PVR-350 card back out to the TV. Lots of experimentation to do, but at the moment we’re just not using our box for watching TV much. Just recording things. (Thus we lose out on the great benefit of pausing live TV, dammit…)

Finally, I went into Setup -> Video -> Player Settings, and tried changing the current value of

mplayer -fs -zoom -quiet -vo x11 -ao oss -nocache %s

to instead be “Internal” to see if it’ll do MPEGs better. I played a couple of different AVIs to start, but mythfrontend wasn’t rendering them fast enough. Oh well. I put it back to using mplayer, and will spend more time on this some other day.

It looks like the biggest hurdle to take on at the moment is playing mpegs.

More later,


Fixed Size:
I went into “Utilities/Setup” -> Setup -> Appearance and started fiddling with the settings. I put in 720 for the width and 576 for the height, then gradually reduced each one til it looked a bit better. Each time I’d adjust a number, do Next til I could do Finish, and see how it looked. Iook the numbers down to 640 x 510 but it also shows that MythTV is displaying something out of skew…I could experment going to 530, 550, 560, then back down to 551, 552, til 555 looked like it was right on the line of the tv screen.

Lots of waiting while it pre-scales theme images repeatedly. It was also much faster to adjust with the keyboard’s Left & Right arrow keys and use the OK button on the remote to click the Next buttons. Trying to use the left & right arrow buttons on the Hauppauge remote was too slow. Once the size seemed like it’s likely to be right, I had to adjust the X offset and then Y offset to make it all sit in the right place. I found it helpful to drop the width & height down to something small like 620×500, and then tweak the offsets until it sat properly in the smaller view. Then I pushed them back up to 640×550 and it looked right.

The final numbers for me were

width(px) 640
height(px) 550
X offset = 50
Y offset = 11

The end story being that it’s tedious (and should be possible to automate this) but possible.

Channel Changing:
The Red-Eye Serial consists of a 9-pin female serial plug on one end, and the small bit of electronics on the other. The serial end gets plugged into the sole serial port on the back of the Shuttle, and the other should be taped onto the front of NTL box on the right side of the LED display. I created a script called /usr/local/bin/red_eye.script containing just

# Put it into the background, which makes the on-screen effect look much faster.
/usr/local/bin/red_eye /dev/ttyS0 $* 2 &
# The exit 0 is important, otherwise mythtv thinks it failed and
# tries to switch back to the previous channel.
exit 0

The arguments are the serial port, the channel number (what our red_eye.script script receives as its only argument), and finally the number 2, indicating how many milliseconds it should hold off before trying to do anything else. (Or, more to the point, how long to wait before potentially allowing anyone else to send a command to the box.) Also, the “exit 0” is important, otherwise mythtv thinks it failed and tries to switch back to the previous channel. It occurs to me another part of this fix is adding “exit (0);” at the end of main() in red_eye.c; right now it’s exiting with the return status of a call to printf, which explains the non-zero status out of the red_eye program. The file /usr/local/bin/red_eye came from a set of downloads for the Red-Eye Serial. I recompiled it from the source provided just for my own state of mind (had to change “exit();” to “exit(1);“); I should’ve added the “exit (0);” bit too.

It was also important to edit /etc/group and add mythtv to uucp group so the program can send the channel number to the serial port. Putting them in the group avoids messing with the default permissions on /dev/ttyS0. (This is with Fedora Core 3, it may have different ownership on other Linux distributions.)

Finally, I ran mythtvsetup, chose Input Connections, and selected S-Video0 (NTL Digital Dublin). In its setup page, I changed “External channel change command” to be “/usr/local/bin/red_eye.script“. I went to Finish (doing Ctl-Return on my keyboard), then the Escape key twice. I had to restart mythtvbackend for the change to take effect.

Following Jarod Wilson’s Tips ‘n Tricks, the green Power button on the Hauppauge remote can now stop and start the MythTV front-end. This is really handy on the odd occasion when it freezes up for one reason or another. I just had to add the lines

prog = irexec
button = OFF
repeat = 4
config = /usr/local/bin/mythpowerbutton.sh

to my ~/.lircrc file, and create the script /usr/local/bin/mythpowerbutton.sh containing

STATUS=`ps -e | grep $PROG | grep -v grep | wc -l | awk '{print $1}'`

if [ $STATUS -eq 0 ]
( $PROG & )
killall $PROG
exit 0

Big amount of citizens simply cannot allow themselves to get health insurance so they have choice to pay for the really expensive prescription meds or trying to buy generic pills online. Generics produced in India are very good as other branded meds. Only reputable pharmacy produces them such as Sunrise remedies. Having this in top one is allowed to buy clomid uk in generic pharmacy online with extremely affrodable shipping to any point in the world

Powered by WordPress