Reputation: 837
I am building an Android device based on the Qualcomm sdm845 SoC. For audio, I use a simple USB audio codec. On the development kit that came with the sdm845 SOM module however, they used the Qualcomm WCD9340 codec. My USB audio codec is actually a Teensy 3.2 (NXP Kinetis Cortex-M4) breakout with an I2S DAC and I2S microphones connected. When I connect this device on the USB port of the development kit (running a custom Android 9 BSP), I get audio I/O over USB. So the HAL support is there.
On my custom PCB carrying the same sdm845 SOM however, the USB audio device won't output any sound. On a Linux kernel level, it works fine using tinyplay and tinycap on an adb shell. So the hardware and kernel are good, the problem is likely in the Android HAL, that is probably still expecting the WCD9340.
I am looking for a place somewhere in the Android HAL where the actual mapping between Android and Linux device is done, or another way to force the USB audio card to become the primary output device.
There is an option in the device configuration to "TARGET_USES_AOSP_FOR_AUDIO", effectively removing all Qualcomm-specific audio implementations, but this also doesn't give me any results. Strange, because I have successfully been using the same USB audio codec with a vanilla AOSP build on Hikey960.
Does anybody have experience with this?
Upvotes: 0
Views: 1251
Reputation: 837
For what it's worth, here's how I ultimately hacked my way through this. Not production-ready by a landslide, but it did the job: I modified the Slimbus read and write calls in the WCD9340 kernel driver code so that they basically became stubs. After the stubbed initialization of the WCD9340 the USB audio codec takes over and performs audio I/O fine.
Upvotes: 0