May 20, 2012

Realtek RTL2832U DVB-T on Ubuntu 12.04 (Precise) and Linux Mint 13 (Maya)

Ubuntu (Desktop) 12.04 (codenamed Precise Pangolin) was released earlier this May, which has 5-years Long Term Support (LTS) from Canonical.  Let's check it out how my DVB-T USB stick works on Linux kernel 3.2.  Unfortunately, Realtek RTL2832U driver did not make it in the kernel main stream, and the instructions mentioned in the post "HD DVB on Ubuntu 10.04 (Lucid)" posted a year ago did not work for me either.  Luckily, I followed the instructions at https://github.com/ambrosa/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0 ,and everything goes well.  Here's the recap:

Install required packages:

$ sudo apt-get install build-essential git

Check out a copy of the driver source code patched by ambrosa:

$ git clone https://github.com/ambrosa/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0

Makefile configuration and driver compilation/installation:

$ cd DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/
$ vi Makefile (to make sure variable INCLUDE_EXTRA_DVB matches your kernel version)
$ make clean
$ make
$ sudo make install
$ sudo modprobe dvb_usb_rtl2832u

dmesg shown after module insertion:

[  927.960738] IR NEC protocol handler initialized
[  927.963676] dvb-usb: found a 'DK DONGLE' in warm state.
[  927.963680] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[  927.965156] IR RC5(x) protocol handler initialized
[  927.965302] DVB: registering new adapter (DK DONGLE)
[  927.966515] IR RC6 protocol handler initialized
[  927.968948] IR JVC protocol handler initialized
[  927.971631] IR Sony protocol handler initialized
[  927.972945] IR MCE Keyboard/mouse protocol handler initialized
[  927.974271] lirc_dev: IR Remote Control driver registered, major 250
[  927.974493] IR LIRC bridge handler initialized
[  927.980540] RTL2832U usb_init_bulk_setting : USB2.0 HIGH SPEED (480Mb/s)
[  928.116808] RTL2832U check_tuner_type : FC2580 tuner on board...
[  928.709405] DVB: registering adapter 0 frontend 0 (Realtek DVB-T RTL2832)...
[  928.709781] input: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/input/input12
[  928.709916] dvb-usb: schedule remote query interval to 287 msecs.
[  928.709924] dvb-usb: DK DONGLE successfully initialized and connected.
[  928.709997] usbcore: registered new interface driver dvb_usb_rtl2832u


Double confirm with lsmod listing:

$ lsmod | grep rtl28
dvb_usb_rtl2832u      345365  0
dvb_usb                23826  1 dvb_usb_rtl2832u

The VLC player and the ALSA sound driver were in good shape, thus no extra update was required.

HDTV playback

Additional information:

$ lsusb | grep DVB
Bus 002 Device 003: ID 1d19:1102 Dexatek Technology Ltd. DK mini DVB-T Dongle

$ uname -a
Linux cheetah 3.2.0-24-generic-pae #37-Ubuntu SMP Wed Apr 25 10:47:59 UTC 2012 i686 i686 i386 GNU/Linux

$ vlc --version
VLC media player 2.0.1 Twoflower (revision 2.0.1-0-gf432547)
VLC version 2.0.1 Twoflower (2.0.1-0-gf432547)

$ more /proc/asound/version
Advanced Linux Sound Architecture Driver Version 1.0.24.


[Updated May 26, 2012]

Linux Mint 13 (Maya), which was based on Ubuntu 12.04, was released few days ago.  The steps mentioned above work as well on Mint.  Have fun!

HDTV playback on Linux Mint 13

May 18, 2012

Searching for ET in a Green Way (best practice wanted)

As a cloud computing contributor for over 12 years since joining the SETI@home (search for extraterrestrial intelligence at home) in Y2K, the carbon footprint has not been seriously considered. The picture below showed the relationship of the thermal sensor readings and the % of CPU time consumed by SETI client on my home server, which is a 12-year old Pentium III 500 MHz laptop, in six CPU usage threshold profiles ranging from 100%, 80%, 60%, 40%, 20% and finally to 0%.  In summer the temperature can go as high as 75°C (167°F) running SETI in full throttle, while as low as 44°C (111°F) when idling.  Given the global warming issue, the soaring electricity fee,  and being a not-so-serious contributor, I think 40% might be a good choice for my home server.  If you have a better equation (in scientific way) for best practice please let me know. ;)

May 13, 2012

FlyVision FDV-606 Carcam Password Protection Security Bypass

One of the features FDV-606 boasted is the password protection on the video records to prevent unauthorized access. Tests showed the password we set does not apply to the video data for encryption but just a checkpoint in the application layer of the built-in video player.  Thus we can totally bypass this crappy security feature with the video files extraction method aforementioned.

EDM captured from the official website. The translation for the highlighted is "you can set passwords to prevent unauthorized access".

Password input dialog

 In the built-in video player, a correct password is required to access the video files if they're password protected.

小瑪莉 - A DOS Game Written Two Decades Ago! (1992)

Really don't know how to say it in English. The slot machine? It's the first decent program I wrote for fun and for C language practice in the freshman year.

Screenshots:

The literally translated name, Small Mary, is so ...

The help screen

The main screen

May 12, 2012

Legacy DOS Game - nAnB Number Guessing (1994)

A number guessing game most people familiar with, written during the summer break in 1994.  A maximum of 9 digits are supported.  It's a pure text mode program with default VGA palette modified.

The readme file:

                        NANB, Digit Guesser v1.0
                        ========================

           An educational game for MS-DOS.  VGA/EGA required.
           Copyright (c) 1994 by Hubert Lin, NCU M.E., Taiwan
         E-mail: u330634@sparc20.ncu.edu.tw (before Jun. 1995)
                          All Rights Reserved

This software consists of the following files:

        KEYCODE  H   - Header file
        NANB     C   - Source code for the game
        NANB     TXT - This file
        NANB     EXE - The main executable file
        NANB     H   - Header file
        NANB     PRJ - Project file
        UNCRUNCH H   - Header file provided by TheDraw v4.63
        UNCRUN_F OBJ - Object file provided by TheDraw v4.63

 * TheDraw v4.63 is a screen editor by TheSoft Programming Services and
   Ian E. Davis

    <<<  NANB v1.0 is FREEWARE, please distribute or upload it! >>>


Screenshots:


 the main screen

 F1 help screen

7-digits number guessing

Legacy DOS Program - Bezier Curve Drawer (1995)

Yet another assignment in my senior year in university, a Bezier curve plotter.  Lots of math in the code that I long forgot.  Check the Wiki out for details.

 control points (red dots) and the b-curve preview (greent dots)

 a max of 100 control points

 F1 help screen

dialog box for file loading

Rubik's Cube - A DOS Game Written 19 Years Ago (1993)

Accidentally found several programs I wrote in Turbo C running in DOS while cleaning up my almost-full disk drives.  Wondering if I can run them under Linux, a utility called dosemu makes it possible.  The first program is a Rubik's cube game, which you can rotate the whole cube or a single face.  Actually it's a C language assignment co-worked with my classmate Andrew (Yong-Yi) Lee back in 1993, our sophomore year in NCU, and we got a very high score on this project. If my memory serves, he did the 3D animation part while I took care of the logic and 2D gfx.  We also uploaded the executable and the source code to the public domain a year later in 1994.  Amazing that the archive (cube_v1.zip, 110 KB) we uploaded is still available at Simtel legacy MS-DOS collection as of this writing. In those good old days when World Wide Web had not been invented, we had trouble finding the correct term in English for this cube (魔術方塊 in Chinese), so we just translated it literally to Magic Cube. Very funny (or stupid) huh?

Although the screenshots were all taken under the dosemu boxes in Linux, I do believe this game is also compatible on modern OS'es like Windows 7, but haven't been tested yet.

Download cube_v1.zip (110 KB, SHA1 digest c57371faba7bdedb00034cb32449c34ec55f369b):

our advisor

the logo

the main screen, yeah the flower motif's kinda sissy, but i'm not sure that was my idea ;)

on-line help

May 11, 2012

Portrait ASCII Art

Testing out a utility called jp2a, which converts jpeg images to ASCII chars. View the image below with your eyes squinted. Please be noted browsing latency might be affected due to high amount (175 KB) of html code in this page.

Command invoked:

$ jp2a portrait.jpg  --color --width=80 --html > portrait-ascii.htm

ddxxxxxkkkkkkkkkkkkkkkkkkkkOOOOOOOOOOOOkkkkkkkkO0KKKKKKKKK0OkkkkkkkkkkkOkkkxxxxx
xkOOOOOOOOOOOOOkkkkkkkkkkkOOOOOOOOOOOOOOOOOOkkkO0KKKKKKXXK0OOOOOOOOOOOOOOOkkkkkk
KNWWWNXK00OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO0KKKKKKXXKK0000000000000OOOOOOOO
WMMMMMWKOkkkkkkkkkOOOOOOOOOOOOOOOOOOOOOOOOOOOOkkO0KKKKKXXKKKKKKKKK0000000OOkkkOO
WMMMMMWXK0O00OOOOOOOOOOOOOOOOOOOOkkOOOOOOOOOOkkkkO0KKKKKKKK00KKK0000000OOO000000
WMMMMMMNXKKKKK0000OOOOO0000OOOkkkxxddddxdddxxdoodxkOO0KKKKK00KKK00OOO0000KKXNNNN
NWWWWWWNNXXXXKKKK0000000K0Okkkkdl:,'''''',;,;,..':ldkkkOKKKXXXXXKK0000KKKKXNWWWW
WWWMMMWWWWNXXXXKKKKXXXNNNKxxxoc,.    ........'.   ..;cood0XXNNNXXKKKKKKKKXXNNNWN
MMMMMMMMMWWNNNXXXXXNNNWWXxdo:'....,:ccccc::;,.'.    ..'::ckKXNNXK00KXKKKXXXXK0Ok
WMMMMWWWWWNNXXXXXXXXXXXKxoc,...;codddddddddddl::,.     .,;:oOXNXK00XXNXXNNXK0Oxd
XXXXXXXXXXXKKKKKKXXK0Okoc:'..;codxxxxxxxxxxxxxdooc;..   .';;oKNXKO0XNNXXNNXK0Okk
KKKKXXXXXXKKKKKKKXXX0Oo;;'.,ldxxxxxxxxxxxxxxxxxddxdo:'. ...,;dXXKOOKXNNNNNXK0Okx
KKXXXXXXXXXXXXKKKKXXKO:...;odxkkkkkkkxxxxxxxxkkkxkkkxdc'.....;KNKOOKXNNNNXX00Okx
00KXXXXXXXXXXXKKKKXXKd'..,oxxxxxxxdxxkkkkkkkkkxdoddxxxxo,.....kNK0OKXXXXXXK000OO
kk0KKKXXXXXKK0000KKK0c'..cddddoc:,..';lodddoc;,',:codxxxl'...'dK0OO0000K00OOOOOO
OOO0000000000OkkO0000d, .oxdddoloooc:;:clolc::coxxxdxxxxd;..':dOkkkOOOOOOOOOOOOO
OOOO00OOOO0000OkkOOO0k; 'dxddolclc:ccc:coxoc:::;;clodxxkxc..';kOOkOOO0000O000000
OOOOOOOkOO000000kkxxkkc,:dddxdocc;';;:ooxxddl;;,,cloxkxxxl'.'cO0000000O00OOO0OOO
OOOOOkkkOOO00000000OOOOx;dxdxxxdolllodookOxdxdooodkOOkxkkc.:l0KKKKK00OOOOkkOOOOk
OOOOOOkk00KKKKKXXXXKKKKKldxxkkkkkkxxxddxO0OxddxxkkOOkkkkxl;ox0000000OOkxdxxOOOkk
OOO0K0kk0KXKKK0OOOOO0KKKddxxxxxxxxxdodxkOOOkdoodxxxkkkxxxolxO0K0OOOkkxxdodxkOkkk
OkkOK0kk0KKKK0OOkkkOO0OOkxddddddddoooo::loo:ldoddxxxxxxxdxkkk00OkkxxxkkxoddkOOOk
0kkOK0kxOKKKK0kdoooxkOOOOkxdddooollool:;;:::cdkxdddddxxxxkOkkkkxxkkOO0OxoddxOOOk
0kkO00Oxk0KKKOl;:ccdO0000OkddoloooodddooooddxxxdlloodxxxxOOkddxxkO0000OxoooxOOOk
Okxk00OdkO000kdldxkO000OOOkxdooool:;:;:::ccccclc:loddxxx:;:clodxxxxkxxxdooodkOOx
KKKKKKK0OOOOOOOOOOOOOOOOOOOkdollllclooolcccldxkxdooddddc....,;::::;;;;;,:lodkOOd
0KK000OkxxkkkxkOOO0000000Okdoollcclooolcclloddxkxxddool..............   .codOOko
OkkkkkxddxkkkkO000000000Okxddolcclooooooollodxkkkxdlcod..............   .cldkOkd
OOOOOOOxdxxkkkO00000000OOkxddoldlcllooolcclccldolc:coxko:............   .cldk00k
000000Okdxxkkxk0000000OOkxxdoddddoc::::::;;;;;;::cloxkOoxxlc::;;;;,,''..,lox0K0O
00K0000kxdxkkxk000000OOkxxkxxxccddollcc:;;,;;::clodxkkxlxkkkkxddoolc:;;,;lox0KKO
KKK0000OxdxxxxkO000OOOkxxxkddd;.oooollcc::;:::cclodxxxloxkkxxkkkxxocc:;;;loxOKK0
0000000OxdxxxxkO00OOOkxxkododd;.;lllcccc::::::clooddoccodxkxxxxxxkkkxdoolodx0KK0
0000000OxddxxxxOOOOOkxxxdlddddc'.:c:ccccc::ccccllool:cloodxxxdxxoxxxkkkkkkkkO00O
0000000OxddxxkkOkkxxxooolcodxdlc,,::::::;;;;;::cclc:cooddddddodxodxodxxxxkkkkkkk
0000000OkkkOOkxxxxxdo:olocloddoll:::c:cc:;;;;;::llcloddddddxoodxdodolxxdxkkkkkkk
000000OOOOkkxxdddddl:clolclooloolllclooooolclllodoooodddddxdoooxdooccdddxddxxxkk
00000OOOkxxdddooddo:;ococclooooc;'..'cxxxxxkkkkdl;.....'cdddoooodllccdddolodddoo
OO00Okkxxdddoollooc;;cc:::ccc;.  ....,:oxxkkkxc;'.'......',,'..:cll:cdoolooddllo
OOOOkkxxoooooolcco:;,:,...'''','',,;;,,;odxxd:;,,;;',,,;:::;;,:llll:coolllooccoo
OOOkkxdddollllllclc;;lc:::::::::;;;;;:::cddo::ccc:;,;:clllllccloollcclcclllclood
Okkkxxdddollccllccc::lcccccccccc::::::cc:lo:clcc::;:cccclllllllolll:cc:cll:coooo
Ooodxxddoollc::c::c::lcclccccccccccc:ccc:::;cccc:;:ccccccccllllolll:c:clc:ccool:
xollllodddoc:c;;;:::clclllllcccccccc:::;;,,:cccc:;:cccccccllllllllc;c;cc;;clcc;:
ooolc:;codoc:::,,::;ccclclclccccccc:::cc:'';:cc:;::ccc:cccllclcccc:::;c;;cccc;;c
ldolcc:;:cccc;;,';:;lccccllccccccccc::cc;',;;::;;:ccc::cccccccccc:::;;:;::c:,;:c
ldolcc:;,;:;,;;,.;;;cccccccccccccccc::ccc,;ll:;;;:cc::cccccccccc::::,;,;cc:,;:cc
oddolc:;,';:;.';',;;c:::cccccccccccc:;:lolloc:;;:cc:::ccccc:::c::::;';,::;,;:ccl
oooddlc:;,';c:'..,,:::::::cccccccc:cc;;:cllc:;,;::::;:cccc:::::::::,'';:;';:::::
olccllolc;,',::,.'';;;;:::c:::cccc::c:;;,;;;;;,;:::;:::c:::::::;;;;'',:,.,,;::cc
dollc:::clc;'';:'..;;;;;;::c::::cc:::::cc:;;;,;::::;;:::::::;;;;;;;..;,.';;:cccl
olcclooc;;:c:,.;:'.,;;,;;;::c:::::c::::::;,;;;::::;;;;::::;;;;;;;;,.',..,;::clol
ollc::cloc;;;;'',:.,,,,,,;::::::::::::;;;;;,,;:::;;;;;::;;;;;;;;;;..,..',;:ccc:;
olllc::;:cccc:;,';.'',,,,,;;:c::;:::::;;,,,,;:::;;;;;;;:;;;;,,;;;,..'..',;::,,:c
loooolc:;;::ccc:;,...''',,,,;::c:;;::;;,,,,;::;;;;;;;;;;;,,,,;;;,,...,;cl::,:clc
cclllooooolc:::cc:......'''''',::;;,;;,,,,,:::;;;;;;;;;;;,,,,;;,''.,:ooolloddclo
c::::ccc:::;::::::c;'..........,;::;,,,',,;::;;,;;;;;;;;,,,,,;,,,:odoodxdolod:;c
ccllc:;;;;::cccc:::c:,.......''',;;;,''',;::;,;;;;;;;;;,,,,,,,,.:lodxdoc:lddcc:;
lcc::ccccccc::;;;;;;:c,....''''''',;;,',;::;;,;;;;;;;;,,,'',,''.;::cc;,cdocclolc
c::cclccc:::;;,,''',,;;'...'''....',,,,;;::;;,,;;,;;,,,,''',,'..;::;,cddc,'llolc