目前日期文章:201509 (15)

瀏覽方式: 標題列表 簡短摘要

atmel touch tools to set atmel object value


首先說明一下我的環境:
---
CPU: MSM8992
Touch panel: ATMEL MXT_224s
OS:Android  5.1.1 (lollipop)
---
目前有一個平台是用 atmel mxt 224s touch panel,有時候會有修改此touch panel object的需要
在網路上找了一下,發現有一個工具 mxt-app 可以用來修改touch panel內部object的設定
網址如下:
https://github.com/atmel-maxtouch/mxt-app

於是在 ubuntu環境下利用下面指定下載source code,目錄為 mxt-app
git clone https://github.com/atmel-maxtouch/mxt-app.git
並執行
git submodule init
git submodule update
來download libusbdroid submodule

根據https://github.com/atmel-maxtouch/mxt-app 網站的說明,要compile需要下載NDK
所以我就在我 windows 平台上,至以下網址下載 Android NDK
https://developer.android.com/ndk/downloads/index.html#download
因我是 64 bit 平台,下載後得到檔案為 android-ndk-r10e-windows-x86_64.exe 410MB,並解壓縮

注意此 android-ndk-r10e 不能放在有空白字元目錄下,所以我就放在 D:\android-ndk-r10e
並將此路徑加到windows的環境變數PATH中

將在 ubuntu 系統下載的 mxt-app source code複製到 windows 系統中,並切換目錄到windows mxt-app放置處
根據https://github.com/atmel-maxtouch/mxt-app 網站的說明,因我的系統為Android  5.1.1 (lollipop)
必須enable PIE support,不然執行時會出現 "error: only position independent executables (PIE) are supported." 錯誤訊息

執行以下命令:
ndk-build APP_PLATFORM=android-16

binary執行檔會產生再 mxt-app/libs目錄下,分別有 arm64-v8a, armeabi,armeabi-7a,mips,mips64,x86,x86_64
因我的系統是屬於 arm64_v8a,所以我將 mxt-app/libs/arm64-v8a/mxt-app 複製到 android 裝置上

先將裝置 root, remount,複製mxt-app到裝置上,給於執行權限
.adb root
.adb remount
.adb push mxt-app /data/local/tmp
.adb shell chmod 777 /data/local/tmp/mxt-app
.adb shell

之後在裝置上切換目錄到 /data/local/tmp,執行 mxt-app
./mxt-app

出現以下畫面,下面範例示範 Enter I:   Read (I)nfo block , Enter W:   (W)rite individual object 將T9, 第14個 NUMTOUCH設定為 0x09

root@msm8992:/data/local/tmp # ./mxt-app
./mxt-app
Version:
Registered sysfs path:/sys/bus/i2c/drivers/atmel_maxtouch_ts/2-004b
Command line tool for Atmel maXTouch chips version:

Select one of the options:

Enter L:   (L)oad config file
Enter S:   (S)ave config file
Enter I:   Read (I)nfo block
Enter D:   Rea(D) individual object config
Enter W:   (W)rite individual object
Enter T:   Run sel(T)-test
Enter F:   (F)lash firmware to chip
Enter B:   (B)ackup the config data to NVM
Enter R:   (R)eset the maxtouch device
Enter C:   (C)alibrate the maxtouch device
Enter M:   Display raw (M)essages
Enter U:   D(U)mp Diagnostic data
Enter Q:   (Q)uit the application
I
I
Reading info block.....

Family: 130 Variant: 36 Firmware V3.0.AB Objects: 21
Matrix size: X24Y14
Information Block CRC: 0xF0808B

Type Start Size Instances ReportIds Name
-----------------------------------------------------------------
T37   136   130     1        0-0    DEBUG_DIAGNOSTIC_T37
T5    266     9     1        0-0    GEN_MESSAGEPROCESSOR_T5
T6    275     6     1        1-1    GEN_COMMANDPROCESSOR_T6
T38   281     8     1        0-0    SPT_USERDATA_T38
T71   289   112     1        0-0    SPT_DYNAMICCONFIGURATIONCONTAINER_T71
T7    401     4     1        0-0    GEN_POWERCONFIG_T7
T8    405    14     1        0-0    GEN_ACQUISITIONCONFIG_T8
T9    419    46     1        2-9    TOUCH_MULTITOUCHSCREEN_T9
T18   465     2     1        0-0    SPT_COMMSCONFIG_T18
T25   467     9     1       10-10   SPT_SELFTEST_T25
T42   476    10     1       11-11   PROCI_TOUCHSUPPRESSION_T42
T46   486    10     1       12-12   SPT_CTECONFIG_T46
T47   496    26     1        0-0    PROCI_STYLUS_T47
T56   522    30     1       13-13   PROCI_SHIELDLESS_T56
T57   552     3     1       14-14   PROCI_EXTRATOUCHSCREENDATA_T57
T61   555     5     2       15-16   SPT_TIMER_T61
T65   565    11     1        0-0    PROCI_LENSBENDING_T65
T66   576     3     1       17-17   SPT_GOLDENREFERENCES_T66
T70   579    10     8       18-25   SPT_DYNAMICCONFIGURATIONCONTROLLER_T70
T72   659    80     1       26-26   PROCG_NOISESUPPRESSION_T72
T80   739     4     1        0-0    PROCI_RETRANSMISSIONCOMPENSATION_T80

Select one of the options:

Enter L:   (L)oad config file
Enter S:   (S)ave config file
Enter I:   Read (I)nfo block
Enter D:   Rea(D) individual object config
Enter W:   (W)rite individual object
Enter T:   Run sel(T)-test
Enter F:   (F)lash firmware to chip
Enter B:   (B)ackup the config data to NVM
Enter R:   (R)eset the maxtouch device
Enter C:   (C)alibrate the maxtouch device
Enter M:   Display raw (M)essages
Enter U:   D(U)mp Diagnostic data
Enter Q:   (Q)uit the application
W
W
Enter the object number to write or 0 to finish
9
9
TOUCH_MULTITOUCHSCREEN_T9:
Object element 0 =       139
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 1 =       0
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 2 =       0
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 3 =       19
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 4 =       11
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 5 =       0
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 6 =       112
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 7 =       70
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 8 =       2
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 9 =       7
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 10 =      5
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 11 =      5
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 12 =      2
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 13 =      224
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 14 =      1
Do you want to change this value? (1 for yes/2 for no)1
1
Enter the value to be written to object element 14       :9
9
Wrote 9
Object element 15 =      10
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 16 =      10
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 17 =      10
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 18 =      32
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 19 =      3
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 20 =      224
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 21 =      1
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 22 =      45
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 23 =      44
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 24 =      32
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 25 =      3
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 26 =      0
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 27 =      0
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 28 =      0
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 29 =      0
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 30 =      10
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 31 =      10
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 32 =      0
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 33 =      0
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 34 =      0
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 35 =      0
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 36 =      0
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 37 =      0
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 38 =      0
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 39 =      0
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 40 =      0
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 41 =      0
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 42 =      0
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 43 =      0
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 44 =      0
Do you want to change this value? (1 for yes/2 for no)2
2
Object element 45 =      0
Do you want to change this value? (1 for yes/2 for no)2
2
Enter the object number to write or 0 to finish
0
0
Select one of the options:

Enter L:   (L)oad config file
Enter S:   (S)ave config file
Enter I:   Read (I)nfo block
Enter D:   Rea(D) individual object config
Enter W:   (W)rite individual object
Enter T:   Run sel(T)-test
Enter F:   (F)lash firmware to chip
Enter B:   (B)ackup the config data to NVM
Enter R:   (R)eset the maxtouch device
Enter C:   (C)alibrate the maxtouch device
Enter M:   Display raw (M)essages
Enter U:   D(U)mp Diagnostic data
Enter Q:   (Q)uit the application
q
q
Quit
root@msm8992:/data/local/tmp #


以上提供給有需要的朋友參考!

CuteParrot 發表在 痞客邦 PIXNET 留言(0) 人氣()


相信家裡有椅子是那種有輪子的應該都有以下的痛楚
椅子輪子滑動久了,就會卡上一層厚厚黑黑的髒東西
時間一久更會讓地板磁磚變得一條一條黑黑的

以前遇到這樣的狀況時,都是將椅子翻過來,用鐵尺將卡在輪上的黑黑厚厚一層的髒污尻(ㄎㄠ)掉
但是當家裡有很多張這樣的椅子時,每次用起來真的很麻煩

心裡想,如果有方法可以讓地上的灰塵不要卡在輪子上就好了

這時想到之或許可以用之前買來當滑鼠貼的 [ 特氟龍鐵氟龍膠帶 ] 試試看

二話不說,先將輪上的黑黑後後髒污清除乾淨


再將所有輪子將上[ 特氟龍鐵氟龍膠帶 ] ,這樣一來不僅灰塵無法卡在輪上,輪子跟地板的滑度也變高了

之後就等時間的考驗,看看半年後,輪子會不會卡灰塵。

CuteParrot 發表在 痞客邦 PIXNET 留言(1) 人氣()


抓到空檔,根據以下教學練習用 photoshop CS2 製作了一個GIF

http://kav68795.pixnet.net/blog/post/26084518-%5B%E6%95%99%E5%AD%B8%5D%E4%BD%BF%E7%94%A8photoshop-%E8%A3%BD%E4%BD%9Cgif%E5%8B%95%E7%95%AB

並複習一下如何去除照片中的閒雜人等

 

CuteParrot 發表在 痞客邦 PIXNET 留言(0) 人氣()


一些遊戲的ISO可以從這邊得到
http://www.emuparadise.me/

在此作紀錄,以備不時之需。

CuteParrot 發表在 痞客邦 PIXNET 留言(0) 人氣()

防雷擊抗突波延長線 PowerSync PWS-CURFX1818

家中一些很久以前買的延長線陸陸續續出現損壞情形
這次趁著有空在COSTCO看到具備USB充電功能、無線遙控、防雷擊抗突波的延長線
PowerSync PWS-CURFX1818就下手買了一個用用看

主要內容物有
PWS-CURFX1818本體:
線材長度為 1.8公尺,表面是採用高質感的透明壓克力材質,頗有質感
燈號亮度很溫和不會刺眼


遙控器:


合照:



基本上整個延長線插座區分為三大區域
1.橘色框框: 可遙控電源開關區域,可以經由遙控器做一整區的開關,也就是橘色框框區域不是一起開啟,就是一起關閉
2.Always on 區域: 顧名思義,就是一直都會供電
3.USB 充電區: 提供兩個 USB 2.1A 高安培數的充電埠


無線遙控方式有兩種
1.將電腦的電源線裝在 always on 的插座上,其餘印表機、喇叭等等周邊電源接在橘色部分插頭上
  並將USB遙控器裝在電腦上;當電腦關機時,會在60-80秒後,自動關閉 橘色部分 插頭的電源
  達到電腦關機後,其餘周邊也一併關閉電源的節能模式。

2.直接使用遙控器做電源開關的遙控。



經過兩天的使用後,有以下優點:
1.USB充電很好用,一次可以充兩個裝置,價格也比訪間有USB充電的延長線便宜許多。
2.遙控開關功能結合電腦來使用,可以達成主機關機,周邊一併關電的功能,很方便。
3.插上大大的變壓器不會互相卡到。
4.防雷擊突波功能,可預防家電被雷擊或斷電後的瞬間突波擊壞。

需要建議的地方有:
1.如果有強力磁鐵吸附功能的話會更好
  (PowerSync PT-502防雷擊抗突波延長線 這款就有強力磁鐵吸附功能 COSTCO NT 399元)

價格:
 COSTCO 2015/09/21 只要 699元

完整說明書如下




以上與大家分享!!



CuteParrot 發表在 痞客邦 PIXNET 留言(0) 人氣()

先切換成root
.adb root
remount 裝置
.adb remount

進入 adb shell
.adb shell

切換目錄到
.cd /sys/class/leds

如果要控制 led燈,請在進入 touch-light 目錄
root@msm8909:/sys/class/leds/torch-light0 #
利用以下指令點亮led燈
#echo 255 > brightness
如要更換其他亮度必須先設定 0後再重新設定亮度
#echo 0 > brightness
#echo 10 > brightness

如果要控制 led燈,請在進入 button-backlight 目錄

如果要控制 led燈,請在進入 lcd-backlight 目錄

一樣也是利用以下指令切換亮度
#echo 255 > brightness

如要更換其他亮度必須先設定 0後再重新設定亮度
#echo 0 > brightness
#echo 10 > brightness

文章標籤

CuteParrot 發表在 痞客邦 PIXNET 留言(0) 人氣()

以下就MSM8992 Ortus COM40H4M66ULC 的dtsi設定檔案一一做說明:


&mdss_mdp {
dsi_ortus_wvga_vid: qcom,mdss_dsi_ortus_wvga_video {
//dsi_ortus_wvga_vid 這名稱會被用在msm8992-mtp.dtsi,主要用來
指定主要panel是哪一塊
//mdss_dsi_ortus_wvga_video 這名稱可以自己訂

qcom,mdss-dsi-panel-name = "ORTUS wvga video mode dsi panel";
//"ORTUS wvga video mode dsi panel" 這名稱可以自己訂

qcom,mdss-dsi-panel-controller = <&mdss_dsi0>;
//因為這個 ortus在硬體上是接再 DSI0當主螢幕,所以設為 <&mdss_dsi0>

qcom,mdss-dsi-panel-type = "dsi_video_mode";
//此panel是 video mode,所以設為 "dsi_video_mode"

qcom,mdss-dsi-panel-destination = "display_1";
//因為只有一個螢幕,且當主螢幕用,所以設定為"display_1"
qcom,mdss-dsi-panel-framerate = <60>;
//通常都設定為 <60>
qcom,mdss-dsi-virtual-channel-id = <0>;
//因為只有一個螢幕,且當主螢幕用,所以設定為 <0>
qcom,mdss-dsi-stream = <0>;
//因為只有一個螢幕,且當主螢幕用,所以設定為 <0>
qcom,mdss-dsi-panel-width = <480>;
//螢幕的寬度,根據datasheet設定為480
qcom,mdss-dsi-panel-height = <800>;
////螢幕的寬度,根據datasheet設定為 800
qcom,mdss-dsi-h-front-porch = <16>; //check data sheet
//根據data sheet的 input timing haracteristics (page 17)頁
//將HFP設定為 16
qcom,mdss-dsi-h-back-porch = <16>; //check data sheet
//根據data sheet的 input timing haracteristics (page 17)頁
//將 HBP 設定為 16
qcom,mdss-dsi-h-pulse-width = <16>; //check data sheet
//根據data sheet的 input timing haracteristics (page 17)頁
//將 HPW 設定為 16
qcom,mdss-dsi-h-sync-skew = <0>;
//mdss-dsi-h-sync-skew 通常設定為 0
qcom,mdss-dsi-v-back-porch = <8>; //check data sheet
//根據data sheet的 input timing haracteristics (page 17)頁
//將 VBP 設定為 8
qcom,mdss-dsi-v-front-porch = <8>; //check data sheet
//根據data sheet的 input timing haracteristics (page 17)頁
//將 VFP 設定為 16
qcom,mdss-dsi-v-pulse-width = <8>; //check data sheet
//根據data sheet的 input timing haracteristics (page 17)頁
//將 VPW 設定為 16
qcom,mdss-dsi-h-left-border = <0>;
//通常mdss-dsi-h-left-border 都設定為0
qcom,mdss-dsi-h-right-border = <0>;
//通常mdss-dsi-h-right-border 都設定為0
qcom,mdss-dsi-v-top-border = <0>;
//通常mdss-dsi-h-top-border 都設定為0
qcom,mdss-dsi-v-bottom-border = <0>;
//通常mdss-dsi-h-bottom-border 都設定為0
qcom,mdss-dsi-bpp = <24>;
//此panel為 24 bit RGB,所以設定為 24
qcom,mdss-dsi-underflow-color = <0xff>;
//通常mdss-dsi-underflow-color 都設定為 ff
qcom,mdss-dsi-border-color = <0>;
//通常 mdss-dsi-border-color 都設定為 0
qcom,mdss-dsi-on-command = [
05 01 00 00 C8 00 02 11 00
39 01 00 00 00 00 04 B9 FF 83 63
39 01 00 00 00 00 0E BA 80 00 10 08 08 10 7C 6E 6D 0A 01 80 43
15 01 00 00 00 00 02 36 00
15 01 00 00 05 00 02 3A 70
39 01 00 00 00 00 0D B1 78 24 04 02 02 03 10 10 34 3C 3F 3F
39 01 00 00 00 00 0A B4 00 08 6E 07 01 01 62 01 57
15 01 00 00 00 00 02 CC 0B
39 01 00 00 05 00 1F E0 01 48 4D 4E 58 F6 0B 4E 12 D5 15 95
55 8E 11 01 48 4D 55 5F FD 0A 4E 51 D3 17 95 96 4E 11
05 01 00 00 32 00 02 29 00
]; //follow spec
// mdss-dsi-on-command 要根據 panel data sheet page 30
(power-on sequence)
//來做設定
qcom,mdss-dsi-off-command = [05 01 00 00 05 00 02 28 00
05 01 00 00 78 00 02 10 00]; //follow spec
// mdss-dsi-off-command 要根據 panel data sheet page 33
(power-off sequence)
//來做設定
qcom,mdss-dsi-on-command-state = "dsi_lp_mode";
//mdss-dsi-on-command 通常都是在 lp mode傳送
qcom,mdss-dsi-off-command-state = "dsi_lp_mode";
//mdss-dsi-off-command 通常都是在 lp mode傳送

qcom,mdss-dsi-h-sync-pulse = <1>;
//可以設定的值有,這個設定要跟供應商確定,此panel是設定為 1
// 0 = Don't send hsa/he following vs/ve packet(default)
// 1 = Send hsa/he following vs/ve packet
//
qcom,mdss-dsi-traffic-mode = "non_burst_sync_pulse";
//此panel設定為 sync pulses mode
//所以 mdss-dsi-on-command中有一行,要設定為
//39 01 00 00 00 00 0E BA 80 00 10 08 08 10 7C 6E 6D 0A 01 80 43

qcom,mdss-dsi-lane-map = "lane_map_0123";
//lane的順序,跟HW連接有關,通常設定為 "lane_map_0123"

qcom,mdss-dsi-bllp-eof-power-mode;
//Boolean to determine DSI lane state during
//blanking low power period (BLLP) EOF mode.
//通常都會加設此設定

qcom,mdss-dsi-bllp-power-mode;
//通常都會加設此設定

qcom,mdss-dsi-lane-0-state; // 2 data lanes use only
qcom,mdss-dsi-lane-1-state;
//因此panel data lane只用到 2 lanes所以設定 0 與 1
qcom,mdss-dsi-panel-timings = [66 12 0C 00 34 34 0F 16 0E 03 04
00];
//mdss-dsi-panel-timings根據 Qualcomm (ortus) -80-NH713-1 DSI
TIMING PARAMETERS USER INTERACTIVE SPREADSHEET.xlsm
//去計算出來的

qcom,mdss-dsi-t-clk-post = <0x04>;
//根據 panel data sheet T clk_post去做設定,此panel設定為 0x04

qcom,mdss-dsi-t-clk-pre = <0x1b>;
////根據 panel data sheet T clk_pre 去做設定,此panel設定為 0x1b

qcom,mdss-dsi-bl-min-level = <1>;
qcom,mdss-dsi-bl-max-level = <4095>;
//設定背光亮度最大與最小值

qcom,mdss-dsi-dma-trigger = "trigger_sw";
//Specifies the trigger mechanism to be used for DMA path.
// "none" = no trigger
// "trigger_te" = Tear check signal line used for
trigger
// "trigger_sw" = Triggered by software (default)
// "trigger_sw_seof" = Software trigger and
start/end of frame trigger.
// "trigger_sw_te" = Software trigger and TE
//通常設定為 "trigger_sw"

qcom,mdss-dsi-mdp-trigger = "none";
//指定 mdp trigger方式,可設定的值有
// "none" = no trigger
// "trigger_te" = Tear check signal line used for
trigger
// "trigger_sw" = Triggered by software (default)
// "trigger_sw_te" = Software trigger and TE
//通常設定為 "none"

qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_wled";
//在硬體設計是採用 mipi command控制背光,所以設定為 bl_ctrl_wled
qcom,mdss-dsi-reset-sequence = <1 20>, <0 2>, <1 20>;
//設定 reset pin的行為

qcom,mdss-dsi-min-refresh-rate = <53>;
//Minimum refresh rate supported by the panel, check panel vendor

qcom,mdss-dsi-max-refresh-rate = <60>;
//Maximum refresh rate supported by the panel,check panel vendor

};
};

CuteParrot 發表在 痞客邦 PIXNET 留言(0) 人氣()

這篇主要紀錄 CTS android.hardware.cts.CameraTest -- testVideoSnapshot  Video snapshot too small! Expected at least 1280 x 720 (0.9216 MP)  Fail 解決方式

如果你遇到以下 fail items
CTS fail item:
android.hardware.cts.CameraTest
-- testParameters
fail
junit.framework.AssertionFailedError at junit.framework.Assert.fail(Assert.java:48)
-- testVideoSnapshot
fail
junit.framework.Ass ertionFailedError: Video snapshot too small! Expected at least 1280 x 720 (0.9216 MP) at junit.framework.Assert.fail(Assert.java:50) 

可以嘗試修改檔案
\vendor\qcom\proprietary\mm-camera\mm-camera2\media-controller\mct\pipeline\mct_pipeline.c

修改內容
因目前我的裝置是安裝 5 M的 camera module,某些不支援的解析度必須拿掉,留下 5M 支援的解析度就好。
--

static cam_dimension_t default_preview_sizes[] = {
 
 // { 4096, 2160},// true 4K
 // { 3840, 2160},// 4K
  { 1920, 1080}, //1080p
  { 1280, 960},
  { 1280, 720},  // 720P, reserved
  { 864, 480}, //FWVGA
  { 800, 480},   //  WVGA
  { 768, 432},
  { 720, 480},
  { 640, 480},   // VGA
  { 480, 640},   // VGA portrait
  { 576, 432},
  { 480, 360},   // HVGA
  { 384, 288},
  { 352, 288},   // CIF
  { 320, 240},   // QVGA
  { 240, 320},   // QVGA portrait
  { 240, 160},   // SQVGA
  { 176, 144},   // QCIF
  { 144, 176},    // QCIF portrait
  { 160, 120}
};

static cam_dimension_t default_picture_sizes[] = {

 // { 5248, 3936}, // 20MP
 // { 4608, 3456}, // 16MP
 // { 4160, 3120}, // 13MP
 // { 4000, 3000}, // 12MP
 // { 4096, 2160},// true 4K
 // { 3264, 2448}, // 8MP
  { 2592, 1944}, // 5MP
  { 2048, 1536}, // 3MP QXGA
  { 1920, 1080}, // HD1080
  { 1600, 1200}, // 2MP UXGA
  { 1280, 960},
  { 1280, 768},  // WXGA
  { 1280, 720},  // HD720
  { 1024, 768},  // 1MP XGA
  { 800, 600},   // SVGA
  { 800, 480},   // WVGA
  { 720, 480},   // 480p
  { 640, 480},   // VGA
  { 352, 288},   // CIF
  { 320, 240},   // QVGA
  { 176, 144},    // QCIF
  { 160, 120}
};

static cam_dimension_t default_liveshot_sizes[] = {

 // { 4128, 3096}, //4:3
 // { 4128, 2322}, //16:9
 // { 4000, 3000}, // 12MP
 // { 3264, 2448}, // 8MP
  { 2592, 1944}, // 5MP
  { 2048, 1536}, // 3MP QXGA
  { 1920, 1080}, // HD1080
  { 1600, 1200}, // 2MP UXGA
  { 1280, 960},
  { 1280, 768},  // WXGA
  { 1280, 720},  // HD720
  { 1024, 768},  // 1MP XGA
  { 800, 600},   // SVGA
  { 864, 480},   //FWVGA
  { 800, 480},   // WVGA
  { 720, 480},   // 480p
  { 640, 480},   // VGA
  { 352, 288},   // CIF
  { 320, 240},   // QVGA
  { 176, 144},    // QCIF
  { 160, 120}
};

static  cam_dimension_t default_video_sizes[] = {

 // { 4096, 2160},// true 4K
 // { 3840, 2160},// 4K
  { 1920, 1080},// 1080p
  { 1280, 960},
  { 1280, 720}, // 720p
  { 864, 480}, //FWVGA
  { 800, 480},  // WVGA
  { 720, 480},  // 480p
  { 640, 480},  // VGA
  { 480, 640},  // VGA portrait
  { 480, 360},  // HVGA
  { 352, 288},  // CIF
  { 320, 240},  // QVGA
  { 240, 320},  // QVGA portrait
  { 176, 144},  // QCIF
  { 144, 176},   // QCIF portrait
  { 160, 120}
};

CuteParrot 發表在 痞客邦 PIXNET 留言(0) 人氣()



在一次偶然機會下發現了這個 電玩原聲帶下載集中營
從任天堂時代到現在PS4時代的遊戲音樂,都可以在此下載

Video Game Music

http://downloads.khinsider.com/
 
而一些遊戲的ISO可以從這邊得到
http://www.emuparadise.me/

在此作紀錄以免遺失。

文章標籤

CuteParrot 發表在 痞客邦 PIXNET 留言(0) 人氣()

1.取消 automatic date&time
開啟
\frameworks\base\packages\SettingsProvider\res\values\defaults.xml
改為
<bool name="def_auto_time">false</bool>

2.取消 use 24-hour format
開啟
\frameworks\base\packages\SettingsProvider\res\values\customize.xml
改為
<!-- Time format,default vlaue is 24 : 24 format,other value is 12
format -->
<string name="def_time_format" translatable="false"></string>

重新 make os image後,就會uncheck這兩個設定了

CuteParrot 發表在 痞客邦 PIXNET 留言(0) 人氣()


可以設定或取得的資訊有
http://developer.android.com/reference/android/provider/Settings.System.html

範例:

.取得目前 screen_off_timeout
shell@msm8909:/ $ settings get system screen_off_timeout
604800000

.設定 screen_off_timeout
shell@msm8909:/ $ settings put system screen_off_timeout 4800000

.取消 screen_brightness_mode , 設定背光 screen_brightness
shell@msm8909:/ $ settings put system screen_brightness_mode 0
shell@msm8909:/ $ settings put system screen_brightness 50

CuteParrot 發表在 痞客邦 PIXNET 留言(0) 人氣()



有時候在測試CTS時,在一些測項裡會有類似以下code
if (VERBOSE) Log.v(TAG, "Video snapshot is " +
  bmpOptions.outWidth + " x " + bmpOptions.outHeight +
  ", video size is " + videoWidth + " x " + videoHeight);
但是因為VERBOSE不是TRUE所以不會output logcat log
查CODE後發現有以下的code
---
public class CameraTest extends ActivityInstrumentationTestCase2<CameraCtsActivity> {
    private static String TAG = "CameraTest";
    private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);
---                   
尤其是這一段
VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);
決定VERBOSE是TRUE 或是 FALSE

而這一個屬性質可以透過 setprop來做開啟或是關閉
開啟方式為
adb shell setprop log.tag.CameraTest VERBOSE
關閉方式為
adb shell setprop log.tag.CameraTest
注意上方的CameraTest是從private static String TAG = "CameraTest";得知的

所以當開啟後,logcat終究會秀出以下的log 了
CameraTest: Video snapshot is 864 x 480, video size is 720 x 480                       



Sample:

cameratest.java
--
public class CameraTest extends ActivityInstrumentationTestCase2<CameraCtsActivity> {
    private static String TAG = "CameraTest";
    private static final String PACKAGE = "com.android.cts.hardware";
    private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);

--
            if (VERBOSE) Log.v(TAG, "Video snapshot is " +
                    bmpOptions.outWidth + " x " + bmpOptions.outHeight +
                    ", video size is " + videoWidth + " x " + videoHeight);
--


device:
  mark@R3600:/dev/bus/usb/001$ adb shell setprop log.tag.CameraTest VERBOSE
  mark@R3600:/dev/bus/usb/001$ adb shell getprop log.tag.CameraTest
  VERBOSE
  
logcat show:
  01-01 00:53:54.446  6997  6997 V CameraTest: Video snapshot is 864 x 480, video size is 720 x 480                       

CuteParrot 發表在 痞客邦 PIXNET 留言(0) 人氣()

Goodix Touch panel access via /proc/gmnode20150810
cap0904153026  
最近在 Qualcomm Android 下玩了一片 Goodix的 Touch panel
發現GT9xx有一些debug功能可以使用

在 goodix_tx_probe 函式中如果有 define CONFIG_GT9XX_TOUCHPANEL_DEBUG,就
會呼叫 init_wr_node(client);
會在 /proc 下建立一個名為 gmnodeyearmonthday 的 file node

看起來可以經由對此 /proc/gmnode20150810 做 read, wrtie,來達到對touch
panel 硬體register的讀寫

trace一下 goodix_tool.c的 source code,果然有以下宣告
static const struct file_operations goodix_proc_fops = {
.write = goodix_tool_write,
.read = goodix_tool_read,
.open = simple_open,
.owner = THIS_MODULE,
};

進一步再看一下 goodix_tool_write 與 goodix_tool_read function發現,必須
先有 write 後才能去 read 資料

也就是說在進行 write動作時,必須填寫一個資料結構:如下
static struct st_cmd_head cmd_head;

struct st_cmd_head {
u8 wr; /* write read flag 0:R 1:W 2:PID 3: */
u8 flag; /* 0:no need flag/int 1: need flag 2:need int */
u8 flag_addr[2];/* flag address */
u8 flag_val; /* flag val */
u8 flag_relation; /* flag_val:flag 0:not equal 1:equal 2:> 3:< */
u16 circle; /* polling cycle */
u8 times; /* plling times */
u8 retry; /* I2C retry times */
u16 delay; /* delay befor read or after write */
u16 data_len; /* data length */
u8 addr_len; /* address length */
u8 addr[2]; /* address */
u8 res[3]; /* reserved */
u8 *data; /* data pointer */
} __packed;

大概運作原理了解之後,開始寫一個可以在 android 下 linux運作的c程式
source code有兩個檔案,分別為 Android.mk 與 gmr.c

內容如下
Android.mk
===
LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := eng
LOCAL_SRC_FILES:=gmr.c
LOCAL_MODULE:=gmr
LOCAL_CPPFLAGS += -DANDROID
LOCAL_SHARED_LIBRARIES:=libc
LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/include
include $(BUILD_EXECUTABLE)
===

gmr.c
===


#include <sys/ioctl.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>

#include <linux/types.h>

//#include <gm1.h>


#define MAX 1024


struct st_cmd_head {
__u8 wr; /* write read flag 0:R 1:W 2:PID 3: */
__u8 flag; /* 0:no need flag/int 1: need flag 2:need int */
__u8 flag_addr[2];/* flag address */
__u8 flag_val; /* flag val */
__u8 flag_relation; /* flag_val:flag 0:not equal 1:equal 2:> 3:< */
__u16 circle; /* polling cycle */
__u8 times; /* plling times */
__u8 retry; /* I2C retry times */
__u16 delay; /* delay befor read or after write */
__u16 data_len; /* data length */
__u8 addr_len; /* address length */
__u8 addr[2]; /* address */
__u8 res[3]; /* reserved */
__u8 *data; /* data pointer */
} __packed;

static struct st_cmd_head cmd_head;


int main(int argc, char *argv[])
{
int res=0;
int fd;
char line_buf[MAX];
int n;
int i;
//fprintf(stderr, "This is gm1 test tools !\n");

/* Usage */
if (argc != 5) {
printf("\n===================================================================\n");
printf("Usage: %s <node name> <address 1st byte> <address 2nd byte>
<length>\n", argv[0]);
printf(" <node name>: GT9xx /proc node, like /proc/gmnode20150810
\n");
printf(" <address 1st byte>: GT9xx register value, like 0x81 for
product ID \n");
printf(" <address 2nd byte>: GT9xx register value, like 0x40 for
product ID \n");
printf(" <length>: Read length, set 4 byte for product ID \n");
printf("example:\n");
printf(" gmr /proc/gmnode20150810 0x81 0x40 4\n");
printf(" output: 0x39 0x37 0x30 0x00 \n");
printf("\n===================================================================\n");
printf(" Autour: Mark Yang
20150904 \n");
exit(-1);
}

fprintf(stderr, "Argc list:
argv[1]=%s,argv[2]=0x%x,argv[3]=0x%x,argv[4]=%d \n"
, argv[1],(unsigned char)strtol(argv[2], NULL, 16),(unsigned
char)strtol(argv[3], NULL, 16),atoi(argv[4]));

//if((fd=open("/proc/gmnode20150810",O_RDWR))==-1) // change to O_RDWR
if((fd=open(argv[1],O_RDWR))==-1) // change to O_RDWR
{
// fail handle
fprintf(stderr, "open %s fail !! \n", argv[1]);
res -1;
goto err;
}
//fprintf(stderr, "open %s success, try to write someting !! \n",
argv[1]);

// repare cmd_head
cmd_head.wr= 0; //8; //2; /* write read flag 0:R 1:W 2:PID 3: */
cmd_head.flag=0; /* 0:no need flag/int 1: need flag 2:need int */
cmd_head.flag_addr[0]=0; /* flag address */
cmd_head.flag_addr[1]=0;
cmd_head.flag_val=0; /* flag val */
cmd_head.flag_relation=0 ; /* flag_val:flag 0:not equal 1:equal 2:>
3:< */
cmd_head.circle= 1; /* polling cycle */
cmd_head.times= 1; /* plling times */
cmd_head.retry= 3; /* I2C retry times */
cmd_head.delay=1; /* delay befor read or after write */
cmd_head.data_len= atoi(argv[4]); //4 ; /* data length */
cmd_head.addr_len= 2; /* address length */
cmd_head.addr[0]= (unsigned char)strtol(argv[2], NULL, 16); //0x80 ;
/* address */
cmd_head.addr[1]=(unsigned char)strtol(argv[3], NULL, 16); ;
//argv[2] &0xff ;//0x48 ;

if((n=write(fd,&cmd_head,sizeof(cmd_head)))==-1)
{
// fail handle
fprintf(stderr, "write %s fail !! \n",argv[1]);
res= -1;
goto err;
}
//fprintf(stderr, "write %s success, length=%d !! \n",argv[1],n);


if((n=read(fd,line_buf,MAX))==-1)
{
// fail handle
fprintf(stderr, "read %s fail !! \n",argv[1]);
res= -1;
goto err;
}
line_buf[n]='\0';

//printf("read data: char= %s
\n,line_buf[0]=0x%02x,line_buf[1]=0x%02x\n",
line_buf,line_buf[0],line_buf[1]);

printf("-----------\n");
for(i=0;i<atoi(argv[4]);i++)
{
printf("0x%02x ",line_buf[i]);
}
printf("\n-----------\n");
res=0;

err:
close(fd) ;
//fprintf(stderr, "close,exit gm1 test tools !\n");
return res;
}
===


compile方式:
將這兩個檔案複製到 BSP裡的 /tools/external/gmr
先執行指令設定 android 環境變數
$source build/envsetup.sh
$lunch <yourproject name>
之後切換目錄到 BSP/tools/external/gmr
執行 mm
就可以 build 出 gmr
位於 \out\target\product\<your product name>\system\bin\gmr


在裝置上運行方式:
.adb root
.adb remount
.adb push gmr /system
.adb shell chmod 777 /system/gmr
.adb shell
switch to device shell
#cd system
執行以下指令
/system # ./gmr /proc/gmnode20150810 0x81 0x40 4
輸出以下結果:
./gmr /proc/gmnode20150810 0x81 0x40 4
Argc list:
argv[1]=/proc/gmnode20150810,argv[2]=0x81,argv[3]=0x40,argv[4]=4
-----------
0x39 0x37 0x30 0x00
-----------

目前只有做讀取功能,改天有空再來做寫入功能。

以上純練功,提供給各位參考。




文章標籤

CuteParrot 發表在 痞客邦 PIXNET 留言(0) 人氣()

有時候會利用 shell的date指令來寫一些script檔案,搭配 crontab 來達到自動化抓code、build code

但有時候當硬碟空間不足時,就必須將前幾天的資料刪除,這時就需要做日期的計算

 

取得當天日期,可用

c_date=$(date +%m%d)

 

取的前三天的日期,可用

b_date=$(date -d '3 days ago' +%m%d)

 

取得後三天的日期,可用

a_date=$(date -d '3 days' +%m%d)

 

 

可用以下內容寫成 .sh 去測試

#!/bin/bash
c_date=$(date +%m%d)
b_date=$(date -d '3 days ago' +%m%d)
a_date=$(date -d '3 days' +%m%d)


echo $c_date
echo $b_date
echo $a_date

 

文章標籤

CuteParrot 發表在 痞客邦 PIXNET 留言(0) 人氣()

讓Ubuntu adb devices 認得新裝置如: MSM8992

參考來源: 

http://ubuntuforums.org/showthread.php?t=1918512


用 lsusb 指令看看目前USB上有接那些裝置
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 05c6:9025 Qualcomm, Inc.
Bus 002 Device 002: ID 045e:0800 Microsoft Corp.

有上面可以確定Qualcomm某裝置接到 /dev/bus/usb/001/004 上,

切換目錄到 /dev/bus/usb/001 確定下面有個 004

使用指令列出裝置詳細資料
udevadm info -q all -n /dev/bus/usb/001/004

P: /devices/pci0000:00/0000:00:04.1/usb1/1-2
N: bus/usb/001/004
S: VAD8992
E: BUSNUM=001
E: DEVLINKS=/dev/VAD8992
E: DEVNAME=/dev/bus/usb/001/004
E: DEVNUM=004
E: DEVPATH=/devices/pci0000:00/0000:00:04.1/usb1/1-2
E: DEVTYPE=usb_device
E: DRIVER=usb
E: ID_BUS=usb
E: ID_MODEL=Android
E: ID_MODEL_ENC=Android
E: ID_MODEL_ID=9025
E: ID_REVISION=0310
E: ID_SERIAL=Android_Android_c523b099
E: ID_SERIAL_SHORT=c523b099
E: ID_USB_INTERFACES=:ffffff:ff4201:ff0000:080650:
E: ID_VENDOR=Android
E: ID_VENDOR_ENC=Android
E: ID_VENDOR_ID=05c6
E: MAJOR=189
E: MINOR=3
E: PRODUCT=5c6/9025/310
E: SUBSYSTEM=usb
E: TYPE=0/0/0
E: UDEV_LOG=3
E: USEC_INITIALIZED=309437207

記下
ID_VENDOR_ID,ID_MODEL_ID

新增/etc/udev/rules.d/51-android.rules 檔案

內容為
SUBSYSTEM=="usb",ENV{ID_VENDOR_ID}=="05c6",ENV{ID_MODEL_ID}=="9025",MODE="0666",SYMLINK+="MSM8992"

logout後重新登入

使用指令 adb devices

即可偵測到新裝置

List of devices attached
c523b099 device






CuteParrot 發表在 痞客邦 PIXNET 留言(0) 人氣()

找更多相關文章與討論