grep

timescale

digicorder and recording subsequent programs

Digital television is getting the norm in Belgium, and typically people rent a “digicorder” from the TV provider. This allows you to watch television and also record programs for later consumption.

In practice my family only records a few programs and watch them later. It’s very convenient not to be bound to a specific schedule. (On the other hand it would probably be cheaper to just buy the DVD boxes of the series we like instead of having television at all, but that is another discussion :) ).

In general, the digicorder works fine, I have one big gripe with it though: recording of subsequent programs.

Lets say we’re recording subsequent programs A and B from channel 0. Let’s assume there is some advertisement in between programs. This gives as timescale something like this:

Now, there are three ways the digicorder can record the program, not counting the completely faulty ways when timing goes all wrong.

Both programs want to record a time-slice before and after their program, but this goes wrong in the middle, and only one recording ends up with the middle part.

correct

The correct recording is with the break point in the middle like this:

I presume there are not some kind of markers in between the broad-casted programs on commercial television because it makes their advertisement store even worse.

Therefor, in practice you typically end up with one if these two:

B in recording 1


This is problematic because if you don’t remember not to erase recording 1 after watching program A, the start of program 2 will be lost.

A in recording 2


This is even worse. Lets say you want to watch program B first.

You first have to open recording 1, fast forward all the way to the start of program B, start watching and after a few minutes switch to recording 2. This will also leave recording 1 marked as “watched” even though you didn’t watch program A yet. More confusion!

A simple solution

In the end this is a simple technical problem with an even simpler solution: record the overlap in a separate file and make it part of both recordings. Visual:

If you watch recording 1, you get recording 1 + X. If you watch recording 2, you get X + recording 2.

If you erase recording 1, X stays. Only if both recording 1 and recording 2 are erased, X gets deleted.

More in general there will be X areas both in front and at the end, etc…

Would be nice if the biggest TV provider of Belgium could implement this. If the digicorder was open source I would’ve done this already months ago…
I guess I’ll have to look into some kind of MythTV like setup one day.

arduino-0018, avrdude and usbtiny programmer

For some reason the avrdude binary that is shipped with arduino-0018 has no support for the USBtiny programmer which I use to burn bootloaders on blank AVR atmega328 microcontrollers.
On Debian the workaround is simple: first install avrdude via apt-get/aptidude and then enter the hardware/tools directory in the arduino-0018 dir and replace avrdude by a softlink to /usr/bin/avrdude like this:

$ cd arduino-0018/hardware/tools
$ mv avrdude avrdude.old1
$ ln -s /usr/bin/avrdude .
$ mv avrdude.conf avrdude.conf.old1
$ cp /etc/avrdude.conf .

After this burning a bootloader via the menu in arduino works fine again. A similar approach will probably work on other Linux distributions.

Nokia N82 Bluetooth + GPRS/3G

A few months ago I did an interesting discovery about using my cellphone to go on the internet via bluetooth. I had this strange situation before where it just stopped working, and after revisiting all configs it worked again.

What really happens is that my cellphone somehow crashes, after which I power cycle it by removing the batteries. The phone then boots again, but here is the twist: the service channels in the phone are re-allocated and apparently in a random order!

This implies that the RFCOMM channel configured in the /etc/bluetooth/rfcomm.conf file is possible wrong now!

Solution: just browse the services again with sdptool browse, adapt the file and it should work again!

how to set a serial port at MIDI speed in linux

Linux serial ports only work at standard speeds by default. MIDI runs at 31250 baud, which is not a standard speed. However there are tricks to get custom speeds, but documentation is quite fuzzy. This is a simple recipe that worked for me with an FT232 USB-Serial board.

Check the baud base of the device:

$ setserial -g -a /dev/ttyUSB0
/dev/ttyUSB0, Line 0, UART: unknown, Port: 0×0000, IRQ: 0
        Baud_base: 24000000, close_delay: 0, divisor: 0
        closing_wait: infinite
        Flags: spd_normal low_latency

As you can see the baud base is 24000000 here.
Next calculate the divisor by dividing the baud_base you see here by the speed you want.
In my case 24000000/31250=768.

Apply the new setting:

$ setserial -v /dev/ttyUSB0 spd_cust divisor 768

Next start your serial application, you might want to make sure it is already set to the correct speed before you do the above changes else it might destroy your settings. The correct speed is 38400 baud, which is now aliased to 31250.

With minicom just use the menu (CTRL-A Z) to change the settings.

Screen can be used like this:

screen /dev/ttyUSB0 38400

Exit screen by pressing CTRL-A CTRL-\

Sweet.

arduino toolkit on x86_64 linux Debian/Ubuntu

Update:

I received an email from Ethan Bisset with a much nicer solution: just use the debian provided serial library instead of the one provided with the arduino software.

This is his recipe:

1. Get arduino software
2. apt-get install sun-java6-bin binutils-avr avr-libc gcc-avr librxtx-java
3. Untar arduino software
4. Delete <arduino>/lib/librxtxSerial.so
5. Done!

(below is the old entry:)

Download the linux 32-bit arduino toolkit from the arduino toolkit download page and untar in a directory.

Install the avr tools: apt-get install avr-libc binutils-avr gcc-avr

Install “ia32-sun-java5-bin”. ( apt-get install ia32-sun-java5-bin )

Adapt the “arduino” startup script script and replace java in it by

/usr/lib/jvm/ia32-java-1.5.0-sun/bin/java

Execute the “arduino” startup script. It works just fine now.

Thats all.

Many thanks to the Debian java packagers for providing this 32-bit compatibity jvm!

De Post – volmachten

Blijkbaar heeft De Post een nieuwe melkkoe gevonden: de kleine zelfstandige.

Vandaag stond de postbode aan mijn deur met aan pakketje voor de firma. Hij vertelde me doodleuk dat het niet mag afgeven worden, want ik moet hiervoor een volmacht hebben.
Deze volmacht kun je gaan halen op de post en kost elk jaar geld.

De postbode gaf zelf toe dat dit puur geldklopperij is.

Je bent dus gewaarschuwd: zorg dat verzendingen met de post als geadresseerde je privé gegevens bevatten en niet je firmanaam. Of werk met een andere firma dan De Post.

Ikzelf hang er nu al aan voor dit jaar.

Gelukkig is het zalig weer :)

glibc 2.9 – maradns

As Debian has been released my “unstable” box recently upgraded to glibc 2.9.
This caused DNS resolving to mysteriously fail in some applications.

Turns out that only IPv6 enabled applications suffer.

Apparently libc now fires both an IPv4 and IPv6 DNS resolving request in parallel. It looks like some DNS servers don’t handle that correctly and answer an error on the IPv6 request before the IPv4 request even has time to resolve further in the internet.

In my case it was my local NSLU2 running Debian lenny causing the trouble, more specific the maradns local DNS server and DNS proxy running on it.

I manually upgraded maradns to the latest version (> 1.3.10) and things are “back” to normal.

Another solution is to disable IPv6 systemwide but I prefer not to do that as I use IPv6 occationally for testing.

I fear that this will cause more trouble for alot of people with routers doing DNS proxying.

openMSX 0.7.0

A new version of openMSX has been released!

Important new feature is save-states. This gave me the means to finally finish the very first game I bought as a kid: Konami’s Nemesis 2 for the MSX computer.

In these times games were usually hard. Nemesis 2 is even harder.  The only way to play it without save-states is not dying all 15 levels. Given that Nemesis 2 is a shooter this is VERY hard :)


nemesis2_stage_24_2.png

Each one of those red bullets and grey stones is fatal :)

But save-states wasn’t enough. I also enabled “old-people” mode, meaning running the emulator at 75% speed of the original MSX computer.

After more then an hour of hard labour playing using alot of save-states I finally managed to finish the game.

Only 22 years late ;-)

P.S.: I checked with my MSX friends and no-one was able to finish this game without some form of cheating….

dell precision m6400 power brick

I’m really happy with my new Dell precision M6400.
The only thing most people complain about is the size of the power brick, and I can’t agree more. It’s a huge 200 Watt thing and it’s really as large and heavy as a stone brick.

Luckily I still have a spare power brick of my old Dell precision M65: a 90 Watt  PA-10 family power brick. It has exactly the same voltage (19.5 Volt) so I decided to try it.
I’ve been using it now for a few days when at customer sites and it works fine.

(Try at your own risk!)

a month

Last year I even did it for longer then a month, but this year I want at least to redo a minimal effort, thus I’m going for a month of sobriety, as a kind of cleansing :) (and no, I’m not religious).

These are my 5 daily checkpoints:

  1.  smoothie for breakfast

    This is something which we (me and my wife) do already anyway, have a fresh fruit smoothie for breakfast. Currently our favorite mix is 4 blood oranges, freshly pealed and parted, a seep of  Sea-buckthorn elixir, and a couple of frozen strawberries (or cranberries). Mix all in the blender, long enough to don’t have any parts left. It is extremely tasty, and gives a serious vitamin boost for the winter. The idea is to have it for breakfast and then don’t drink or eat anything else for at least 1.5 hours, to make sure it’s (almost) fully digested.

  2. < 4 coffee

    This is a hard one; people who know me will know I’m a serious coffee lover. I have a special espresso machine, and typically serve single origin or special blend coffees. It’s hard to resist :)

  3. exercise

    Just a walk with the dogs already counts.

  4. no sugar

    This is usually not so hard for me, as I’m not into sweets anyway.

  5. no alcohol

    This is tougher. I’ll have to stick to coffee, tea and fruit juices.

This is all as much a physical as a mental exercice :)