关闭

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

标签: WFD手机重启
302人阅读 评论(0) 收藏 举报

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

[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:arcel
const&, android:arcel*, unsigned int)+118)
#05 pc 00019797 /system/lib/libbinder.so
(android::BpBinder::transact(unsigned int, android:arcel const&,
android:arcel*, 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/frameworks-ext/av/media/libstagefright/wifi-displaymediatek/
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-displaymediatek/
source/RepeaterSource.h
struct RepeaterSource : public MediaSource {
..............
//add start
bool mStop;
//add end
....................
}
&Oslash; 若是case 2 ,请麻烦做如下修改 (修改的code 以红色为标注)。
\alps\mediatek\frameworks-ext\av\media\libstagefright\wifi-displaymediatek\
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;
}
.....................
}


0
0

猜你在找
【直播】机器学习&数据挖掘7周实训--韦玮
【套餐】系统集成项目管理工程师顺利通关--徐朋
【直播】3小时掌握Docker最佳实战-徐西宁
【套餐】机器学习系列套餐(算法+实战)--唐宇迪
【直播】计算机视觉原理及实战--屈教授
【套餐】微信订阅号+服务号Java版 v2.0--翟东平
【直播】机器学习之矩阵--黄博士
【套餐】微信订阅号+服务号Java版 v2.0--翟东平
【直播】机器学习之凸优化--马博士
【套餐】Javascript 设计模式实战--曾亮
查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:59100次
    • 积分:1934
    • 等级:
    • 排名:千里之外
    • 原创:139篇
    • 转载:17篇
    • 译文:0篇
    • 评论:6条
    最新评论