[Q] Need advice. USB hardware and latency - Android Q&A, Help & Troubleshooting

Greetings people. I'm a long-time developer, but have not touched Android development at all yet. I'm considering working on a product for musicians. It will be part hardware and part software. The hardware part will be some high quality inputs, and output, and a DSP. This will connect to a tablet via USB. The software will record audio stream(s) and do real-time processing ( eg add delay, reverb, etc ).
I've read in quite a few places that Android is completely unsuitable for real-time audio work There are serious latency issues, for example. So, I've already been sufficiently scared away from attempting to use Android's audio subsystem. Realistically ... I don't want it anyway ... better to push streams back out the USB port to our dedicated hardware - I can't imagine serious musicians relying on a tablet's built-in sound card for either input or output.
So ... the question now becomes ... can I realistically expect to get decent latency access to USB devices on standard, unrooted, unmodified devices? This leads to the next question ... assuming we will be writing the USB driver in C, how do we go about getting it onto devices? Can applications deployed via the market ( play store ... whatever ) include kernel modules? We'd need root access for this, right? So does that make C kernel modules not an option? Accessing the USB port from Java is NOT an option, as we're after low latency, high bandwidth access. In fact we'd implement both the USB driver and audio processing engine in C. We'd just do the UI in Java.
Does anyone have any experience and / or advice? Any help greatly appreciated. I'd love to be able to provide some decent audio apps for Android to wipe the smirks of Apple users' faces

I don't know about latency on android, but you can't manipulate kernel unless you have unlocked bootloader and that means some serious rooting. So if you want to work on stock ROMs and kernels, there is no way you could succeed.

Doh! Yeah ... makes sense I guess. I can see why there are no audio apps for Android now I'll have a quick look at accessing the USB port from Java, but somehow I think this will never give the latency and bandwith I need ...
Thanks for your reply.

Related

USB DAC's / ALSA / snd-usb-audio / USB sound card

This is something that android needs. USB DAC support.
I've been doing research and have compiled my own kernel for testing. There is something called the Advanced Linux Sound Architecture which has USB sound card support. However, when enabling this on a kernel I compiled, it seems Android totally ignores it. Once more, when I try to activate the module using the command modprobe snd-usb-audio it just completely fails.
When I plug my device in, I can see that the system is recognizing the device in proc/asound and sys/bus/USB/devices/2-1 and also dev/snd
The wiki https://wiki.archlinux.org/index.php/Alsa#Making_sure_the_sound_modules_are_loaded also tells me that everything is OK in dev/snd
The only chance to get this working is to use asoundconf somehow. I have no idea how to do this.
In my opinion, Android totally needs USB sound card support standardized on all Stock kernels and ROMS so that its users can use USB sound card's (USB DAC'S) as they wish.
There are other sites which have mentioned USB DAC support on Android and they may be useful for further research:
http://www.head-fi.org/t/595071/and...w-to-increase-the-issues-priority-with-google - Page 6 onwards seems interesting
http://www.slatedroid.com/topic/29289-usb-audio-cards-support-drivers-and-libs/
http://code.google.com/p/android/is...&colspec=ID Type Status Owner Summary Sta rs - Please star this issue
I have to say, USB Audio support for Jelly Bean was a massive dissapointment since the DAC has to support the ADK. When I tried my standard DAC with Jelly bean, it did not work.
I just wish more custom kernels could support this and wish Google would support it too.
Sent from my Xoom using xda premium
USB audio works on my Allwinner A10 tablet witn "Unofficial CyanogenMod 9 for many AllWinner A10 tablets" firmware from Christian Troy
Proof that USB audio can work on android.
Sent from my Xoom using xda app-developers app
i need usb audio in ics
ntm12 said:
USB audio works on my Allwinner A10 tablet witn "Unofficial CyanogenMod 9 for many AllWinner A10 tablets" firmware from Christian Troy
Click to expand...
Click to collapse
I,m happy to know that i's go right in your tab. So i ask if u can help to make my tab fuctioning in usb-audio mode.
I have a chinese comp rk29 model.
Cheers thnk u
External USB DAC use from Android GT-i9250?
Hi There,
I am interested if you had any developments here with external USB DAC?
I have the Galaxy GT-i9250 and I would love to play music (44/16 or 96/24) files through an external USB DAC such that I bypass the phones internal DAC. Are there any advancements?
If so, how do I do it and what external DAC's do you recomend?
Thanks,
Asif.
asifmajid said:
Hi There,
I am interested if you had any developments here with external USB DAC?
I have the Galaxy GT-i9250 and I would love to play music (44/16 or 96/24) files through an external USB DAC such that I bypass the phones internal DAC. Are there any advancements?
If so, how do I do it and what external DAC's do you recomend?
Thanks,
Asif.
Click to expand...
Click to collapse
Unfortuantly, USB DAC functionality still seems to be severely limited despite support in Linux.
Many Developers focus on optimising a kernel for a specific ROM rather than adding features to the kernel to add functionality such as USB DAC's. I too would like support from developers to bring this forward as there are just a few devices out of hundreds of Android devices with some sort of USB DAC functionality as mentioned in previous posts. I also know that the Samsung Galaxy S3 has limited but native support for some USB DAC's.
I would recommend getting a popular USB DAC device because it would probably be a higher priority to developers to support. (because it would have more users).
From what I understand, USB DAC isn't a hard feature to implement. The problem lies in the fact that not enough people are asking for this functionality at the moment to develop it, beta test it and subsequently implement it.
Maybe, some time in the future (near future, I hope) we can enjoy this as a feature on our Android devices.
Sent from my Xoom using xda app-developers app
Hi !
Any news about it ?
We are sooo much to wait for this !!
Please devs, add it in your kernels !!
Very interesting. I have tried to enable CONFIG_SND_USB_AUDIO=y and CONFIG_USB_AUDIO=y, But it does not work.
Waiting for other Idea.
Few updates
I have a few updates here.
It appears that my HTC One X running Android Revolution HD 13.0 (Jelly Bean) has the drivers and loaded modules for snd_usb_audio. And when I plug my USB DAC into it. It recognizes it and automatically directs sound to it. This is good.
I've dived into why it works on the HTC One X and not on my Xoom and come across a folder called /proc/asound
This folder is to do with the ALSA (Advanced Linux Sound Architecture) and when I plug my USB DAC into my One X, it creates a folder called 'Headset' (since my USB DAC is a headset).
I've found folders named "snd_usb_audio" (or similar) in the following folder locations:
/sys/bus/usb/drivers/snd-usb-audio
/sys/module/snd_usb_audio
I just don't know how to add this gory stuff into another android device. This is what Im trying to do.
Im going to compile a kernel in the next few days to see if I get anywhere.
I have SGS3 and i tried to connect my old M-Audio Duo USB sound card via USB. The phone plays music thru it, but Inputs of the sound card is not recognized, phone still records by build in mics.
What i really need is portable stereo mic attached by USB for my phone so i can make studio quality recordings with it. Something like tascam did for iPhone:
http://tascam.com/product/im2/
If anybody knows some solution please post it here!
Same here, output works on my One X but not input. That's another key barrier to overcome.
Sent from my HTC One X using xda app-developers app
jamjame said:
Same here, output works on my One X but not input. That's another key barrier to overcome.
Sent from my HTC One X using xda app-developers app
Click to expand...
Click to collapse
If you'll figure out a way to make inputs work via usb that would be revolutionary development for android. I wounder why major companies didn't develop some device like that so far. There's demand for it obviously.
I badly want to see this feature figured out and added to CM10. I flashed drewgaren.com's JB TouchWiz rom last night just to get this feature, and I'm already sorely missing CM10.
I would be positively thrilled to see movement towards implementing this feature outside TouchWiz, would be delighted to help test it, and would even throw money at someone who could get it done for us.
djthread said:
I badly want to see this feature figured out and added to CM10. I flashed drewgaren.com's JB TouchWiz rom last night just to get this feature, and I'm already sorely missing CM10.
I would be positively thrilled to see movement towards implementing this feature outside TouchWiz, would be delighted to help test it, and would even throw money at someone who could get it done for us.
Click to expand...
Click to collapse
If anyone knows the ROM on which both Input and output (or at least input) from the soundcart works thru USB, please let me know.
"eXtream Software Development has released their app USB Audio Recorder PRO to the Play Store. It allows recording and playback using many standards compliant USB audio devices, a first for Android. By writing custom USB audio code, pro audio is now finally possible on millions of Android devices."
"The Android app USB Audio Recorder PRO allows you to record and playback audio using class-compliant USB audio devices on your Android phone or tablet! eXtream Software Development has written a custom USB audio driver from scratch...
Supported are mono and stereo streams, 16-bit and 24-bit and any sample rate (up to 192kHz) that the device provides..."
http://www.head-fi.org/t/595071/android-phones-and-usb-dacs/1020#post_8954935
http://www.extreamsd.com/USBAudioRecorderPRO/
https://play.google.com/store/search?q=usb+audio+recorder+pro
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
A USB audio source code:
http://www.alsa-project.org/main/index.php/Main_Page
https://github.com/sgs3/GT-I9300_Kernel/blob/master/sound/usb/card.c#L2
https://github.com/sgs3/GT-I9300_Kernel/tree/master/sound/usb
USB audio & Android
USB standard (audio, mass storage, etc.) driver supported on stock Galaxy S3 / Note2
"As long as the kernel on the Android device supported the USB standard driver of the hardware (mass storage, input, etc.), Android would be able to use it and therefore open up a new range of extra devices compatible with the system."
USB standard (audio, mass storage, etc.) driver not supported:
* Developing your USB standard (audio, etc.) driver at the kernel space
"However, there are many devices that have not been "compatible" from the beginning. For instance, let's say your common RFID reader. It most likely uses a USB-serial port and probably comes with a Linux or Windows driver as well as some software. Most Android tablets will come without the USB-serial driver for your RFID reader however.
Therefore, if you want to load your driver you will need to root your tablet, determine the version of your current kernel, find the kernel sources online, hope that everything compiles to have your driver ready and then load it onto your tablet. In the end, when you finally have your kernel driver running, you will be required to write C code as well as some JNI glue to communicate with your Activity or Service in Android.
All in all, this approach is not very straightforward.
* Writing your own USB "soft driver" at the user space
There is a very elegant solution to aforementioned problem.
It requires far less skills in hacking and porting than the mentioned approach. However, you will require some advanced knowledge in Android programming as well as some USB know-how.
You can write your own "soft driver" in Android. Since the USB Host API has been released, it is now possible to communicate with any USB device using the most commonly seen USB transfers (control, interrupt, bulk).
In the end, your result will be portable across all Android devices that have USB host enabled and have Android version 3.1+. Moreover, this solution does NOT require root access to the tablet or phone. It is currently the only viable solution that does not require the user to have any know-how of rooting/hacking the device and risk losing warranty in the process."
http://android.serverbox.ch/?p=549
I see that both the Android compatible DACs (V-MODA VAMP VERZA, XDUOO XP-1) and the USB Audio Recorder PRO app supports nearly the same devices.
Other than that I hear that the requirements are:
USB Host (Basically almost every newer device can do this)
USB OTG Cable (Who worries about a cable?)
1. Is this because of simply the CONFIG_USB_AUDIO parameter set to false? Shouldn't a mod like CyanogenMod enable this?
2. Or because V-MODA VAMP VERZA, XDUOO XP-1 are the only USB DACs to support the ADK interface in Jelly Bean ?
3. What exactly is the difference between the Verza, XDUOO and the other DACs? Why wouldn't any DAC be compatible through USB Audio in the linux kernel ?
I really wish to lift my Samsung Galaxy S2 sound quality, and I am ready to spend the money to make it sound good. But the Verza is too expensive for me and has few other outputs and inputs so I doubt the reuse for the crazy price. I simply can't trust XDUOO before they make an english website, god knows what will happen on warranty issues!
dezzadk said:
I see that both the Android compatible DACs (V-MODA VAMP VERZA, XDUOO XP-1) and the USB Audio Recorder PRO app supports nearly the same devices.
Other than that I hear that the requirements are:
USB Host (Basically almost every newer device can do this)
USB OTG Cable (Who worries about a cable?)
1. Is this because of simply the CONFIG_USB_AUDIO parameter set to false? Shouldn't a mod like CyanogenMod enable this?
2. Or because V-MODA VAMP VERZA, XDUOO XP-1 are the only USB DACs to support the ADK interface in Jelly Bean ?
3. What exactly is the difference between the Verza, XDUOO and the other DACs? Why wouldn't any DAC be compatible through USB Audio in the linux kernel ?
I really wish to lift my Samsung Galaxy S2 sound quality, and I am ready to spend the money to make it sound good. But the Verza is too expensive for me and has few other outputs and inputs so I doubt the reuse for the crazy price. I simply can't trust XDUOO before they make an english website, god knows what will happen on warranty issues!
Click to expand...
Click to collapse
Somehow, My Vamp Verza does not work with my New S4, but it worked with S3 and Note2 on Jelly bean.
lmk said:
Somehow, My Vamp Verza does not work with my New S4, but it worked with S3 and Note2 on Jelly bean.
Click to expand...
Click to collapse
I didn't expect that. However, someone has got it working with their FiiO E17 --http://www.head-fi.org/t/595071/android-phones-and-usb-dacs/2415#post_9485365 ..
Do you have i9505 or i9500 ?
And what ROM? latest stock?
lmk said:
Somehow, My Vamp Verza does not work with my New S4, but it worked with S3 and Note2 on Jelly bean.
Click to expand...
Click to collapse
Does your Vamp Verza work with your Galaxy S4 using USB Audio Recorder PRO?
There is a free trial version of USB Audio Recorder PRO?
https://play.google.com/store/apps/details?id=com.extreamsd.usbaudiorecorderpro
"From what I understand, USB Audio Recorder Pro app allows higher quality recordings to be played in their true hi-res quality because it bypasses a 16-bit/48kHz limitation in Android kernel. (The DX100 also does that with the iBasso software.) All other apps downsample to 16/48 before passing the signal to the external DAC like the Apex Glacier.
Besides that, I also find the app to output very natural sound. So I used the app quite a bit when I am in the mood for the best quality."
http://www.head-fi.org/t/595071/android-phones-and-usb-dacs/2475#post_9511194
Tried with audio pro, it does not work too. S4 shv300S 8 core exynos latest 4.2.2 updated last week in Seoul.

[Q] low OSC/Midi (no audio) latency possible?

Hello,
I'm new to the mobile development, but I have a computer science background. I want to do a concept for a real-time interface for audio interaction, so real low latency is essential. I have read a lot about this topic in the last week, but it's impossible to get a real overview in such a short time. So before I dig really deep I need to evaluate the feasibility from this project.
I've read a lot about the problems with Android and low audio applications and I know that iOS is way superior in this field, but I would prefer Android when it's possible. (I don't have a mac which is essential for developing iOS, and I just like the more 'open' Andoid more )
So my question are:
1. Is the bad low latency behaviour only related to actual audio buffer/processing, or does it affect midi or OSC only applications too? For me the interface is the important part - that means it's ok for me just to get midi/OSC commands which are processed in a separate PC.
2. I need a low overall latency (from the finger touch event to command output). Is this also a problem with Android compared to iOS?
kind regards,
audio developer

[Q] What is the state of external audio input on Android?

Hello,
I'm trying to get higher quality audio input (sample width and conditioning, don't care about sampling rate above 32k) than is available through the microphone jack and was looking for an overview of where the development of such capabilites stands today. From what I gather:
Android 3.1 (maybe 3.2) added some support for USB Audio, though I can find almost no details on the capabilities. I can't post links, but a post on computeraudiophile with google search terms "usb audio enabled galaxy s3" claims support for a bunch of USB DACs on the Galaxy S3, but there is no mention of using the ADC.
Android 4.1 added support for USB audio docks -- these are generally (as far as I can find) speaker systems with a USB cable -- which only support audio output.
Software such as USB Audio Recorder Pro can record from a number of devices but this is of no use to a developer wishing to get the data into a separate application.
Lots of devices have HDMI ports but I found nothing about anyone managing HDMI input.
I can't find any such device for Bluetooth, but also nothing suggesting that it isn't possible. If so, can anyone speculate on audio quality limitations?
Now, I understand that the vast majority of users who want USB audio want output so it can go to their speakers, but there are some who need the other direction (or both...). Can anyone more familiar with the subject comment on the state of external audio input on Android devices?
Thanks,
Ben

[Q] Send audio from Android to speakers

Hey folks,
I just finished my house and put speakers in each room. Right now I didn't bought any kind of receiver because I'm not sure what system I should choose, so I just wired the speakers (they all go to a single place in each room).
I'm looking for a way to stream audio from my Android devices to each room/speaker. I don't want to use a single app to send audio, because most local apps (I'm located in Romania) really don't have such features (Spotify has Google Cast support, but Zonga - what we use locally - doesn't). So I need something that basically "mirrors audio" from my device; this is also great when playing games on my tablet.
Here are my conclusions so far.
Bluetooth
Is compatible with basically every OS. I can just buy a BT audio receiver for each room. The problem is that I cannot send audio from a single device to more than one receiver. So for example if I want to send audio to my kitchen and living, there's no way of doing it with bluetooth.
Miracast / DLNA
Very hard to use. There's no "simple" way of connecting/reconnecting to a Miracast / DLNA receiver without going to Settings -> Display -> etc etc each time. I don't need video, just audio. Also I cannot send audio to multiple sources.
Google Cast
Very easy to use *if* the App you're using supports Google Cast. Unfortunately most of the local apps I'm using don't support Google Cast. Also I cannot send audio to multiple sources.
AirPlay
For an Apple use this would be the best solution. Unfortunately I couldn't find any way of "mirroring" audio from an Android device to my AppleTV without rooting the device. Also I cannot send audio to multiple sources.
Media-centers
I found a lot of media-center solutions, including Qualcomm AllPlay. The decent ones allow you to send audio to multiple rooms through WiFi and specific protocols. The issue is that all these solutions are proprietary and require you to install and use a single specific/proprietary app, which is - in the best scenario - limited to playing local content from your device.
So what I really need is a solution that (in the order of importance):
1) allows me to "audio-mirror" my devices (at least the ones using Android) with ease
2) allows me to stream audio to more than one room/receiver
3) doesn't costs a fortune (I'm ready to pay $500 for this, but not more)
What's your opinion on this? Is there any solution? Thanks!
No easy way.
RealAudiio streamer-player?
Private dancer (req. root on source) streams audio from android to dlna renderer.
Well, as stated previously I don't want to use a specific app, so I think that maybe the best solution would be bluetooth? If you know any other solutions please let me know.

Seeking a very specific remote-control software

Hi guys,
Nuno here.
I am seeking a software which will let me control my computer from my Android phone. However, there are some requirements which must be met by this software so it meets my needs. Here are the requirements I need:
1. Audio transfer: I need audio transfered from my computer to my phone. I don't care about the quality, the less latency the better.
2. Full keyboard support: Because of the fact that I am blind I control my computer exclusively from the keyboard, so I need a software which supports keyboards in full, so all keys are intercepted by my computer.
3. (Optional) self-hosted: it would be good if I could host the software on the master computer to which I will be connecting.
Thanks in advance for all the answers.

Categories

Resources