1

I'm developing VoIP application using low latency fast path,the problem is that when I change the audio route to speaker I noticed that the recorder callback fires every 100ms instead of 5ms as it should work and the following error is generated:

E/ACDB-LOADER(  183): Error: ACDB AudProc vol returned = -19
D/audio_hw_primary(  183): enable_snd_device: snd_device(32: speaker-mic)
D/audio_hw_primary(  183): enable_audio_route: apply and update mixer path: low-latency-record
D/audio_hw_primary(  183): disable_audio_route: reset and update mixer path: low-latency-record
D/audio_hw_primary(  183): disable_snd_device: snd_device(32: speaker-mic)
E/AudioFlinger(  183): read failed: framesRead=-2147483631
D/audio_hw_primary(  183): select_devices: out_snd_device(0: none) in_snd_device(32: speaker-mic)
D/msm8974_platform(  183): platform_send_audio_calibration: sending audio calibration for snd_device(32) acdb_id(11)
D/        (  183): Failed to fetch the lookup information of the device 0000000B 
E/ACDB-LOADER(  183): Error: ACDB AudProc vol returned = -19
D/audio_hw_primary(  183): enable_snd_device: snd_device(32: speaker-mic)
D/audio_hw_primary(  183): enable_audio_route: apply and update mixer path: low-latency-record
D/audio_hw_primary(  183): disable_audio_route: reset and update mixer path: low-latency-record
D/audio_hw_primary(  183): disable_snd_device: snd_device(32: speaker-mic)
E/AudioFlinger(  183): read failed: framesRead=-2147483631
D/audio_hw_primary(  183): select_devices: out_snd_device(0: none) in_snd_device(32: speaker-mic)
D/msm8974_platform(  183): platform_send_audio_calibration: sending audio calibration for snd_device(32) acdb_id(11)
D/        (  183): Failed to fetch the lookup information of the device 0000000B 
E/ACDB-LOADER(  183): Error: ACDB AudProc vol returned = -19
D/audio_hw_primary(  183): enable_snd_device: snd_device(32: speaker-mic)
D/audio_hw_primary(  183): enable_audio_route: apply and update mixer path: low-latency-record
D/audio_hw_primary(  183): disable_audio_route: reset and update mixer path: low-latency-record
D/audio_hw_primary(  183): disable_snd_device: snd_device(32: speaker-mic)
E/AudioFlinger(  183): read failed: framesRead=-2147483631
D/audio_hw_primary(  183): select_devices: out_snd_device(0: none) in_snd_device(32: speaker-mic)
D/msm8974_platform(  183): platform_send_audio_calibration: sending audio calibration for snd_device(32) acdb_id(11)
D/        (  183): Failed to fetch the lookup information of the device 0000000B 
E/ACDB-LOADER(  183): Error: ACDB AudProc vol returned = -19
D/audio_hw_primary(  183): enable_snd_device: snd_device(32: speaker-mic)
D/audio_hw_primary(  183): enable_audio_route: apply and update mixer path: low-latency-record
D/audio_hw_primary(  183): disable_audio_route: reset and update mixer path: low-latency-record
D/audio_hw_primary(  183): disable_snd_device: snd_device(32: speaker-mic)
E/AudioFlinger(  183): read failed: framesRead=-2147483631
D/audio_hw_primary(  183): select_devices: out_snd_device(0: none) in_snd_device(32: speaker-mic)
D/msm8974_platform(  183): platform_send_audio_calibration: sending audio calibration for snd_device(32) acdb_id(11)
D/        (  183): Failed to fetch the lookup information of the device 0000000B 
E/ACDB-LOADER(  183): Error: ACDB AudProc vol returned = -19
D/audio_hw_primary(  183): enable_snd_device: snd_device(32: speaker-mic)
D/audio_hw_primary(  183): enable_audio_route: apply and update mixer path: low-latency-record
D/audio_hw_primary(  183): disable_audio_route: reset and update mixer path: low-latency-record
D/audio_hw_primary(  183): disable_snd_device: snd_device(32: speaker-mic)
E/AudioFlinger(  183): read failed: framesRead=-2147483631
  • Device : Nexus 5 Android 5.0.1
  • Native buffer size 240 samples (shorts)
  • Native frequency rate 48000 Hz Player preset :
    SL_ANDROID_STREAM_VOICE
  • Recorder Preset : SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION
  • AudioManager on MODE_IN_COMMUNICATION

It's important to note that if the audio route stays on headset it works fine. Is any one knows what the problem?

VitalyD
  • 289
  • 1
  • 15

1 Answers1

1

Your code works fine with headset tells me that, changing the route to your speaker is generating the delay.

OpenSL routes the audio playback to the speaker by default. Now when you set the streamType to SL_ANDROID_STREAM_VOICE it routes the audio to your headset. When you route the audio back to speaker, you might need to set the streamType to default and initialize the player again.

I don't know the exact reason, why your recorder callback is fired after 100ms instead of 5ms. But anyway, I think you've set the audio sampling rate of your device correctly.

And there's another thing to check is the buffer size. Yes 240 is okay. But you might try setting lower size as you need to fire the recorder callback often.

Hope that helps.

Community
  • 1
  • 1
Reaz Murshed
  • 23,691
  • 13
  • 78
  • 98
  • Thanks for the answer, the recorder fires every 5ms until I change audio route to speaker, so the recorder works fine until something wrong occurs. So you saying that I need to re-Initialize the player every audio route ? – VitalyD May 23 '16 at 19:01
  • Didn't understand. Sorry. What's your problem again? – Reaz Murshed May 23 '16 at 19:04
  • The problem is that when I change audio route to speaker, the far-end side can not hear me, since my recorder callback stops working. It happens only if I use fast path, meaning, only if I use native buffer size and sampling rate. – VitalyD May 23 '16 at 22:09