> touch /tmp/x.c
> gcc -E -dM -c /tmp/x.c
#define __linux__ 1
#define linux 1
#define __i386__ 1
#define __i386 1
#define __GNUC_MINOR__ 95
#define i386 1
#define __unix 1
#define __unix__ 1
#define __GNUC__ 2
#define __linux 1
#define __ELF__ 1
#define unix 1
A Programmer's Life Wiki
2011-04-26
Read Memory Usage
How to read memory usage of a process from /proc/pid/status
VmPeak: 8368 kB (peak usage of virtual memory)
VmSize: 7344 kB (usage of virtual memory)
VmLck: 0 kB (locked memory)
VmHWM: 2336 kB (peak usage of hardware memory)
VmRSS: 2336 kB (usage of hardware memory)
VmData: 3052 kB (heap)
VmStk: 88 kB (stack)
VmExe: 16 kB (text section)
VmLib: 4080 kB (shared library)
VmPTE: 56 kB (page table entry size)
Explanation comes from:
http://d.hatena.ne.jp/naoya/20080727/1217119867
http://www.kernel.org/doc/man-pages/online/pages/man5/proc.5.html
http://www.linuxquestions.org/questions/programming-9/vmsize-regarding-proc-pid-status-432227/
VmPeak: 8368 kB (peak usage of virtual memory)
VmSize: 7344 kB (usage of virtual memory)
VmLck: 0 kB (locked memory)
VmHWM: 2336 kB (peak usage of hardware memory)
VmRSS: 2336 kB (usage of hardware memory)
VmData: 3052 kB (heap)
VmStk: 88 kB (stack)
VmExe: 16 kB (text section)
VmLib: 4080 kB (shared library)
VmPTE: 56 kB (page table entry size)
Explanation comes from:
http://d.hatena.ne.jp/naoya/20080727/1217119867
http://www.kernel.org/doc/man-pages/online/pages/man5/proc.5.html
http://www.linuxquestions.org/questions/programming-9/vmsize-regarding-proc-pid-status-432227/
2011-03-29
Linux Signal Handler
To register a signal handler in linux:
signal(SIGINT, signalhandler);
The signal handler will run in the main thread, main thread will be interrupted.
signal(SIGINT, signalhandler);
The signal handler will run in the main thread, main thread will be interrupted.
Linux Library
There are two kinds of libs in Linux:
Static Library & Shared Library
code from Static Library is actually included in final executable.
code from Shared Library is not included in final executable.
For Shared Library, we can use it in two ways:
1. explicit linking (during compile time, designate which lib to link)
2. dynamic loading (during run time, good for plugin)
Static Library & Shared Library
code from Static Library is actually included in final executable.
code from Shared Library is not included in final executable.
For Shared Library, we can use it in two ways:
1. explicit linking (during compile time, designate which lib to link)
2. dynamic loading (during run time, good for plugin)
Memory Band Width Problem
1) Noise happens on camera preview window.
This problem is solved by using src rotation instead of display rotation. display rotation needs more time for memory access.
2) Noise happens on screen when we take multi-shot
This problem is solved by raising the clock.
3) Noise happens on the last preview when take multi-shot
It can be solved by raising the clock but finally we found that it is a bug of incorrect panel setting.
This problem is solved by using src rotation instead of display rotation. display rotation needs more time for memory access.
2) Noise happens on screen when we take multi-shot
This problem is solved by raising the clock.
3) Noise happens on the last preview when take multi-shot
It can be solved by raising the clock but finally we found that it is a bug of incorrect panel setting.
How Audio is Played on a certain Mobile Phone
The audio is composed of two parts: decoder and mixer.
* There can be mufti decoders active at same time,
* All the result of decoders goes in to mixer
* Input of decoder is encoded frames, out put of decoder is PCM
* input of mixer is connected to the output decoder, mixer mix all the streams to one stream.
aac -- aac decoder -- PCM \
amr -- amr decoder -- PCM - Mixer -- PCM
mp3 -- mp3 deocder -- PCM /
There is one DSP. aac/amr/mp3 decoder applet and mixer applet share the DSP resource.
A non-preemptive OS is controlling all the applets.
* There can be mufti decoders active at same time,
* All the result of decoders goes in to mixer
* Input of decoder is encoded frames, out put of decoder is PCM
* input of mixer is connected to the output decoder, mixer mix all the streams to one stream.
aac -- aac decoder -- PCM \
amr -- amr decoder -- PCM - Mixer -- PCM
mp3 -- mp3 deocder -- PCM /
There is one DSP. aac/amr/mp3 decoder applet and mixer applet share the DSP resource.
A non-preemptive OS is controlling all the applets.
How Barcode Reader Works
1. Set the camera in viewfinder mode
2. Copy the frame in the chip memory from camera which is in view finder mode. The data format is YUV420
2. Copy the frame in the chip memory from camera which is in view finder mode. The data format is YUV420
Subscribe to:
Comments (Atom)