Soloud + OpenSLES backend, inactive audio track

0

I'm using soloud as a audio lib, with opensles backend for playback. Everything seems to be working perfectly, but only 9/10 times. On those semi rare occasions, startup seems normal, but the app has no audio. Trying to change volume on active app brings up Ringtone volume (instead of Media volume). "Fliger" output shows this for my app:

working:

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

broken:

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

I've tried playing with buffer sizes (following the android guidelines for low latency) but to no effect.

I know it's a hard stretch, but does anyone have any ideas what to look at?

android
audio
asked on Stack Overflow Jul 18, 2018 by vesoljc • edited Jul 18, 2018 by Phantômaxx

1 Answer

1

Meh, i found the issue :) thread startup was to slow, and sles callback got triggered before thread pooling was initiated.

answered on Stack Overflow Jul 18, 2018 by vesoljc

User contributions licensed under CC BY-SA 3.0