Wednesday, April 01, 2009

Watch your time

My MythBox seems to have lost some time - it's been missing the first 30 seconds or so of every recording. Sure enough, the system clock was off. At some point, somehow, my time server updates stopped working. I'm not sure what I did to knock it out of whack, and don't care to sink too much time into this right now, but here's what I did to get it back in order.

Check your date with the "date" command.

root@mythtv:/root# date
Wed Apr 1 23:12:09 EDT 2009

Verify that date against time.gov.


If it seems off, you can sync up with a time server manually with the 'rdate' command:
root@mythtv:/root# rdate -s nist.expertsmi.com

That's just one of the time servers I found - I don't remember where. After that, do another check and you should see your time sync up with time.gov, and your recordings will start on time. When I get around to looking into what happened with my time server synchronization, I'll write a follow-up post.

Tuesday, April 08, 2008

Fixed: Missing 80 Seconds From the Beginning of Recordings

For over a month now, some of my recordings have been missing 80-90 seconds toward the beginning. I would notice this mainly while watching "The Daily Show", but never with "The Colbert Report." The monologue would start, and then the video would skip, and I'd hear the audience laughing, not knowing what I'd missed.

I could just write what the problem was, but I think it's useful to see how to go about solving these type of problems in Linux... Of course, that's once you get over the temporary state of depression that usually follows a Linux system problem.

Where was I.... Oh, so I checked the log files, and found occasional entries like this:

----------------------------------------------------
Apr 8 15:55:09 mythbox kernel: [316852.916516] ivtv0: All encoder MPEG stream buffers are full. Dropping data.
Apr 8 15:55:09 mythbox kernel: [316852.916523] ivtv0: Cause: the application is not reading fast enough.
A
----------------------------------------------------

So there's the culprit. Now what? I should mention at this point that myth writes all of its data to a networked Linux file server, mounted by NFS. So, something's going on where myth tries to write to my file server, and the file server, for whatever reason, isn't grabbing the data fast enough, and Myth gives up, dropping it. After 80-90 seconds, it's able to resume writing.

I recalled that I had recently done an "apt-get dist-upgrade", which had upgraded the kernel, as well as just about everything else in the machine. Problems after such an upgrade usually lead to a particularly depressing state of... er, depression. And any error in your log files that contains "ivtv" (or any other driver)... just makes it worse.

Since this was happening at the beginning of "The Daily Show", but not "The Colbert Show," I figured that maybe the NFS server was in some sort of state where it needed to be woken up, and that once it was recording, it was able to successfully record the rest of that show and the next one as well. Basically, I didn't want to deal with this, so I ignored it for now.

After a month of this, I still wasn't ready to fix the problem -- it was time for a hack. I changed the recording schedule for "The Daily Show" to start 5 minutes early, so I wouldn't miss anything when it decided to drop 80-90 seconds of video.

The first time I watched my new recording, I was really upset to see that the video still cut out at the same spot! But... This was a clue! It's not the case that the file server was asleep at the wheel - there's something going on at the top of the hour! This also explains why "The Colbert Report" was never affected - that starts up at half past the hour.

So I started looking through /etc/crontab, but didn't see anything that runs on an hourly schedule on my file server. I then looked through my Webmin screens. Webmin seems to have its own task scheduling system -- I could be wrong, but didn't see anything in the crontabs that point to it. I found that I had an hourly task to backup my databases.

It's entirely possible that this backup could be CPU-intensive enough to tie up the server long enough for my MythTV box to have nowhere to drop the data. So I tested this by running the backup command from the console with the "time" command.

----------------------------------------------------
time /etc/webmin/mysql/backup.pl --all
----------------------------------------------------

'time' is an awesome command. It just runs whatever is after it, keeping track of how long it takes to complete. This took.... 80 seconds.

Problem solved.

Backing up the database hourly is unnecessary anyway - I only archive that backup once a day, so the other 23 are just overwritten and forgotten. That must have been an accident.

So, I changed this to once-daily, at 3AM, and the problem went away.

It's hard for non-Linux users to understand how rewarding it is. Sure, these problems happen, and if you give up, it's hard to deal with. But, if you hang in there, it becomes a high tech riddle. Solving something like this makes the whole experience worthwhile.

Sunday, February 24, 2008

Using 'screen'

I wrote a simple script to start a 'screen' session on my mythtv box when the mythtv user logs in, at ~/bin/start_screen.sh

--------------------
#!/bin/bash

screen -d -m
--------------------

This starts a detatched screen session. I can now ssh into the mythtv box, connect to that screen, and execute commands in the context of the logged-in mythtv user. Before I had setup irexec to run in its own start-up script, I used to launch it from this screen session. And now that I've been using synergy, there's even less of a reason to keep this screen session around. I'll still keep it going, just in case :)

This page is what got me started with screen.

Synergy: My New Best Friend

I wish I had heard about Synergy sooner. This app is so cool. If you have a laptop, and run MythTV, you'll wish you've been using it all along as well.

From Synergy's site:
---------------
Synergy lets you easily share a single mouse and keyboard between multiple computers with different operating systems, each with its own display, without special hardware. It's intended for users with multiple computers on their desk since each system uses its own monitor(s).
---------------

I use Synergy to let me control my mythbox from my laptop. This is not the same as VNC. I don't see the mythtv desktop from my laptop. I'm still using my TV as a monitor, but using my laptop mouse and keyboard to control it. It's very handy for watching web videos on my tv through mythtv, or just to interface with myth a little faster than with my remote control. My mythtv box doesn't have a keyboard plugged into it anymore.

I have my system setup so that my laptop is the synergy server. The server is the machine that has the keyboard and mouse that you want to share. I created a simple script on my mythtv box that starts the synergy client when the mythtv user first logs in (through the session start-up scripts configuration) at ~/bin/synergy_client:

---------------
#!/bin/bash
synergyc --name mythtv [laptop ip address]
---------------

When I want to control my myth box with my laptop keyboard and mouse, i start up the synergy server on my laptop with a simple script named ~/bin/synergy_server:

---------------
#!/bin/bash
killall synergys
sleep 1
synergys --config /etc/synergy.config --name laptop
---------------

If both the server and client are running, I just move my mouse to the right edge of my laptop's screen, and it's now on the mythtv box. Any keyboard activity is sent to mythtv. The clipboard is shared between the two machines. If I want to confine myself to the current box I'm in, I just turn on Scroll Lock. This will prevent the mouse from moving outside the current context.

For reference, here's my laptop's synergy config file:

section: screens
laptop:
mythtv:
end

section: aliases
laptop:
[laptop's ip address goes here]
mythtv:
[mythtv's ip address goes here]
end

section: links
laptop:
right = mythtv
mythtv:
left = laptop
end

section: options
screenSaverSync = false
end

Starting 'irexec' on reboot

Every time I reboot my MythTV frontend/backend box, I'm annoyed that I have to sit in front of my tv with the keyboard to open up an xterm window and run 'irexec' so that the "wife button" works to stop/start MythTV Frontend when it's misbehaving.

I tried setting 'irexec' as a start script in Gnome, but that never worked. I found the answer to be embarrassingly simple... Wrap the command in your own bash script, then set that script as a startup script.

So in /home/mythtv/bin/start_irexec.sh :
#######

#!/bin/bash
irexec

#######

That's it! I set that command as a startup command in Gnome, and now I can unplug the keyboard, and reboot anytime I need.

Tuesday, July 31, 2007

~/.lircrc Updates - ISO DVD Menu Navigation

Another fix that I should have done a year ago... I updated my ~/.lircrc to let me use my remote control for dvd menu navigation. Before, I would pull out my keyboard to start up a dvd. Here's a list of all the codes. To find out what the buttons are called on your remote, run irw and start hitting buttons, reading the input.

Here's my new ~/.lircrc:

# ~/.mythtv/lircrc
#
# MythTV native LIRC config file for
# the grey Hauppauge remote
#
# By Jarod Wilson, 2003/12/21
# Amalgamated from Jeff Campbell's,
# .lircrc, the mythtv.org docs, and
# a few touches of my own. :)
#
# and of my own! (Blake)
#

# Channel Up
begin
prog = mythtv
button = CH+
repeat = 3
config = Up
end

# Channel Down
begin
prog = mythtv
button = CH-
repeat = 3
config = Down
end

# OK/Select
begin
prog = mythtv
button = OK
config = Space
end

# Play
begin
prog = mythtv
button = PLAY
config = Return
end

# Stop
begin
prog = mythtv
button = STOP
config = Esc
end

# Escape/Exit/Back
begin
prog = mythtv
button = BACK/EXIT
config = Esc
end

## Power Off/Exit
#begin
#prog = mythtv
#button = OFF
#config = Esc
#end

# Power Button
begin
prog = irexec
button = Power
repeat = 4
config = /usr/local/bin/mythpowerbutton.sh
end

# Red means stop! - not no more, now it means bring up HUE/COLOR settings
begin
prog = mythtv
button = RED
config = F
end

# Pause
begin
prog = mythtv
button = PAUSE
repeat = 3
config = P
end

# Mute
begin
prog = mythtv
button = MUTE
repeat = 3
config = |
end

# Fast forward (30 sec default)
begin
prog = mythtv
button = Rewind
repeat = 3
config = Left
end

# Rewind (10 sec default)
begin
prog = mythtv
button = Forward
repeat = 3
config = Right
end

# Skip forward (10 min default)
begin
prog = mythtv
button = SKIP
repeat = 3
config = PgDown
end

# Skip backward (10 min default)
begin
prog = mythtv
button = REPLAY
repeat = 3
config = PgUp
end

# Record
begin
prog = mythtv
button = RECORD
repeat = 3
config = R
end

# Delete
begin
prog = mythtv
button = BLANK
repeat = 3
config = D
end

# OSD browse
begin
prog = mythtv
button = GREEN
repeat = 3
config = O
end

# Display EPG while in live TV,
# View selected show while in EPG
begin
prog = mythtv
button = MENU
repeat = 3
config = M
end

# Scroll up
begin
prog = mythtv
button = VOL+
repeat = 3
config = Right
end

# Scroll down
begin
prog = mythtv
button = VOL-
repeat = 3
config = Left
end

# Bring up OSD info
begin
prog = mythtv
button = GO
repeat = 3
config = I
end

# Change display aspect ratio
begin
prog = mythtv
button = FULL
repeat = 3
config = W
end

# Seek to previous commercial cut point
begin
prog = mythtv
button = YELLOW
repeat = 3
config = Q
end

# Seek to next commercial cut point
begin
prog = mythtv
button = BLUE
repeat = 3
config = Z
end

# Numbers 0-9

begin
prog = mythtv
button = 0
repeat = 3
config = 0
end

begin
prog = mythtv
button = 1
repeat = 3
config = 1
end

begin
prog = mythtv
button = 2
repeat = 3
config = 2
end

begin
prog = mythtv
button = 3
repeat = 3
config = 3
end

begin
prog = mythtv
button = 4
repeat = 3
config = 4
end

begin
prog = mythtv
button = 5
repeat = 3
config = 5
end

begin
prog = mythtv
button = 6
repeat = 3
config = 6
end

begin
prog = mythtv
button = 7
repeat = 3
config = 7
end

begin
prog = mythtv
button = 8
repeat = 3
config = 8
end

begin
prog = mythtv
button = 9
repeat = 3
config = 9
end


### MPlayer lirc setup

# Show OSD
begin
prog = mplayer
button = MENU
repeat = 3
config = osd
end

# Pause playback
begin
prog = mplayer
button = PAUSE
repeat = 3
config = pause
end

# Skip ahead a minute if playing
# If paused, resume playing
begin
prog = mplayer
button = PLAY
repeat = 3
config = seek +1
end

# Stop playback and exit
begin
prog = mplayer
button = STOP
repeat = 3
config = quit
end

# Mute
begin
prog = mplayer
button = MUTE
repeat = 3
config = mute
end

# Seek back 10 seconds
begin
prog = mplayer
button = Rewind
repeat = 3
config = seek -10
end

# Seek forward 30 seconds
begin
prog = mplayer
button = Forward
repeat = 3
config = seek +30
end

# Quit
begin
prog = mplayer
button = BACK/EXIT
repeat = 3
config = quit
end

# Seek forward 10 minutes
begin
prog = mplayer
button = SKIP
repeat = 3
config = seek +600
end

# Seek backward 10 minutes
begin
prog = mplayer
button = REPLAY
repeat = 3
config = seek -600
end

# Toggle full-screen
begin
prog = mplayer
button = FULL
repeat = 3
config = vo_fullscreen
end

### Xine lirc setup

begin
prog = xine
button = PLAY
repeat = 3
config = Play
end

begin
prog = xine
button = STOP
repeat = 3
config = Stop
end

begin
prog = xine
button = OFF
repeat = 3
config = Quit
end

begin
prog = xine
button = PAUSE
repeat = 3
config = Pause
end

begin
prog = xine
button = CH+
repeat = 3
config = EventUp
end

begin
prog = xine
button = CH-
repeat = 3
config = EventDown
end

begin
prog = xine
button = VOL-
repeat = 3
config = EventLeft
end

begin
prog = xine
button = VOL+
repeat = 3
config = EventRight
end

begin
prog = xine
button = OK
repeat = 3
config = EventSelect
end

begin
prog = xine
button = BACK/EXIT
repeat = 3
config = Menu
end

begin
prog = xine
button = FFW
repeat = 3
#config = SpeedFaster
config = SeekRelative+60
end

begin
prog = xine
button = REW
repeat = 3
#config = SpeedSlower
config = SeekRelative-60
end

begin
prog = xine
button = FULL
repeat = 3
config = Volume+
end

begin
prog = xine
button = BLANK
repeat = 3
config = Volume-
end

begin
prog = xine
button = MUTE
repeat = 3
config = Mute
end

begin
prog = xine
button = MENU
repeat = 3
config = RootMenu
end

begin
prog = xine
button = SKIP
repeat = 3
config = EventNext
end

begin
prog = xine
button = REPLAY
repeat = 3
config = EventPrior
end

begin
prog = xine
button = GO
repeat = 3
config = OSDStreamInfos
end

begin
prog = xine
button = RED
repeat = 3
config = Quit
end

begin
prog = xine
button = RED
repeat = 3
config = Quit
end



### VLC config

# Show OSD
#begin
#prog = vlc
#button = MENU
#repeat = 3
#config = osd
#end

# Pause playback
begin
prog = vlc
button = PAUSE
repeat = 3
config = key-play-pause
end

# Play
begin
prog = vlc
button = PLAY
repeat = 3
config = key-play
end

# Stop playback and exit
begin
prog = vlc
button = STOP
repeat = 3
config = key-quit
end

# Volume Down
begin
prog = vlc
button = Vol-
repeat = 3
config = key-vol-down
end

# Volume Up
begin
prog = vlc
button = Vol+
repeat = 3
config = key-vol-up
end

# Faster
begin
prog = vlc
button = Ch+
repeat = 3
config = key-faster
end

# Slower
begin
prog = vlc
button = Ch-
repeat = 3
config = key-slower
end

# Mute
begin
prog = vlc
button = MUTE
repeat = 3
config = key-vol-mute
end

# Seek back 10 seconds
begin
prog = vlc
button = Rewind
repeat = 3
config = key-jump-10sec
end

# Seek forward 10 seconds
begin
prog = vlc
button = Forward
repeat = 3
config = key-jump+10sec
end

# Quit
begin
prog = vlc
button = BACK/EXIT
repeat = 3
config = key-quit
end

# Seek forward 1 minute
begin
prog = vlc
button = SKIP
repeat = 3
config = key-jump+1min
end

# Seek backward 1 minute
begin
prog = vlc
button = REPLAY
repeat = 3
config = key-jump-1min
end

# Seek forward 5 minutes
begin
prog = vlc
button = Blue
repeat = 3
config = key-jump+5min
end

# Seek backward 5 minutes
begin
prog = vlc
button = Yellow
repeat = 3
config = key-jump-5min
end

# Toggle full-screen
begin
prog = vlc
button = FULL
repeat = 3
config = key-fullscreen
end

# Position - shows where you are in the video
begin
prog = vlc
button = Go
repeat = 3
config = key-position
end

# Subtitles
begin
prog = vlc
button = Blank
repeat = 3
config = key-subtitle-track
end

# Snapshots
begin
prog = vlc
button = Record
repeat = 3
config = key-snapshot
end

# Audio Sync'ing
# Audio Delay UP
begin
prog = vlc
button = Green
repeat = 3
config = key-audiodelay-up
end

# Audio Delay DOWN
begin
prog = vlc
button = Red
repeat = 3
config = key-audiodelay-down
end

# Navigation Menu Up
begin
prog = vlc
button = Ch+
repeat = 3
config = key-nav-up
end

# Navigation Menu Down
begin
prog = vlc
button = Ch-
repeat = 3
config = key-nav-down
end

# Navigation Menu Right
begin
prog = vlc
button = Vol+
repeat = 3
config = key-nav-right
end

# Navigation Menu Left
begin
prog = vlc
button = Vol-
repeat = 3
config = key-nav-left
end

# Navigation Select
begin
prog = vlc
button = Ok
repeat = 3
config = key-nav-activate
end

vlcrc Updates - Fixed Volume

I don't know why this took me so long, but I finally spent two minutes to look through ~/.vlc/vlcrc to set the volume to 100%. Up until now, I've had to keep setting the volume for every video.

All it took was setting the volume setting:

# Audio output volume (integer)
volume=1000

Tuesday, October 03, 2006

Highlights of my new VLC setup

My previous post was kinda long, so I wanted to make a quick post about the new features that my new VLC setup affords me...

New features:

* Screenshots - I can now take screenshots of the video that's playing. In my vlc conf file, I set the snapshot directory to be in my MythImages location, in a VideoCaptures subdirectory. This way I can view them with MythImages. I also have access to that folder through a Samba share, so I can pull them down on my laptop. I mapped the "Record" button to the snapshot command:

# Snapshots
begin
prog = vlc
button = Record
repeat = 3
config = key-snapshot
end


* Audio Syncing - I can now delay/speed up audio at 50ms increments. This is huge, sometimes my video slides out of sync, or the video just plays out of sync. This way, with my remote buttons, I can adjust it at play time with my remote. I mapped the Green and Red buttons to audio syncing:

# Audio Delay UP
begin
prog = vlc
button = Green
repeat = 3
config = key-audiodelay-up
end

# Audio Delay DOWN
begin
prog = vlc
button = Red
repeat = 3
config = key-audiodelay-down
end


* Subtitles - This is pretty huge too... If you ever backup one of your DVDs to your myth box as VTS files, you may want to view subtitles. With my new vlc setup, I can now do this with the "Blank" button:

# Subtitles
begin
prog = vlc
button = Blank
repeat = 3
config = key-subtitle-track
end


* Others - I also mapped keys for volume up/down, and for video speed-up/slow-down. The former is very helpful for quieter videos. In the past, I found myself logging in with my laptop and running alsamixer. This is much easier. For the latter, I haven't found much use, since the audio doesn't play with the speeded-up/slowed-down video.. But hey, I had extra buttons.

I might later on try setting up bookmarks with the number keys, but we'll see. I'm crossing my fingers that there are other commands that aren't listed in the vlc config file, because I'm having way too much fun mapping these to my remote!

Switching from Mplayer to VLC

In my previous post I mentioned how I wanted to switch from Mplayer for my MythTV video player to VLC so that my Google Video mpeg4 files in my iTunes library would play in MythTV.

1. Change your video player to VLC:
My existing mplayer command, as setup in MythTV's "Utilities/Setup" -> "SetUp" -> "Media Settings" -> "Video Settings" -> "Player Settings" used to be:

mplayer -framedrop -monitoraspect 16:9 -fs -zoom -quiet -vo xv -alang en -ao oss %s

I found a post somewhere that mentioned to use this for vlc:
vlc file://%s vlc:quit


2. Add handling for Mpeg4 files:
After changing your video player to VLC, it's now time to register the file extensions you may see mpeg4's come over as.

In "Utilities/Setup" -> "SetUp" -> "Media Settings" -> "Video Settings" -> "File Types", add the extensions "mp4" and "m4v". Set them up to use the default player.


3. Edit your VLC setup for LIRC and to default to fullscreen
Assuming you're using LIRC for your remote control handling, you'll need to tell VLC to hook into it. Edit your ~/.vlc/vlcrc, finding the "#control=" command. Un-comment it out by removing the "#", and set it to "control=lirc" (without the quotes).

Find the "#fullscreen=" command. Un-comment it out, and set it to "fullscreen=1" (without the quotes)

Save the file and exit.


4. Add your remote control bindings for Hauppauge remote
I'm using the remote control that comes with the Hauppauge 250 and 350. If you're not, then you can use the same setup that I am, but for each command, change the "button" setting with whatever you get while pressing a button when you're running "irw". The "irw" command will spit back the names of the buttons you're pressing - pretty cool little app.

Well, anyway, here's my VLC LIRC config. Each of these commands are listed in the VLC config, so if you want to modify them or add other settings, you should be able to figure out how with this example and your VLC setup file. By the way - I can't tell you how happy I am to now have audio sync'ing buttons on my remote! The few videos that have audio sync'ing problems can be fixed by delaying or advancing the audio track by increments of 50ms!!!

Also, the snapshot button is pretty cool - it lets you take screenshots of the video, which then drop them in ~/.vlc directory, or where ever you set your "snapshot-path=" setting. I've set mine to a directory inside my Myth Photo directory.

One more thing - Please leave a comment if you have further ideas for remote button mapping. These are all I could think of for VLC -- I'd love to find a use for my number buttons.

good luck! YMMV

### VLC config

# Pause playback
begin
prog = vlc
button = PAUSE
repeat = 3
config = key-play-pause
end

# Play
begin
prog = vlc
button = PLAY
repeat = 3
config = key-play
end

# Stop playback and exit
begin
prog = vlc
button = STOP
repeat = 3
config = key-quit
end

# Volume Down
begin
prog = vlc
button = Vol-
repeat = 3
config = key-vol-down
end

# Volume Up
begin
prog = vlc
button = Vol+
repeat = 3
config = key-vol-up
end

# Faster
begin
prog = vlc
button = Ch+
repeat = 3
config = key-faster
end

# Slower
begin
prog = vlc
button = Ch-
repeat = 3
config = key-slower
end

# Mute
begin
prog = vlc
button = MUTE
repeat = 3
config = key-vol-mute
end

# Seek back 10 seconds
begin
prog = vlc
button = Rewind
repeat = 3
config = key-jump-10sec
end

# Seek forward 10 seconds
begin
prog = vlc
button = Forward
repeat = 3
config = key-jump+10sec
end

# Quit
begin
prog = vlc
button = BACK/EXIT
repeat = 3
config = key-quit
end

# Seek forward 1 minute
begin
prog = vlc
button = SKIP
repeat = 3
config = key-jump+1min
end

# Seek backward 1 minute
begin
prog = vlc
button = REPLAY
repeat = 3
config = key-jump-1min
end

# Seek forward 5 minutes
begin
prog = vlc
button = Blue
repeat = 3
config = key-jump+5min
end

# Seek backward 5 minutes
begin
prog = vlc
button = Yellow
repeat = 3
config = key-jump-5min
end

# Toggle full-screen
begin
prog = vlc
button = FULL
repeat = 3
config = key-fullscreen
end

# Position - shows where you are in the video
begin
prog = vlc
button = Go
repeat = 3
config = key-position
end

# Subtitles
begin
prog = vlc
button = Blank
repeat = 3
config = key-subtitle-track
end

# Snapshots
begin
prog = vlc
button = Record
repeat = 3
config = key-snapshot
end

# Audio Sync'ing
# Audio Delay UP
begin
prog = vlc
button = Green
repeat = 3
config = key-audiodelay-up
end

# Audio Delay DOWN
begin
prog = vlc
button = Red
repeat = 3
config = key-audiodelay-down
end

iTunes Video & MythTV

Google's video site lets you download videos in mpeg4, which is playable on your iPod. I keep my iTunes library on my linux file server, which is the same box that MythTV uses for its storage. So, since the videos I download from Google Video are on the same box that MythTV accesses, of course it was only a matter of time before I got around to setting it up so MythTV had access to these videos through the Video player.

I was hoping all that was necessary to get this working was to create a symbolic link from my iTunes Movie directory to somewhere inside the MythTV video directory. This did make them accessible, but the problem was that my mplayer didn't seem to play these mpeg4 videos. The audio would come across correctly, but I'd get a still image for the video.

I tinkered a little bit and found that although my current mplayer command didn't seem to do the trick, VLC had no problem.

In my next post, I'll explain my VLC setup.

Thursday, May 25, 2006

My GeForce FX 5200 Nightmare...

I thought I'd cut back on fan noise and heat, so I picked up a fanless GeForce FX 5200 video card on Ebay... I tried hooking it up to my HDTV by DVI -> HDMI like my previous setup. Well, I had no success... I thought something was wrong when the BIOS didn't even pick it up for the boot screen. No matter what I tried, I couldn't get any signal on my TV's HDMI input.

From what I read, a lot of others have had this problem.

So, two horrible days later, and I've got my old card back in there. If anyone could recommend a good, cheap, quiet, cool, fanless video card that can handle 1080i over DVI -> HDMI, please let me know!

Tuesday, January 31, 2006

MythVideo plays ISOs!

I just noticed something accidentally -- apparently MythVideo can play (at least some) DVD ISO files. So, you can archive your DVDs to your file server, and play them directly with MythVideo without ripping it to mpeg4 or mpeg2.

Good stuff!

Fixing MythVideo's audio/video sync problem

I've been watching more and more videos through MythVideo these days, and have been frustrated with audio/video lag. I messed around with the settings and finally came up with something that seems to be working very well. Here's my new mplayer command for MythVideo:

mplayer -framedrop -monitoraspect 16:9 -fs -zoom -quiet -vo xv -ao oss %s

Switching to OSS seems to have fixed the problem.

Thursday, December 08, 2005

Getting MythVideo to use 16:9 aspect ratio

When I last left off, MythTV was using my 61MD10 61" HDTV in full 1280x720, but MythVideo was stretching my HDTV .avi files too wide and showing black bars on the top and bottom. As it turns out, mplayer isn't able to autodetect the 16:9 aspect ratio.

Thanks to this post, I found that I needed to supply this information in the MythVideo playback settings.

Here's my new mplayer command:

mplayer -monitoraspect 16:9 -fs -zoom -quiet -vo xv -ao esd %s

Wednesday, December 07, 2005

My 720p xorg.conf

# /etc/X11/xorg.conf (xorg X Window System server configuration file)

Section "Files"
FontPath "/usr/share/X11/fonts/misc"
FontPath "/usr/share/X11/fonts/cyrillic"
FontPath "/usr/share/X11/fonts/100dpi/:unscaled"
FontPath "/usr/share/X11/fonts/75dpi/:unscaled"
FontPath "/usr/share/X11/fonts/Type1"
FontPath "/usr/share/X11/fonts/CID"
FontPath "/usr/share/X11/fonts/100dpi"
FontPath "/usr/share/X11/fonts/75dpi"
# paths to defoma fonts
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/CID"
EndSection

Section "Module"
Load "GLcore"
Load "i2c"
Load "bitmap"
Load "ddc"
Load "dri"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "type1"
Load "vbe"
EndSection

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc104"
Option "XkbLayout" "us"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "Emulate3Buttons" "true"
Option "ZAxisMapping" "4 5"
EndSection


Section "Device"
Identifier "NVidia"
Driver "nv"
VendorName "nVidia Corporation"
BoardName "NV28 [GeForce4 Ti 4200 AGP 4x]"
BusID "PCI:1:0:0"
EndSection

Section "Monitor"
Identifier "HDTV"
VendorName "InFocus"
ModelName "61MD10"
VertRefresh 30-90
HorizSync 20-150
# No clue if this is a good ModeLine to use
ModeLine "ATSC-720-59.94p" 74.176 1280 1320 1376 1650 720 722 728 750
EndSection

Section "Screen"
Identifier "HDTV Screen"
Device "NVidia"
Monitor "HDTV"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1280x720"
EndSubSection
EndSection

Section "ServerLayout"
Identifier "Default Layout"
Screen "HDTV Screen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
EndSection

Section "DRI"
Mode 0666
EndSection

MythTV in 720p

I'm setting up my Myth box to use my new Infocus 61" 61MD10 HDTV, and having a much smoother time than I expected. I was going to get a PCHDTV3000 card to record HDTV, but later learned that it can only record over-the-air (OTA) broadcasts, not encrypted HDTV that comes over the cable lines.

Considering that our HDTV formats are still in flux, and might go towards cablecard in the next year, I'm going to just be happy with big, fuzzy regular TV recordings on a big screen. I think I'm okay with that. I decided that if I could get X working in full 720p resolution, that I could at least play HDTV recordings that I happen to find elsewhere.

So, I put in my NVidia video card with DVI output. I have a DVI->HDMI cable which I used to plug my Myth box into the tv. I was very surprised that my original xorg.conf file that the Ubuntu install created worked the first try with the DVI output!

TV playback is working great, but my HDTV playback with mplayer is stretching the videos width-wise, so I gotta look into why that's happening.

In any case, I found some good (?) Modelines here

I'll post my end xorg.conf in the next post.

Thursday, December 01, 2005

Annoying myth backend problems

Occasionally I run into a problem where I can't delete a show, and the frontend hangs because of it. I restart the backend and frontend, then all systems are go. It looks like when the backend gets in this state that no shows are recorded either.

I just looked through the mythbackend logs to look for anything out of the ordinary. I found one line this morning that looked interesting:

/var/log/mythtv/mythbackend.log.1:2005-12-01 02:58:36.786 unknown socket


There's not too much information there, so I looked for that same error across the archived logs, and found a bunch:

/var/log/mythtv/mythbackend.log:2005-12-01 07:57:30.304 unknown socket
/var/log/mythtv/mythbackend.log.1:2005-11-30 07:40:11.621 unknown socket
/var/log/mythtv/mythbackend.log.1:2005-12-01 02:58:36.786 unknown socket
/var/log/mythtv/mythbackend.log.2:2005-11-29 07:40:24.165 unknown socket
/var/log/mythtv/mythbackend.log.2:2005-11-30 02:55:11.343 unknown socket
/var/log/mythtv/mythbackend.log.3:2005-11-28 07:38:55.313 unknown socket
/var/log/mythtv/mythbackend.log.3:2005-11-29 02:53:19.537 unknown socket
/var/log/mythtv/mythbackend.log.4:2005-11-27 07:38:47.522 unknown socket
/var/log/mythtv/mythbackend.log.4:2005-11-28 02:49:52.655 unknown socket
/var/log/mythtv/mythbackend.log.5:2005-11-26 07:39:36.989 unknown socket
/var/log/mythtv/mythbackend.log.5:2005-11-27 02:47:05.457 unknown socket
/var/log/mythtv/mythbackend.log.6:2005-11-25 07:39:38.032 unknown socket
/var/log/mythtv/mythbackend.log.6:2005-11-26 02:43:37.770 unknown socket
/var/log/mythtv/mythbackend.log.7:2005-11-24 07:40:56.346 unknown socket
/var/log/mythtv/mythbackend.log.7:2005-11-25 02:40:18.666 unknown socket


What's unusual is that these all happen at two times: 2:40am and 7:40pm. I'm not sure these messages have anything to do with this problem, but it's interesting nonetheless. I don't have any crontabs scheduled, but I'm wondering if this is when the backend is looking for new tv listings.

Something to look into..

Has anyone else out there had the delete problem, or any idea what these messages are?

Tuesday, November 29, 2005

Watching "Dirty Jobs" from my bathroom!

That's right, I'm so excited about MythTV that I'm blogging from the crapper, and am damn proud of it. Right now, I'm on the toilet, running MythTV frontend on my laptop which is wirelessly connected to my MythTV backend. And yes, the bathroom door is shut :D

I wasn't able to get this working well with my last MythTV setup, so I figured that with 1 hour shows being 1.1GB, that it must have been a network problem. Well, it's working great with my new backend server, so as it turns out, the poor performance must have come from the backend machine itself.

My Hardware:
My last backend box was a 733MHz P3; my new one is a 2.4GHz P4. My laptop frontend is a 1.73GHz Centrino with plenty of power.

My Network:
802.11g WPA. I'm upstairs from my DLink wireless router (I used to use a LinkSys, but found it had awful range) with the door closed.

My Performance:
I'm a code monkey Linux geek, and honestly, I have no idea how I'm getting this kind of performance over a wireless network. This 1-hour-long show I'm watching is takes up more than 1GB of disk space, and I'm able to start watching the video, and jump through it quickly. The menus are a little sluggish, and it takes about 2-3 seconds to start up a recording, but once it starts up, the video is running really well. Even FFWD/RWD is responsive, only giving me about a 1 second lag.

To compare, I tried running a mplayer on this file through a remote X ssh shell. I was able to see about 1 frame a second. Again - it's amazing how great the MythTV frontend/backend connection works.

Conclusion:
I'm super-impressed - it looks like I won't have to run CAT5 cables throughout my house afterall. In fact, it might be a fun project to try to setup diskless computers around the house to network-boot linux and act as MythTV fronends. Of course if I get around to it, I'll post my results!

Way to go, MythTV team -- the client/server architecture holds up across a WPA wireless network!

Monday, November 21, 2005

What to Expect in Future Posts...

I have so much I need to post here, and wanted to give you a heads up so you know what to expect. I'm planning on posting the following (and then some):

* A description and schematic of the wiring for my setup. It includes 2 TV cards and three TV inputs

* My mplayer setup in MythVideo and how I'm dealing with audio/video sync problems

* Information on how I'm using Samba to dump videos and mp3s from other boxes into MythVideo and MythMusic

* A re-hash of my IRBlaster script that changes the channels on my Comcast Digital TV

* An explanation of my script that generates an iTunes-ready XML RSS Podcast for mp3s I drop in a specific directory -- useful for podcasts you need to manually grab

* The script I modified/wrote that transcodes tv shows to mpeg4 videos that are viewable by my "iPod with Video"

* Photos of my setup, and hopefully a video screenshot of my mythbox in action (if I can figure out how to do that)

* A loving and persuasive write-up about Ubuntu Linux

* The problems that my recent upgrade has overcome from my build a year ago

*** Answers to questions anyone might have for me -- please posts comments and I'll respond as soon as I can. This isn't an easy project, but once completed, you'll feel bad for your friends with Tivos!

Please offer feedback!

If this site was at all helpful, please let me know by leaving comments or emailing me at: "blake (NO SPACE) caldwell **AT** gmail DOT com"

Please also let me know if anything here was inaccurrate or if you'd like to elaborate on something I skimmed by quickly.