Android init.xx.rc中 /data 目录创建文件夹的方法


init.xx.rc中 /data 目录创建文件夹的方法

问题:

需要在 /data 目录创建文件夹

分析:

1、/data 是开机时创建的目录,需要在data创建完成之后再创建此目录下的文件夹。
2、google 修改了策略:想在/data/目录下创建文件夹的话,要在on post-fs-data的时候进行。
3、一般按照类似 mkdir /data/xx 0700 root root 的格式创建,需要有权限和用户[组]的信息

解决方法:
继续阅读“Android init.xx.rc中 /data 目录创建文件夹的方法”

MTK 平台如何配置喇叭和听筒二合一


[DESCRIPTION]

有客户会使用听筒喇叭二合一的方式来节省成本,因此需要进行相关的配置

[SOLUTION]

一. 开启通路

1. ProjectConfig.mk

MTK_2IN1_SPK_SUPPORT = yes

2. audio_device.xml
two_in_one_speaker_output下面的配置修改成和speaker打开时的配置一致
例如:
使用外部PA,接在lineout上,打开speaker的时候需要同时调用Speaker_Amp_Switch和Ext_Speaker_Amp_Switch这两个kctl,打开MTK_2IN1_SPK_SUPPORT这个宏之后,打开听筒的时候也应该调用这两个kctl

    <!-- 2-in-1 speaker output-->
    <path name="two_in_one_speaker_output" value="turnon">
        <kctl name="Speaker_Amp_Switch" value="On" />
        <kctl name="Audio_Speaker_class_Switch" value="CLASSAB" />
    </path>
    <path name="two_in_one_speaker_output" value="turnoff">
        <kctl name="Audio_Speaker_class_Switch" value="RECEIVER" />
        <kctl name="Speaker_Amp_Switch" value="Off" />

改为

    <!-- 2-in-1 speaker output-->
    <path name="two_in_one_speaker_output" value="turnon">
	    <kctl name="Speaker_Amp_Switch" value="On" />
	    <kctl name="Ext_Speaker_Amp_Switch" value="On" />
    </path>
    <path name="two_in_one_speaker_output" value="turnoff">
            <kctl name="Ext_Speaker_Amp_Switch" value="Off" />
	    <kctl name="Speaker_Amp_Switch" value="Off" />

二. 外部PA的模式切换

通常听筒模式和喇叭模式的声音大小是不一样的,所以需要调整喇叭模式和听筒模式的外部PA的工作的mode

1./vendor/mediatek/proprietary/custom/proj/hal/audioflinger/audio/audio_custom_exp.h 增加

 
 #define HAVING_RCV_SPK_SWITCH

2./vendor/mediatek/proprietary/hardware/audio/common/V3/aud_drv/AudioALSAHardwareResourceManager.cpp

status_t AudioALSAHardwareResourceManager::OpenReceiverPath(const uint32_t SampleRate __unused) {
//AudioALSACodecDeviceOutReceiverPMIC::getInstance()->open();
    IsAudioSupportFeature(AUDIO_SUPPORT_2IN1_SPEAKER)) {
    mDeviceConfigManager->ApplyDeviceTurnonSequenceByName(AUDIO_DEVICE_2IN1_SPEAKER);
} else {
    mDeviceConfigManager->ApplyDeviceTurnonSequenceByName(AUDIO_DEVICE_RECEIVER);
}
   #ifdef HAVING_RCV_SPK_SWITCH
     AudioALSACodecDeviceOutReceiverSpeakerSwitch::getInstance()->open();
   #endif

    return NO_ERROR;
   }

修改成:

status_t AudioALSAHardwareResourceManager::OpenReceiverPath(const uint32_t SampleRate __unused) {
    #ifdef HAVING_RCV_SPK_SWITCH
    AudioALSACodecDeviceOutReceiverSpeakerSwitch::getInstance()->open();
    #endif
    //AudioALSACodecDeviceOutReceiverPMIC::getInstance()->open();
    if (IsAudioSupportFeature(AUDIO_SUPPORT_2IN1_SPEAKER)) {
    mDeviceConfigManager->ApplyDeviceTurnonSequenceByName(AUDIO_DEVICE_2IN1_SPEAKER);
} 
  else {
   mDeviceConfigManager->ApplyDeviceTurnonSequenceByName(AUDIO_DEVICE_RECEIVER);
 }

3. /kernel-4.4/sound/soc/mediatek/codec/mt6357/mtk-soc-codec-6357.c

static void Ext_Speaker_Amp_Change(bool enable)
{
enable的时候加一下判断,receiver有开,就设置mode 8,如果没有开就设置mode 3
disable的时候也是,receiver有开,就按mode 8 去关闭,如果没有,就按mode 3去关闭
例子如下
//modify here 
if (pin_extspkamp != 54)
if(mCodec_data->mAudio_Ana_DevicePower[AUDIO_ANALOG_DEVICE_RECEIVER_SPEAKER_SWITCH] == true) 
AudDrv_GPIO_EXTAMP_Select(false, 8);
else
AudDrv_GPIO_EXTAMP_Select(false, 3); 
else
if(mCodec_data->mAudio_Ana_DevicePower[AUDIO_ANALOG_DEVICE_RECEIVER_SPEAKER_SWITCH] == true) 
AudDrv_GPIO_EXTAMP2_Select(false, 8);
else
AudDrv_GPIO_EXTAMP2_Select(false, 3);
////////
#endif 
......

后续mode的改动也按照上述方式修改

}

三. 正确加载听筒的参数,需要如下修改/device/mediatek/proj/audio_param/VolumeGainMap_AudioParam.xml
RCV_NO_ANA对应的param_id下面的

<Param name="dl_analog_type" value="0"/>

改为

<Param name="dl_analog_type" value="3"/>

uboot 编译出现 Error: You must add new CONFIG options using Kconfig 解决方法


[现象]

UBoot 编译时出现:

Error: You must add new CONFIG options using Kconfig The following new ad-hoc CONFIG options were detected:

[方法] 修改其中一个即可

1. 增加对应的值到

u-boot\scripts\config_whitelist.txt

2. 注释掉顶层 Makefile 中下面几句:

quiet_cmd_cfgcheck = CFGCHK  $2
cmd_cfgcheck = $(srctree)/scripts/check-config.sh $2 \
		$(srctree)/scripts/config_whitelist.txt $(srctree)

改成:

#quiet_cmd_cfgcheck = CFGCHK  $2
#cmd_cfgcheck = $(srctree)/scripts/check-config.sh $2 \
#		$(srctree)/scripts/config_whitelist.txt $(srctree)

3. 修改 Error 为 Warning 防止编译中断

diff --git a/scripts/check-config.sh b/scripts/check-config.sh
index 6618dfb..9d2cfc6 100755
--- a/scripts/check-config.sh
+++ b/scripts/check-config.sh
@@ -37,14 +37,13 @@  cat `find ${srctree} -name "Kconfig*"` |sed -n \
 	-e 's/^menuconfig \([A-Za-z0-9_]*\).*$/CONFIG_\1/p' |sort |uniq > ${ok}
 comm -23 ${suspects} ${ok} >${new_adhoc}
 if [ -s ${new_adhoc} ]; then
-	echo "Error: You must add new CONFIG options using Kconfig"
+	echo "Warning: You must add new CONFIG options using Kconfig"
 	echo "The following new ad-hoc CONFIG options were detected:"
 	cat ${new_adhoc}
 	echo
 	echo "Please add these via Kconfig instead. Find a suitable Kconfig"
 	echo "file and add a 'config' or 'menuconfig' option."
 	# Don't delete the temporary files in case they are useful
-	exit 1
 else
 	rm ${suspects} ${ok} ${new_adhoc}
 fi

格科微[GalaxyCore]摄像头成像方向调节方法


GalaxyCore 系列摄像头采用逐行扫描的方式将阵列产生的信号依次输入到模拟信号处理模块中。最开始的行为 0 行。在默认寄存器设置下,Sensor 的阵列数据输出顺序为从下到上,从左到右。GalaxyCore 系列摄像头可通过寄存器控制扫描顺序,实现镜像/垂直翻转。
继续阅读“格科微[GalaxyCore]摄像头成像方向调节方法”