2009年8月28日 星期五

* ubuntu mplayer using fbdev

reference http://forum.ubuntu.org.cn/viewtopic.php?f=74&t=118666

#mplayer -vo help
#mplayer -vo fbdev /media/sda7/else/lian.flv

#mplayer -vo fbdev -vf scale=1024:768 video_file.avi
-vo fbdev 是告诉mplayer用framebuffer作视频驱动.
-vf scale=1024:768 是全屏的方法,可按屏幕的具体情况作调整
用fbxine的话需要下载:
# apt-get install xine-console

picture
# apt-get install fbi
用这个软件包里的fbi可以浏览图片,fbgs可以观看pdf文件:
# fbi -a *jpg
# fbgs -c *pdf

2009年8月27日 星期四

* ubuntu command "mksquashfs"

#cd /scratchbox
#mksquashfs . /scratchbox.squashfs -b 65536
#mkdir scratchbox.base

//only for test,this is base layer and squashfs only support read mode

#mount -t squashfs -oloop scratchbox.squashfs scratchbox.base/
#mkdir scratchbox.changes
#mkdir scratchbox
#mount -t aufs -o dirs=scratchbox.changes/=rw:scratchbox.base/=rr aufs /scratchbox

//if you want to automount while bootup linux,then you need to edit /etc/fstab


------------------------------------------------------------------------------
mount squashfs
And, make sure you are root

#mount -t squashfs -o loop /scratchbox.squashfs /scratchbox.base/

#mount -t aufs -o dirs=/scratchbox.changes/=rw:/scratchbox.base/=rr aufs /scratchbox

*ubuntu command "7zip"

make sure you are a root
Tar file:
#sudo su
#tar -cvf - Adobe | 7za a -t7z -m0=lzma -mx=9 -mfb=64 -md=64m -ms=on -si Adobe.tar.7z

Untar file:
#7za x -so /opt/Adobe.tar.7z | tar -xf -

* ubuntu bash.bashrc setting

edit #/etc/bash.bashrc
Added

----------------------------------------

----------------------------------------
bind 'C-b':backward-word
bind 'C-f':forward-word
bind 'C-w':backward-kill-word

bind '"\x1b\x5b\x41":history-search-backward'
bind '"\x1b\x5b\x42":history-search-forward'

export HISTFILESIZE=10000
export HISTSIZE=10000
---------------------------------------------

2009年8月26日 星期三

*audio driver on linux

Reference Essential Linux device drives

1. Audio connection


cpu ===> audio codec ===> MIC or speaker

ex: audio codec : AC97. TI TPS65950
audio codec converts digitial audio to analog sound for playing through speakers
Then, audio codec has "mixer" functionality

2.Linuc sound subsystem
ALSA is the sound subsystem of choice in the 2.6 kernel

Device node : /dev/snd/*

/dev/snd/controlC0 is control node for volume gain
/dev/snd/pcmC0D0p is a playback device, p is playback
/dev/snd/pcmC0D0c is a recording device, c is capture

3. Accessing information via /proc/asound and /sys/class/sound

4. ALSA library : user space alsa library alsa-lib which provides the libasound.so
ALSA utility : alsa-utils, alsamixer, amixer, alsactl , aplay and areocrd

5. Audio driver is build out of three main function
* Playback
* Capture
* Mixer control functions

2009年8月24日 星期一

* ubuntu scp command

Ubuntu scp command

scp 來源 目的

將檔案從遠端傳到本機
遠端-->本機
scp username@tohostname:/remotefile /newlocalfile



將檔案從本機傳到遠端
本機 -->遠端

scp localfile username@tohostname:/newfilename

* [ D ] Ubuntu can't use console

Ubuntu can't use console
Solution:
#cd /etc/event.d/
#cp tty1 ttyS0
Please make sure your console setting by bootargs=console=ttyS0,115200......

Then, edit /etc/event.d/ttyS0
----------------------------------------------------------------------------
#vi /etc/event.d/ttyS0

tart on stopped rc2
start on stopped rc3
start on stopped rc4
start on stopped rc5

stop on runlevel 0
stop on runlevel 1
stop on runlevel 6

console owner
respawn
exec /sbin/getty 115200 ttyS0
----------------------------------------------------------------------------