Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

乐视1s x500 anr sdk释放时死锁 #156

Closed
IsaiahKing opened this issue Mar 29, 2017 · 4 comments
Closed

乐视1s x500 anr sdk释放时死锁 #156

IsaiahKing opened this issue Mar 29, 2017 · 4 comments

Comments

@IsaiahKing
Copy link

配置如下

compile 'com.ksyun.media:libksylive-java:2.2.6'
compile 'com.ksyun.media:libksylive-armv7a:2.2.6'
compile 'com.ksyun.media:libksylive-arm64:2.2.6'
compile 'com.ksyun.media:libksylive-x86:2.2.6'

anr 线程日志

"main" prio=5 tid=1 Waiting
  | group="main" sCount=1 dsCount=0 obj=0x74c69000 self=0x42407800
  | sysTid=23224 nice=-6 cgrp=default sched=0/0 handle=0x4000eecc
  | state=S schedstat=( 34007561145 6551492956 95163 ) utm=2832 stm=568 core=1 HZ=100
  | stack=0xff543000-0xff545000 stackSize=8MB
  | held mutexes=
  at java.lang.Object.wait!(Native method)
  - waiting on <0x04ce8db8> (a java.lang.Object)
  at java.lang.Thread.join(Thread.java:724)
  - locked <0x04ce8db8> (a java.lang.Object)
  at com.ksyun.media.streamer.capture.AudioCapture.release(AudioCapture.java:193)
  at com.ksyun.media.streamer.kit.KSYStreamer.release(KSYStreamer.java:2170)
  - locked <@addr=0x137d13c0> (a java.lang.Object)
  at com.es.live.basic.service.a.e.a(unavailable:-1)
  - locked <@addr=0x137d12b0> (a java.lang.Boolean)
  at com.es.live.basic.service.a.b.b(unavailable:-1)
  at com.es.live.ui.live.LiveActivity.a(LiveActivity.java:1856)
  at com.es.live.ui.live.LiveActivity.a(LiveActivity.java:178)
  at com.es.live.ui.live.LiveActivity$1.handleMessage(LiveActivity.java:461)
  at android.os.Handler.dispatchMessage(Handler.java:111)
  at android.os.Looper.loop(Looper.java:194)
  at android.app.ActivityThread.main(ActivityThread.java:5589)
  at java.lang.reflect.Method.invoke!(Native method)
  at java.lang.reflect.Method.invoke(Method.java:372)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:956)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:751)
"AudioCapture" prio=10 tid=110 Waiting
  | group="main" sCount=1 dsCount=0 obj=0x13105860 self=0x89948400
  | sysTid=28381 nice=-6 cgrp=default sched=0/0 handle=0x849ba000
  | state=S schedstat=( 126773778 65385453 805 ) utm=10 stm=2 core=1 HZ=100
  | stack=0x976f9000-0x976fb000 stackSize=1036KB
  | held mutexes=
  at java.lang.Object.wait!(Native method)
  - waiting on <0x0ae52ff4> (a java.lang.Object)
  at com.ksyun.media.streamer.capture.AudioCapture$a.run(AudioCapture.java:359)
  - locked <0x0ae52ff4> (a java.lang.Object)
  at java.lang.Thread.run(Thread.java:818)
@chriszeng87
Copy link
Contributor

有logcat的日志么

@IsaiahKing
Copy link
Author

IsaiahKing commented Apr 5, 2017

logcat日志比较长, 需要哪一部分的日志,这个推流时间基本超过30分钟才能复现问题。
现在判断是AudioCapture关闭慢导致的死锁,从定时轮询发现有时AudioCapture关闭的比较慢。

在调用mKStreamer.stopStream()之后,mKStreamer.getAudioCapture().isRecordingState() 为 true会持续到调用mKStreamer.release()的时候,这种情况下就会卡死。

@buliaoyin
Copy link
Contributor

这个问题我们内部还没有复现出来,不过下个将发布版本的AudioCapture模块进行了比较大程度的优化,避免了锁的使用,应该能够完全避免这种问题

@fpzeng
Copy link
Owner

fpzeng commented Apr 25, 2017

请使用新版本测试:https://github.com/ksvc/KSYStreamer_Android/releases/tag/v4.2.0

内部优化了同步机制,anr几率降低很多

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants