常見需求
設(shè)備問題
攝像頭
-攝像頭翻轉(zhuǎn):
- 在\device\sprd\pike2{sp7731e_1h10}\camera\sensor_config.xml中(7731在默認(rèn)目錄,其他的在incar目錄下,如:sprdroid1_q\incar\project\s9863a1h10__s8631vg_2g\device\sprd\sharkl3\s9863a1h10\camera\sensor_config.xml)修改對應(yīng)的攝像頭的Orientation如
<SlotId>0</SlotId>
<SensorName>ov2680</SensorName>
<Facing>BACK</Facing>
<Orientation>90</Orientation>
<Resource_cost>50</Resource_cost>
<TuningParameter>
<TuningName>ov2680</TuningName>
</TuningParameter>
</CameraModuleCfg>
改成:
<CameraModuleCfg>
<SlotId>0</SlotId>
<SensorName>ov2680</SensorName>
<Facing>BACK</Facing>
<Orientation>270</Orientation>
<Resource_cost>50</Resource_cost>
<TuningParameter>
<TuningName>ov2680</TuningName>
</TuningParameter>
</CameraModuleCfg>
2.如果修改失敗,檢查是否保存了修改的文件或者
rm -rf out/target/product/sp7731e_1h10/vendor/etc/sensor_config.xml 刪除原有已經(jīng)編譯出來的配置文件避免腳本不再編譯,重新編譯
-攝像頭打不開:
在\bsp\kernel\kernel4.14\arch\arm\boot\dts\sp7731e-1h10-native.dts:
將
status = "okay";
clock-frequency = <400000>;
sensor_main: sensor-main@37 {
compatible = "sprd,sensor-main";
reg = <0x37>;
clock-names = "clk_src", "sensor_eb",
"clk_96m", "clk_76m8",
"clk_48m", "clk_26m";
clocks = <&mm_clk CLK_SENSOR0>,
<&mm_gate CLK_MSENSOR0_EB>,
<&pll CLK_TWPLL_96M>,
<&pll CLK_TWPLL_76M8>,
<&pll CLK_TWPLL_48M>,
<&ext_26m>;
vddio-supply = <&vddcamio>;
vddcama-supply = <&vddcama>;
vddcamd-supply = <&vddcamd>;
vddcammot-supply = <&vddcammot>;
reset-gpios = <&ap_gpio 37 0>;
power-down-gpios = <&ap_gpio 38 0>;
host = "dcam0";
sprd,phyid = <0>;
csi = <&csi0>;
};
改成:
sensor_main: sensor-main@37 {
compatible = "sprd,sensor-main";
reg = <0x37>;
clock-names = "clk_src", "sensor_eb",
"clk_96m", "clk_76m8",
"clk_48m", "clk_26m";
clocks = <&mm_clk CLK_SENSOR0>,
<&mm_gate CLK_MSENSOR0_EB>,
<&pll CLK_TWPLL_96M>,
<&pll CLK_TWPLL_76M8>,
<&pll CLK_TWPLL_48M>,
<&ext_26m>;
vddio-supply = <&vddcamio>;
vddcama-supply = <&vddcama>;
vddcamd-supply = <&vddcamd>;
vddcammot-supply = <&vddcammot>;
reset-gpios = <&ap_gpio 37 0>;
power-down-gpios = <&ap_gpio 39 0>;
host = "dcam0";
sprd,phyid = <0>;
csi = <&csi0>;
};
和
compatible = "sprd,sensor-sub";
reg = <0x21>;
clock-names = "clk_src","sensor_eb",
"clk_96m", "clk_76m8",
"clk_48m", "clk_26m";
clocks = <&mm_clk CLK_SENSOR0>,
<&mm_gate CLK_MSENSOR0_EB>,
<&pll CLK_TWPLL_96M>,
<&pll CLK_TWPLL_76M8>,
<&pll CLK_TWPLL_48M>,
<&ext_26m>;
vddio-supply = <&vddcamio>;
vddcama-supply = <&vddcama>;
vddcamd-supply = <&vddcamd>;
vddcammot-supply = <&vddcammot>;
reset-gpios = <&ap_gpio 37 0>;
power-down-gpios = <&ap_gpio 39 0>;
host = "dcam0";
sprd,phyid = <0>;
csi = <&csi0>;
};
改成
compatible = "sprd,sensor-sub";
reg = <0x21>;
clock-names = "clk_src","sensor_eb",
"clk_96m", "clk_76m8",
"clk_48m", "clk_26m";
clocks = <&mm_clk CLK_SENSOR0>,
<&mm_gate CLK_MSENSOR0_EB>,
<&pll CLK_TWPLL_96M>,
<&pll CLK_TWPLL_76M8>,
<&pll CLK_TWPLL_48M>,
<&ext_26m>;
vddio-supply = <&vddcamio>;
vddcama-supply = <&vddcama>;
vddcamd-supply = <&vddcamd>;
vddcammot-supply = <&vddcammot>;
reset-gpios = <&ap_gpio 37 0>;
power-down-gpios = <&ap_gpio 38 0>;
host = "dcam0";
sprd,phyid = <0>;
csi = <&csi0>;
};
-閃光燈打不開:bsp\kernel\kernel4.14\arch\arm\boot\dts\sp7731e-1h10-overlay.dts
刪除
compatible = "sprd,flash-wd3124da";
flash-ic = <3124>;
flash-torch-en-gpios = <&ap_gpio 12 0>;
flash-en-gpios = <&ap_gpio 13 0>;
};
-打包失敗:
1.添加ddr和spl的固件
2.添加u_boot:\out\target\product\sp7731e_1h10\u-boot-sign.bin
-編譯失敗:缺失文件:{\Sprd\NV_Manager\SC7731E}android 10.0\s706-7731E_in_dclass_W20.08.3_band_auto_nv+modem_android10.0_200318下的文件復(fù)制到{incar}\build\buid_pac\out目錄下
-屏幕不亮(未配置相關(guān)宏)
1.sprdroid1_q\incar\config{s9863a1h10__p30g_2g}\ProjectConfig.mk
2.INCAR_LCD_MODUEL=INCAR_LCD_9863A_HJC_HX8279_MIPI_FHD 選擇對應(yīng)的
-SO庫找不到:
1.system\core\init\selinux.cpp (不需要過GMS)
bool IsEnforcing() {
{
return false;//直接屏蔽掉
int fd(open("/mboot/selinux", O_RDONLY | O_CLOEXEC | O_BINARY));
if (fd != -1) {
char v = 0xff;
if (read(fd, &v, 1) < 0)
PLOG(ERROR) << "Failed to read /mboot/selinux";
close(fd);
LOG(WARNING) << "/mboot/selinux is " << v;
return v == '1';
}
}
if (ALLOW_PERMISSIVE_SELINUX) {
return StatusFromCmdline() == SELINUX_ENFORCING;
}
return true;
}
2.Y:\sprdroid1_q\device\sprd\pike2\common\rootdir\root\init.cali.rc:
start vendor.modem_control
start vendor.refnotify
start console
+ start system_suspend
3.如果需要過GMS 抓log看權(quán)限:
-vendor\prebuilt_apps\preloadapp\Android.mk
LOCAL_DEX_PREOPT := false
-查看日志的vac,找到閃退的包名,查看是哪個文件需要添加權(quán)限
-\device\sprd\pike2\common\sepolicy/{} u:r:untrusted_app_27是27的就改27的 25的就改25的
-調(diào)TP
1.先確定平臺
2.找到對應(yīng)的ProjectConfig.mk:\incar\config{}\ProjectConfig.mk
3.找到對應(yīng)的兩個值INCAR_PROJECT_CONFIG = 和INCAR_TOUCH_MODUEL =
4.\bsp\kernel\kernel4.14\drivers\input\touchscreen\gslX680\gslX680_ts.c
6.定位到對應(yīng)的.h文件發(fā)給驅(qū)動工程師
-問題點(diǎn):
1.packages\apps\Launcher3\src\com\android\launcher3\states\RotationHelper.java
2.public static boolean getAllowRotationDefaultValue() { // If the device was scaled, used the original dimensions to determine if rotation // is allowed of not. Resources res = Resources.getSystem(); int originalSmallestWidth = res.getConfiguration().smallestScreenWidthDp * res.getDisplayMetrics().densityDpi / DENSITY_DEVICE_STABLE; return true; }
-修復(fù)sd卡不能熱插拔:Y:bsp\kernel\kernel4.14\drivers\mmc\core\core.c
void mmc_power_off(struct mmc_host *host)
{
if (host->ios.power_mode == MMC_POWER_OFF)
return;
mmc_pwrseq_power_off(host);
host->ios.clock = 0;
// host->ios.vdd = 0; //注釋這一行
host->ios.power_mode = MMC_POWER_OFF;
/* Set initial state and call mmc_set_ios */
mmc_set_initial_state(host);
/*
* Some configurations, such as the 802.11 SDIO card in the OLPC
* XO-1.5, require a short delay after poweroff before the card
* can be successfully turned on again.
*/
mmc_delay(1);
}```
-人臉識別解鎖圖像倒轉(zhuǎn)
![image.png](https://upload-images.jianshu.io/upload_images/6296697-3756f55bf72b2269.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)