我将soloud用作音频库,并使用opensles后端进行播放。一切似乎都运行良好,但只有9/10次。在那些很少见的情况下,启动似乎很正常,但是该应用程序没有音频。尝试在活动应用程序上更改音量会提高铃声音量(而不是媒体音量)。 “ Fliger”输出显示了我的应用程序:
工作:
Output thread 0xf2540000 type 0 (MIXER):
Thread name: AudioOut_6
I/O handle: 6
TID: 31533
Standby: no
Sample rate: 48000 Hz
HAL frame count: 960
HAL format: 0x1 (pcm16)
HAL buffer size: 3840 bytes
Channel count: 2
Channel mask: 0x00000003 (front-left, front-right)
Format: 0x1 (pcm16)
Frame size: 4 bytes
Pending config events: none
Output device: 0x3 (EARPIECE|SPEAKER)
Input device: 0 (NONE)
Audio source: 0 (default)
Normal frame count: 960
Last write occurred (msecs): 7
Total writes: 858683
Delayed writes: 0
Blocked in write: yes
Suspend count: 0
Sink buffer : 0xf59e4000
Mixer buffer: 0xf27f6000
Effect buffer: 0xf27e4000
Fast track availMask=0xfe
AudioStreamOut: 0xf5982e70 flags 0x2 (PRIMARY)
Thread throttle time (msecs): 12438
AudioMixer tracks: 0x0000000b
FastMixer not initialized
Stream volumes in dB: 0:-24, 1:-19, 2:-22, 3:-22, 4:-22, 5:-22, 6:0, 7:-6, 8:-19, 9:-96, 10:-22, 11:0, 12:0
Normal mixer raw underrun counters: partial=0 empty=0
3 Tracks of which 1 are active
Name Active Client Type Fmt Chn mask Session fCount S F SRate L dB R dB Server Main buf Aux Buf Flags UndFrmCnt
0 no 31508 1 00000001 00000003 2643 24000 S 1 48000 0 0 00008BAB 0xf59e4000 0x0 0x601 725
1 no 1480 1 00000001 00000003 2801 10081 S 1 44100 -inf -inf 00002761 0xf59e4000 0x0 0x600 0
3 yes 903 3 00000001 00000003 2824 1924 A 3 48000 0 0 00032A00 0xf59e4000 0x0 0x000 0
0 Effect Chains
断:
Output thread 0xf2540000 type 0 (MIXER):
Thread name: AudioOut_6
I/O handle: 6
TID: 31533
Standby: yes
Sample rate: 48000 Hz
HAL frame count: 960
HAL format: 0x1 (pcm16)
HAL buffer size: 3840 bytes
Channel count: 2
Channel mask: 0x00000003 (front-left, front-right)
Format: 0x1 (pcm16)
Frame size: 4 bytes
Pending config events: none
Output device: 0x3 (EARPIECE|SPEAKER)
Input device: 0 (NONE)
Audio source: 0 (default)
Normal frame count: 960
Last write occurred (msecs): 141220
Total writes: 858467
Delayed writes: 0
Blocked in write: no
Suspend count: 0
Sink buffer : 0xf59e4000
Mixer buffer: 0xf27f6000
Effect buffer: 0xf27e4000
Fast track availMask=0xfe
AudioStreamOut: 0xf5982e70 flags 0x2 (PRIMARY)
Thread throttle time (msecs): 12428
AudioMixer tracks: 0x0000000b
FastMixer not initialized
Stream volumes in dB: 0:-4.7, 1:-19, 2:-22, 3:-22, 4:-22, 5:-22, 6:0, 7:-6, 8:-19, 9:-96, 10:-22, 11:0, 12:0
Normal mixer raw underrun counters: partial=0 empty=0
3 Tracks of which 0 are active
Name Active Client Type Fmt Chn mask Session fCount S F SRate L dB R dB Server Main buf Aux Buf Flags UndFrmCnt
0 no 31508 1 00000001 00000003 2643 24000 S 1 48000 0 0 00008BAB 0xf59e4000 0x0 0x601 725
1 no 1480 1 00000001 00000003 2801 10081 S 1 44100 -inf -inf 00002761 0xf59e4000 0x0 0x600 0
3 no 748 3 00000001 00000003 2813 1924 S 1 48000 0 0 00000B40 0xf59e4000 0x0 0x600 2886
0 Effect Chains
我尝试过使用缓冲区大小(遵循低延迟的android准则),但是没有效果。
我知道这很艰难,但是没有人知道要看什么吗?
答案 0 :(得分:0)
嗯,我发现了问题:) 线程启动速度变慢,并且在启动线程池之前触发了sles回调。