- 易迪拓培训,专注于微波、射频、天线设计工程师的培养
WFD 连接做connect和disconnect,手机概率性的没有反应以及重启
录入:edatop.com 点击:
[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-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
....................
}
Ø 若是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;
}
.....................
}
连续操作手机,做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-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
....................
}
Ø 若是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;
}
.....................
}
往死顶
楼上的 ,牛逼
申明:网友回复良莠不齐,仅供参考。如需专业帮助,请学习易迪拓培训专家讲授的ADS视频培训课程。
上一篇: 如何客制化AT命令,去 设置音频输出模式以及音量大小
下一篇:synopsys.dat总是验证出错,求指教哪里有问题
ADS培训课程推荐详情>>
国内最全面、最专业的Agilent ADS培训课程,可以帮助您从零开始,全面系统学习ADS设计应用【More..】
- Agilent ADS教学培训课程套装
- 两周学会ADS2011、ADS2013视频教程
- ADS2012、ADS2013射频电路设计详解
- ADS高低阻抗线微带滤波器设计培训教程
- ADS混频器仿真分析实例视频培训课程
- ADS Momentum电磁仿真设计视频课程
- ADS射频电路与通信系统设计高级培训
- ADS Layout和电磁仿真设计培训视频
- ADS Workspace and Simulators Training Course
- ADS Circuit Simulation Training Course
- ADS Layout and EM Simulation Training Course
- Agilent ADS 内部原版培训教材合集