Sunday, December 10, 2006

More MythTV work

Did some more work trying to figure out why certain operations in MythTV are so slow.

Turns up it isn't the database after all that makes the program guide so slow. Recorded the SQL operations performed and the page down takes about 20ms of database time. However, the load average is 2.3, so I started looking at general load issues.

Found a couple of very useful things:

By default, MythTV is configured to use the standard "Preferred MPEG Decoder". However, the NVidia chipset supports XvMC, which does the bulk of the decoding in the GPU. Setting the field to "Standard XvMC" dropped the CPU utilization of the X server from 19% to 2%. Will look at the KnoppMyth code that sets up the nVidia driver, and see about configuring this by default.

See the following page for more info:

http://www.mythtv.org/wiki/index.php/XvMC

Also noticed that the ivtv-env-vbi process was using 8% of the CPU. VBI is used for sending closed captioning information. Since I never need this functionality, I just needed to turn this off in mythtv-setup. Perhaps this shouldn't be on by default.

The mythtv-frontend process is still using 20% of the CPU, but the load average is now 0.60 and a bit more responsive. I figure if I can get to the bottom of why this process is using so much CPU I will probably have the program guide issue licked. My suspicion is it is some sort of rescaling of the video stream (perhaps from 640x480 used in the MPEG up to the display resolution of 800x600)

Also going to wake up in the middle of the night and see if I can find a channel that goes off-air and displays a test pattern. If I can record a test-pattern for a few minutes, I can fix the color calibration problem.