转自:android as a usb sound card · Issue #25 · xiongyihui/notes (github.com)

Android 里面是有USB Gadget支持的,可以模拟为各类USB Device,比如虚拟串口、声卡、网卡,也可以作为复合设备,像adb + mass_storage,或者 adb + audio_source (android作为麦克风声卡)

image

在adb shell中,可以通过一下命令使能 adb + audio_source 复合USB设备功能:

echo 0 > /sys/class/android_usb/android0/enable && echo "adb,audio_source" > /sys/class/android_usb/android0/functions && echo 1 > /sys/class/android_usb/android0/enable

Reference:

https://osmocom.org/projects/quectel-modems/wiki/Android_USB_Gadget
https://android.googlesource.com/kernel/msm/+/android-7.1.0_r0.2/drivers/usb/gadget/function/f_audio_source.c

Last modification:February 13th, 2021 at 08:17 pm