USB audio on the Moto G?

Search This thread

UnknownAX

Senior Member
Nov 15, 2011
143
9
I already found out, that the Moto G supports USB OTG, but would it support USB DAC's (digital-analog audio converter) ? If any Moto G owner owns a USB Dac or atleast something compareable like a USB headset or USB headphones, I'd be really thankfull if you could try it out.
The dac/headset needs to be plugged into the phone using a USB OTG cable.
Thanks! :)

Sent from my GT-I8160 using xda app-developers app
 

shaftenberg

Senior Member
Jul 31, 2010
703
742
Cologne
Works!! BUT:
I hooked an USB-OTG to Moto G, in there a Creative USB Soundcard with analog/digital output. Analog didn't work (must be the soundcard), but digital. I connected the digital out with a light cable to my RME environment and I could hear the music but with wrong frequency and crackled - but it works :D
Moto G has enough power to let the soundcard work.

[edit]
Hooked another soundcard in, this time analog works but wrong sample frequency and oversaturated, no option to control the volume.
 
Last edited:
  • Like
Reactions: UnknownAX

UnknownAX

Senior Member
Nov 15, 2011
143
9
Wow! This phone seems to be even more incredible value than I ever thought.

The problems that you mention sound pretty weird, though. The first thing that I'd suspect is the lack of special drivers for the soundcards on the Moto g. Maybe a simple DAC that doesn't need any special drivers would work better.

In fact, stock androids rarely work with any USB audio devices. But there's a app that includes special drivers and makes most USB-OTG enabled droids work with USB audio devices. You can the trial version (link in the description of the app) of it if you like:
https://play.google.com/store/apps/...=organic&utm_term=usb+audio+recorder+pro+demo

Be aware that the trial only works for 15 minutes and it doesn't play the usual audio formats. ( .flac works) If you try it, you should put a flac on the phone before installing the app.

Oh, and who knows how well this might work when CM and KitKat arrive!

Thanks a lot for your help.:)

Sent from my GT-I8160 using xda app-developers app
 
Last edited:

shaftenberg

Senior Member
Jul 31, 2010
703
742
Cologne
With the app it works, without stuttering and you can control the output volume, although there was an error warning at startup regarding main volume :D
I tried to record something, but hadn't enough time. First try was unsuccessful unfortunately.
 

Attachments

  • Screenshot_2013-11-24-23-27-58.png
    Screenshot_2013-11-24-23-27-58.png
    93.2 KB · Views: 961
  • Screenshot_2013-11-24-23-28-03.png
    Screenshot_2013-11-24-23-28-03.png
    92.1 KB · Views: 833
  • Screenshot_2013-11-24-23-28-11.png
    Screenshot_2013-11-24-23-28-11.png
    140.7 KB · Views: 800
  • Like
Reactions: UnknownAX

UnknownAX

Senior Member
Nov 15, 2011
143
9
With the app it works, without stuttering and you can control the output volume, although there was an error warning at startup regarding main volume :D
I tried to record something, but hadn't enough time. First try was unsuccessful unfortunately.

Well, that's nice to hear. Maybe some Custom ROMs (Cyanogenmod in particular) will have better support for this without the app.
Anyway, I think I'm going to get this phone (Christmas is coming :p). Usb audio support (atleast with the app) is crucial for me, so thanks for reporting that it works.:good:

One last thing though, what make and model were the two soundcards that you used for testing?
 

UnknownAX

Senior Member
Nov 15, 2011
143
9
Could you test this on the faux kernel that your running atm, Shaftenberg? :eek:

Most people who have tried it on the stock ROM have experienced the same glitches that you mentioned in your first post. On the other hand, there's also one report of it working fine, with the Google music player. The DAC is probably the biggest factor.

Anyway, I'm just waiting for the 16gb version to be available....
 

nlra

Senior Member
Sep 5, 2012
160
85
I tried 2 DACs. One was a CEntrance DACport LX flashed with the iPad firmware, and the other was a cheap off-brand thing (ELE EL-D01 on eBay). Both of them "worked", but I encountered the same issue with each: I tested both by playing a Youtube video, and the audio was not playing back at the proper sampling rate. The audio was slightly slowed down... as a result, pitches were slightly lower, and the audio lagged behind the video pretty significantly. If I had to guess, the audio was 48kHz, and Android was trying to play it back at 44.1kHz without resampling it first.

Why it was doing this, I have no idea: on a Nexus 4 running stock Jellybean with jacknorris' patch (which, AFAIK, doesn't pay attention to sampling rates but just assumes Android will handle that properly elsewhere), this works perfectly. However, it was fascinating/encouraging to see this work at all on the Moto G: it means that with stock firmware, not only does OTG/USB host mode work, and not only does the kernel have the stock Linux USB DAC driver compiled in, but the Android framework itself attempts to use the DAC, which is *definitely* not true with plain-jane AOSP.

One thing I was sad to see (which also seems to be true of a LOT of other Android phones that support OTG out-of-the-box) is that if I injected 5V from an external source into the USB power lines, the phone would NOT charge as long as OTG mode was engaged. Which means that, at least with the stock Moto G firmware, you can't both be in USB host most *and* be charging the battery at the same time. (Interestingly, the very first time you plug the power in, the phone says "charging", but it's quickly obvious it isn't. If you unplug and re-plug the power in after that, it will not show the lightning symbol on the battery any longer until you reboot the phone. Normal USB chargers continue to work without the OTG cable without requiring a reboot.)

-- Nathan
 
  • Like
Reactions: UnknownAX

UnknownAX

Senior Member
Nov 15, 2011
143
9
If I had to guess, the audio was 48kHz, and Android was trying to play it back at 44.1kHz without resampling it first.

That makes sense to me. But what would happen if we played a 44.1kHz track? It wouldn't have to resample then, would it?
Maybe that's why there is a report of it working with google music player...maybe he just happened to try it with a 44.1kHz track?
I'm pretty sure this will/can be fixed with a ROM / Kernel. Like USB OTG charging, it's just a matter of time (I hope). Both things have already been successfully enabled on many different devices.

Thanks for the info, luckily I'm not the only one showing interest in this.
 

tapasmonkey

New member
Dec 30, 2013
1
1
It most definitely works with my Moto G and my FiiO E17 (connected via a generic OTG cable)

Trouble is, although it ALMOST worked, I got sporadic but impossible to listen to skipping/stuttering when using Poweramp or the native Google player app.

I finally found an app made by the same people who do the USB Audio Recorder Pro as mentioned by the poster, called USB Audio Player Pro (can't post the link, being a new poster, but a quick search for "USB audio player" gets to it)

...it costs over 5 pounds, and to be frank it is not the world's prettiest or richly featured player, but it certainly works and the output sound is great.

Anyway, just posting to let you know that it works, at least with my Fiio E17.
 
  • Like
Reactions: AwesomeTurtle

nlra

Senior Member
Sep 5, 2012
160
85
So here's some good news: after applying the official KitKat 4.4.2 OTA, OTG still works, USB DAC support still exists, and now it even works properly, at least for me! No more strange audio sampling issues: I could attach either one of my DACs and play the same Youtube clip without any difficulty! Audio was perfectly in-sync with the video.

-- Nathan
 

jjacks

Member
Sep 20, 2006
11
2
Has anybody found a way to enable OTG and charging at the same time? I genuinely enjoy listening to Moto G + FiiO E17 but it leaves me with low battery on the way home which is rather frustrating and makes me to swap charger/DAC during the day.
I don't mind putting unofficial ROM in as long as it doesn't require hardware mods.
 

nlra

Senior Member
Sep 5, 2012
160
85
Has anybody found a way to enable OTG and charging at the same time? I genuinely enjoy listening to Moto G + FiiO E17 but it leaves me with low battery on the way home which is rather frustrating and makes me to swap charger/DAC during the day.
I don't mind putting unofficial ROM in as long as it doesn't require hardware mods.

I have taken ziddey's USB OTG kernel patch for the Nexus 4, which allows both for charging as well as USB OTG mode without an actual OTG cable, and I have compiled a new kernel for the stock Moto G 4.4.2 ROM, and it works great! The only thing is that you have to use a non-OTG cable...if it detects the OTG cable it will shut off the charging. So you will need a USB Y cable to inject a 5V power source to both your DAC and phone, and plug the phone into the Y cable using a standard micro-USB cable instead of an OTG cable.

If people are interested in this kernel, I can post it. You will need to unlock your bootloader to flash it.

-- Nathan
 
  • Like
Reactions: samwathegreat

jjacks

Member
Sep 20, 2006
11
2
That is interesting. I would be happy to flash it. Is it safe operation? I flashed multiple windows mobile / windows phone devices but no experience with Android mods yet. Any downsides of custom kernel?
 

nlra

Senior Member
Sep 5, 2012
160
85
That is interesting. I would be happy to flash it. Is it safe operation? I flashed multiple windows mobile / windows phone devices but no experience with Android mods yet. Any downsides of custom kernel?

You should read some of the other threads on how to unlock your Moto G bootloader and how to flash stock ROMs back, at the very least, before applying mine. I can't educate you on these matters here and there are other threads more appropriate for those discussions. Then take that knowledge and apply it to this. In this case, as long as you are using a stock Motorola ROM already (and not a GPE ROM!), you only need to flash one component: the kernel.

This kernel is completely identical to the stock Motorola kernel in every way except that it has ziddey's patch applied. So the only downsides would be:

1) because you have to unlock the bootloader, if you live in the U.S. at least, Motorola can legally void your hardware warranty, even if you have a hardware failure that cannot be linked to your unlocking of the bootloader. (Other countries' laws are different and Motorola may not be legally allowed to void warranties for bootloader unlocks where you are at.)

2) If an OTA update is pushed to your phone, I believe the kernel will be replaced with a stock one again, and this will stop working. Either that, or because you are running a custom kernel or an unlocked bootloader, perhaps OTAs won't be pushed to your phone, or if they are, they might not install. I have not tested this or read up on this myself as I generally detest OTA updates outside of my control, and prefer to flash my devices myself on my terms when I'm ready to do so.

You can read about ziddey's USB OTG patches that he developed (with the help/inspiration of CaptainMuon) here: http://xdaforums.com/nexus-4/orig-development/usb-otg-externally-powered-usb-otg-t2181820

The only real difference between how this works on the Nexus 4 and how this works on the Moto G is that, as I explained previously, on the Moto G, there is something in hardware that prevents the phone from accepting a charge if it detects that you are using an OTG micro-USB cable, whereas the Nexus 4 doesn't care if you use an OTG cable or not because pin 5 on the Nexus 4 is not actually wired to anything internally. On the Moto G, there is even a slight cosmetic quirk: if you try to inject 5V power to the phone through an OTG cable, the first time that you plug it in after a fresh reboot, it will say that it is charging after you plug the cable in, but it actually isn't (battery will continue to deplete). And if you unplug the cable and plug it back in, it will no longer show the "charging" symbol, until you reboot the phone again. If you plug in a regular micro-USB cable, though, it will both show charging as well as actually take a charge.

Another thing to be aware of is that there are two different releases of KitKat 4.4.2 that Motorola has released for the G (they released an updated 4.4.2 ROM that fixed a couple of bugs after its initial release), but as far as I can tell, they have so far only released the kernel sources for the original 4.4.2 ROM and not the updated one. So I have only managed to build a kernel for the original 4.4.2 update for the Moto G. I have not tested this, but it's *possible* that this kernel will work just fine with the later 4.4.2 ROM. You are welcome to try it; you won't harm your phone by doing so and can always flash the factory kernel back if it doesn't work or has problems. This kernel likely won't work with any 3rd-party ROMs or with the Google Play Edition ROM (which doesn't support USB DACs anyway, sooo no point in using that one, at least if you care about USB audio which you obviously do). Motorola has not released any kernel sources for 4.4.3 or 4.4.4 yet either, so you should stick with 4.4.2 for now. If this kernel does not work with the later 4.4.2 release, then you should be able to downgrade your system image to the older 4.4.2 ROM and use this kernel with that.

The two 4.4.2 releases on the Moto G (excluding the GPE ROM) are marked by their kernel versions. The first 4.4.2 kernel is versioned as KXB20.9-1.8-1.4, and corresponds to the U.S. retail 172.44.4 ROM version, among others internationally. The second 4.4.2 kernel is versioned as KXB20.9-1.10-1.24-1.1, and corresponds to the U.S. retail 174.44.1 ROM version, among others internationally. It is the source for the first kernel that I have access to.

You may download my kernel from here: http://www.nconx.com/~nathan/motog/boot_motog_KXB20.9-1.8-1.4_OTG_charge.img

After you have unlocked the bootloader via Motorola's site and mfastboot, enter Fastboot mode on your phone again, and then flash the kernel to the phone with mfastboot (the Motorola version of fastboot) the same way that you would flash a stock Motorola kernel (see this post, step 3b: http://xdaforums.com/showthread.php?t=2542219), but substituting in the file name of my kernel instead:

Code:
mfastboot flash boot boot_motog_KXB20.9-1.8-1.4_OTG_charge.img

Reboot your phone, plug it into your DAC + 5V power source (again, using a normal micro-USB cable), and enjoy battery charging while simultaneously connected up to your external DAC. :)

Good luck,

-- Nathan
 
  • Like
Reactions: samwathegreat

umeshvenkat

New member
Jul 21, 2012
2
0
My Moto G works with Creative X-FI DAC

My Moto G runs Kitkat.
OTG cable is connected between Creative X-FI Dac and Moto G. Then Creative device's optical output is fed to the Logitech speaker with optical input. Sound with this setup is much better and awesome.
 

Mkoll

New member
Feb 8, 2015
1
0
My Moto G Works w/ Fiio E07K

Running Android 4.4.4

Moto G (LTE) > USB OTG cable > Fiio E07K USB Cable > Fiio E07K > headphones

:victory:
 
Last edited:

samwathegreat

Senior Member
Apr 17, 2010
2,096
1,843
I have taken ziddey's USB OTG kernel patch for the Nexus 4, which allows both for charging as well as USB OTG mode without an actual OTG cable, and I have compiled a new kernel for the stock Moto G 4.4.2 ROM, and it works great! The only thing is that you have to use a non-OTG cable...if it detects the OTG cable it will shut off the charging. So you will need a USB Y cable to inject a 5V power source to both your DAC and phone, and plug the phone into the Y cable using a standard micro-USB cable instead of an OTG cable.

If people are interested in this kernel, I can post it. You will need to unlock your bootloader to flash it.

-- Nathan

Would you be interested in building a compatible kernel for 4.4.4? Is the source available? My Moto G is brand new pre-installed with 4.4.4. so no option to use your 4.4.2 kernel. I would really appreciate the help - I have a project that requires me to be able to charge and host simultaneously.

Also, I'm fine with flashing an alternate ROM with source available, such as CyanogenMod -- anything to get OTG + Charging working. Any advice is appreciated.

Thanks,

samwathegreat
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    So here's some good news: after applying the official KitKat 4.4.2 OTA, OTG still works, USB DAC support still exists, and now it even works properly, at least for me! No more strange audio sampling issues: I could attach either one of my DACs and play the same Youtube clip without any difficulty! Audio was perfectly in-sync with the video.

    -- Nathan
    1
    Works!! BUT:
    I hooked an USB-OTG to Moto G, in there a Creative USB Soundcard with analog/digital output. Analog didn't work (must be the soundcard), but digital. I connected the digital out with a light cable to my RME environment and I could hear the music but with wrong frequency and crackled - but it works :D
    Moto G has enough power to let the soundcard work.

    [edit]
    Hooked another soundcard in, this time analog works but wrong sample frequency and oversaturated, no option to control the volume.
    1
    With the app it works, without stuttering and you can control the output volume, although there was an error warning at startup regarding main volume :D
    I tried to record something, but hadn't enough time. First try was unsuccessful unfortunately.
    1
    I tried 2 DACs. One was a CEntrance DACport LX flashed with the iPad firmware, and the other was a cheap off-brand thing (ELE EL-D01 on eBay). Both of them "worked", but I encountered the same issue with each: I tested both by playing a Youtube video, and the audio was not playing back at the proper sampling rate. The audio was slightly slowed down... as a result, pitches were slightly lower, and the audio lagged behind the video pretty significantly. If I had to guess, the audio was 48kHz, and Android was trying to play it back at 44.1kHz without resampling it first.

    Why it was doing this, I have no idea: on a Nexus 4 running stock Jellybean with jacknorris' patch (which, AFAIK, doesn't pay attention to sampling rates but just assumes Android will handle that properly elsewhere), this works perfectly. However, it was fascinating/encouraging to see this work at all on the Moto G: it means that with stock firmware, not only does OTG/USB host mode work, and not only does the kernel have the stock Linux USB DAC driver compiled in, but the Android framework itself attempts to use the DAC, which is *definitely* not true with plain-jane AOSP.

    One thing I was sad to see (which also seems to be true of a LOT of other Android phones that support OTG out-of-the-box) is that if I injected 5V from an external source into the USB power lines, the phone would NOT charge as long as OTG mode was engaged. Which means that, at least with the stock Moto G firmware, you can't both be in USB host most *and* be charging the battery at the same time. (Interestingly, the very first time you plug the power in, the phone says "charging", but it's quickly obvious it isn't. If you unplug and re-plug the power in after that, it will not show the lightning symbol on the battery any longer until you reboot the phone. Normal USB chargers continue to work without the OTG cable without requiring a reboot.)

    -- Nathan
    1
    It most definitely works with my Moto G and my FiiO E17 (connected via a generic OTG cable)

    Trouble is, although it ALMOST worked, I got sporadic but impossible to listen to skipping/stuttering when using Poweramp or the native Google player app.

    I finally found an app made by the same people who do the USB Audio Recorder Pro as mentioned by the poster, called USB Audio Player Pro (can't post the link, being a new poster, but a quick search for "USB audio player" gets to it)

    ...it costs over 5 pounds, and to be frank it is not the world's prettiest or richly featured player, but it certainly works and the output sound is great.

    Anyway, just posting to let you know that it works, at least with my Fiio E17.