Android native code not creating AudioRecord on Asus Tinkerboard 2S

73 views Asked by At

I am trying to use Picovoice on the Tinkerboard 2S and I am getting these logs when trying to initialise a process

2023-10-20 20:58:02.838   282-520   AudioFlinger            audioserver                          E  createRecord() getInputForAttr return error -38
2023-10-20 20:58:02.838  5915-5994  IAudioFlinger           com.hussell.dukebox                  E  createRecord returned error -38
2023-10-20 20:58:02.838  5915-5994  AudioRecord             com.hussell.dukebox                  E  createRecord_l(336073480): AudioFlinger could not create record track, status: -38
2023-10-20 20:58:02.838  5915-5994  AudioRecord-JNI         com.hussell.dukebox                  E  Error creating AudioRecord instance: initialization check failed with status -38.
2023-10-20 20:58:02.839  5915-5994  android.me...udioRecord com.hussell.dukebox                  E  Error code -20 when initializing native AudioRecord object.
2023-10-20 20:58:02.840  5915-5915  PorcupineManager        com.hussell.dukebox                  E  ai.picovoice.android.voiceprocessor.VoiceProcessorStateException: Audio recorder did not initialize successfully. Ensure you have acquired
                                                                                                    permission to record audio from the user.

Firstly, I have the right permissions in the Manifest and I have validated that the permissions are enabled for audio recording through the device as well, as well as requesting the permission at runtime when the app is first installed.

I have gone through the Java source code and can't see why it'd be wrong there, and it does seem to be in the native libraries. I really don't know what could be causing this. I have tried to initialise the process at different times, well after everything else in the system is initialised, but no luck. I have tried a few different versions of Android for this board, but still not luck there.

I have also asked this question in the TinkerBoard forums, but I am asking here since maybe it is more generic to the OS.

Update: I have noticed that I do not have pcmC0D0p in the audio devices directory.

crw-rw---- 1 system audio 116,   6 2013-01-18 08:50 controlC1
crw-rw---- 1 system audio 116,   8 2013-01-18 08:50 controlC2
crw-rw---- 1 system audio 116,   5 2013-01-18 08:50 pcmC1D0p
crw-rw---- 1 system audio 116,   7 2013-01-18 08:50 pcmC2D0p
crw-rw---- 1 system audio 116,  33 2013-01-18 08:50 timer

Is it safe to just change the naming of these to see if it fixes it?

0

There are 0 answers