USB microphone (SSS1700 chip) fails with VOICE_COMMUNICATION on emteria Android 16
Hello,
I am experiencing a USB microphone issue on emteria Android 16 running on a Raspberry Pi CM4-based device.
The same hardware configuration, USB audio adapter, and application worked correctly on emteria Android 13.
The USB audio device is detected correctly by the kernel and exposes both playback and capture:
03-00: USB Audio : USB Audio : playback 1 : capture 1
The capture device supports:
S16_LE, mono, 48000 Hz
S24_3LE, mono, 48000 Hz
A regular Android audio recorder application can successfully record and play back audio using this microphone, although the recording quality is relatively poor. Therefore, the microphone hardware, USB audio driver, ALSA capture device, and the general Android recording path are functional.
However, microphone capture fails in our VoIP application using Linphone 4.4.7 and OpenSL ES. The application has the RECORD_AUDIO permission granted, and AppOps confirms that microphone access is allowed.
The application requests:
Audio source: AUDIO_SOURCE_VOICE_COMMUNICATION
Device: AUDIO_DEVICE_IN_USB_HEADSET
ALSA address: card 3, device 0
Sample rate: 48000 Hz
Channels: mono
Format: PCM 16-bit
The Android USB Audio HAL initially creates a valid 16-bit input configuration. However, while creating the audio patch, the USB device-side port is changed to PCM INT_24_BIT, while the application-side input remains PCM INT_16_BIT.
The relevant log is:
AHAL_ModuleUsb:
checkAudioPatchEndpointsMatch:
mismatch port configuration
source:
PCM INT_24_BIT
sink:
PCM INT_16_BIT
This is followed by:
setAudioPatch Failed
createAudioPatch Failed
startInput failed, status -38
AudioRecord: start status -38
The final AudioRecord diagnostics report:
source=AUDIO_SOURCE_VOICE_COMMUNICATION
sampleRate=48000
channels=1
encoding=AUDIO_FORMAT_PCM_16_BIT
lastError.at=start
lastError.code=-38
startCount=0
Therefore, this does not appear to be an application permission issue. Android allows microphone access and correctly selects the USB input device, but the input stream fails during audio patch creation because the USB Audio HAL attempts to connect a 24-bit device-side configuration to a 16-bit application-side configuration.
The regular AudioRecorder application works, while the VoIP application using AUDIO_SOURCE_VOICE_COMMUNICATION fails. This may indicate an issue specifically in the USB Audio HAL routing or format negotiation for the VOICE_COMMUNICATION input path.
Could you please check whether this is a known issue in emteria Android 16 and whether the USB Audio HAL should select the common 16-bit format supported by both endpoints instead of switching the USB device-side port to 24-bit?
Best regards,
Wojciech
Comments
More logs from adb logcat around the moment of using microphone device on attached file.
And one more thing. On Android 13 that USB audio device was exposed as a speaker device and there was ability to change the volume from the android dash bar. Now on Android 16 the very same device is recognized as a headphone device, and i thing the sound and microphone quality got worse. Could you help me with this case also? Thank you in advance.
We'll be happy to look into it, but I suggest fixing one problem at a time. Since you also opened a separate thread for a display problem, we need your answer there first please: https://forum.emteria.com/discussion/1490/7-inch-waveshare-rgb-lcd-hat-for-raspberry-pi-cm4
I understand that manually copying dtbo file solves the problem, but this is not a sustainable solution for everyone.
Once that is fixed, we'll take a look into audio routing.