random findings by wt8008
RSS icon Home icon
  • MythTV and XBMC Integration

    Posted on May 28th, 2012 wt8008 No comments

    MythTV’s main purpose is to function as a DVR. XBMC’s purpose is geared towards functioning as a media player—to interface the TV with all media stored on the computer, network, or even the internet. Both are designed with a 10-foot user interface for an HDTV, but XBMC’s interface is more polished. XBMC is cross-platform and is officially available for Linux, Windows, and OSX/ATV.

    XBMC has the basic photo, music, and video viewer just like MythTV, but XBMC’s strength is in its add-on capability. Add-ons extend the functionality of XBMC. Many add-ons reformat website data online and display it directly in XBMC. Examples of add-ons are YouTube, Hulu, Netflix, and podcasts networks. It is also useful for bringing internet-only content to the TV. Official add-ons can be directly downloaded within XBMC. The large XBMC community also provides unofficial add-ons, these add-ons can be found on the XBMC forums. One unofficial add-on is xbmc-addons-chinese, which provides an interface to Chinese websites with flash video and live streaming TV channels. There are also add-ons for other international communities. Some add-ons are platform dependent, if they relay on external supporting applications.

    An official add-on is MythBox which provides can access a MythTV backend. It can replace the main features MythTV’s frontend for watching videos and recordings. Watching live TV is also available, but the interface for changing channels is clunky requiring the on-screen tv guide.

    MythTV Integration

    Currently, I use a combined MythTV frontend/backend setup with Mythwelcome to automatically turn on and off my HTPC for recordings. I am also using LIRC with a remote control.

    A simple way to integrate XBMC into such a setup is to allow the user to launch XBMC directly from the frontend. You can add an XBMC menu entry in MythTV’s menu xml file.

    I am using the media center menu theme, so the corresponding menu xml file is located in /usr/share/mythtv/themes/mediacentermenu/mainmenu.xml

       <button>
          <type>MENU_XBMC</type>
          <text>XBMC</text>
          <description>Launch XBMC</description>
          <action>EXEC /usr/bin/xbmc</action>
       </button>

    The advantage of launching XBMC from the frontend is that MythTV will stop responding to LIRC commands until XBMC exits. The LIRC daemon will send the key action to both programs, if you were to open them separately.

    LIRC Setup

    To map the LIRC remote commands to XBMC actions, you edit ~/.xbmc/userdata/Lircmap.xml:

         <remote device="LIRC_Remote_Name">
            <title>GUIDE</title>
            <playlist>BACK</playlist>
            <menu>MENU</menu>
            <info>INFO</info>
            <back>EXIT</back>
            <up>UP</up>
            <down>DOWN</down>
            <left>LEFT</left>
            <right>RIGHT</right>
            <select>OK</select>
            <myvideo>A</myvideo>
            <mymusic>B</mymusic>
            <mypictures>C</mypictures>
            <mytv>D</mytv>
            <back>BACK</back>
            <pageplus>CHUP</pageplus>
            <pagedown>CHDOWN</pagedown>
            <play>PLAY</play>
            <pause>PAUSE</pause>
            <FastFoward>FASTFOWARD</FastFoward>
            <Rewind>REWIND</Rewind>
            <Stop>Stop</Stop>
            <one>ONE</one>
            <two>TWO</two>
            <three>THREE</three>
            <four>FOUR</four>
            <five>FIVE</five>
            <six>SIX</six>
            <seven>SEVEN</seven>
            <eight>EIGHT</eight>
            <nine>NINE</nine>
            <zero>ZERO</zero>
            <select>ENTER</select>
            <skipnext>PGUP</skipnext>
            <skipprevious>PGDOWN</skipprevious>
        </remote>
    

    Smartphones can also function as a remote control using an app. XBMC system settings need to be modified to enable access.

    Final Words

    With the XBMC add-ons, you do not need to record some network shows, because they are available directly in XBMC over Hulu, although the streaming quality is not as good as free OTA broadcasts. For some shows like news, the lower bitrate is acceptable. There are multiple add-ons with link to different US and international TV networks and sites. With the wide selection of add-ons, XBMC is a great addition to an HTPC.

    There is a PPA available with instructions for Ubuntu users.

  • FTDI USB-Serial Converter for New Products

    Posted on April 14th, 2011 wt8008 No comments

    If you have a generic FTDI product that simulates a serial port (COM port), but it does not register as /dev/ttyUSB0 in Ubuntu/Linux, it could be that the device is too new or a rare product (industrial use) and not a recognized vendor/product ID. (This also applies for products that use a USB-Serial bridge for communications.) You can attempt to tell if the product uses such a chip by taking a look at the ICs on the product itself or by the drivers it uses in Windows.

    Use lsusb to see what new shows when you plugin the USB device.

    Bus 002 Device 002: ID 413c:a005 Dell Computer Corp. Internal 2.0 Hub

    In this example the vendor ID is 413c and the product ID is a005.

    You can manually allow it to register by:

    sudo modprobe ftdi_sio
    sudo su -c "echo 413c a005 > /sys/bus/usb-serial/drivers/ftdi_sio/new_id"

    using the vendor and product IDs from the previous step. It should show up as /dev/ttyUSB0 unless you already have another device plugged in. You can see the output of dmesg to determine the exact name/device file.

    You may need to give yourself permissions to read and write to the device.

    sudo chmod +rw /dev/ttyUSB0

    Auto Register when Connected

    For automatically preforming the commands upon connection create a file /usr/local/bin/serial-usb.sh with contents

    #!/bin/bash
    modprobe ftdi_sio
    echo 413c a005 > /sys/bus/usb-serial/drivers/ftdi_sio/new_id

    Give the file executable permissions with

    sudo chmod +x /usr/local/bin/serial-usb.sh

    Create a new udev rule to detect when the device is plugged in to run the previous script with a file in /etc/udev/rules.d/70-serial-usb.rules with the contents:

    ATTRS{idVendor}=="413c", ATTRS{idProduct}=="a005", RUN+="/usr/local/bin/serial-usb.sh"

    You may need to restart/reload udev by

    sudo /etc/init.d/udev restart
  • MythTV with SPDIF Digital Sound Output and Passthrough

    Posted on March 24th, 2011 wt8008 No comments

    Most modern motherboards will include a S/PDIF header, but with a soldering iron, one is easily added. This allows for digital audio output from the onboard sound. The next part shows how to configure and test a setup using ALSA tools and mplayer for Linux. Finally, a custom asoundrc configuration is used for MythTV to allow for analog and digital output for stereo streams and digital passthrough for DTS and Dolby Digital encoded audio.

    S/PDIF Connector

    My MythTV system uses the ECS K8T890-A motherboard, it does not contain a S/PDIF header. Upon closer inspection, near the PCI-e slot, you will find that ECS used a Realtek ALC655 for audio output. The datasheet for the ALC655 is publicly available. From the specifications, the ALC655 supports digital output, but ECS did not include headers for it. With a soldering iron, this is a non-issue. The reference design gives a simple circuit consisting of a few capacitors and resistors to allow the ALC655’s output to be interfaced with a S/PDIF compatible receiver. S/PDIF connectors used are typically RCA or BNC. The decision will be based upon what cables and connectors you have available. Cables with characteristics impedance of 75 Ω should be used for best performance. This value is typically used for video coax. Once you have a RCA or BNC pannel/borad mount connector, you need to secure it to the PC chasis. If you have old, unused PCI cards, you can remove their brackets for use. As an example, with a unused Ethernet card, the hole for the Ethernet jack can allow you to glue in a RCA socket.

    From the `Pin Assignments’ section in the datasheet, pin 48 is named SPDIFO. In the `Pin Description’ section it describes the function as “S/PDIF output” which is what is needed. The dot indicates Pin 1 (see the photo below modified from Japanese Wikipedia.) Pin 48 is on the edge of the device and is not a pin in the center, making it easier to perform soldering. (Warranty likely does not allow for user modifications. ;-)) Solder a thin wire such as 30 AWG to the pin. Make sure the wire is long enough to reach the PC case. Tug on the wire to verify the solder joint; the wire should not break off. Next the wire needs to be secured, as the solder joint cannot handle stress. Glue the wire about 1 inch away from the ALC655 to the motherboard edge; hot glue will work for this application.

    Realtek_alc655_pins

    Next, secure with hot glue the RCA socket to the Ethernet back plate. Solder on the circuit from the design guide directly on the back of the RCA socket pins. Finally, solder the glued wire to the input of the circuit. Remember the solder a ground connection, the ground connection is the metal of the back plate itself. Now, connect a 75 Ω cable between the computer and the device.

    Linux Setup

    Now to properly configure the digital output and test it using mplayer.

    In alsamixer(1) verify that IEC958 output is not muted. Use the hotkey `M’ to unmute it. The value should read “MM” when muted, and “00” when enabled. Now lets review what devices are available on the system with:

    aplay -l

    the output is

    [email protected]:~$ aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: V8237 [VIA 8237], device 0: VIA 8237 [VIA 8237]
      Subdevices: 4/4
      Subdevice #0: subdevice #0
      Subdevice #1: subdevice #1
      Subdevice #2: subdevice #2
      Subdevice #3: subdevice #3
    card 0: V8237 [VIA 8237], device 1: VIA 8237 [VIA 8237]
      Subdevices: 1/1
      Subdevice #0: subdevice #0

    With only one sound card, they should be all listed as card 0. Also, note that I have 4 subdevices. Some users will see an analog and digital device here. (I do not so the configuration file in the next section differs.) Next, view the ALSA names for the sound devices on your system with

    aplay -L

    the output is

    [email protected]:~$ aplay -L
    null
        Discard all samples (playback) or generate zero samples (capture)
    pulse
        Playback/recording through the PulseAudio sound server
    front:CARD=V8237,DEV=0
        VIA 8237, VIA 8237
        Front speakers
    surround40:CARD=V8237,DEV=0
        VIA 8237, VIA 8237
        4.0 Surround output to Front and Rear speakers
    surround41:CARD=V8237,DEV=0
        VIA 8237, VIA 8237
        4.1 Surround output to Front, Rear and Subwoofer speakers
    surround50:CARD=V8237,DEV=0
        VIA 8237, VIA 8237
        5.0 Surround output to Front, Center and Rear speakers
    surround51:CARD=V8237,DEV=0
        VIA 8237, VIA 8237
        5.1 Surround output to Front, Center, Rear and Subwoofer speakers
    iec958:CARD=V8237,DEV=0
        VIA 8237, VIA 8237
        IEC958 (S/PDIF) Digital Audio Output

    You should see a iec958 or spdif device here.

    Use mplayer(1) to output via S/PDIF by manually selecting it on the command line with:

    mplayer -vo none -ao alsa:device=iec958 filename

    where -vo is no video out device, -ao alsa:device=iec958 is the audio out device by using the alsa audio driver, and device name is from the ones given in aplay -L. The sound should only output from the digital port. You can test files with encoded DTS audio or Dolby Digital audio by using

    mplayer -vo none -ao alsa:device=iec958 -ac hwdts,hwac3 filename

    This allows for directly passing the encoded audio signal to your receiver, the software will do no decoding. You should be able to get bit perfect surround sound.

    MythTV Audio Settings

    To always use digital output, go to
    Utilities/Setup -> General -> Audio page
    and use the following settings:

     Audio output device:         ALSA:iec958
     Digital Audio Capabilities
         Dolby Digital            check
         DTS                      check

    Digital Output

    Note the name of the device `iec958′ matches the output of aplay -L and mplayer.

    On the next page,

     Use internal volume controls      uncheck

    Internal Mixer Setting

    If this is not unchecked, then the system will decode and re-encode the DTS/Dolby Digital audio as PCM.

    The system is then setup to always output a digital signal.

    MythTV Setup for Dual, Analog and Digital, Outputs

    If the audio source was not DTS or Dolby Digital encoded, then you can output both to the digital and analog outputs with a custom .asoundrc configuration by creating a virtual device that maps the left and right audio channels. If the audio source was DTS or Dolby Digital encoded, only the digital output is available. (MythTV only can output one audio stream.)

    A custom .asoundrc is needed.

    # ~/.asoundrc or /etc/asound.conf
    # ALSA configuration file
    
    ##### USAGE #####
    # Save this file as "~/.asoundrc" (for user-specific sound configuration) or
    # "/etc/asound.conf" (for system-wide sound configuration) and specify ALSA
    # device names ad described in the next section.
    
    ##### IMPORTANT #####
    # To make this ALSA configuration file work with your sound card, you will need
    # to define the appropriate card and device information for the "analog-hw" and
    # "digital-hw" devices below.  You can find the card and device information
    # using "aplay -l".
    
    # Default output device
    pcm.!default {
      type plug
      slave {
        pcm dualout
      }
    }
    
    ##### Configuration File #####
    
    # Override the default output used by ALSA.  If you do not override the
    # default, your default device is identical to the (unmixed) "analog" device
    # shown below.  If you prefer mixed and/or digital output, uncomment the
    # appropriate four lines below (only one slave.pcm line).
    #
    # Alias for device names
    
    # Actual device name usable for applications
    pcm.dualout {
        type plug
        slave.pcm "dual"
        hint {
            show on
            description "Output to analog and digital ports"
        }
    }
    
    ctl.dualout {
        type hw
        card 0
    }
    
    # The following devices are not useful by themselves.  They require specific
    # rates, channels, and formats.  Therefore, you probably do not want to use
    # them directly.  Instead use of of the devices defined above.
    
    # Alias for analog output on the card
    # Do not use this directly--it requires specific rate, channels, and format
    pcm.analog-hw {
      type hw
      card 0     # MODIFY to match your setup
     # The default value for device is 0, so no need to specify
    #  - Uncomment one of the below or create a new "device N" line as appropriate
    #    for your sound card
    #  device 1
    #  device 4
    }
    
    # Control device (mixer, etc.) for the card
    ctl.analog-hw {
      type hw
      card 0
    }
    
    # Alias for digital (S/PDIF) output on the card
    # Do not use this directly--it requires specific rate, channels, and format
    pcm.digital-hw {
      type hw
      card 0
      device 0    # MODIFY to match your setup
      subdevice 3 # MODIFY to match your setup
                  #  Remove this if not needed (many won't need this line)
    #  - Comment out "device 1" above and uncomment one of the below or create a
    #    new "device N" line as appropriate for your sound card
    #  device 2
    #  device 4
    }
    
    # Control device (mixer, etc.) for the card
    ctl.digital-hw {
      type hw
      card 0
    }
    
    # multi -- a virtual device with four channels. This maps two stero streams
    # from the analog and digital outputs as one 4-channel stream. (Complex format)
    pcm.multi {
      type multi
      slaves.a.pcm "analog-hw"
      slaves.a.channels 2
      slaves.b.pcm "digital-hw"
      slaves.b.channels 2
    
      bindings.0.slave a
      bindings.0.channel 0
      bindings.1.slave a
      bindings.1.channel 1
      bindings.2.slave b
      bindings.2.channel 0
      bindings.3.slave b
      bindings.3.channel 1
    }
    
    ctl.multi {
      type hw
      card 0
    }
    
    # dual -- creates a 4 channel pcm stream based on the multi device. Maps this
    # devices 4 streams to the multi device. (Interleaved format, supported by most
    # applications)
    pcm.dual {
        type route
        slave.pcm "multi"
        slave.channels 4
        ttable.0.0 1
        ttable.1.1 1
        ttable.0.2 1
        ttable.1.3 1
    }
    
    ctl.dual {
        type hw
        card 0
    }

    This defines a name for the analog and digital output device. Next, it creates a virtual 4 channel device and maps the analog and digital audio channels to it. Finally, an interleaved format device is created for MythTV’s usage.

    The pcm.analog-hw block defines the exact card and device of your analog output. Typically this is card 0 and device 0. Verify the card and device indices with mplayer(1):

    mplayer -ao alsa:device=hw0.0 filename

    The expected output is sound from your speakers connected to the analog outputs. Similarly, for the pcm.digital-hw block, find the exact card and device (and possibly subdevice) with

    mplayer -ao alsa:device=hw0.0.3 filename

    My IEC958 device is located on card: 0, device 0, subdevice 3. Use the process of elimination to determine the exact index of the device. Modify the corresponding section of the configuration file with the card, device, and subdevice index.

    The other pcm.multi, pcm.dualout, and pcm.dual do not need to be modified as they only preform channel mapping. In MythTV, configure the default output device to be ALSA:dualout. (`Scan for audio devices’ feature only detects “type plug”.)

    Analog Digital Output

    Stereo analog and stereo sound should output for 2 channel audio sources. For audio encoded in DTS or Dolby Digital, your receive should receive the raw data and preform the decoding.

    References

  • KDE4 Ambience Theme in Ubuntu for KDE Applications

    Posted on November 21st, 2010 wt8008 No comments

    I have been running Ubuntu 10.04 and wanted to configure the appearance of KDE applications to match the Ambience theme in Ubuntu. Luckily, there are some built-in themes which helps with the configuration.

    First use the KDE 4 System Settings Center to change the Appearance of the KDE widgets, colors, icons, and fonts. The system settings center is located in the systemsettings-kde4 package. (If not already installed.) Run

    $ systemsettings

    to start up the configuration program. Select “Appearance” (or “Application Appearance”) to change KDE applications widget style, colors, icons, and fonts.

    1. Style
    2. Choose the “GTK+” widget style from the drop down menu. This will match the style of the progress bars, buttons, slider bars, drop down menus, etc. to the Gnome style.

    3. Colors
    4. The metallic color scheme of KDE4 can be changed here. You can import the file that I modified from KDE-look. (See References for original creator.) The colors roughly match, but may not exactly match.

    5. Icons
    6. Select “Ubuntu-Mono-Dark” icon theme to match the Ubuntu standard icons.

    7. Fonts
    8. Change the font settings here to match the font settings that were chosen in Ubuntu. If the font size number does not match the KDE application font size, you may need to use the “Force fonts DPI” option. You can see your current font settings in System->Preference->Appearance and the fonts tab.

    With these settings your KDE4 applications should fit in nicely with the Gnome based desktop!

    References:
    Ambiance-like: KDE Color Scheme KDE4

  • Dockstar Running Debian

    Posted on November 13th, 2010 wt8008 No comments

    The Dockstar is a plug computer runs a Marvell 1.2GHz ARM processor with 128 MB RAM and 256 MB flash which stores it’s own variant of Linux. The boot loader on the device can be modified to boot off a USB stick, leaving the original Linux on the flash unmodified. Using Jeff’s guide it was possible to put Debian on a USB stick and boot from it easily.

    Before starting, since the device will phone-home, the hbwb process needs to be killed before connecting to the internet. Using the guide from ahsoftware.de, the process was disabled. The dockstar can be connected to an offline router with a DHCP server so that you can get its IP address. Otherwise without a DHCP server, it will asign itself an IP address of 169.254.x.y, where x, y are the last two bytes of the device’s MAC address. With the IP address, ssh into the device as root with the default password of stxadmin. The next step is to kill the hbwb process, remount / as writable, chmod go+w /dev/null, and modify the rcS init.d script to prevent hbmgr.sh from running. Remount / as read-only, and the device can then be restarted/halt.

    Next follow the instructions on Jeff’s site to partition a flash drive using fdisk(8). Then download and run his script to install Debian on the flash drive. After it is completed, if the Dockstar does not boot into Debian, reboot the device by using a pen/paper clip by pressing the reset button on the dockstar for a warm boot. Some flash drives such as Kingston’s have issues with cold booting.

    Cold Boot

    If you setup netconsole, you can see the boot messages from the dockstar and see where the cold boot fails with the usb drive. The first run of “usb start” causes the issue, so Mike on the fourms changed the uBoot options to re-start the USB every time the dockstar boots, essentially making every boot a warm boot to the USB thumb drive. Use fw_setenv to modify the variables.

    Applications

    Now with the armel version of Debian installed, the dockstar can run almost anything Debian can. (Ubuntu does not have armel repositories.) The exception is of course is the hardware. Speed of the flash drive can be come an issue, especially when writing many small files. There is no video output, but there is a serial console if you want to so some soldering. The current application for my dockstar is for running CUPS as a print server. Future applications I have in mind is a NAS type server. For now, I am using it to store my tomato CIFS bandwidth logs. It can also be a useful SSH server. Any applications which require 24/7 uptime can use the device, as it is also low power compared with a normal computer system. More applications and usages will come as I think of some as they are needed.

    References

    http://ahsoftware.de/dockstar/
    http://jeff.doozan.com/debian/

  • HDHomerun, Comcast QAM, MythTV

    Posted on September 4th, 2010 wt8008 2 comments

    With my new HDHomeRun, I need to setup MythTV backend to get channels from Comcast unencrypted QAM.Mythbuntu comes preinstalled with the hdhomerun_config command line and GUI tools, under Applications->Multimedia->HDHomeRun Config GUI. If it is plugged in the “Scan” button will discover any tuners on the network. Also, if you plug different sources into HDHomeRun, such as Cable and OTA, note the tuner numbers for later reference. If you have dual tuners you will have two entries. From there, you can flip through the channels and view what streams exist under that channel. With the “View” button VLC will open and play the video stream.

    HDHomeRun Config GUI

    HDHomeRun Config GUI

    The device ID of your HDHomeRun can be found by

    $ hdhomerun_config discover

    The output will look like

    hdhomerun device XXXXXXXX found at Y.Y.Y.Y

    where the XXXXXXXX represents the HDHomeRun ID, and Y.Y.Y.Y is the IP address. You should note the ID for use later on.

    Channel Scanning

    Integrating into Mythtv is not as direct as I hoped. The scanner built into Mythtv 0.23 does not handle the Comcast QAM stream properly. It can scan the channels, but it cannot use the virtual channel numbers from Comcast, and Mythtv will results in many conflicting channel numbers. Follow the guide at http://www.mythtv.org/wiki/Scte65scan to use scte65scan to scan and discover the virtual channel numbers. The rough procedure from the wiki is below:

    1. Run mythtv-setup to configure the backend.
    2. Setup section 1: General, and section 2: Video sources. Do not setup the other sections (or else the database dump of scte65scan will not work, maybe using -f4 as a command line option is a workaround and also default sourceid=1 , not tested or tried yet.)
    3. Download scte65scan source and HDHomerun libraries, follow the instructions to compile and for editing the HDHomrun Makefile.
    4. The VCT_ID for my area is 3065 (0x0bf9), after following the instructions on the wiki to discover them (the scan takes a few minutes):

    $ ./scte65scan -H FFFFFFFF us-Cable-Standard-center-frequencies-QAM256

    5. Now the SQL script will be generated to be used to import into Mythtv.

    $ ./scte65scan -H XXXXXXXX,0 -p -f3 -V 3065 us-Cable-Standard-center-frequencies-QAM256 > vct.sql

    Recall XXXXXXXX is the HDHomeRun ID, the 0 after it represents the tuner number, -p option is needed for the local PSIP channels in the cable stream, -f3 for SQL install script, -V 3065 where 3065 is my local areas VCT_ID, us-Cable-Standard…. is a file containing the channel frequencies that will be scanned, and finally vct.sql is the output SQL script. Read

    $ scte65scan --help

    for more details.

    6. Next import the output to the SQL database

    $ mysql -u mythtv -p mythconverg < vct.sql

    This allows you to access the mythconverg database as the mythtv user, but remember to lookup the database password in the Mythtv frontend before you proceed. The other method is to logon as -u root, if you remember the initial password you setup for it. If you get an error regarding

    ERROR 1062 (2300) at line 4: Duplicate entry '1' for key 'PRIMARY'

    it is due already having video sources defined, you can either delete them, or try different -f options in

    $ scte65scan --help

    7. The channel information entered is viewable in the backend setup under 5. Channel Editor. Continue with the setup by adding the 3. Video Source, and the channels should populate without a scan. Also setup the 4. Input connections.

    The channel scanner for OTA signals works fine, so you can use the internal scanner for that purpose.

    Inferred Sensor

    Using the inferred sensor on the HDHomeRun requires telling the device to forwards the signals to the backend, using lircd on the backend to process the signals into keys, and having mythtv map the remote key presses to keyboard shortcuts.

    The HDHomeRun site has a guide for setting up the HDHomeRun.

    
    
    $ hdhomerun_config  <device id> set /ir/target "<backend-ip>:5000 store"

    The store command saves the setting into flash, so on reboot of the tuner, it will continue to foward the IR commands. Next, use irrecord to let the computer learn each key of the remote.

    
    
    $ irrecord -H udp -d 5000 "<name of remote>"

    Attempt to give generic/general key names, since later a parser will be used to generate the key maps to Mythtv. Copy the resulting file,

    # sudo mv "<name of remote>" /etc/lirc/lircd.conf

    Now to start up lircd the first time, I recommend using verbose mode to watch what happens.

    # sudo lircd -n -H udp -d 5000

    Use irw to test the setup. With irw running press remotes on the key and it will print out the corresponding key that is pressed. If all is well then configure the /etc/lirc/hardware.conf file. Some recommended settings

    REMOTE_DRIVER="udp"
    REMOTE_LIRCD_CONFIG=/etc/lirc/hardware.conf"

    Now, setup the key mapping between lirc and MythTV, Mythbuntu users can use

    $ mythbuntu-lirc-generator

    This will parse the keynames in /etc/lirc/lircd.conf and guess a corresponding key/function in MythTV. Next, manually edit the generated file

    $ vim ~/.lirc/mythtv

    Custom mappings or unmaps keys needs to be manually added in. The format is

    begin
      remote = "<name of remote>"
      prog = mythtv
      button = CHUP
      config = Page Up  
      delay = 0
      repeat = 0
    end
  • Tomato CIFS Bandwidth Logs Backup

    Posted on August 4th, 2009 wt8008 No comments

    As seen from my previous post, I have moved to Tomato firmware for my router. A feature that caught my eye was the ability to save bandwidth logs to CIFS (Samba shares). My ISP does not have any monthly bandwidth limitations, but I know some others in my area does, and this feature would be a must have for them. By default the bandwidth history is saved in RAM, and if the power goes out, then all the logs will be lost.

    On my Linux server, I created a new user (adduser(1)) with a default shell of /bin/false (/etc/passwd), and also a corresponding samba user (smbpasswd(1)). I configured the Samba share for that user with

    [tomato]
    path = /home/tomato
    public = no
    writeable = yes
    also, the server's global setting requires a security level of user
    [global]
    ...
    security = user

    On the router in Administration->CIFS Client, enable cifs1, for the UNC enter in the IP address, and share name. Do not use the hostname of the system.

    \\192.168.1.5\shared_example

    also enter in the username and password of the samba account that was created above. Hit save to mount the share, and after the 10 second countdown, you’ll see the total size of the mount, and the free space left.

    Now to enable the remote log saving. In Administration->Bandwidth Monitoring, change the save location to CIFS. I used the Create New File for the first time running it, but I am not sure if that option is necessary. Hit Save, and go to your share and see the backup log. The monthly start date can also be adjusted, for those who need to monitor monthly usage based upon an arbitrary day.

    Reference: http://www.wi-fiplanet.com/tutorials/article.php/3794171

  • cups-pdf Printer Margins Issue

    Posted on May 4th, 2009 wt8008 No comments

    I needed a way to print to pdf from a wine application. Typically the Gnome printing system has a pdf printer that I can use. I run micro-cap, a spice program for homework and prelab work for my analog filters course. I installed the cups-pdf package in the repositories, and it seemed to work great. After I sent the pdf to the printer, I found out that cups-pdf prints all the way to the edge. When I print the results out, the edge gets cut off by my printer. To remedy this issue, I went to see the PPD file for the printer in

    /etc/cups/ppd/<pdf-printer name>.ppd

    . The line that reads

    *ImageableArea Letter/US Letter: "0 0 612 792"

    sets the allowable printable area. I changed that line to

    *ImageableArea Letter/US Letter: "18 12 594 780"

    the numbers were from my laser printers ppd file.

    If you use A4 sized paper, change the corresponding line, and proper values for A4 paper.

  • Mythtv Remote udev Rules

    Posted on March 22nd, 2009 wt8008 No comments

    I was looking at setting some udev rules for my remote for mythtv, so that if I change the input devices (i.e. add or remove a mouse/keyboard), I want the name of the device to be constant so that I do not need to modify my lirc configuration files.

    I tried to setup this before, when I first setup mythtv (see my earlier mythtv post), but I never got it to work. There were two issues, one is that the filename for the rules was wrong, and also I had issues with the rules themselves. Anyways here is how you do it…

    This is my complete /etc/udev/rules.d/10-localremote.rules file

    KERNEL=="event*",ATTRS{name}=="saa7134 IR (Avermedia AVerTV GO",SYMLINK="input/irremote"

    This will link /dev/input/irremote to the device that is associated with my tv tuner’s IR receiver.

    [email protected]:/dev/input$ ls -l irremote
    lrwxrwxrwx 1 root root 6 2009-03-22 15:06 irremote -> event3

    Right now, it points to event3, but if I plug in my mouse and keyboard irremote will then point to event5.

    The associated file /etc/lirc/hardware.conf should also have the REMOTE_DEVICE field point to the new device.

    There is some way to setup the remote using hal, but I will give that a try another day. See http://www.doctort.org/adam/general/update-on-twinhan-remote-for-mythbuntu-810.html I will give that a try another day.

  • Ubuntu Resolve Hostname

    Posted on February 7th, 2009 wt8008 1 comment

    I wanted to ping my vmware-player system using its hostname. The easiest way to do this is to install samba on the server computer, and let samba announce to the network my hostname.

    Everyone on the network that can pick up and process those packets will know about the hostname.

    Playing with /etc/nsswitch.conf and /etc/dhcp3/dhclient.conf does not make an effect that I can notice.

    Edit: Apparently I only tested from my laptop. My Desktop (the host system for vmware) cannot ping the hostname of my vmware-client directly, but it can reach it via .local from avahi. Some weird configuration somewhere. I should try with a livecd.

    Edit: Samba worked fine for Ricky’s Windows PC to Ricky’s eee running Ubuntu.