AudioFlinger server died!声音问题。。求解答

03-14 11:29:38.918 1839 2238 D AudioDecoder: Decoding (assets/res/sound/model/model2019_idle.mp3) to pcm data wasted 5.130000ms
9703-14 11:29:38.918 1839 2238 I AudioDecoder: No need to resample since the sample rate (44100) of the decoded pcm data is the same as the device output sample rate
9803-14 11:29:38.918 1839 2238 D AudioDecoder: Resampling (assets/res/sound/model/model2019_idle.mp3) wasted 0.008000ms
9903-14 11:29:38.918 1839 2238 D AudioDecoder: Interleave (assets/res/sound/model/model2019_idle.mp3) wasted 2.894000ms
10003-14 11:29:44.998 1839 1870 W AudioSystem: AudioFlinger server died!
10103-14 11:29:44.998 1839 1870 W IMediaDeathNotifier: media server died
10203-14 11:29:44.998 1839 4432 E libOpenSLES: Error after prepare: 100
10303-14 11:29:45.090 1839 1863 D dalvikvm: GC_CONCURRENT freed 1393K, 20% free 6880K/8556K, paused 0ms+1ms, total 6ms
10403-14 11:29:45.254 1839 4480 W libOpenSLES: frameworks/wilhelm/src/android/AudioPlayer_to_android.cpp:846: pthread 0xb92b7bd8 (tid 4480) sees object 0xb9e5a090 was locked by pthread 0xb79aa2f8 (tid 1874) at frameworks/wilhelm/src/itf/IObject.c:411
10503-14 11:29:59.958 1839 1863 D dalvikvm: GC_CONCURRENT freed 1367K, 20% free 6896K/8556K, paused 3ms+2ms, total 22ms
10603-14 11:30:14.866 1839 1863 D dalvikvm: GC_CONCURRENT freed 1389K, 20% free 6887K/8556K, paused 2ms+2ms, total 19ms

之后就是直接卡屏了。

github上最新的代码应该修复了这个问题。急的话可以pull 最新代码把audio相关的修改覆盖一下。
或者等下个发布版本。
这个是在部分android设备上使用系统进行解码导致的死锁问题,引擎层面无法彻底修复,github v3分支已经改为引擎层自己解码ogg,MP3,wav格式的文件。

https://github.com/cocos2d/cocos2d-x 的v3分支 是这个分支吗?一楼出错那个信息,是在这个分支合并编译后的包出的错,包含android-specific的。@dumganhar

日志贴完整一点。前面应该有:V/AudioDecoderMp3: Create AudioDecoderMp3
这样的日志。如果有,应该就是v3最新的了。那就是另外的问题了。
这是神马设备?

@dumganhar 这里是比较完整的日志,就是最新版的。这个设备是逍遥安卓模拟器,系统是4.2.2

ave (assets/res/sound/cheers.mp3) wasted 8.079000ms
103-15 16:07:40.343 8146 8793 I AudioDecoderMp3: Original audio info: numChannels: 1, sampleRate: 44100, bitPerSample: 16, containerSize: 16, channelMask: 4, endianness: 2, numFrames: 88704, duration: 2.011429, total size: 177408
203-15 16:07:40.343 8146 8793 D AudioDecoder: Decoding (assets/res/sound/model/model100019_idle.mp3) to pcm data wasted 6.904000ms
303-15 16:07:40.343 8146 8793 I AudioDecoder: No need to resample since the sample rate (44100) of the decoded pcm data is the same as the device output sample rate
403-15 16:07:40.343 8146 8793 D AudioDecoder: Resampling (assets/res/sound/model/model100019_idle.mp3) wasted 0.009000ms
503-15 16:07:40.347 8146 8793 D AudioDecoder: Interleave (assets/res/sound/model/model100019_idle.mp3) wasted 5.364000ms
603-15 16:07:51.735 8146 8170 D dalvikvm: GC_CONCURRENT freed 591K, 36% free 4520K/7024K, paused 0ms+0ms, total 5ms
703-15 16:08:10.951 8146 8170 D dalvikvm: GC_CONCURRENT freed 594K, 36% free 4514K/7024K, paused 0ms+1ms, total 6ms
803-15 16:08:30.007 8146 8170 D dalvikvm: GC_CONCURRENT freed 583K, 36% free 4514K/7024K, paused 0ms+1ms, total 5ms
903-15 16:08:49.311 8146 8170 D dalvikvm: GC_CONCURRENT freed 594K, 36% free 4514K/7024K, paused 1ms+1ms, total 7ms
1003-15 16:09:06.923 8146 11554 I ReYunTrack: there is no more data need to resend
1103-15 16:09:09.615 8146 8170 D dalvikvm: GC_CONCURRENT freed 579K, 36% free 4523K/7024K, paused 0ms+0ms, total 3ms
1203-15 16:09:27.387 8146 11559 W DebugConnManager: getNetworkInfo() on networkType 0
1303-15 16:09:27.387 8146 11560 I ReYunGame: there is no more data need to resend
1403-15 16:09:27.423 8146 8170 D dalvikvm: GC_CONCURRENT freed 561K, 36% free 4551K/7024K, paused 1ms+2ms, total 6ms
1503-15 16:09:46.711 8146 8170 D dalvikvm: GC_CONCURRENT freed 629K, 36% free 4521K/7024K, paused 0ms+0ms, total 6ms
1603-15 16:10:07.087 8146 8170 D dalvikvm: GC_CONCURRENT freed 595K, 36% free 4513K/7024K, paused 1ms+1ms, total 9ms
1703-15 16:10:26.815 8146 8170 D dalvikvm: GC_CONCURRENT freed 580K, 36% free 4520K/7024K, paused 1ms+1ms, total 8ms
1803-15 16:10:44.959 8146 8793 I AudioDecoderMp3: Original audio info: numChannels: 1, sampleRate: 44100, bitPerSample: 16, containerSize: 16, channelMask: 4, endianness: 2, numFrames: 27648, duration: 0.626939, total size: 55296
1903-15 16:10:44.959 8146 8793 D AudioDecoder: Decoding (assets/res/sound/gogogo.mp3) to pcm data wasted 1.858000ms
2003-15 16:10:44.959 8146 8793 I AudioDecoder: No need to resample since the sample rate (44100) of the decoded pcm data is the same as the device output sample rate
2103-15 16:10:44.959 8146 8793 D AudioDecoder: Resampling (assets/res/sound/gogogo.mp3) wasted 0.009000ms
2203-15 16:10:44.959 8146 8793 D AudioDecoder: Interleave (assets/res/sound/gogogo.mp3) wasted 1.554000ms
2303-15 16:10:45.555 8146 8180 D ThreadPool: stretch pool from 1 to 3, waste 0.000696 seconds
2403-15 16:10:45.559 8146 8793 I AudioDecoderMp3: Original audio info: numChannels: 1, sampleRate: 44100, bitPerSample: 16, containerSize: 16, channelMask: 4, endianness: 2, numFrames: 47232, duration: 1.071020, total size: 94464
2503-15 16:10:45.559 8146 8793 D AudioDecoder: Decoding (assets/res/sound/model/model1025_idle.mp3) to pcm data wasted 4.578000ms
2603-15 16:10:45.559 8146 8793 I AudioDecoder: No need to resample since the sample rate (44100) of the decoded pcm data is the same as the device output sample rate
2703-15 16:10:45.559 8146 8793 D AudioDecoder: Resampling (assets/res/sound/model/model1025_idle.mp3) wasted 0.010000ms
2803-15 16:10:45.559 8146 8793 D AudioDecoder: Interleave (assets/res/sound/model/model1025_idle.mp3) wasted 2.987000ms
2903-15 16:10:45.583 8146 11582 I AudioDecoderMp3: Original audio info: numChannels: 1, sampleRate: 22050, bitPerSample: 16, containerSize: 16, channelMask: 4, endianness: 2, numFrames: 77184, duration: 3.500408, total size: 154368
3003-15 16:10:45.583 8146 11582 D AudioDecoder: Decoding (assets/res/sound/model/useSkill_3001.mp3) to pcm data wasted 23.679001ms
3103-15 16:10:45.587 8146 11582 D AudioDecoder: Resampling (assets/res/sound/model/useSkill_3001.mp3) wasted 5.509000ms
3203-15 16:10:45.603 8146 11582 D AudioDecoder: Interleave (assets/res/sound/model/useSkill_3001.mp3) wasted 12.887000ms
3303-15 16:10:45.819 8146 8180 D ThreadPool: shrink pool, _idleThreadNum = 3
3403-15 16:10:45.819 8146 8180 D ThreadPool: shrink 2 threads, waste: 0.000177 seconds
3503-15 16:10:45.823 8146 8180 D ThreadPool: stretch pool from 1 to 3, waste 0.000795 seconds
3603-15 16:10:45.827 8146 8793 I AudioDecoderMp3: Original audio info: numChannels: 1, sampleRate: 44100, bitPerSample: 16, containerSize: 16, channelMask: 4, endianness: 2, numFrames: 73728, duration: 1.671837, total size: 147456
3703-15 16:10:45.827 8146 8793 D AudioDecoder: Decoding (assets/res/sound/model/model1033_idle.mp3) to pcm data wasted 6.328000ms
3803-15 16:10:45.827 8146 8793 I AudioDecoder: No need to resample since the sample rate (44100) of the decoded pcm data is the same as the device output sample rate
3903-15 16:10:45.827 8146 8793 D AudioDecoder: Resampling (assets/res/sound/model/model1033_idle.mp3) wasted 0.009000ms
4003-15 16:10:45.843 8146 8793 D AudioDecoder: Interleave (assets/res/sound/model/model1033_idle.mp3) wasted 16.614000ms
4103-15 16:10:45.859 8146 11585 I AudioDecoderMp3: Original audio info: numChannels: 1, sampleRate: 44100, bitPerSample: 16, containerSize: 16, channelMask: 4, endianness: 2, numFrames: 87552, duration: 1.985306, total size: 175104
4203-15 16:10:45.859 8146 11585 D AudioDecoder: Decoding (assets/res/sound/model/useSkill_4002.mp3) to pcm data wasted 21.750000ms
4303-15 16:10:45.859 8146 11585 I AudioDecoder: No need to resample since the sample rate (44100) of the decoded pcm data is the same as the device output sample rate
4403-15 16:10:45.859 8146 11585 D AudioDecoder: Resampling (assets/res/sound/model/useSkill_4002.mp3) wasted 0.018000ms
4503-15 16:10:45.867 8146 11585 D AudioDecoder: Interleave (assets/res/sound/model/useSkill_4002.mp3) wasted 7.035000ms
4603-15 16:10:46.099 8146 11584 I AudioDecoderMp3: Original audio info: numChannels: 1, sampleRate: 44100, bitPerSample: 16, containerSize: 16, channelMask: 4, endianness: 2, numFrames: 77184, duration: 1.750204, total size: 154368
4703-15 16:10:46.099 8146 11584 D AudioDecoder: Decoding (assets/res/sound/model/model1008_idle.mp3) to pcm data wasted 10.864000ms
4803-15 16:10:46.099 8146 11584 I AudioDecoder: No need to resample since the sample rate (44100) of the decoded pcm data is the same as the device output sample rate
4903-15 16:10:46.099 8146 11584 D AudioDecoder: Resampling (assets/res/sound/model/model1008_idle.mp3) wasted 0.012000ms
5003-15 16:10:46.111 8146 11584 D AudioDecoder: Interleave (assets/res/sound/model/model1008_idle.mp3) wasted 11.259000ms
5103-15 16:10:46.127 8146 8793 I AudioDecoderMp3: Original audio info: numChannels: 1, sampleRate: 48000, bitPerSample: 16, containerSize: 16, channelMask: 4, endianness: 2, numFrames: 196992, duration: 4.104000, total size: 393984
5203-15 16:10:46.127 8146 8793 D AudioDecoder: Decoding (assets/res/sound/model/useSkill_1008.mp3) to pcm data wasted 30.459999ms
5303-15 16:10:46.131 8146 8793 D AudioDecoder: Resampling (assets/res/sound/model/useSkill_1008.mp3) wasted 7.284000ms
5403-15 16:10:46.143 8146 8793 D AudioDecoder: Interleave (assets/res/sound/model/useSkill_1008.mp3) wasted 10.607000ms
5503-15 16:10:47.199 8146 8170 D dalvikvm: GC_CONCURRENT freed 596K, 36% free 4514K/7024K, paused 0ms+0ms, total 6ms
5603-15 16:10:47.563 8146 11585 I AudioDecoderMp3: Original audio info: numChannels: 2, sampleRate: 44100, bitPerSample: 16, containerSize: 16, channelMask: 3, endianness: 2, numFrames: 44928, duration: 1.018775, total size: 179712
5703-15 16:10:47.563 8146 11585 D AudioDecoder: Decoding (assets/res/sound/vs.mp3) to pcm data wasted 6.710000ms
5803-15 16:10:47.563 8146 11585 I AudioDecoder: No need to resample since the sample rate (44100) of the decoded pcm data is the same as the device output sample rate
5903-15 16:10:47.563 8146 11585 D AudioDecoder: Resampling (assets/res/sound/vs.mp3) wasted 0.008000ms
6003-15 16:10:47.563 8146 11585 I AudioDecoder: Audio channel count is 2, no need to interleave
6103-15 16:10:47.563 8146 11585 D AudioDecoder: Interleave (assets/res/sound/vs.mp3) wasted 0.006000ms
6203-15 16:10:47.575 8146 11584 I AudioDecoderMp3: Original audio info: numChannels: 1, sampleRate: 44100, bitPerSample: 16, containerSize: 16, channelMask: 4, endianness: 2, numFrames: 86400, duration: 1.959184, total size: 172800
6303-15 16:10:47.575 8146 11584 D AudioDecoder: Decoding (assets/res/sound/castBigSkill.mp3) to pcm data wasted 18.120001ms
6403-15 16:10:47.575 8146 11584 I AudioDecoder: No need to resample since the sample rate (44100) of the decoded pcm data is the same as the device output sample rate
6503-15 16:10:47.575 8146 11584 D AudioDecoder: Resampling (assets/res/sound/castBigSkill.mp3) wasted 0.010000ms
6603-15 16:10:47.587 8146 8793 I AudioDecoderMp3: Original audio info: numChannels: 1, sampleRate: 44100, bitPerSample: 16, containerSize: 16, channelMask: 4, endianness: 2, numFrames: 220032, duration: 4.989388, total size: 440064
6703-15 16:10:47.587 8146 8793 D AudioDecoder: Decoding (assets/res/sound/win.mp3) to pcm data wasted 22.572001ms
6803-15 16:10:47.587 8146 8793 I AudioDecoder: No need to resample since the sample rate (44100) of the decoded pcm data is the same as the device output sample rate
6903-15 16:10:47.587 8146 8793 D AudioDecoder: Resampling (assets/res/sound/win.mp3) wasted 0.009000ms
7003-15 16:10:47.595 8146 11584 D AudioDecoder: Interleave (assets/res/sound/castBigSkill.mp3) wasted 18.690001ms
7103-15 16:10:47.599 8146 8793 D AudioDecoder: Interleave (assets/res/sound/win.mp3) wasted 12.867000ms
7203-15 16:10:47.735 8146 8180 W AudioPlayerProvider: Couldn’t find the pcm cache: (assets/res/music/1001.mp3)
7303-15 16:10:53.023 8146 8180 D ThreadPool: shrink pool, _idleThreadNum = 3
7403-15 16:10:53.023 8146 8180 D ThreadPool: shrink 2 threads, waste: 0.000132 seconds
7503-15 16:10:53.027 8146 8793 I AudioDecoderMp3: Original audio info: numChannels: 1, sampleRate: 44100, bitPerSample: 16, containerSize: 16, channelMask: 4, endianness: 2, numFrames: 56448, duration: 1.280000, total size: 112896
7603-15 16:10:53.027 8146 8793 D AudioDecoder: Decoding (assets/res/sound/model/model2077_idle.mp3) to pcm data wasted 4.361000ms
7703-15 16:10:53.027 8146 8793 I AudioDecoder: No need to resample since the sample rate (44100) of the decoded pcm data is the same as the device output sample rate
7803-15 16:10:53.027 8146 8793 D AudioDecoder: Resampling (assets/res/sound/model/model2077_idle.mp3) wasted 0.008000ms
7903-15 16:10:53.031 8146 8793 D AudioDecoder: Interleave (assets/res/sound/model/model2077_idle.mp3) wasted 4.514000ms
8003-15 16:10:55.799 8146 8793 I AudioDecoderMp3: Original audio info: numChannels: 1, sampleRate: 44100, bitPerSample: 16, containerSize: 16, channelMask: 4, endianness: 2, numFrames: 66816, duration: 1.515102, total size: 133632
8103-15 16:10:55.799 8146 8793 D AudioDecoder: Decoding (assets/res/sound/model/model2059_idle.mp3) to pcm data wasted 5.260000ms
8203-15 16:10:55.799 8146 8793 I AudioDecoder: No need to resample since the sample rate (44100) of the decoded pcm data is the same as the device output sample rate
8303-15 16:10:55.799 8146 8793 D AudioDecoder: Resampling (assets/res/sound/model/model2059_idle.mp3) wasted 0.009000ms
8403-15 16:10:55.803 8146 8793 D AudioDecoder: Interleave (assets/res/sound/model/model2059_idle.mp3) wasted 3.593000ms
8503-15 16:11:04.095 8146 8793 I AudioDecoderMp3: Original audio info: numChannels: 1, sampleRate: 44100, bitPerSample: 16, containerSize: 16, channelMask: 4, endianness: 2, numFrames: 67968, duration: 1.541224, total size: 135936
8603-15 16:11:04.095 8146 8793 D AudioDecoder: Decoding (assets/res/sound/model/model2060_idle.mp3) to pcm data wasted 5.790000ms
8703-15 16:11:04.095 8146 8793 I AudioDecoder: No need to resample since the sample rate (44100) of the decoded pcm data is the same as the device output sample rate
8803-15 16:11:04.095 8146 8793 D AudioDecoder: Resampling (assets/res/sound/model/model2060_idle.mp3) wasted 0.071000ms
8903-15 16:11:04.099 8146 8793 D AudioDecoder: Interleave (assets/res/sound/model/model2060_idle.mp3) wasted 5.000000ms
9003-15 16:11:06.895 8146 8170 D dalvikvm: GC_CONCURRENT freed 587K, 36% free 4514K/7024K, paused 1ms+0ms, total 6ms
9103-15 16:11:08.967 8146 8793 I AudioDecoderMp3: Original audio info: numChannels: 2, sampleRate: 44100, bitPerSample: 16, containerSize: 16, channelMask: 3, endianness: 2, numFrames: 112896, duration: 2.560000, total size: 451584
9203-15 16:11:08.967 8146 8793 D AudioDecoder: Decoding (assets/res/sound/model/model2045_idle.mp3) to pcm data wasted 17.318001ms
9303-15 16:11:08.967 8146 8793 I AudioDecoder: No need to resample since the sample rate (44100) of the decoded pcm data is the same as the device output sample rate
9403-15 16:11:08.967 8146 8793 D AudioDecoder: Resampling (assets/res/sound/model/model2045_idle.mp3) wasted 0.009000ms
9503-15 16:11:08.967 8146 8793 I AudioDecoder: Audio channel count is 2, no need to interleave
9603-15 16:11:08.967 8146 8793 D AudioDecoder: Interleave (assets/res/sound/model/model2045_idle.mp3) wasted 0.006000ms
9703-15 16:11:25.435 8146 8170 D dalvikvm: GC_CONCURRENT freed 580K, 36% free 4520K/7024K, paused 0ms+1ms, total 3ms
9803-15 16:11:27.123 8146 8177 W AudioSystem: AudioFlinger server died!
9903-15 16:11:27.123 8146 8177 W IMediaDeathNotifier: media server died
10003-15 16:11:27.123 8146 8177 W AudioSystem: AudioPolicyService server died!
10103-15 16:11:27.123 8146 11586 E libOpenSLES: Error after prepare: 100
10203-15 16:11:27.379 8146 11663 W libOpenSLES: frameworks/wilhelm/src/android/AudioPlayer_to_android.cpp:846: pthread 0xbaf96380 (tid 11663) sees object 0xbacbe4b0 was locked by pthread 0xb97f0720 (tid 8180) at frameworks/wilhelm/src/itf/IObject.c:411
10303-15 16:11:28.119 8146 8300 W AudioTrack: obtainBuffer timed out (is the CPU pegged?) 0xb9a313c0 name=0x1user=0f08ee00, server=0f08ea00
10403-15 16:11:28.119 8146 8300 W IAudioTrack: start() error: Broken pipe
10503-15 16:11:28.119 8146 8300 W AudioTrack: dead IAudioTrack, creating a new one from obtainBuffer() TID 8300
10603-15 16:11:29.123 8146 8300 W AudioTrack: obtainBuffer timed out (is the CPU pegged?) 0xb9a313c0 name=0x1user=0f08f200, server=0f08ee00
10703-15 16:11:30.127 8146 8300 W AudioTrack: obtainBuffer timed out (is the CPU pegged?) 0xb9a313c0 name=0x1user=0f08f200, server=0f08ee00
10803-15 16:11:31.131 8146 8300 W AudioTrack: obtainBuffer timed out (is the CPU pegged?) 0xb9a313c0 name=0x1user=0f08f200, server=0f08ee00
10903-15 16:11:32.135 8146 8300 W AudioTrack: obtainBuffer timed out (is the CPU pegged?) 0xb9a313c0 name=0x1user=0f08f200, server=0f08ee00
11003-15 16:11:33.135 8146 8300 W AudioTrack: obtainBuffer timed out (is the CPU pegged?) 0xb9a313c0 name=0x1user=0f08f200, server=0f08ee00
11103-15 16:11:34.139 8146 8300 W AudioTrack: obtainBuffer timed out (is the CPU pegged?) 0xb9a313c0 name=0x1user=0f08f200, server=0f08ee00
11203-15 16:11:35.139 8146 8300 W AudioTrack: obtainBuffer timed out (is the CPU pegged?) 0xb9a313c0 name=0x1user=0f08f200, server=0f08ee00
11303-15 16:11:36.139 8146 8300 W AudioTrack: obtainBuffer timed out (is the CPU pegged?) 0xb9a313c0 name=0x1user=0f08f200, server=0f08ee00
11403-15 16:11:37.139 8146 8300 W AudioTrack: obtainBuffer timed out (is the CPU pegged?) 0xb9a313c0 name=0x1user=0f08f200, server=0f08ee00
11503-15 16:11:38.143 8146 8300 W AudioTrack: obtainBuffer timed out (is the CPU pegged?) 0xb9a313c0 name=0x1user=0f08f200, server=0f08ee00
11603-15 16:11:39.207 8146 8300 W AudioTrack: obtainBuffer timed out (is the CPU pegged?) 0xb9a313c0 name=0x1user=0f08fe00, server=0f08fa00
11703-15 16:11:40.211 8146 8300 W AudioTrack: obtainBuffer timed out (is the CPU pegged?) 0xb9a313c0 name=0x1user=0f08fe00, server=0f08fa00
11803-15 16:11:41.211 8146 8300 W AudioTrack: obtainBuffer timed out (is the CPU pegged?) 0xb9a313c0 name=0x1user=0f08fe00, server=0f08fa00
11903-15 16:11:42.211 8146 8300 W AudioTrack: obtainBuffer timed out (is the CPU pegged?) 0xb9a313c0 name=0x1user=0f08fe00, server=0f08fa00
12003-15 16:11:47.027 8146 8170 D dalvikvm: GC_CONCURRENT freed 587K, 36% free 4519K/7024K, paused 1ms+1ms, total 14ms

@dumganhar 请问有结论了吗:hushed:

10103-15 16:11:27.123 8146 11586 E libOpenSLES: Error after prepare: 100
10203-15 16:11:27.379 8146 11663 W libOpenSLES: frameworks/wilhelm/src/android/AudioPlayer_to_android.cpp:846: pthread 0xbaf96380 (tid 11663) sees object 0xbacbe4b0 was locked by pthread 0xb97f0720 (tid 8180) at frameworks/wilhelm/src/itf/IObject.c:411
10303-15 16:11:28.119 8146 8300 W AudioTrack: obtainBuffer timed out (is the CPU pegged?) 0xb9a313c0 name=0x1user=0f08ee00, server=0f08ea00
10403-15 16:11:28.119 8146 8300 W IAudioTrack: start() error: Broken pipe
10503-15 16:11:28.119 8146 8300 W AudioTrack: dead IAudioTrack, creating a new one from obtainBuffer() TID 8300

系统出错,没招啊。你试试不要用模拟器,用真机设备看看。