[Galaxy S III Original Android Development] rab1412000:
usb audio in sgs3

hi gm,

as you well know usb audio is not available by default on android devices. however there is a tweak/script that has worked on the galaxy nexus. afaik, no developer is working on it for the sgs3. a fellow poster collated the data necessary for such a 'tweak'. many in head-fi.org and in this forum have been waiting for full usb audio support. we hope your the guy to finally give it to us.

"Hi there,

As far as I know, the most advanced developer for enabling USB audio is Tsynik. But he doesn’t have a top-selling smartphone.

His instructions for enabling USB audio can be found at the following link:

http://www.slatedroid.com/topic/29289-usb-audio-cards-support-drivers-and-libs/

"

1st: USB Host support in Android kernel.

2nd. USB audio driver, in kernel, or compiled as a module.

# USB Audio

insmod /drv/snd-hwdep.ko

insmod /drv/snd-rawmidi.ko

insmod /drv/snd-usbmidi-lib.ko

insmod /drv/snd-usb-audio.ko

3rd. Some logic to switch to USB audio card, or back to internal one.

So, it can be checkbox in Android preferences, or automatic switching via init.rc and it's on-device-added events. Last thing is your choise, you can set it in many ways (as it's controlled by property change, or, on other devices, by asound.conf rules), but it's not universal yet."

Ezekeel, has added support for USB audio as module in his modded Galaxy Nexus kernel (i.e. 1st step and 2nd step):

http://rootzwiki.com/topic/14685-kernel27-jul-glados-v20-for-jb/page__st__760__p__618834#entry618834

It remains to him to find out some logic to switch the audio stream to the USB DAC. He would like to re-write the logic part to switch the audio stream, but he doesn’t own a USB DAC.

The easiest way is to have a non-switchable audio stream always to the USB DAC by doing the following:

"The last effort is to inspect libaudio.so in HEX redactor, finding there /dev/snd/pcmC0D0p and change it to /dev/snd/pcmC1D0p (or /dev/snd/pcmC2D0p) if you have HDMI and your DAC is 3rd card. One byte change is enough ;) So, it will always try to stream audio to USB DAC, and you will have no sound if there is no USB card connected ;) You don't need to change /dev/snd/pcmC0D0c - it's probably internal MIC, and /dev/snd/ctlC0D0p - it's mixer control of internal sound card.”

A tip from a pro to switch audio stream: use the tinyalsa lib

“In ICS, it's typical for a hardware device to use the kernel ALSA

and then use the tinyalsa lib (instead of libasound).”

http://music.columbia.edu/pipermail/andraudio/2012-April/000614.html

If gokhanmoral doesn’t have a USB DAC for testing purposes, please tell him to buy some cheap USB sound cards that work with the Galaxy S3.

. C-Media chipset-based sound card Dynamode 7 channel USB 2.0 (USB DAC/amp):

http://www.amazon.com/Dynamode-USB-...TF8&qid=1348909694&sr=8-2&keywords=Dynamode+7

http://www.chinacomputerparts.com/d-p1140199199635616900-cables/

http://xdaforums.com/showpost.php?p=27604946&postcount=449

. Syba SD-AUD20101: (optical S/PFIF capable)

http://www.amazon.com/Syba-Digital-Optical-Output-SD-AUD20101/dp/B006SF68P2/

http://www.sybausa.com/productInfo.php?iid=1191

http://www.head-fi.org/t/595071/android-phones-and-usb-dacs/375#post_8736082

If he like to get an affordable good USB DAC(amp), he can buy the Stoner UD100 at 50us$.

http://www.avsforum.com/t/1393599/enable-usb-audio-on-any-android-4-0-smartphone-tablet/60#post_22426901"