常见需求
设备问题
摄像头
-摄像头翻转:
- 在\device\sprd\pike2{sp7731e_1h10}\camera\sensor_config.xml中(7731在默认目录,其他的在incar目录下,如:sprdroid1_q\incar\project\s9863a1h10__s8631vg_2g\device\sprd\sharkl3\s9863a1h10\camera\sensor_config.xml)修改对应的摄像头的Orientation如
0
ov2680
BACK
90
50
ov2680
改成:
0
ov2680
BACK
270
50
ov2680
2.如果修改失败,检查是否保存了修改的文件或者
rm -rf out/target/product/sp7731e_1h10/vendor/etc/sensor_config.xml 删除原有已经编译出来的配置文件避免脚本不再编译,重新编译
-摄像头打不开:
在\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下的文件复制到{incar}\build\buid_pac\out目录下
-屏幕不亮(未配置相关宏)
1.sprdroid1_q\incar\config{s9863a1h10__p30g_2g}\ProjectConfig.mk
2.INCAR_LCD_MODUEL=INCAR_LCD_9863A_HJC_HX8279_MIPI_FHD 选择对应的
-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看权限:
-vendor\prebuilt_apps\preloadapp\Android.mk
LOCAL_DEX_PREOPT := false
-查看日志的vac,找到闪退的包名,查看是哪个文件需要添加权限
-\device\sprd\pike2\common\sepolicy/{} u:r:untrusted_app_27是27的就改27的 25的就改25的
-调TP
1.先确定平台
2.找到对应的ProjectConfig.mk:\incar\config{}\ProjectConfig.mk
3.找到对应的两个值INCAR_PROJECT_CONFIG = 和INCAR_TOUCH_MODUEL =
4.\bsp\kernel\kernel4.14\drivers\input\touchscreen\gslX680\gslX680_ts.c
6.定位到对应的.h文件发给驱动工程师
-问题点:
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; }
-修复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);
}```
-人脸识别解锁图像倒转
![image.png](https://upload-images.jianshu.io/upload_images/6296697-3756f55bf72b2269.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)