I'm attempting to use AudioRecord
with AudioSource.VOICE_DOWNLINK
on Nexus 5X, Android 7.1 (my own build from AOSP).
I'm already past the permissions stage - moved my APK to privileged apps, made an adjustment to AudioRecord
in Android source to stop throwing an exception about this source.
Now I'm getting empty recording buffers during a phone call.
I know that there are a lot of call recording apps, and they work on other devices. I've also seen certain apps that can perform some hack on a rooted N5 and make it work.
I wish to achieve the same on Nexus 5X - ANY adjustment is OK for me, including changing Android version, modifying Qualcomm drivers, device configuration files, etc. - basically anything that can be achieved in a custom ROM.
I've tried messing around with platform code - hardware/qcom/audio/hal/voice.c, especially the function voice_check_and_set_incall_rec_usecase
, but could not make sense out of it so far.
Also checked device/lge/bullhead/mixer_paths.xml, found there's a section related to call recording:
<!-- Incall Recording -->
<ctl name="MultiMedia1 Mixer VOC_REC_UL" value="0" />
<ctl name="MultiMedia1 Mixer VOC_REC_DL" value="0" />
<ctl name="MultiMedia8 Mixer VOC_REC_UL" value="0" />
<ctl name="MultiMedia8 Mixer VOC_REC_DL" value="0" />
<!-- Incall Recording End -->
But I also couldn't make sense out of it or how it can be helped.
Not sure if it is a Nexus 5 specific issue but usually the class used to record calls is
MediaRecorder
. Have you tried to replaceAudioRecorder
by aMediaRecorder
?Based on this stack-overflow question, I think you could try the following code based on Ben blog post:
In this sample, I've used
MediaRecorder.AudioSource.VOICE_CALL
but you can test other options likeMediaRecorder.AudioSource.VOICE_COMMUNICATION
and also the microphone just to see if there are any hardware issues on your phone.