Opentel ODT4200PVR

I recently purchased the Opentel ODT4200 PVR from oznetics for $460. I bought via ebay and picked up from them and had problems at all; in fact they were very helpful.

Overall, we are quite happy with the unit. It has a large enough 80GB harddisk, and most importantly two tuners so you can watch one channel whilst recording another. Unlike the more expensive models, you can not record two channels at once. There is also no way to access files (USB or Firewire, etc) though the box comes with instructions on how to upgrade the harddrive should you wish to. The remote is a good size and very functional.

As I said, we are quite happy, but there are a few points of annoyance. I am running the latest 1.27 firmware. Some of the issues, both bugs and wishlist include:

  • The recording interface is quite unintuitive. When you add a "reservation" after selecting the time you automatically start a new reservation. Should you wish to change the file name for the recorded program, you need to go into the list of reservations and select one you added, and then modify the file name.
  • The reservation list only shows the channel and date and time information for your reservations. It would be nice if this showed the filename it is going to record to. It would be nice to have a few more reservation options, like "only do this on weekdays" or "repeat this 13 times".
  • There are many digital channels, most of which you want to skip over for normal use (some, like high def you want to skip all the time). The Opentel has a nice feature of favourites which allow you to group only the channels you want into one of a few favourites groups. However, one more than one occasion the box has become a bit confused if I'm in favourites mode or all channels mode requiring about five switches between modes and random channel changing, etc to come back.
  • On more than one occasion it has been randomly unable to lock onto channels and simply displays a black screen. The only way to get it to come back is to power cycle the box. This may be a heat issue as we have the box in a cupboard, and has not been a major issue.
  • If a show is recording, you can not modify in any way any of your existing recordings. This means changing their filenames, deleting an existing recording, etc.
  • I'm not sure what the deal is with the 4:3, 16:9 and letterbox formats. There is an "auto" format which seems to just be 16:9 mode. It would be nice if it just used 4:3 for non-widescreen broadcasts and letterbox when it was.
  • Fast forward using the time slider (rather than just kicking into 2x, 4x or 16x speedup this mode shows a standard time bar that you move a pointer along) occasionally gets confused. When this happens it generally ends up playing the audio for where you stopped but displaying a paused static image from where you left off. What would be really nice is if a tap of the [>|] button skipped 30 seconds, and hold it down to "slide" the time. As it is, you can get the feel of how long to hold down the button to slide past most of the ads after a few shows :)
  • "Time-shift" for pausing live TV is basically useless. Once you have started the time shift, you can't swap channels without stopping the recording and you can't rewind. So you might as well just start a normal recording, which you can watch back whilst it is recording anyway.
  • Some of the error messages are in engrish.
  • It can get very hot, though we do keep it in a cabinet. Turn the box "off" spins down the harddrive but it still remains quite warm to touch.
  • The harddrive appears to be almost constantly churning away. You can't hear it in normal operation with the TV playing, but it does make you wonder what it is doing. I can only assume it is a background defragmenter to try and keep space contiguous.
  • Guide information is only for the current and next show. This is a network thing, not a Opentel thing.
  • Channel 10 has some white dots which are apparently due to overscan from incorrectly (that might be a bit strong, I don't fully understand) broadcast VBI information.

In conclusion, the above bugs are all annoyances, and in most day to day use the unit works fine. This is a great unit if you don't want to hit the $900 mark for the Topfield model or spend more time fiddling with MythTV than watching TV. I wouldn't say we watch that much, but it's nice to be able to record the good stuff and watch it at your leisure and the Opentel works great for us.

Naughty Hits

Recently I started keeping track of "people" (trojaned Windows boxes) looking for things like formail.cgi or mt-comments.cgi on my work webserver. Having now hit the 1000 unique IP address mark I thought I'd graph the locations of the offenders with geoip.

The full graph shows the USA on top by a large margin, but Spain not far behind with UK, Italy and France rounding out the top 5.

What does this mean? Nothing, really; except with a bit of coercion Openoffice can be made to make quite a nice graph (tip: to just export the graph copy it into a new "Drawing" then export that to PDF).

on threads under linux

Other questions that come up about threads

How many threads can I run? This depends on a number of things

  • The ulimit of the user. Set the number of threads with ulimit -u (or somewhere like /etc/security/limits.conf).

  • The default stack size. By default, the stack size of a new thread is quite large, in the region of megabytes. It's not going to take you long to run out of memory for new stacks. Luckily, pthread_attr_setstacksize() allows you use smaller stacks.

  • The kernel. The kernel won't allow you to fill up your entire memory with thread descriptors. See kernel/fork.c:fork_init()

    /*
      * The default maximum number of threads is set to a safe
      * value: the thread structures can take up at most half
      * of memory.
      */
      max_threads = mempages / (8 * THREAD_SIZE / PAGE_SIZE);
    

    I belive this works out to around 4000 threads on a 256Mb x86 machine; YMMV of course.

What does ps show me? By default, ps should only show you the parent thread. Try with -m for the child threads.

checking for NPTL

This question seems to come up constantly. A compile time check for NPTL probably isn't what you want, since you can easily turn NPTL on or off on a program with something like LD_ASSUME_KERNEL. The following snippet is, AFAIK, the best way to check for NPTL support.

#include <stdio.h>
#include <unistd.h>
#include <alloca.h>
#include <string.h>

int isnptl (void)
{
    size_t n = confstr (_CS_GNU_LIBPTHREAD_VERSION, NULL, 0);
    if (n > 0)
    {
        char *buf = alloca (n);
        confstr (_CS_GNU_LIBPTHREAD_VERSION, buf, n);
        if (strstr (buf, "NPTL"))
            return 1;
    }
    return 0;
}

int main(void)
{
    printf("NPTL: %s\n", isnptl() ? "yes" : "no");
    return 0;
}

But more important is why are you checking?.

inkscape

Last night I tried to use inkscape to do some graphic design type work. Here's my (point format) review from start to finish

  • It's not 64 bit clean. It doesn't even start on an IA64 box, and it's something to do with glib and quarks and string lists which will take more time to track down than I have, unfortunately. The code is huge; the build directory ended up hitting the 600mb mark. The best I can do at this stage is offer one of the developers a login.
  • Once working on my ibook, I was pleasantly surprised with everything but the colour chooser. There is no eye-dropper tool that I could find, and no way to store a palette of colours either, so I was forced to remembering and typing in RGB colours. If you copy and object and then edit it's colour properties, it defaults back to black. The gradient tool is fairly non-intuitive, giving strange names to stops. This was frustrating. Everything else, however, worked great.
  • The inbuilt bitmap tracing tool was really nice.
  • I was quite impressed with the final output. It looked great on the screen.
  • I needed a PDF. So I exported to to postscript, and it just looked wrong. For a start, the alpha transparency doesn't export to postscript at all, so things that were looking grey on the screen were just black. On one piece of clipart, the export had dropped a few bits leaving white gaps in the picture. It seemed to have rasterised some of the output, especially the stuff I bitmap traced, making it look really dodgey.
  • I imported the SVG into Illustrator, hoping it would save better PDF's. Illustrator also ignored the alpha transparency, but, more worryingly, when constraining the artboard to a particular size in Illustrator the Inkscape output seemed to be about 4cm larger than the (supposedly same) artboard size. I don't know who is right, but I trust Illustrator. I can't be sending wrong sized artwork to a printer, because they will just crop the overflow.

All said, trying to use Inkscape to quickly get artwork into PDF format for printing hasn't really worked all that well for me. I've had to use Illustrator to tweak the final output. With a few UI enhancements (which are happening in current dev versions) and a first-class export to PDF it would put a strong link in the linux-as-a-desktop chain.

reading rdtsc on amd64

On an 386 you can read the rdtsc by simply doing

unsigned long long result;
__asm__ __volatile__("rdtsc" : "=A" (result));

Note, however, in the gcc docs the documentation for the =A constraint has an important caveat

Specifies the a or d registers. This is primarily useful for 64-bit integer values (when in 32-bit mode) intended to be returned with the d register holding the most significant bits and the a register holding the least significant bits.

Thus this is not what you want when using amd64 in 64 bit mode with 64 bit registers. Follow the example of the kernel code, and do the shifts by hand

#define rdtscll(val) do { \
     unsigned int __a,__d; \
     asm volatile("rdtsc" : "=a" (__a), "=d" (__d)); \
     (val) = ((unsigned long)__a) | (((unsigned long)__d)<<32); \
} while(0)

footnote: why oh why can't everyone use a real 64 bit architecture?

xchat notifier plugin

I previously mentioned that there must be a better way to make xchat pop up a dialog box, and of course there is, the plugin!

It's so easy; though finding the text command to match is a bit obscure. Here it is

__module_name__ = "gnome-notifier-plugin"
__module_version__ = "1.0"
__module_description__ = "notify of channel events via gnome-notify"

import xchat
import os

def channel_message(word, word_eol, userdata):

    err = os.system("/usr/bin/gnome-notify " +
                    "\'<font color=\"red\">New channel message</font></br>" +
                    "<b>"+word[0]+"</b><br>"+word[1]+"\'")
    if (err != 0):
        print("Failed to launch gnome-notify!")
    return xchat.EAT_NONE

xchat.hook_print("Channel Msg Hilight", channel_message)

you just put that in your .xchat2 directory and next thing you know you should have screenshots like that below!

gnome-notifier xchat plugin

.Xresources

the .Xresources file is in the format classname*paramater: value. Once you change it, you need to either log out or run xrdb -merge ~/.Xresources.

You should be able to set .Xdefaults to do much the same thing without reloading.

To find the class name, use the xprop utility to look for WM_CLASS, e.g. for xtightvncviewer

ianw@mingus:~$ xprop WM_CLASS
[click on xtightvncviewer window]
WM_CLASS(STRING) = "xtightvncviewer", "Vncviewer"
ianw@mingus:~$ cat ~/.Xresources
xtightvncviewer*grabKeyboard: True

Most applications use a client name that is the executable name with a capital letter, but xtightvncviewer doesn't quite follow this rule.