微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 手机设计讨论 > MTK手机平台交流 > mt6735WFD连接做connect和disconnect,手机概率性的没有反应以及重启。

mt6735WFD连接做connect和disconnect,手机概率性的没有反应以及重启。

时间:10-02 整理:3721RD 点击:
[DESCRIPTION]
连续操作手机,做 WFD connect 和 disconnect 的动作,手机会概率发生没有反应以及重启的问题。
从 log 发生来看, WindowManager 这边会卡在 RemoteDisplay.nativeDispose() 。具体的 CallStack 如下。
"WindowManager" prio=5 tid=12 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x420f6530 self=0x5ce662a8
| sysTid=710 nice=-4 sched=0/0 cgrp=apps handle=1558603520
| state=S schedstat=( 11487599370 9157963355 38440 ) utm=877 stm=271
core=2
#00 pc 000247e8 /system/lib/libc.so (__ioctl+8)
#01 pc 00038248 /system/lib/libc.so (ioctl+28)
#02 pc 0001d3a9 /system/lib/libbinder.so
(android::IPCThreADState::talkWithDriver(bool)+140)
#03 pc 0001d8c3 /system/lib/libbinder.so
(android::IPCThreadState::waitForResponse(android:arcel*, int*)+42)
#04 pc 0001DACb /system/lib/libbinder.so
(android::IPCThreadState::transact(int, unsigned int, android::Parcel
const&, android::Parcel*, unsigned int)+118)
#05 pc 00019797 /system/lib/libbinder.so
(android::BpBinder::transact(unsigned int, android::Parcel const&,
android::Parcel*, unsigned int)+36)
#06 pc 00064b35 /system/lib/libmedia.so
#07 pc 00088863 /system/lib/libandroid_runtime.so
#08 pc 0001e74c /system/lib/libdvm.so (dvmPlatformInvoke+112)
#09 pc 0004fa91 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int
const*, JValue*, Method const*, Thread*)+484)
#10 pc 00027b28 /system/lib/libdvm.so
#11 pc 0002f100 /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
#12 pc 0002c5e4 /system/lib/libdvm.so (dvmInterpret(Thread*, Method
const*, JValue*)+188)
#13 pc 00062e6d /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method
const*, Object*, bool, JValue*, std::__va_list)+340)
#14 pc 00062e91 /system/lib/libdvm.so (dvmCallMethod(Thread*, Method
const*, Object*, JValue*, ...)+20)
#15 pc 000574a5 /system/lib/libdvm.so
#16 pc 0000d600 /system/lib/libc.so (__thread_entry+72)
at android.media.RemoteDisplay.nativeDispose(Native Method)
at android.media.RemoteDisplay.dispose(RemoteDisplay.java:137)
at android.media.RemoteDisplay.dispose(RemoteDisplay.java:113)
at
com.android.server.display.WifiDisplayController.updateConnection(WifiDisp
layController.java:1042)
at
com.android.server.display.WifiDisplayController.disconnect(WifiDisplayCon
troller.java:1005)
at
com.android.server.display.WifiDisplayController.requestDisconnect(WifiDis
playController.java:608)
at
com.android.server.display.WifiDisplayAdapter$7.run(WifiDisplayAdapter.jav
a:247)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.os.HandlerThread.run(HandlerThread.java:61)
从具体分析 log 来看,有两种 case 会导致这种状况:
Ø Case 1 : WFD disconnect 操作中, Video Source 没办法 stop 成功。
在 WifiDisplaySource stop 过程中,一直没有红色的 log ,表示 video source 一直没有被
stopped 。
07-21 10:09:07.028 151 3010 I MediaPuller: MediaPuller(audio/raw)
stopping.
07-21 10:09:07.029 151 3001 I MediaPuller: MediaPuller(video/raw)
stopping.
07-21 10:09:07.103 151 3010 I MediaPuller: MediaPuller(audio/raw) stopped.
MediaPuller: MediaPuller(video/raw) stopped.
Ø Case 2 : Udp Session 创建失败。
从 main log 中来看,一直打出如下的 error log 。
01-01 01:13:05.891 157 11398 E NetworkSession: Error in
createCLIentOrServer:-101
01-01 01:13:05.898 157 11398 E NetworkSession: Error in
createClientOrServer:-101
01-01 01:13:05.903 157 11398 E NetworkSession: Error in
createClientOrServer:-101
01-01 01:13:05.913 157 11398 E NetworkSession: Error in
createClientOrServer:-101
01-01 01:13:05.923 157 11398 E NetworkSession: Error in
createClientOrServer:-101
01-01 01:13:05.928 157 11398 E NetworkSession: Error in
createClientOrServer:-101
01-01 01:13:05.931 157 11398 E NetworkSession: Error in
createClientOrServer:-101
01-01 01:13:05.934 157 11398 E NetworkSession: Error in
createClientOrServer:-101
01-01 01:13:05.938 157 11398 E NetworkSession: Error in
createClientOrServer:-101
01-01 01:13:05.948 157 11398 E NetworkSession: Error in
createClientOrServer:-101
01-01 01:13:05.951 157 11398 E NetworkSession: Error in
createClientOrServer:-101

[SOLUTION]
Ø 若是 Case 1 ,请麻烦做如下修改(修改的 code 以红色为标注)。
1) alps/mediatek/php?mod=tag&id=6090" target="_blank" class="relatedlink">Frameworks-ext/av/media/libstagefright/wifi-display-
mediatek/source/RepeaterSource.cpp
status_t RepeaterSource::start(MetaData *params) {
CHECK(!mStarted);
//add start
mStop=false;
//add end
..........................
}
status_t RepeaterSource::stop() {
CHECK(mStarted);
ALOGI("stopping");
mStop = true;
if (mBuffer != NULL) {
ALOGV("releasing mbuf %p", mBuffer);
mBuffer->release();
mBuffer = NULL;
}
tatus_t err = mSource->stop();
if (mLooper != NULL) {
mLooper->stop();
mLooper.clear();
mReflector.clear();
}
ALOGI("stopped");
mStarted = false;
return err;
}
void RepeaterSource:nMessageReceived(const sp<AMessage> &msg) {
switch (msg->what()) {
case kWhatRead:
{
MediaBuffer *buffer;
//add start
if (true == mStop) {
break;
}
//add end
#ifdef MTB_SUPPORT
ATRACE_BEGIN("Repeater, KWhatRead");
#endif
#ifndef ANDROID_DEFAULT_CODE
int64_t startUs = ALooper::GetNowUs();
#endif
status_t err = mSource->read(&buffer);
//add start
if (true==mStop) {
if (mBuffer != NULL) {
mBuffer->release();
mBuffer = NULL;
}
if(buffer!=NULL) {
buffer->release();
}
break;
}
//add end
........................
}

2) alps/mediatek/frameworks-ext/av/media/libstagefright/wifi-display-mediatek/source/RepeaterSource.h
struct RepeaterSource : public MediaSource {
..............
//add start
bool mStop;
//add end
....................
}
Ø 若是 case 2 ,请麻烦做如下修改 ( 修改的 code 以红色为标注 ) 。
\alps\mediatek\frameworks-ext\av\media\libstagefright\wifi-display-
mediatek\rtp\RTPSender.cpp
status_t RTPSender::initAsync(
const char *remoteHost,
int32_t remoteRTPPort,
TransportMode rtpMode,
int32_t remoteRTCPPort,
TransportMode rtcpMode,
int32_t *outLocalRTPPort) {
...........................

for (;;) {
修改成
int count =0;
status_t err;
for(;count <6;count ++){
............................
// 將 err 放在 for 循環外面
//status_t err;
}
//add that start
if(count >5)
{
notifyError(err);
return err;
}
//add that end
if(rtpMode == TRANSPORT_UDP){
mRTPConnected =true;
}
.....................
}

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top