隨筆

AsusSystemUI 和 SystemUI的切换

adb root
adb remount
adb shell rm -rf /system/priv-app/AsusSystemUI
adb shell mkdir /system/priv-app/SystemUI
adb push SystemUI.apk /system/priv-app/SystemUI/.
adb reboot

dump audio的patch

repo forall -pc 'git log --oneline | grep " \ [audio\ ]" -i' > audio_patch.txt

dump author=XX的patch

repo forall -pc 'git log --oneline --author=sherry -i'

连接服务器到本地目录

sshfs [email protected]:/home/c2 /home/snake/source/home_c2

提交patch

git add
git commit -m “==”
git remote -v
caf ssh://10.64.58.7/8953/device/asus/Z01M (fetch)
caf ssh://10.64.58.7/8953/device/asus/Z01M (push)
git push XXX HEAD:refs/for/"branch"
(git push ssh://172.29.0.92/8953/device/asus/Z01M HEAD:refs/for/qcom/8953/a70/bsp-7.1.1-12000.1)

全局设置branch 和 remote -v

repo start --all qcom/8953/a70/bsp-7.1.1-12000.1
repo forall -c 'pwd; git remote add caf-remote ssh://172.29.0.92/8953/REPO_PROJECT' sudo repo start --all qcom/8937/a70/bsp-scorpio sudo repo forall -c 'pwd; git remote add caf-remote ssh://172.29.0.92/8937/REPO_PROJECT'
git push caf-remote HEAD:refs/for/qcom/8937/a70/bsp-scorpio(branch)

找回丢弃的提交

git fsck --lost-found

change id

$ scp -P 29418 -p 172.29.0.92:hooks/commit-msg .git/hooks/

打开kernel log

echo -n "file msm-pcm-afe-v2.c +p" > /sys/kernel/debug/dynamic_debug/control
echo -n "file q6afe.c +p" > /sys/kernel/debug/dynamic_debug/control
echo -n "file q6voice.c +p" > /sys/kernel/debug/dynamic_debug/control

adb shell cat /proc/kmsg >kernel.txt

显示耳机广播

adb shell am broadcast -a android.intent.action.HEADSET_PLUG --ei state 1

修改countrycode

root@ASUS_Z01H_1:/ # PhoneInfoTest 9 1 BR 0
root@ASUS_Z01H_1:/ # PhoneInfoTest 9 0 BR
root@ASUS_Z01H_1:/ # PhoneInfoTest 6 1 BR 0
root@ASUS_Z01H_1:/ # PhoneInfoTest 6 0 BR

查看k的寄存器的值

climax -d /dev/i2c-5 --slave=0x34 --dump

start spk_calibration

dump

climax -d /dev/i2c-5 --slave=0x34 --dump

adb shell 命令广播

adb shell am broadcast -a android.snake.selectmic --es msg "bmic" --ei msg 100

dump audio_flinger

adb shell dumpsys media.audio_flinger > dumpsys.audio_flinger

systrance 命令

python systrace.py -o trace2.html -b 32768 -t 15 audio sched freq

dump audioflinger pcm数据

diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp
index 364e339..4a923c1 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -19,6 +19,8 @@
 #define LOG_TAG "AudioFlinger"
 //#define LOG_NDEBUG 0
 
+#include 
+#include  
 #include "Configuration.h"
 #include 
 #include 
@@ -569,7 +571,15 @@ status_t AudioFlinger::PlaybackThread::Track::getNextBuffer(
     } else {
         mAudioTrackServerProxy->tallyUnderrunFrames(0);
     }
-
+ {
+ int tmpFd = ::open("/data/misc/audio/dumpTrack.pcm", O_CREAT | O_WRONLY | O_APPEND, 0777);
+ if ( tmpFd < 0 ) {
+ ALOGE("Fail to open dumpTrack file");
+ } else {
+ ::write(tmpFd, buffer->raw, buffer->frameCount * TrackBase::mChannelCount * 2);
+ ::close(tmpFd);
+ }
+ } 
     return status;
 }
 

dump hal pcm

diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index a4f8525..52b4f72 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -2785,6 +2785,8 @@ static ssize_t out_write(struct audio_stream_out *stream, const void *buffer,
     struct audio_device *adev = out->dev;
     int snd_scard_state = get_snd_card_state(adev);
     ssize_t ret = 0;
+    int tmpFd;
+    size_t count = bytes; 
 
     lock_output_stream(out);
 
@@ -2835,10 +2837,18 @@ static ssize_t out_write(struct audio_stream_out *stream, const void *buffer,
         }
     }
 
+ 
     if (adev->is_channel_status_set == false && (out->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL)){
         audio_utils_set_hdmi_channel_status(out, (void *)buffer, bytes);
         adev->is_channel_status_set = true;
     }
+        tmpFd = open("/data/misc/audio/dump.pcm", O_CREAT | O_WRONLY | O_APPEND, 0777 );
+        if ( tmpFd < 0 ) {
+        ALOGE("No dump file");
+        } else {
+        write(tmpFd, buffer, count);
+        close(tmpFd);
+        }
 
     if (is_offload_usecase(out->usecase)) {
         ALOGVV("copl(%p): writing buffer (%zu bytes) to compress device", out, bytes);

diff --git a/media/libaudioclient/AudioTrack.cpp b/media/libaudioclient/AudioTrack.cpp
index f1ad4b6..25f30c4 100644
--- a/media/libaudioclient/AudioTrack.cpp
+++ b/media/libaudioclient/AudioTrack.cpp
@@ -2196,6 +2196,17 @@ nsecs_t AudioTrack::processAudioBuffer()
         mCbf(EVENT_MORE_DATA, mUserData, &audioBuffer);
         size_t writtenSize = audioBuffer.size;
 
+ int tmpFd;
+ const int16_t* p = static_cast(audioBuffer.i16);
+ size_t count = audioBuffer.size;
+ tmpFd = ::open("/data/misc/audio/track.pcm", O_CREAT | O_WRONLY | O_APPEND );
+ if ( tmpFd < 0 ) {
+ ALOGE("No dump file");
+ }
+ else{
+ ::write(tmpFd, p, count);
+ ::close(tmpFd);
+ }
         // Sanity check on returned size
         if (ssize_t(writtenSize) < 0 || writtenSize > reqSize) {
             ALOGE("EVENT_MORE_DATA requested %zu bytes but callback returned %zd bytes",

单跑cts

https://source.android.com/compatibility/cts/setup
安装CtsAdminApp.apk,settings--security--Device adminstrators将cts相关的测项勾上。
push media报到机器上后开始测试。

测试时加上-o,可以跳过检查。
run cts -m CtsMediaTestCases -t android.media.cts.DecoderTest#testHEVCDecode30fps3840x2160

下code

repo init -u ssh://10.64.58.7/manifest -b dev/8953/asus/7.1.1-3.1.10
repo sync -c -d
repo start --all dev/8953/asus/7.1.1-3.1.10
repo forall -c 'pwd; git remote add caf-remote ssh://172.29.0.92/8953/$REPO_PROJECT'
./mkimage Z01M build_eng
./mkimage Z01H build_eng

Titan服务器

/home/n3/data/Titian
ssh [email protected]
密碼:426429-2015
sshfs [email protected]:/media/n3/data/ /home/snake/source/home_n3
data -> /media/n3/data/

build ZS570KL

Build Cmd: 非pro: ./mkimage zs570kl build_userPro:
./mkimage zs570kl build_user MSM8996PRO=1

开启usb_dialog

adb shell setprop sys.usb.config diag,adb

grep

grep -irn "xxxxx" --include ".[ch]" ./
grep -irn "xxxxx" --include "
.c" ./

input系统发生命令

    //input_event(audiowizard, EV_ABS, ABS_MISC, g_audiowizard_force_preset_state);
    //input_event(audiowizard, EV_ABS, ABS_X, g_audiowizard_force_preset_state);
    //input_report_abs(audiowizard,ABS_X,g_audiowizard_force_preset_state);

//input_set_capability(audiowizard,EV_ABS,ABS_MISC);
//input_set_abs_params(audiowizard, ABS_X, 0, 3, 0, 0);  
//input_set_abs_params(audiowizard, ABS_Y, 0, 3, 0, 0);  
//input_set_abs_params(audiowizard, ABS_Z, 0, 3, 0, 0);

禁用数字签名

永久禁用可以在提示符后面输入bcdedit.exe /set nointegritychecks on后回车,开启数字签名的话bcdedit.exe /set nointegritychecks off回车

读写寄存器

7.4 Trigger WDSP crash from ADB
adb shell "echo '0x21E 0x02' > /d/regmap/tavil-slim-pgd/registers"
7.5 Collect the register dump
Execute the following command to collect the register dump:
adb shell "cat /d/regmap/tavil-slim-pgd/registers" | tee codec_dump.txt

git clone firmware

git clone ssh://10.64.58.7/845/qcom_firmware -b draco-9.0-r00072.1

你可能感兴趣的:(隨筆)