USB audio in Lollipop

954 views
Skip to first unread message

Felix Homann

unread,
Oct 20, 2014, 10:26:08 AM10/20/14
to andro...@googlegroups.com
Hi Glen,
Now that Lollipop is announced and a new set of preview images is available can you shed some light on the feature set we can expect on Lollipop's USB audio support?

I see that at least the Nexus 7 preview still uses a 3.4.0 kernel which is pre-historic when it comes to USB audio support. It lacks the complete rewrite of the UAC2 code, lacks support for standard compliant devices using implicit feedback, latency is so much better with modern kernels etc. Have you at least backported the USB audio stuff to the ancient Android kernel? Or aren't you using the mainline kernle support for USB audio devices at all?

BTW, where can I get the sources for the kernel used in Android 5.0 preview?

Moreover, on the Android user space side I can't see any controls for my USB audio devices on the Android 5.0 preview. Is this going to change with the final version (probably not...). E.g. no volume control means no sound means USB audio support not usable :-(

How are we supposed to control the volumes of our professional USB audio interfaces, how shall we control their respective effect units, sample rates etc.
I'm actually worrying that the USB audio support we get with 5.0 will still not be usable with professional audio gear.

Looking forward to your comments.

Kind regards,
Felix

Davy Wentzler

unread,
Oct 21, 2014, 7:10:40 AM10/21/14
to andro...@googlegroups.com
IIRC, Android USB audio device support does not use ALSA or anything from Linux, so I doubt the kernel version matters.
Unfortunately, we cannot get any of our USB devices working with playback and recording simultaneously and get lots of errors like slow playback and glitches in other situations, so it doesn't look well. (and yes, we also tested in apps that are not ours..).

Kind regards,

Davy
eXtream Software Development

Felix Homann

unread,
Oct 22, 2014, 8:55:08 AM10/22/14
to andro...@googlegroups.com


Am Dienstag, 21. Oktober 2014 13:10:40 UTC+2 schrieb Davy Wentzler:
IIRC, Android USB audio device support does not use ALSA or anything from Linux, so I doubt the kernel version matters.

Oh, I didn't know this. Are you sure? This would mean a *lot* of unneccesarily duplicated work and trouble.

Regards,
Felix

mic _

unread,
Oct 22, 2014, 9:40:59 AM10/22/14
to andro...@googlegroups.com
>IIRC, Android USB audio device support does not use ALSA or anything from Linux, so I doubt the kernel version matters.

The last time I worked with USB audio on Android, Google's implementation was using tinyalsa (see https://android.googlesource.com/platform/hardware/libhardware/+/master/modules/usbaudio/audio_hw.c).

And Qualcomm's implementation (which also included support for device-mode USB accessories, recording, etc) looked something like this:

App
 |
 v
OpenSL ES
 |
 v
AudioTrack
 |
 v
AudioFlinger
 |
 v
Audio HAL -> dummy output device driver
                      |
                      v            
                     DSP
                      |
                      v
Audio HAL <-  dummy input device driver
 |
 v
ALSA user-space
 |
 v
USB audio driver


--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk.
For more options, visit https://groups.google.com/d/optout.

Glenn Kasten

unread,
Oct 27, 2014, 9:19:40 PM10/27/14
to andro...@googlegroups.com
Felix, Davy, and mic ...
Thanks for your questions and feedback about the initial support for USB host-mode audio in Android 5.0.
The source code has not yet been released to AOSP; when it is, it should be easier to discuss the details here.
I'll make a note to self to get back to this thread !
Thanks again,
Glenn


On Wednesday, October 22, 2014 6:40:59 AM UTC-7, mic wrote:
>IIRC, Android USB audio device support does not use ALSA or anything from Linux, so I doubt the kernel version matters.

The last time I worked with USB audio on Android, Google's implementation was using tinyalsa (see https://android.googlesource.com/platform/hardware/libhardware/+/master/modules/usbaudio/audio_hw.c).

And Qualcomm's implementation (which also included support for device-mode USB accessories, recording, etc) looked something like this:

App
 |
 v
OpenSL ES
 |
 v
AudioTrack
 |
 v
AudioFlinger
 |
 v
Audio HAL -> dummy output device driver
                      |
                      v            
                     DSP
                      |
                      v
Audio HAL <-  dummy input device driver
 |
 v
ALSA user-space
 |
 v
USB audio driver

On Wed, Oct 22, 2014 at 2:55 PM, Felix Homann <showlabor.felixhomann@gmail.com> wrote:


Am Dienstag, 21. Oktober 2014 13:10:40 UTC+2 schrieb Davy Wentzler:
IIRC, Android USB audio device support does not use ALSA or anything from Linux, so I doubt the kernel version matters.

Oh, I didn't know this. Are you sure? This would mean a *lot* of unneccesarily duplicated work and trouble.

Regards,
Felix

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+unsubscribe@googlegroups.com.

Glenn Kasten

unread,
Nov 4, 2014, 11:21:02 AM11/4/14
to andro...@googlegroups.com
The documentation for USB host mode audio is now published here:
    http://source.android.com/devices/audio_usb.html
It should answer many of the questions above.

The source code pathname for the USB audio hardware abstraction layer (HAL) is included in that article.
The 5.0 source code push has not yet been announced yet at android-building group as far as I know.
I expect that should happen soon, but I don't have a date.

There was a related question about isochronous mode at this thread:
   https://groups.google.com/forum/#!topic/android-building/En61B4_KkAQ
The answer is that Android host mode USB audio is layered on top of ALSA
(via the tinyalsa user mode library), and ALSA supports USB audio interfaces in isochronous mode.
So although android.hardware.usb.UsbConstants says "currently not supported"
for isochronous mode, this limitation does not impact the audio path.

Please let me know if you have any further questions or comments on the USB host mode audio  implementation.

Davy Wentzler

unread,
Nov 4, 2014, 11:36:49 AM11/4/14
to andro...@googlegroups.com
Hi Glenn,

Thanks for that. One comment: synchronous mode IS used for some USB audio devices and does not use a fixed byte count per packet IMHO. If the sample rate is 44100Hz, then you still require 44 frames and 45 frames sometimes. The only thing is that it uses the clock of the USB bus to synchronize to, but you can still select the sample rate on the device.

Kind regards,

Davy
eXtream Software Development


--
You received this message because you are subscribed to a topic in the Google Groups "android-ndk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-ndk/LLZj9hhCXe0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-ndk...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages