为什么在播放新音乐时播放音乐会停止?

时间:2015-06-04 09:13:15

标签: android libgdx

当我的游戏开始时,音乐A开始播放。过了一段时间,音乐B开始了。问题是当音乐B开始时,音乐A停止。音乐A的声音刚刚停止。我希望两者同时玩。

此问题仅发生在我的一部手机上:运行Android L的Moto G第二代。它不会出现在其他手机或模拟器上。

问题与手机的扬声器无关,因为在手机上使用耳机时会出现同样的问题。

我正在使用LibGDX的Music课来播放音乐。

问题可能是什么?

这是音乐B开始播放后的logcat:

06-04 14:29:56.772: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:29:56.773: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [5ms]
06-04 14:29:56.782: D/hardware_info(316): hw_info_append_hw_type : device_name = speaker
06-04 14:29:56.786: E/msm8974_platform(316): platform_update_tpa_poll: Could not get ctl for mixer cmd - TPA6165 POLL ACC DET
06-04 14:29:56.790: I/AudioFlinger(316): HAL output buffer size 32768 frames, normal sink buffer size 32768 frames
06-04 14:29:56.791: I/AudioFlinger(316): AudioFlinger's thread 0xb8586988 ready to run
06-04 14:29:56.793: W/AudioFlinger(316): moveEffectChain_l() effect chain for session 0 not on source thread 0xb5b51008
06-04 14:29:56.806: D/audio_hw_primary(316): out_set_parameters: enter: usecase(3: compress-offload-playback) kvpairs: routing=2
06-04 14:29:56.818: D/audio_hw_primary(316): out_set_parameters: enter: usecase(3: compress-offload-playback) kvpairs: delay_samples=576;music_offload_avg_bit_rate=128000;music_offload_sample_rate=48000;padding_samples=1720
06-04 14:29:56.828: D/audio_hw_primary(316): out_set_parameters: enter: usecase(3: compress-offload-playback) kvpairs: delay_samples=576;music_offload_avg_bit_rate=128000;music_offload_sample_rate=48000;padding_samples=1720
06-04 14:29:56.859: V/msm8974_platform(316): platform_get_output_snd_device: enter: output devices(0x2)
06-04 14:29:56.859: V/msm8974_platform(316): platform_get_output_snd_device: exit: snd_device(speaker)
06-04 14:29:56.859: D/audio_hw_primary(316): select_devices: out_snd_device(2: speaker) in_snd_device(0: )
06-04 14:29:56.859: D/hardware_info(316): hw_info_append_hw_type : device_name = speaker
06-04 14:29:56.859: V/msm8974_platform(316): platform_send_audio_calibration: sending audio calibration for snd_device(2) acdb_id(14)
06-04 14:29:56.868: E/msm8974_platform(316): platform_update_tpa_poll: Could not get ctl for mixer cmd - TPA6165 POLL ACC DET
06-04 14:29:57.069: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:29:57.073: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [5ms]
06-04 14:29:57.373: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:29:57.376: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [8ms]
06-04 14:29:57.672: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:29:57.676: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [8ms]
06-04 14:29:57.973: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:29:57.976: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [8ms]
06-04 14:29:58.272: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:29:58.277: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [9ms]
06-04 14:29:58.575: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:29:58.576: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [8ms]
06-04 14:29:58.876: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:29:58.876: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [8ms]
06-04 14:29:59.172: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:29:59.176: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [8ms]
06-04 14:29:59.406: I/ThermalEngine(325): Sensor:xo_therm_pu2:41000 mC
06-04 14:29:59.474: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:29:59.476: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [8ms]
06-04 14:29:59.677: I/SBar.MotoNetworkCtrlr(1382): onReceive: WifiManager.RSSI_CHANGED_ACTION Received
06-04 14:29:59.677: I/SBar.MotoNetworkCtrlr(1382): updateWifiState: RSSI_CHANGED_ACTION: mWifiConnected=true mWifiLevel=3 mWifiRssi=-64
06-04 14:29:59.681: D/PhoneApp(1681): getPhone phoneId:0
06-04 14:29:59.687: I/SBar.MotoNetworkCtrlr(1382): refreshSignalCluster[0]: wifi: mWifiConnected=true Wifi=0x7f020130=stat_sys_wifi_signal_3_fully Activity=0x00000000=( none ) Accessibility="Wifi three bars."
06-04 14:29:59.690: I/SBar.MotoNetworkCtrlr(1382): updateTelephonySignalStrength[1]:  No service
06-04 14:29:59.691: I/SBar.MotoNetworkCtrlr(1382): updateDataNetType[1]: phoneId1 is not DDS( =phoneId0 ) ! -- Set all data icons to off ( SubscriptionManager.getPhoneId returned 0=0x00000000 )
06-04 14:29:59.692: I/SBar.MotoNetworkCtrlr(1382): refreshSignalCluster[1]: wifi: mWifiConnected=true Wifi=0x7f020130=stat_sys_wifi_signal_3_fully Activity=0x00000000=( none ) Accessibility="Wifi three bars."
06-04 14:29:59.692: I/SBar.MotoNetworkCtrlr(1382): onReceive: WifiManager.RSSI_CHANGED_ACTION Received
06-04 14:29:59.692: I/SBar.MotoNetworkCtrlr(1382): updateWifiState: RSSI_CHANGED_ACTION: mWifiConnected=true mWifiLevel=3 mWifiRssi=-64
06-04 14:29:59.695: D/PhoneApp(1681): getPhone phoneId:0
06-04 14:29:59.699: I/SBar.MotoNetworkCtrlr(1382): updateTelephonySignalStrength[1]:  No service
06-04 14:29:59.700: I/SBar.MotoNetworkCtrlr(1382): updateDataNetType[1]: phoneId1 is not DDS( =phoneId0 ) ! -- Set all data icons to off ( SubscriptionManager.getPhoneId returned 0=0x00000000 )
06-04 14:29:59.770: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:29:59.772: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [4ms]
06-04 14:30:00.000: V/AlarmManager(869): send {abf518f, *alarm*:android.intent.action.TIME_TICK}
06-04 14:30:00.070: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:30:00.070: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [2ms]
06-04 14:30:00.074: V/AlarmManager(869): done {abf518f, *alarm*:android.intent.action.TIME_TICK} [74ms]
06-04 14:30:00.376: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:30:00.376: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [8ms]
06-04 14:30:00.672: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:30:00.674: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [6ms]
06-04 14:30:00.969: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:30:00.971: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [3ms]
06-04 14:30:01.000: V/AlarmManager(869): send {1799853a, *alarm*:com.android.deskclock.ON_QUARTER_HOUR}
06-04 14:30:01.062: I/ActivityManager(869): Start proc com.google.android.deskclock for broadcast com.google.android.deskclock/com.android.alarmclock.DigitalAppWidgetProvider: pid=9611 uid=10059 gids={50059, 9997, 1028} abi=armeabi-v7a
06-04 14:30:01.064: I/SFPerfTracer(285):      triggers: (rate: 121:10967) (2 sw vsyncs) (0 skipped) (615:1406278 vsyncs) (617:1731577)
06-04 14:30:01.268: V/AlarmManager(869): done {1799853a, *alarm*:com.android.deskclock.ON_QUARTER_HOUR} [267ms]
06-04 14:30:01.270: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:30:01.272: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [4ms]
06-04 14:30:01.569: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:30:01.574: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [6ms]
06-04 14:30:01.870: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:30:01.873: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [5ms]
06-04 14:30:02.169: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:30:02.171: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [3ms]
06-04 14:30:02.469: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:30:02.471: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [3ms]
06-04 14:30:02.702: I/SBar.MotoNetworkCtrlr(1382): onReceive: WifiManager.RSSI_CHANGED_ACTION Received
06-04 14:30:02.702: I/SBar.MotoNetworkCtrlr(1382): updateWifiState: RSSI_CHANGED_ACTION: mWifiConnected=true mWifiLevel=3 mWifiRssi=-65
06-04 14:30:02.708: D/PhoneApp(1681): getPhone phoneId:0
06-04 14:30:02.711: I/SBar.MotoNetworkCtrlr(1382): updateTelephonySignalStrength[1]:  No service
06-04 14:30:02.712: I/SBar.MotoNetworkCtrlr(1382): updateDataNetType[1]: phoneId1 is not DDS( =phoneId0 ) ! -- Set all data icons to off ( SubscriptionManager.getPhoneId returned 0=0x00000000 )
06-04 14:30:02.769: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:30:02.771: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [3ms]
06-04 14:30:03.069: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:30:03.074: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [6ms]
06-04 14:30:03.369: V/AlarmManager(869): send {37acb279, *alarm*:com.domobile.applock/.service.LockService}
06-04 14:30:03.373: V/AlarmManager(869): done {37acb279, *alarm*:com.domobile.applock/.service.LockService} [5ms]
06-04 14:30:03.605: D/PhoneApp(1681): getPhone phoneId:0
06-04 14:30:03.609: I/SBar.MotoNetworkCtrlr(1382): updateTelephonySignalStrength[1]:  No service
06-04 14:30:03.610: I/SBar.MotoNetworkCtrlr(1382): updateDataNetType[1]: phoneId1 is not DDS( =phoneId0 ) ! -- Set all data icons to off ( SubscriptionManager.getPhoneId returned 0=0x00000000 )

1 个答案:

答案 0 :(得分:0)

也许您正在使用需要硬件级解码的编码格式,并且该解码器一次只能处理一次解码?也许还有一些其他资源一次只能处理一个音乐?