random findings by wt8008
RSS icon Home icon
  • Kile DVItoPDF

    Posted on October 20th, 2008 wt8008 No comments

    The dvi-to-pdf setting in Kile produceds A4 by default, another missed A4 paper size setting. Set the build settings in Kile to

    Command: dvipdfmx
    Options: -p letter ‘%S.dvi’

    Now the pdf’s produced from dvi files will be of proper size.

  • Mythtv Box with HDTV Support

    Posted on October 5th, 2008 wt8008 No comments

    Last month, I completed building a Mythbuntu box with HDTV support. I also have analog support, but who would want to watch TV on that, so I didn’t bother setting that part up. Anyway here is the hardware setup:

    • CPU: Athlon XP 3000+ (from the top of my head Runs at 2.25 GHz)
    • RAM: 1GB
    • HD: 750GB
    • Video card: PNY Geforce 6600gt
    • TV Tuner
      • HDTV: Air2PC rev 2
      • NTSC: Avermedia AverTV Go 007 FM Plus

    The CPU recommended for single core processors are P4 3.0GHz or equivalent for HDTV playback. With only using the CPU alone my computer was able to play back HDTV video, but it was not smooth. A way around this (but not recommended by the community because of issues with using this) is with XvMC, which allows X to use the video card’s processor to accelerate playback. Only the 5000-7000 series close source drivers from Nvidia have the support for XvMC, and also only the 5000 series support color OSD during playback. The menus are in color, but any item that displays on top of the video is in grayscale with XvMC.

    My system was used as as frontend and backend. For HDTV the backend just writes a digital stream to the HD so this does not strain the system. For analog TV, if the tuner did not have hardware encoding the CPU would have to do the lifting, thus the CPU would have to do more work. A seperate backend would help for commercial tagging.

    The video card has S-video, composite, and component video out, along with the standard DVI and VGA (via an adaptor). The HDTV we have that the HTPC is hooked to does not contain any other HD inputs besides component video. My xorg.conf file is located at the end of the post for 1080i output.

    The video settings I have is to have video above 720p and 1080i to play back using XvMC, and for lower resolutions to use ffmpeg. This allows me to smoothly playback HDTV (but there is still another issue), and have color OSD for lower resolutions.

    If I were to use the Avermedia tuner, it is will be detected by the kernel automatically. My Avermedia card came with a remote, so I am using the remote that came with that tv tuner to control Mythtv and mplayer. The infered port should be detected and be under /dev/input/event*. By using the command `cat /proc/bus/input/devices’, you can find the module that goes with the remote. Note that when mice, keyboards, or other input devices are added to the system, the device location may change without udev rules. I have generated a lircd.conf file for my remote. By using the mythbuntu-control-centre, you can setup the remote to use the devinput driver, proper device, and link to the lircd.conf file. Under the users home folder in ~/.lirc/mythtv, the file maps the buttons from the remote file (lircd.conf) to mythtv commands. Both files will be located at the end of this post.

    The Air2PC card requires a firmware file (dvb-fe-bcm3510-01.fw) to be downloaded and placed in /lib/firmware for the kernel to properly use the card. In dmesg output, you will see that the firmware is sucessfully loaded upon boot.


    • Using XvMC with OSD is in grayscale and causes the video playback to shutter. When the OSD timesout video playback resumes smoothly.
    • EIT: The electronic programming guide transmitted through the air by the TV stations, sometimes stop over each other. For example, Channel’s 5 programming data will also appear in Channel’s 4 slot. I later found out there is a setting for each channel to allow EIT programming to be disabled on each channel.

    Testing ATSC Card via Commandline

    The dvb-utils package in Ubuntu has utlities for scanning for channels. This will install the scan utilty which will look for channels, it is ran by

    scan /usr/share/dvb/atsc/us-ATSC-center-frequencies-8VSB > channels.conf

    It will save the results of the scan in channels.conf. Some programs, like mplayer use this file for viewing tv. Run mplayer to view TV

    mplayer dvb://

    Now with the tv verfied to be working.

    Setup Mythtv Backend

    1. General Settings
    2. Capture Card
      1. Card Type: DVB DTV capture card for ATSC tuner; NTSC card is Analog V4L capture card – audio alsa:1,0 (or /dev/dsp1) audio sampling limit maybe 32000
    3. Video Source – setup scanning frequncies, and listing grabbers
    4. Input Connections – map a capture card to a video source, also scan for channels in here
    5. Channel Editor – easier to edit with the Mythweb plugin http://mythtvboxhostname/mythweb
    6. Storage Directory – for recordings

    Setup Mythtv Frontend
    Utilities/Setup -> Setup


    • output and mixer device ALSA:default
    • mixer control PCM, so that i can have the master volume at 95%


    • Screen Settings – my tv requires
      • GUI width: 1730
      • GUI height: 1025
      • GUI X offset: 80
      • GUI Y offset: 35
    • Font sizes: Small – 12, Mediu – 16, Big – 25

    TV Settings

    1. General
    2. Program Guide: Eco – Transparent
    3. Playback
    4. Playback OSD
    5. Playback Groups
      • Live TV for v4l can support up to 640 x 480
      • Enable realtime priority threads – need to edit the RTC of the kernel
      • Enable extra audio buffering – without this causes studdering issues on HDTV
      • Disable OpenGL vertical sync for timing – does not properly work for me
    6. Playback profiles:
      • if rez >= 1280 720 -> XvMC-opengl
        • Deinterlace: None or Box (2x) (if a patched is applied and complied in)
      • if rez > 0 0 -> ffmpeg & Xvideo
        • Deinterlace: Kernel
      • Sticky keys and smart fast forwarding settings located here
      • Commerical Skip settings
      • Recording Priorities

    Other settings are for Mythvideo, which is not as complex as setting up the tv part, so that has been omitted.


    • hardware.conf – goes under /etc/lirc/ remote dev
    • lircd.conf – goes under /etc/lirc/ remote control keys
    • mplayer – goes under ~/.lirc matches remote keys to mplayer options
    • mythtv – goes under ~/.lirc maps remote keys to mythtv options
    • xorg.conf