Android Quickblox 视频聊天错误

Posted

技术标签:

【中文标题】Android Quickblox 视频聊天错误【英文标题】:Android Quickblox Video chat error 【发布时间】:2014-02-19 20:18:48 【问题描述】:

我正在使用 Quickblox 库为 android 开发视频聊天应用程序。但是我在保持视频聊天会话时遇到了一些错误。当用户以接收者(第二个用户)身份登录时,应用程序会在一段时间后崩溃,并给出以下日志输出。

 01-28 18:23:20.149: W/System.err(15082):   at java.net.PlainSocketImpl.access$100(PlainSocketImpl.java:46)
01-28 18:23:20.149: W/System.err(15082):    at java.net.PlainSocketImpl$PlainSocketOutputStream.write(PlainSocketImpl.java:269)
01-28 18:23:20.149: W/System.err(15082):    at java.io.DataOutputStream.write(DataOutputStream.java:98)
01-28 18:23:20.149: W/System.err(15082):    at java.io.OutputStream.write(OutputStream.java:82)
01-28 18:23:20.149: W/System.err(15082):    at com.quickblox.module.videochat.core.senders.TcpPacketsSender$TcpVideoAudiosenderRunnable.run(TcpPacketsSender.java:98)
01-28 18:23:20.149: W/System.err(15082):    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
01-28 18:23:20.149: W/System.err(15082):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
01-28 18:23:20.149: W/System.err(15082):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
01-28 18:23:20.149: W/System.err(15082):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
01-28 18:23:20.149: W/System.err(15082):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
01-28 18:23:20.149: W/System.err(15082):    at java.lang.Thread.run(Thread.java:856)
01-28 18:23:20.159: W/System.err(15082): Caused by: libcore.io.ErrnoException: sendto failed: EPIPE (Broken pipe)
01-28 18:23:20.159: W/System.err(15082):    at libcore.io.Posix.sendtoBytes(Native Method)
01-28 18:23:20.159: W/System.err(15082):    at libcore.io.Posix.sendto(Posix.java:146)
01-28 18:23:20.159: W/System.err(15082):    at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:177)
01-28 18:23:20.159: W/System.err(15082):    at libcore.io.IoBridge.sendto(IoBridge.java:463)
01-28 18:23:20.159: W/System.err(15082):    ... 12 more
01-28 18:23:20.199: W/AudioTrack(15082): obtainBuffer() track 0x7e5788 disabled, restarting
01-28 18:23:20.219: W/ilbc-codec(15082): Ignore last 0 bytes
01-28 18:23:20.349: W/System.err(15082): java.net.SocketException: sendto failed: EPIPE (Broken pipe)
01-28 18:23:20.359: W/System.err(15082):    at libcore.io.IoBridge.maybeThrowAfterSendto(IoBridge.java:496)
01-28 18:23:20.359: W/System.err(15082):    at libcore.io.IoBridge.sendto(IoBridge.java:465)
01-28 18:23:20.359: W/System.err(15082):    at java.net.PlainSocketImpl.write(PlainSocketImpl.java:507)
01-28 18:23:20.359: W/System.err(15082):    at java.net.PlainSocketImpl.access$100(PlainSocketImpl.java:46)
01-28 18:23:20.359: W/System.err(15082):    at java.net.PlainSocketImpl$PlainSocketOutputStream.write(PlainSocketImpl.java:269)
01-28 18:23:20.359: W/System.err(15082):    at java.io.DataOutputStream.write(DataOutputStream.java:98)
01-28 18:23:20.359: W/System.err(15082):    at java.io.OutputStream.write(OutputStream.java:82)
01-28 18:23:20.359: W/System.err(15082):    at com.quickblox.module.videochat.core.senders.TcpPacketsSender$TcpVideoAudioSenderRunnable.run(TcpPacketsSender.java:98)
01-28 18:23:20.359: W/System.err(15082):    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
01-28 18:23:20.359: W/System.err(15082):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
01-28 18:23:20.359: W/System.err(15082):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
01-28 18:23:20.359: W/System.err(15082):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
01-28 18:23:20.359: W/System.err(15082):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
01-28 18:23:20.359: W/System.err(15082):    at java.lang.Thread.run(Thread.java:856)
01-28 18:23:20.359: W/System.err(15082): Caused by: libcore.io.ErrnoException: sendto failed: EPIPE (Broken pipe)
01-28 18:23:20.369: W/System.err(15082):    at libcore.io.Posix.sendtoBytes(Native Method)
01-28 18:23:20.369: W/System.err(15082):    at libcore.io.Posix.sendto(Posix.java:146)
01-28 18:23:20.369: W/System.err(15082):    at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:177)
01-28 18:23:20.369: W/System.err(15082):    at libcore.io.IoBridge.sendto(IoBridge.java:463)
01-28 18:23:20.379: W/System.err(15082):    ... 12 more

有时会出现 AdioRecord 错误

java.lang.IllegalStateException: startRecording() called on an uninitialized AudioRecord.

有人对此有任何想法或有任何其他用于聊天应用程序集成的库吗? 谢谢

编辑 这里还有一些错误,

01-29 16:38:58.831: E/AndroidRuntime(6775): FATAL EXCEPTION: Thread-3039
01-29 16:38:58.831: E/AndroidRuntime(6775): java.lang.ExceptionInInitializerError
01-29 16:38:58.831: E/AndroidRuntime(6775):     at com.quickblox.module.videochat.core.AudioRecorder$AudioRecorderRunnable.run(AudioRecorder.java:123)
01-29 16:38:58.831: E/AndroidRuntime(6775):     at java.lang.Thread.run(Thread.java:856)
01-29 16:38:58.831: E/AndroidRuntime(6775): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load ilbc-codec: findLibrary returned null
01-29 16:38:58.831: E/AndroidRuntime(6775):     at java.lang.Runtime.loadLibrary(Runtime.java:365)
01-29 16:38:58.831: E/AndroidRuntime(6775):     at java.lang.System.loadLibrary(System.java:535)
01-29 16:38:58.831: E/AndroidRuntime(6775):     at com.googlecode.androidilbc.Codec.<init>(Codec.java:16)
01-29 16:38:58.831: E/AndroidRuntime(6775):     at com.googlecode.androidilbc.Codec.<clinit>(Codec.java:5)
01-29 16:38:58.831: E/AndroidRuntime(6775):     ... 2 more


01-29 11:01:15.772: E/AndroidRuntime(18705): FATAL EXCEPTION: main
01-29 11:01:15.772: E/AndroidRuntime(18705): java.lang.RuntimeException: Unable to start activity ComponentInfocom.rechargedoctor.android.app/com.quickblox.videochatsample.ui.ActivityVideoChat: java.lang.IllegalStateException: startRecording() called on an uninitialized AudioRecord.
01-29 11:01:15.772: E/AndroidRuntime(18705):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1959)
01-29 11:01:15.772: E/AndroidRuntime(18705):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1984)
01-29 11:01:15.772: E/AndroidRuntime(18705):    at android.app.ActivityThread.access$600(ActivityThread.java:126)
01-29 11:01:15.772: E/AndroidRuntime(18705):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1150)
01-29 11:01:15.772: E/AndroidRuntime(18705):    at android.os.Handler.dispatchMessage(Handler.java:99)
01-29 11:01:15.772: E/AndroidRuntime(18705):    at android.os.Looper.loop(Looper.java:137)
01-29 11:01:15.772: E/AndroidRuntime(18705):    at android.app.ActivityThread.main(ActivityThread.java:4456)
01-29 11:01:15.772: E/AndroidRuntime(18705):    at java.lang.reflect.Method.invokeNative(Native Method)
01-29 11:01:15.772: E/AndroidRuntime(18705):    at java.lang.reflect.Method.invoke(Method.java:511)
01-29 11:01:15.772: E/AndroidRuntime(18705):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
01-29 11:01:15.772: E/AndroidRuntime(18705):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
01-29 11:01:15.772: E/AndroidRuntime(18705):    at dalvik.system.NativeStart.main(Native Method)
01-29 11:01:15.772: E/AndroidRuntime(18705): Caused by: java.lang.IllegalStateException: startRecording() called on an uninitialized AudioRecord.
01-29 11:01:15.772: E/AndroidRuntime(18705):    at android.media.AudioRecord.startRecording(AudioRecord.java:534)
01-29 11:01:15.772: E/AndroidRuntime(18705):    at com.quickblox.module.videochat.core.AudioRecorder$AudioRecorderRunnable.initRecorder(AudioRecorder.java:97)
01-29 11:01:15.772: E/AndroidRuntime(18705):    at com.quickblox.module.videochat.core.AudioRecorder$AudioRecorderRunnable.<init>(AudioRecorder.java:75)
01-29 11:01:15.772: E/AndroidRuntime(18705):    at com.quickblox.module.videochat.core.AudioRecorder.startAudioRecorder(AudioRecorder.java:31)
01-29 11:01:15.772: E/AndroidRuntime(18705):    at com.quickblox.module.videochat.core.service.QBVideoChatService.startVideoChat(QBVideoChatService.java:93)
01-29 11:01:15.772: E/AndroidRuntime(18705):    at com.quickblox.videochatsample.ui.ActivityVideoChat.initViews(ActivityVideoChat.java:69)
01-29 11:01:15.772: E/AndroidRuntime(18705):    at com.quickblox.videochatsample.ui.ActivityVideoChat.onCreate(ActivityVideoChat.java:40)
01-29 11:01:15.772: E/AndroidRuntime(18705):    at android.app.Activity.performCreate(Activity.java:4465)
01-29 11:01:15.772: E/AndroidRuntime(18705):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
01-29 11:01:15.772: E/AndroidRuntime(18705):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1923)
01-29 11:01:15.772: E/AndroidRuntime(18705):    ... 11 more

【问题讨论】:

【参考方案1】:

首先,检查您是否将本机库复制到您的项目中。然后,如果您遇到其他错误,请尽量不要将示例源复制到您的项目中,而是尝试加载和运行视频聊天示例的源,您可以在此处找到 https://github.com/QuickBlox/Sample-VideoChat-android

【讨论】:

我在尝试运行示例代码时也遇到了同样的错误。对你来说工作正常吗?就我而言,我的音频质量很差。此外,视频聊天在各个点被强制关闭,出现上述错误。【参考方案2】:

只需将 libs/armeabi/libilbc-codec 文件从 Sample-VideoChat-android 项目复制到您的新项目。一切都应该正常。

【讨论】:

以上是关于Android Quickblox 视频聊天错误的主要内容,如果未能解决你的问题,请参考以下文章

android quickBlox 视频通话代码强制关闭点击接收按钮点击

quickblox 聊天示例显示错误

登录时出现quickblox错误,android

QuickBlox Android 无响应

Android:Quickblox 客户端未连接或不再连接。错误

QuickBlox 有时会在登录时出现未经授权的错误。为啥?