Android and USB audio - Android Software/Hacking General [Developers Only]

In have a question about Android and how it handles USB audio. I know that USB has a unified audio layer that is standardized and requires little in order to be seen and operated by the os. Its that reason why most usb audio class devices are simply plug and play, however some devices require add'l drivers for extra fucntions, i.e. dsp functions. What I'm trying to understand is how Android handles usb audio, does it conform to usb audio class stipulations as well, so audio devices are generally plug and play, or is there something extra that would be required?
I'm asking because I hope to get a G-Tablet this Xmas and use it in my car. I could just use the analogue outs but I want something a bit more robust, and was hoping to get an external usb audio device with multiple outputs. Maybe write a driver if needed depending on the complexity, of course. any help would be appreciated.

USB audio works on my Allwinner A10 tablet witn "Unofficial CyanogenMod 9 for many AllWinner A10 tablets" firmware from Christian Troy

Related

[Q] USB sound card on Android?

I have a Android pad running 2.1 and it has 2 x USB ports and a lousy audio out (3.5 Jack).
I was wondering if USB soundcards work on Android? I am under the impression it is plug&play in linux, and that android uses the same audio driver? (just not via USB).
Beeing able to use a USB soundcard with propper sound would greatly improve sound quality (I want to use my pad in my car) :/
+1
I also want to know about USB sound cards support under Android. I have SB Live 24 (USB) and it works with my ARM-based Asus Wi-Fi router, but what about Android 2.2 and MIDs with USB-host port? ;-)
Anyone tried it?
It could be possible
Any update on this thread, would like to get this for my asus transformer if anyone can confirm it works. http://www.asus.com/Multimedia/Audio_Cards/Xonar_U3/#overview
It could be possible!
I tray it on acer iconia tab a500 and noting happend.
It not working.
It maybe need a driver but i don't see any driver anywere
:-(
USB audio in Android progress
Just for note, it works! I recently added self-compiled snd-usb-audio modules to allwinner based tablet. Found corresponding /dev/snd/* devices. Hard part is to add switch to USB audio to java, if there are no full alsa support in ROM. If alsa used, I need only edit /etc/asound.conf ;-)
tsynik said:
Just for note, it works! I recently added self-compiled snd-usb-audio modules to allwinner based tablet. Found corresponding /dev/snd/* devices. Hard part is to add switch to USB audio to java, if there are no full alsa support in ROM. If alsa used, I need only edit /etc/asound.conf ;-)
Click to expand...
Click to collapse
could you give some more details on how this was done?
USB OTG gets mouse/keyboard/mass storage working, but USB soundcard doesn't get sound through it (though the card is receiving power) and I cant see a way to check if it can see the device.
the USB soundcard I'm using was seen by my linux pc (kernel 3.0.0-15) straight away no drivers or config needed.
Here is a what I found on USB AUDIO output with Android (maybe it makes sense to put and update this table to the first topic)
NOTE: as of now SOME (not all!) USB AUDIO Android support implementations stream data through Android MUX that disturbs the original PCM stream for changing volume which means re-sampling original media, but also limited to 44.1kHz(some 48) 16 bit, so for SOME Android:
1) max all your volume controls while using external DAC
2) there is no reason to have / use DAC with higher rates then 44.1/16
3) there is no reason to have / use files of more then 44.1/16 quality. Trying to play 96kHz 24bit file will result in forcing Android to re-sample it on the fly with limited resources and not perfect algorithms leading to degrading output quality lower then proper done in studio or desktop 44.1/16!
There might be a way bypassing the Android layer and going right to ALSA you can do 24 bit.
If you specify a hardware device ("hw:0") in ALSA you can bypass any potential sample conversions.
*there is way around it in linux ALSA http://blog.agdunn.net/?p=434 but i have not seen such for Android
Supporting Devices
---------
Galaxy S III $700 Android phone
ARCHOS G9 $250+ Android tablet (looks like the key is OMAP chipset kernel drivers)
Squeezebox Touch $250 - propriatary logitech linux box
Ainol Novo 7/8 Advance 8gb 100$ Android tablet or Allwinner with a modded Android kernel
Nook Touch with custom rom
any A10 Android tablet http://www.slatedroid.com/topic/33373-rom-cm9-nightlies/
* Hyundai A7HD tablet with Cm9
* Mediacom 907c, Momo11 Bird, JXD S9000, Eken A90
* Visture V3
* Mediacom 910i, Teclast A10t
* ICOO D90W
* CEMA10N7 "unknown" device
* Bmorn V99
* Mediacom 711i, Momo9
* Protab2XXL
* Sanei N83
* Hyundai A7HD
* MOMO9 needs
http://forum.xda-developers.com/showthread.php?p=22280857#post22280857
http://www.slatedroid.com/topic/29289-usb-audio-cards-support-drivers-and-libs/
. B&N Nook Colour with a modded Android kernel
http://forum.xda-developers.com/showthread.php?t=1459892
. WitsTech A81G with a slightly modded Android kernel
http://android.modaco.com/topic/343858-external-usb-devices/page__st__20
Suported DACs:
for Galaxy S III
List of USB DACs with known USB controller that interwork with Samsung Galaxy S III for the time being:
+ AMB Labs Gamma2 with USB controller TI Burr-Brown PCM2707
+ FiiO E7 with USB controller TI Burr-Brown PCM2706
+ HifiMan Express with USB controller TI Burr-Brown PCM2702
+ Topping TP30 with USB controller TI Burr-Brown PCM2704
+ ODAC Tenor TE7022
List of USB DACs with known USB controller that don't interworking with Samsung Galaxy S III for the time being:
. FiiO E17 with USB controller Tenor TE7022
. iBasso D6 with USB controller TI TAS1020B
. Grant Fidelity TubeDAC-11 with USB controller Tenor TE7022
Hegel HD20 with USB controller Tenor TE7022 has also some issue
Audiotrak Prodigy Cube with USB controller Tenor TE7022
for Archos G9
+FiiO E17
+BEHRINGER UCA222
- E10 not supported
for Ainol Novo 7/8 Advance
+FiiO E7
+Burr-Brown PCM2704 USB DAC
+Creative
for Squeezebox Touch
+ Red Wine Audio Isabellina and an
+ HRT Music Streamer II+.
B&N Nook Colour
+Logitech DAC A-5572A |
+Beresford TC-7520SE Caiman |
+FiiO E7
B&N Nook Touch
+C-Media $5 USB adaptor
+Lexicon Alpha 24 bit adaptor
please reply here if you find more info on DAC/devices suppot so i'll keep this post up to date.
I use either a C-Media $5 USB adaptor or a Lexicon Alpha 24 bit adaptor on my Nook Touch.
By bypassing the Android layer and going right to ALSA I can do 24 bit field recording.
If you specify a hardware device ("hw:0") in ALSA you can bypass any potential sample conversions.
Renate NST said:
I use either a C-Media $5 USB adaptor or a Lexicon Alpha 24 bit adaptor on my Nook Touch.
By bypassing the Android layer and going right to ALSA I can do 24 bit field recording.
If you specify a hardware device ("hw:0") in ALSA you can bypass any potential sample conversions.
Click to expand...
Click to collapse
why you are sure that it is 24 bit coming out of Nook Touch tablet?
what ROM / kernel you are using?
where you specify a hardware device? this should be done editing config file or there is a menu items in settings interface?
I'm sure that it's 24 bit because I can look at the file and see that all the bits are exercised.
Moreover, since the microphone only hits about -30dBFS, I have to crank the gain.
Compared to a 16 bit recording (which is effectively 11 bits when using 30 dB gain), the 24 bits (effectively 19 bits) sounds much better.
The Nook doesn't have any builtin audio, except for Dummy which is hw:0
My application uses hw:1
There's really no need to select the audio adapter because there is usually just the one.
Renate NST said:
The Nook doesn't have any builtin audio, except for Dummy which is hw:0
My application uses hw:1
There's really no need to select the audio adapter because there is usually just the one.
Click to expand...
Click to collapse
I am a bit confused.
can you explain step by step how to archive it on stock NOOK touch?
1)install custom ROM with kernel and USB host support?
2)install specific media player? which one do you use?
3)plug in USB DAC, player will use it as output by default so no hw:0 tweaking needed?
The whole USB host mode on Nook Touch is covered here.
You will need a modified kernel.
The stock mediaplayer works but there is an unresolved bug that you need a little utility app to get over.
You need to put in an asound.conf
Renate NST said:
The stock mediaplayer works but there is an unresolved bug that you need a little utility app to get over.
You need to put in an asound.conf
Click to expand...
Click to collapse
So putting asound.conf from the thread you'd mention will solve it and it will be transparent output 24bit 96khz?
can I use other media player such as Astro or PoweAMP?
The Android layer only supports 16 bits.
The MediaPlayer can not play 24 bit files.
To do anything 24 bit you need an external USB adaptor that supports it and an application that directly uses ALSA.
I believe that there are other 24 bit apps on the market.
24 bit is really only useful for recording when there is a large dynamic range.
Renate NST said:
The Android layer only supports 16 bits.
The MediaPlayer can not play 24 bit files.
To do anything 24 bit you need an external USB adaptor that supports it and an application that directly uses ALSA.
I believe that there are other 24 bit apps on the market.
24 bit is really only useful for recording when there is a large dynamic range.
Click to expand...
Click to collapse
I think we are talking about different use-cases.
My question was on plugging external 24bit/96kHz capable DAC (not ADC) to Android device and playing high quality 16bit/44.1 and higher .flac files using one of android players through that external DAC.
As i understand you've done it at least for 16bit DAC? and even mentioned that there is a way to bypass Android layer to get up to24 bit transparently out to the DAC and can highlight the steps for Nook Thouch to archive it.
Can you share your experience, settings and apps you've used?
Most USB adapters you will find are 16 bit.
To get 24 bit, you have to go to a "pro" interface, M-Audio, Lexicon, whatever.
ALSA supports 24 & 32 bits, but does not directly support MP3 or FLAC.
The Android layer supports MP3 (maybe FLAC?) playback, but not record.
You can get 24 bit playback just by using the ALSA utility aplay on PCM files only.
I do not know what there is on the market for 24 bit record/play.
You'd need an app with a JNI interface to the ALSA library.
I wrote a recording application for the Nook Touch that does that.
I cited it in the thread mentioned.
Renate NST said:
Most USB adapters you will find are 16 bit.
Click to expand...
Click to collapse
Just got stock Nook Simple Touch. Can you guide what steps to do to let it play music to external DAC?

Hacking MTP or MSP to spoof file-system for USB Audio out

I'm in the process of learning the Android HW & SW architecture. I'm trying to think of some interesting projects that I can mess around with to help me learn. (I'm experienced in electronics, software and firmware dev.)
Anyway, one thing I've been thinking about is the need for real-time audio over USB using the current defacto standards; MTP and Mass-Storage. The real target audience here is people who have a "USB enabled" car stereo.
My idea:
Implement some layer of abstraction between the protocol on the Android device and the file system that it exposes to the USB host. This would really be a "Fake file-system" that acts as a WAV buffer for the Android audio out. This would provide some amount of universality, because almost all of those devices support WAV. (Plus, it would otherwise potentially require trans-coding...)
I know that capturing the audio outputs presents a challenge. Perhaps the Bluetooth Audio PCM stream could be captured and converted to wave by creating a "virtual Bluetooth headset" to pair to. (Not optimal...but an option)
To me the biggest challenge seems to be the USB interface. I've designed USB hardware before and realize that a LOT of the low-level protocol stuff is implemented in hardware. In that case, it might be almost impossible to attach that USB subsystem to some "virtual FAT partition". (which would be required for USB Mass Storage)
In the case of MPT, it seems like you might be able to "trick" the host into playing a 4GB WAV file (4G is the max-size in MTP) that is being fed by android in the background. There might be a hiccup every x Minutes once you reach EOF, but it would still be usable as a proof-of-concept.
I know this is a pretty expansive topic that involves low-level specifics for several protocols. I'm just trying to figure out if there are any real "show-stoppers" that would make something like this impossible.(I'm under no impression that it could just be an App. I'm pretty much under the assumption that this would require a custom ROM at the least.)

[Q] Can Jack Audio ever work in Tubuntu? Plus some audio apps that do..

Hey, I wanted to say that I am really loving x3maniacs build of Ubuntu for tf101, Tubuntu, it's revitalized a piece of hardware I didn't even know needed revitalizing.
I only had one or two questions involving audio. Is there any way to get Jack Audio working on an ARM processor, this one in particular? I've read enough to know that they don't play nice together, but I've read of some success getting it to work with the ARM based Pandaboard through an external audio interface compatible with Ubuntu/Linux. I'd much rather prefer the software way, but anything would be awesome.
And I guess that's part of my second question: Is there any way to get USB midi interfaces or Audio Interfaces recognized? Maybe recognized is the wrong word, because I scanned the ports with my Korg microkey plugged in, and it saw a device labeled KORG, but I think I need to be able to use a midi softsynth like timidity or fluidsynth to have it translate to an application.
I'm already really impressed with this build, and linux in general, I know it's very midi capable, it recognized my psx controllers hooked up with a super dual box pro, and as two seperate midi game controllers no less with fully working thumb axis controllers (which is more than I can say for android).
I should also mention that I'm really interested in this because LMMS (Linux MultiMedia Studio), Audacity, and the Hydrogen sampler all seem to be up and running really well on Tubuntu, I mean I'm more than happy with that. I can even use an adapter to split the microphone input and audio output in the headphone jack so I can plug my guitar, bass, and microphones in and record directly into Audacity. More than I ever could've imagined doing with this hardware.
And anyone who's into audio production or beat making, you should really check out LMMS on Tubuntu, full of instruments, plugin effects, and an Sf2 (soundfont) player, all with really manageble latency considering.
so even though I'm happy where it's at, I'm just wondering if that one small, yet crucial and difficult to work around, piece can be figured out. Jack would open the system up to programs like Ardour, Rosegarden, Musecore (which actually works but crashes when you try to go into preferences and can't play sound, think it's automatically configured to jack or alsa_seq), and Traverso, which all start up, but can't really be used without Jack; or the world of guitar amp modeling, as there's a way to get a guitar signal in.
Sorry for the long post, but I am really excited by the sheer number of things that are already working in this build (not even mentioning GIMP or Libreoffice).
Really, thanks to everyone for their hard work on this. Hope to hear from someone on the issue.
Oh, and I should warn anyone who might try, excessive installing and uninstalling of audio drivers/midi drivers seems to lead to instability in the system, I've reflashed and started from scratch many times in the last few days.
Also, also, I usually found my self in search of snd-seq modprobe file/directory, that seemed to be the thing that couldn't be found and connected to jack most often.
Alright, thanks again.

TV Droid boxes

Considering a android TV box, but requirements are
IR remote control
HDMI video out
Optical or coaxial audio output
Jelly Bean OS
1GB RAM
Micro SD slot for app storage.
wifi and wired ethernet.
Something along the lines of this, although unsure if it meets all my requirements. £50 sort of thing add interactive features to the TV..and use a media playback device easier to use than the HTPC, mouse, totally quiet etc
http://www.ebay.co.uk/itm/Android-4...ternet_TV_Media_Streamers&hash=item1c33e14b8c

Windows vs. Android USB Surround DAC question.

For my specific project I'm working on I need to know some things. Involving surround sound and level adjustments. I remember on my PC being able to make level adjustments per speaker. Mainly the sub. Directly to the 7.1 surround card. I've never used a surround DAC.
My question applies to both Windows and Android devices. Using a legit USB Surround DAC, can level adjustments be made per channel . I know I can make eq adjustments in both devices. I know that Android audio out doesn't have surround sound built into it. So there would be no reason for it. But now with these Android boxes and even car radios running Android with in app level adjustments... I've read that using a legit DAC and playing a legit multi channel media will work to its fullest. But nobody really threw down hard core proof.
Nobody has a USB dac they use and can tell me

Categories

Resources