星期五, 6月 24, 2011

OMAPDSS:How to enable DVI display

How to enable DVI display
DVI display can be enabled in two ways
1. Using bootargs
Eg: omapdss.def_disp="dvi" omapfb.mode=dvi:720x480@60
2. Using SYSFS attributes
echo 0 > /sys/devices/platform/omapdss/display0/enabled
echo "" > /sys/devices/platform/omapdss/manager0/display
fbset -fb /dev/fb0 -xres 720 -yres 480
echo "dvi" > /sys/devices/platform/omapdss/manager0/display
echo 1 > /sys/devices/platform/omapdss/display2/enabled
kill
Restart without enabling rotation: matrix_gui -qws /usr/share/matrix/html/menu_main.html

ref: http://processors.wiki.ti.com/index.php/AM37x_EVM_Software_Developer%27s_Guide

星期四, 6月 16, 2011

Bash - rename your file name

for i in *.rmvb; do mv $i `echo $i | cut -d '.' -f 2,3,4,5,6`; done

ex: 远古外星人.Ancient.Aliens.S02E10.HDTV-RMVB.rmvb to Ancient.Aliens.S02E10.HDTV-RMVB.rmvb

星期日, 3月 27, 2011

Ubuntu Backup/Restore

reference from: http://ubuntuforums.org/showthread.php?t=81311

1. Gen the Tar file:
tar cvpf sendai-backup.tar --exclude=/proc --exclude=/lost+found --exclude=/sendai-backup.tar --exclude=/mnt --exclude=/sys /

2. Restore the tar to target
tar xvpf sendai-backup.tar -C /

3. mkdir the exclude dir
mkdir proc
mkdir lost+found
mkdir mnt
mkdir sys

星期三, 12月 29, 2010

MK100 Dev. Env R3

Installing Windows Embedded CE 6.0 – Steps:

1. Visual Studio 2005
2. Visual Studio 2005 SP1
3. Visual Studio 2005 SP1 for Vista
4. Windows Embedded CE 6.0
5. Windows Embedded CE 6.0 SP1
6. Windows Embedded CE 6.0 R2
7. Windows Embedded CE 6.0 R3
8. Install Windows Embedded CE 6.0_Product_Update_Rollup_2009
9. copy C:\Program Files\Common Files\microsoft shared\Windows CE Tools\Platman\target\wce600\armV4i to C:\Program Files\Common Files\microsoft shared\Windows CE Tools\Platman\target\wce600\armV4 (for active-sync)
10. device emulator 2.0
11. .net cf 2.0 sp2
12. install ARM VFPv2 library
13. install WesttekFileViewers6.exe (Office, PDF viewer)

星期一, 12月 27, 2010

Windows CE 6 FTPD, HTTPD related document

FTPD
http://msdn.microsoft.com/en-us/library/ms881874.aspx

HTTPD
http://msdn.microsoft.com/en-us/library/ee498633.aspx

星期一, 12月 20, 2010

network adb in beagleboard

since rowboat gadget driver does not works for me. so i choose use network adbd for my beagleboard-xm.

target:
setprop service.adb.tcp.port 5555
stop adbd
start adbd

windows:
adb connect xxx.xxx.xxx.xxx:5555

done.

Beagle edit boot.scr

Strip the 72byte long uboot header:
dd if=boot.scr of=boot.script bs=1 skip=72

use u-boot mkimage to gen the .scr
mkimage -A arm -T script -C none -n "beaglexm boot script" -d boot.script boot.scr

星期五, 4月 16, 2010

OMAP3 GPIO reset pin

take omap3-evm as reference

1. xxxx.h for mux

MUX_VAL(CP(GPMC_WAIT2), (IEN | PTU | EN | M4)) /*GPIO_64*/\

2. xxx.c for set h-l-h pulse

/* Make GPIO 64 as output pin */
writel(readl(&gpio3_base->oe) & ~(GPIO0), &gpio3_base->oe);

/* Now send a pulse on the GPIO pin */
writel(GPIO0, &gpio3_base->setdataout);
udelay(1);
writel(GPIO0, &gpio3_base->cleardataout);
udelay(1);
writel(GPIO0, &gpio3_base->setdataout);

星期三, 2月 03, 2010

Platform Builder 6 remote tools

C:\Program Files\Common Files\microsoft shared\Windows CE Tools\Platman\target\wce600

copy armv4i to armv4

then VS2005(PB6) remote tools is ready.

星期二, 1月 26, 2010

Enable multi-core compiling with Visual Studio 2005/2008 for Qt

for Visual studio 2005 mkspecs\win32-msvc2005\qmake.conf
for Visual studio 2008 mkspecs\win32-msvc2008\qmake.conf

change
QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t-
to
QMAKE_CFLAGS = -nologo -Zm200 -MP -Zc:wchar_t-

Speeding up Visual C++ Qt Builds (jom)

1. extract jom binary to %QTDIR%\bin
2. run jom instead of nmake

binary stored place: ftp://ftp.qt.nokia.com/jom/

Install Qt 4.5.3 for Windows with VS2005

Install Qt 4.5.3 for Windows with VS2005

1. get qt-win-opensource-src-4.5.3.zip from ftp or file server

2. extract zip file to c:\qt\

3. cd C:\Qt\qt-win-opensource-src-4.5.3 (check the path in your system)

4. C:\Program Files\Microsoft Visual Studio 8\VC\bin\vsvars32.bat

5. configure -platform win32-msvc2005 -no-qt3support

5.1. wait for a while

6. nmake

6.1. wait for a while

7. Add system variable "QTDIR=C:\Qt\qt-win-opensource-src-4.5.3" & "PATH=C:\Qt\qt-win-opensource-src-4.5.3\bin;%PATH%"

MySQL for Qt

1. Install MySQL with development files (%QTDIR% == C:\Qt\qt-win-opensource-src-4.5.3)
2. C:\Program Files\Microsoft Visual Studio 8\VC\bin\vsvars32.bat
3. cd %QTDIR%\src\plugins\sqldrivers\mysql
4. qmake "INCLUDEPATH+='C:\Program Files\MySQL\MySQL Server 5.1\include'" "LIBS+='C:\Program Files\MySQL\MySQL Server 5.1\lib\opt\libmysql.lib'" mysql.pro
5. nmake
6. Check result. (you will see files in %QTDIR%\plugins\sqldrivers)

星期二, 10月 13, 2009

PCHK6410 development env

Installing Windows Embedded CE 6.0 – Steps:

1. Visual Studio 2005
2. Visual Studio 2005 SP1
3. Visual Studio 2005 SP1 for Vista
4. Windows Embedded CE 6.0
5. Windows Embedded CE 6.0 SP1
6. Windows Embedded CE 6.0 R2
7. Windows Embedded CE 6.0 cumulative product update package (through 12/31/2008)
8. Install Windows Embedded CE 6.0 monthly update package (since 2009/01)
9. copy C:\Program Files\Common Files\microsoft shared\Windows CE Tools\Platman\target\wce600\armV4i to C:\Program Files\Common Files\microsoft shared\Windows CE Tools\Platman\target\wce600\armV4 (for active-sync)
10. device emulator 2.0
11. .net cf 2.0 sp2

星期三, 5月 06, 2009

svn server in Linux

Create Repos:
svnadmin create ~/SVN/repos/project

then:
svn import xxx/yyy/ ~/SVN/repos/project

星期三, 7月 16, 2008

apt-get got gpgv error on debian-mipsel

1. get ntpdate
2. ntpdate time.stdtime.gov.tw
3. run `apt-get update` should be fine.

星期六, 7月 12, 2008

Qt4.4.0 + Eclipse CDT

Finally, I make my decision to transfer from Visual Stdio + Qt to Eclipse + Qt for cross-platform & singal UI.

Here is my install steps.

1. get the qt4.4.0 windows binary version. (Mingw can also installed while qt4.4.0 installing.)
2. get qt for eclipse plugin
3. get Eclipse + CDT latest version.
4. install all on C:\Develop (Qt4: c:\develop\qt4, Eclipse: c:\develop\eclipse)
5. set PATH=c:\mingw\bin;c:\develop\qt4\bin
6. set INC=c:\mingw\lib;c:\develop\qt4\lib
7. set include=c:\mingw\include;c:\develop\qt4\include
8. done

PS: debug libs are not included. user has to build by own througth 'qtvars.bat compile_debug'

reference: http://labs.trolltech.com/blogs/2007/07/11/develop-qt-applications-in-eclipse/

星期四, 7月 10, 2008

Qt4.4.0 with Visual C++ 2005 express on Windows

just a little bit different from Qt4.4.0 with VC6.

My experience about compiling Qt 4.4.0 with Visual C++ 2005 on Windows is as below.

1. Get the Qt 4.4.0 source from Trolltech
2. extrat the source pack to c:\qt4-src
3. set environment variable
PATH=%PATH%;c:\qt4\bin
QTDIR=c:\qt4
QMAKESPEC=win32-msvc2005
4. Get Platform SDK 2003 R2 & Install
5. run visual studio command mode & call %PLATFORMSDK%\setenv.bat /RETAIL
6. cd c:\qt4-src
7. copy the qt4-src/mksepc/ to qt4/mkspec
8. configure.exe -prefix c:\qt4 (see more options by using "configure -help")
9. run 'nmake' to compiling the source, wait 1hr (CPU - C2D 1.83G).
10. finally, we got what we expect.

PS: using vc 2005 compiler will get MMX, SSE, SSE2, WEBKIT support.

星期三, 7月 09, 2008

Qt4.4.0 with Visual C++ 6.0 on Windows

Qt support compiler on Windows other than Mingw from Qt 4.3.x, but user has to compile the source by own.

My experience about compiling Qt 4.4.0 with Visual C++ 6.0 on Windows is as below.

1. Get the Qt 4.4.0 source from Trolltech
2. extrat the source pack to c:\qt4-src
3. set environment variable
PATH=%PATH%;c:\qt4\bin
QTDIR=c:\qt4
QMAKESPEC=win32-msvc
4. cd c:\qt4-src
5. copy the qt4-src/mksepc/ to qt4/mkspec
6. configure.exe -prefix c:\qt4 (see more options by using "configure -help")
7. run 'nmake' to compiling the source, wait 1hr (CPU - C2D 1.83G).
8. finally, we got what we expect.

星期二, 7月 08, 2008

Debian on mipsel projects (1)

Debian commands memo:

1. debootstrap
2. debfrost
3. deborphan
4. apt-utils
5. aptitude
6. dpkg-reconfigure
7. update-rc.d
8. rcconf (like: ntsysv)
9. localpurge

Debian from scrath:
1. dfsbuild

Myth TV:

星期五, 2月 15, 2008

AlphaBlend related info

http://en.wikipedia.org/wiki/Alpha_compositing

Alpha-Blending 技术简介 <原文出處:http://dev.gameres.com/Program/Visual/2D/AlphaBlending.htm>


  现在的游戏,不管是 2D 还是 3D 的,为了追求透明光影效果,通常都会使用到 Alpha-Blending 技术。下面,我们将谈论什么是 Alpha-Blending 技术并简单介绍 Alpha-Blending 技术的具体算法。

  所谓 Alpha-Blending,其实就是按照“Alpha”混合向量的值来混合源像素和目标像素。为了便于理解,我们就从两个像素间的 Alpha-Blending 过程谈起吧。

  第一步,先把源像素和目标像素的 RGB 三个颜色分量分离,然后把源像素的三个颜色分量分别乘上 Alpha 的值,并把目标像素的三个颜色分量分别乘上 Alpha 的反值,接下来把结果按对应颜色分量相加,再对最后求得的每个分量结果除以 Alpha 的最大值(通常这一步都是用移位来完成,这亦是 Alpha 的最大值为何总是二的幂的原因),最后把三个颜色分量重新合成为一个像素输出。

  在这个过程中,为了分离像素中的 RGB 三个颜色分量,我们一般会使用掩膜的方法。至于具体的三个掩膜值:RMask、GMask 和 BMask,可以从 DirectDraw 中的 DDPixelFormat 返回得到(当然,你也可以根据自己的需要做各种灵活处理)。

  在下面给出的说明性例程中,我们假设 RMask、GMask 和 BMask 已经存放的是 RGB 三个颜色分量的位掩膜值,Alpha 的最大值为 256,而 source 和 dest 是指向源像素和目标像素的指针。

int ialpha = 256 - *alpha; // Alpha 的反值

*dest = (RMask & (((*source & RMask) * *alpha + (*dest & RMask) * ialpha) >>8)) | (GMask & (((*source & GMask) * *alpha + (*dest & GMask) * ialpha) >>8)) | (BMask & (((*source & BMask) * *alpha + (*dest & BMask) * ialpha) >>8));

  终于明白什么是 Alpha-Blending 了吧?很简单不是,快去编程一试吧。如果大家感兴趣,下次再为大家介绍几种别的混合方法。请期待『几种常用的像素混合方法』。