Samsung galaxy nexus
Oct 16, 2012 at 2:28 AM Post #226 of 249
Well, first of all you need to have your phone rooted.
There are a lot of good tutos for that on the web. Personnaly I used the Nexus Toolkit to root my GNex and Nexus 7.
Here is a tuto : http://www.wugfresh.com/dev/nexus-root-toolkit/
 
Once done, you have to install an alternate bootloader to allow you to install kernels and roms.
You can use ROM Manager to install CWM 6.0.1.0, the best bootloader. https://play.google.com/store/apps/details?id=com.koushikdutta.rommanager
 
After that, download GlaDos kernel at this address : http://goo.im/devs/Ezekeel/GLaDOS-GalaxyNexus
Copy the zip file on your GNex and reboot in recovery mode.
Install the zip, the kernel is installed !
 
Now, you need a terminal app to run commands.
I use Android terminal Emulator. https://play.google.com/store/apps/details?id=jackpal.androidterm
 
Once installed, lauch it.
To switch to root user type :
 
su 
 
To load usb audio modules type :
 
 
insmod /system/modules/snd-hwdep.ko
insmod /system/modules/snd-rawmidi.ko
insmod /system/modules/snd-usbmidi-lib.ko
insmod /system/modules/snd-usb-audio.ko
 
To check the media.audio.out.mode property type :
getprop media.audio.out.mode
 
The default value is codec.
 
To change the value type :
setprop media.audio.out.mode usb
 
Now your GNex should be ready to use USB DAC.
 
I've finally ordered for a E7 DAC. It is a self powered DAC so I hope it will work with my GNEx.
 
I keep you updated !
 
Oct 16, 2012 at 9:28 AM Post #227 of 249
Quote:
Well, first of all you need to have your phone rooted.
There are a lot of good tutos for that on the web. Personnaly I used the Nexus Toolkit to root my GNex and Nexus 7.
Here is a tuto : http://www.wugfresh.com/dev/nexus-root-toolkit/
 
Once done, you have to install an alternate bootloader to allow you to install kernels and roms.
You can use ROM Manager to install CWM 6.0.1.0, the best bootloader. https://play.google.com/store/apps/details?id=com.koushikdutta.rommanager
 
After that, download GlaDos kernel at this address : http://goo.im/devs/Ezekeel/GLaDOS-GalaxyNexus
Copy the zip file on your GNex and reboot in recovery mode.
Install the zip, the kernel is installed !
 
Now, you need a terminal app to run commands.
I use Android terminal Emulator. https://play.google.com/store/apps/details?id=jackpal.androidterm
 
Once installed, lauch it.
To switch to root user type :
 
su 
 
To load usb audio modules type :
 
 
insmod /system/modules/snd-hwdep.ko
insmod /system/modules/snd-rawmidi.ko
insmod /system/modules/snd-usbmidi-lib.ko
insmod /system/modules/snd-usb-audio.ko
 
To check the media.audio.out.mode property type :
getprop media.audio.out.mode
 
The default value is codec.
 
To change the value type :
setprop media.audio.out.mode usb
 
Now your GNex should be ready to use USB DAC.
 
I've finally ordered for a E7 DAC. It is a self powered DAC so I hope it will work with my GNEx.
 
I keep you updated !

That's great! Thanks!  I knew all the steps except the terminal commands :) but this is great for anyone here who doesn't know the steps.
 
If this works, it means you have to change the media.audio.out.mode property and reboot every time you want to switch audio mode. And if you reboot phone, you have to enable all the modules as well once it boots up.  Someone may have to write a small Tasker script to make this a bit more automatized.  
 
Oct 18, 2012 at 1:08 PM Post #228 of 249
Well... I just received the Fiio E7 ! 
But I'm a bit confused because... I didn't realize the OTG cable wasn't in the box. And I don't have any OTG cable... 
mad.gif

 
So I will have to wait for a cable...
 
Oct 19, 2012 at 9:20 PM Post #230 of 249
I'm also pretty interested to hear your results
 
Oct 23, 2012 at 4:10 PM Post #233 of 249
Hello guys,
 
I've finally received my OTG cable.
Unfortunately it does not work...
 
I'm not so far, the USB DAC is well recognised by the system, but I do not find how to switch audio out to the DAC...
 
The DAC is in 3rd position in /proc/asound/cards so I think the key is to find how to switch to this card.
 
 
I will not give up easily and I'm going to keep trying.
 
It is working well on my Nexus 7 so I see no reason why it won't be working on the GNex.
 
Oct 23, 2012 at 4:32 PM Post #234 of 249
May be a temporary workaround:
http://www.slatedroid.com/topic/29289-usb-audio-cards-support-drivers-and-libs/page__view__findpost__p__324083
 
"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 :wink: So, it will always try to stream audio to USB DAC, and you will have no sound if there is no USB card connected :wink: 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."
 
Oct 26, 2012 at 1:38 PM Post #236 of 249
Hey guys I am new here but have been following the thread.  I myself have been able to load the modules and get the device to show in the /proc/asound/cards as device 2.. I am actually (for testing purposes) using a simple Logitech USB headset.  I am currently attempting to see if there is a way to implement an asound.conf file based on the info from here http://alsa.opensrc.org/FAQ026.  Hopefully it will yield some positive results..
As far as loading the modules.. I have added them to the /init.rc file and rebuilt my kernel so they don´t wipe every boot, although after doing all this I think I found a CM10 hook into the init system so I probably could have avoided the kernel rebuild. I have confirmed via USBAudioTester.apk (available for free norm/root on Play store) that I am able to at LEAST get audio input from the mic.  
However I am yet to make it output audio via the USB interface.  Since the app does basic tests, this still confirms that there isn't a mechanism to switch to an USB audio interface.. I am currently trying to trace the mechanism that Android(CM10-Nightly) uses to switch inputs.  My next test is to plug in an external Keyboard and logcat watch for switches.. and do getprop lists to see if any properties change.  
 
I don´t have a lot of time for this testing, but will report what and when I can.
Provided anyone is interested :wink:
 
Oct 26, 2012 at 1:41 PM Post #237 of 249
Oh I forgot to add my Specs:
Samsung Galaxy Nexus SCH-i515 (vzw)
CM10 Nightly - 10-20121014-NIGHTLY-toro
GLaDOS Kernel v2.1 (modded with modules for usb on startup: made a 91UsbAudio init script in /etc/init.d and rebuilt the kernel)
 
Oct 27, 2012 at 9:44 AM Post #238 of 249
Quote:
Hey guys I am new here but have been following the thread.  I myself have been able to load the modules and get the device to show in the /proc/asound/cards as device 2..

 
Hi,
 
You mean your device is in 3rd position ?
My DAC is always loading in 3rd position also.
 
In Poitee's kernel, for Nexus7, DAC is loading in 2nd position (device 1) and the DAC works.
 
The difference I noticed is Poitee has directly integrated snd modules into his kernel.
 
I have been able to recompile GlaDos kernel to integrate snd modules directly into the kernel instead of having modules to load.
I was hoping having the same behaviour as Poitee's.
 
Unfortunately it does not change anything and my device is still loading in 3rd position...
 
Oct 29, 2012 at 5:38 PM Post #240 of 249
Okay I was able to get audio in/out working by installing AlsaMixer from the Play store. It didn't work right away, I ended up copying the libs and binaries to my /system partition.. However I wasn't able to get the device to switch for audio out for the entire device. I was able to change the default output by changing the asound.conf that I moved from the AlsaMixer apk. Unfortunately that change seemed to only work with anything that was aware of Alsa (alsa_aplay etc..) from adb shell or a terminal I was able to do a lot..I could play single files and record audio but the default audio was still outputting to the speaker.
Now the really disappointing thing was that the music or audio files were very crackly. I player with the output settings.. Changed rate to 48000 instead of 44100. It didn't really change anything. I even tried specifying the device with Aplay but the result was the same.
So at this point I am not sure how to proceed.. My thoughts are that the DAC is either not that good, or it was too much processor strain. As far as getting it to work in the OS.. I am clueless, I bet they are using AudioFlinger in some way rather than alsa and the interface pref needs to be set there. Unfortunately I wasn't able to find much info on AudioFlinger at all.
 

Users who are viewing this thread

Back
Top