obtainBuffer timed out (is the CPU pegged?)

https://stackoverflow.com/questions/5293025/audiotrack-lag-obtainbuffer-timed-out [典]

03-13 14:55:57.100: WARN/AudioTrack(3454): obtainBuffer timed out (is the CPU pegged?) 0x2e9348 user=00000960,     server=00000000
03-13 14:55:57.340: WARN/AudioFlinger(72): write blocked for 233 msecs, 9 delayed writes, thread 0xba28

I ran into a similar problem, although I was using a RandomAccessFile, instead of a BufferedInputStream, to read the PCM data. The issue was that the file I/O was too slow. I suspect you will have this problem even with a buffered stream, because the I/O is still taking place on the same thread as audio processing.

The solution is to have two threads: A thread that reads buffers from a file and queues them into memory, and another thread that reads from this queue and writes to the audio hardware. I used a ConcurrentLinkedQueue to accomplish this.

I used the same technique for recording, using AudioRecord, but in the reverse direction. The key is to place the file I/O on a separate thread.

 

https://stackoverflow.com/questions/7398392/android-audiotrack-only-plays-first-2-seconds-back-then-stops

09-13 09:13:24.816: WARN/Archive(1066): audiostate is: 3
09-13 09:13:26.089: WARN/AudioTrack(1066): obtainBuffer() track 0x298b18 disabled, restarting
09-13 09:13:27.214: WARN/AudioTrack(1066): obtainBuffer() track 0x298b18 disabled, restarting
09-13 09:13:28.332: WARN/AudioTrack(1066): obtainBuffer() track 0x298b18 disabled, restarting
09-13 09:13:29.457: WARN/AudioTrack(1066): obtainBuffer() track 0x298b18 disabled, restarting

I just saw the logcat: obtainBuffer() track 0x298b18 disabled, restarting .. that is to say : you have not got audio data and the input audio stream have been stopped .so the buffer must wait for the audio stream in. i think you should check the inputstream and the read method. you must ensure that you have read the audio data continuously.

https://stackoverflow.com/questions/24378916/obtainbuffer-timed-out-is-the-cpu-pegged

obtainBuffer timed out (is the CPU pegged?)

https://www.oschina.net/question/1273322_128331

 

媒体资源没有释放 E AudioMixer: AudioMixer::getTrackName out of available tracks

 检查下代码 临时的播放资源需要及时释放

 

https://bbs.csdn.net/topics/390134512

https://blog.csdn.net/bberdong/article/details/52161426

 

转载于:https://www.cnblogs.com/Ph-one/p/8669418.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值