4

A lot of screenshots in the Internet mention a 'audio source' USB configuration for Android. For example, this one from Google:

However, I cannot see this option with my SM-A510F with Android 9 (LineageOS 16).

Is there something I can do to enable it? Is it definitively gone from Android?

  • 1
    You do realize that the Samsung SM-A510F is from 2016 and has a headphone jack so it is unlikely to have the drivers for USB Audio. Otherwise you should show what you see on your device. – Morrison Chang May 24 at 21:18
  • 3
    Based on some reports, the Audio Source option was removed since Android 9 (ref: XDA Forum, Reddit) – Andrew T. May 24 at 22:41
  • @AndrewT. > Thank you for the links, so I guesse there is no official communication about this. – azmeuk May 25 at 7:01
5

Android devices can work in USB host or device mode. Host is the one which controls USB communication. PCs mostly operate in host mode. Device is the one which is being powered and controlled by the host. Flash drive is a common example of USB device. Linux/Android kernel supports device mode through different gadget drivers. UMS, MTP, ADB are different gadget modes on Android devices.

Audio over USB in Device Mode

On Android devices, technically it's possible to stream Audio over USB both in host and device mode. Since Android 4.1 the latter mode is “provided by Android Open Accessory (AOA) 2.0 and provides limited audio capability”. It uses the USB Audio Gadget Driver in kernel (built with CONFIG_USB_AUDIO option) and the accessories supporting AOAv2 protocol are built using Accessory Development Kit (ADK). Custom Accessories page states:

AOA protocol specifies how an accessory can establish communication with an Android device via USB. Due to the low power output of Android devices, AOA requires the accessory to act as a USB host, meaning the connecting accessory must power the bus.

But as per official documentation:

Accessory mode audio has not been widely adopted, and is not currently recommended for new designs.

And the AOA protocol documentation warns:

Caution: AOAv2 audio support has been deprecated in Android 8.0.

It means Android 9+ devices won't be able to function in device mode while streaming audio over USB. So the Audio Source USB configuration option is no more there.

Audio over USB in Host Mode

However Android devices support audio peripherals in host mode (kernel must be built with CONFIG_SND_USB_AUDIO). Since AOA is specific to Android, such accessories aren't usable with other hosts like PCs. So there was a demand from audio peripheral manufacturers, device OEMs and ROM developers community to support standard USB audio out capability in host mode (e.g. see this, this and this). Support for a subset of USB audio class 1 (UAC1) features was added in Android 5.0.

USB Device classes specify the standard protocols for USB peripheral functions so that the host can inter-operate with them without requiring any hardware-specifc driver (i.e. in driverless mode). USB Mass Storage (UMS) is a common example. All Mass Storage Class (MSC) compliant thumb drives work on all OSes including Linux, Android and Windows, irrespective of the device vendor. In the same way the USB audio peripherals which are USB Audio Class 1 compliant work with Android devices like on any other USB hosts e.g. PCs.

So host mode USB audio covers wide range of USB-based peripherals including the headsets that follow the USB headset specification.

When a UAC1 compatible peripheral device (like a DAC) is connected to USB port on Android device, digital audio is automatically routed to that peripheral. However if an app wants to use advanced USB host APIs to interact with the peripheral (and not simply the audio routing) , it's possible to Disable USB audio routing in Developer Options.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.