[MOD] USB Audio Support

Search This thread

redeyedjedi

Senior Member
May 1, 2011
831
505
Google Pixel 6 Pro
have you had a chance to test it out? I was wondering if mic in (via dac) will finally work properly...

I haven't. .....the full android L source isn't out yet.....and on nexus 7 I don't think hardly any hardware works yet. From the Google IO they say that the USB support is as complete as Apple.....so I think that means mic in too......but I dont know.

The next generation of android phones aren't even supposed to have headphone Jacks anymore.....just USB out.
 
  • Like
Reactions: Ssyyddii

Ssyyddii

Member
Mar 10, 2013
26
1
I haven't. .....the full android L source isn't out yet.....and on nexus 7 I don't think hardly any hardware works yet. From the Google IO they say that the USB support is as complete as Apple.....so I think that means mic in too......but I dont know.

The next generation of android phones aren't even supposed to have headphone Jacks anymore.....just USB out.

Does anyone know if usb audio works on nexus 4 running 5.01 . have not been able to confirm or not
If it works on lollipop.
 

killahax

Senior Member
Oct 3, 2012
132
4
Nexus 7 USB Audio Support

I originally started looking into this as part of my Nexus 7 car project. Rebooting just to get USB audio working conflicted with my goal of being able to "dock and forget". It took a bit of experimenting and debugging but it's finally working
wink2.png


This program should enable USB audio support on your Nexus 7 - that means you are able to plug and unplug a USB sound card without having to reboot in order for it to work. Other devices should also work but I have not been able to fully test.

It works by downloading your devices services.jar which is then extracted and de-odexed if required. The necessary classes are then patched and a new services.jar is packaged up, re-odexed, re-signed and finally re-uploaded to your device. The previous method replaced the entire services.jar which turned out to be a really bad idea!

As always please let me know of any issues you stumble upon. The patching software was written quickly so there will most likely be bugs!

Instructions


  1. Obtain a full backup of your device. This patch is experimental.
  2. Ensure your device is ADB enabled, rooted and has busybox installed.
  3. Make sure your PC has Java and .NET 4 installed.
  4. Download usb-audio-patcher below and extract to a folder.
  5. Run usb-audio-patcher.exe, the software will guide you through the rest of the process.
  6. Flash a kernel with USB audio support. Nexus 7 Wifi kernels can be found below although any kernel with USB audio support will work.

Downloads

Software
[Windows] usb-audio-patcher-1.1.zip.

Kernels
[N7 CM10 / Stock 4.1.2] cm-10-n7-wifi-usb-audio-kernel.zip
[N7 CM10.1 / Stock 4.2.1] cm-10.1-n7-wifi-usb-audio-kernel.zip
[Timurs N7 Kernel] http://rootzwiki.com...ment-usb-audio/

Misc
[Volume Control] n7-volume-control-patch.zip - Allow media volume control when USB audio device is connected.

will this usb audio work with 5.0.0 + roms? with timur or elemental kernals? so I can just plug in my usb dac in my usb hub?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 35
    Nexus 7 USB Audio Support

    I originally started looking into this as part of my Nexus 7 car project. Rebooting just to get USB audio working conflicted with my goal of being able to "dock and forget". It took a bit of experimenting and debugging but it's finally working
    wink2.png


    This program should enable USB audio support on your Nexus 7 - that means you are able to plug and unplug a USB sound card without having to reboot in order for it to work. Other devices should also work but I have not been able to fully test.

    It works by downloading your devices services.jar which is then extracted and de-odexed if required. The necessary classes are then patched and a new services.jar is packaged up, re-odexed, re-signed and finally re-uploaded to your device. The previous method replaced the entire services.jar which turned out to be a really bad idea!

    As always please let me know of any issues you stumble upon. The patching software was written quickly so there will most likely be bugs!

    Instructions


    1. Obtain a full backup of your device. This patch is experimental.
    2. Ensure your device is ADB enabled, rooted and has busybox installed.
    3. Make sure your PC has Java and .NET 4 installed.
    4. Download usb-audio-patcher below and extract to a folder.
    5. Run usb-audio-patcher.exe, the software will guide you through the rest of the process.
    6. Flash a kernel with USB audio support. Nexus 7 Wifi kernels can be found below although any kernel with USB audio support will work.

    Downloads

    Software
    [Windows] usb-audio-patcher-1.1.zip.

    Kernels
    [N7 CM10 / Stock 4.1.2] cm-10-n7-wifi-usb-audio-kernel.zip
    [N7 CM10.1 / Stock 4.2.1] cm-10.1-n7-wifi-usb-audio-kernel.zip
    [Timurs N7 Kernel] http://rootzwiki.com...ment-usb-audio/

    Misc
    [Volume Control] n7-volume-control-patch.zip - Allow media volume control when USB audio device is connected.
    8
    Working USB DAC solution for KitKat!

    Here's a small New Year present to all audio lovers!

    This patcher was originally developed by JackNorris and was later modified by _crue_ - many thanks!
    However, 4.4.zip patch disabled headphone functionality. So I ripped contents of WiredAccessoryManager from Timur's USB-ROM and updated 4.2 and 4.4 zips with them.

    Results:

    1. USB DAC hotplug works!
    2. Switching between internal speakers and DAC - works!
    3. Once headphones are plugged in, sound switches from speakers or DAC to them - works!
    4. No volume control for USB DAC - this requires another patch for AudioPolicyManagerBase.cpp before ROM compilation (http://xdaforums.com/showthread.php?t=2222374&page=93 post #928 - again, all credits to JackNorris). I do not have the environment to build my own ROM...

    It's strange that FineVolumeControl app is able to control DAC volume.

    As of now, it's a partial success, but hope is not lost! Please look for 1st post in this thread for instructions.

    Tested with Oxydo v15 version 1 (BTW, v1 boot failure can be caused by different SEPOLICY binary in CM11 and AOSP ROMs, binary from latest CM11 kernel works even if installed in AOSP kernel ramdisk) and CM11 nightly from 12/25.

    Credits:

    To JackNorris and _crue_ for the patcher
    To Timur Mehrvarz for his tremendous development work on USB ROM.

    Happy New Year!

    P.S. Additional info (as per recommendation from redeyedjedi)

    Java JRE 1.6 (16u45 recommended) must be installed (included SMALI binaries might not work with Java 1.7), as well as .NET v4 or v4.5

    Hotplug on boot does not work (not an issue for me) no matter which options I adjust under /sys/kernel/usbhost - I must unplug OTG cable from Nexus first.
    However, if I boot without OTG cable, then connect it without DAC and only later connect the DAC, it is detected properly.
    If I boot with OTG Y-cable (with power connected to it) and plug the DAC after boot completion it is detected properly.
    It seems that initial DAC detection routine in the kernel is affected by OTG charging patch (as Timur stated a while ago). There might be something else in his ROM to force initial DAC detection. I played with Timur's kernel during my 4.2.2 days and it did not detect DAC on boot as well when using stock ROM.
    If I boot with stock CM11 kernel, DAC is detected on boot, hotplug works, but no OTG charging (and I need it for USB peripherals)
    And there's still a volume control issue...:(

    WARNING: It seems that this patch will only work on CM11-based ROMs! It can render AOSP ROMs (such as Purity) unbootable! Please use with caution!
    8
    Just a quick update to let you guys know that I will be posting a new simpler patch method soon which will also include the option to enable volume control. I'm hoping to finish things off tonight/tomorrow.
    6
    Thanks so much for your help, if you could make a flashable version as sadly my android knowledge is somewhat limited :highfive:

    I have a flashable version already.....its what I run. just need to upload to devhost.....got a reply from showp so its all good. give me a bit....I might even be able to from my tablet......otherwise itll be tomorrow cause im not home.



    OK.......its rude to hijack a thread.....so I will take the time in the next days to do a proper thread. I'm also on my personal tablet and this particular build has 100mb of modules you don't need but it will work just fine. So please.... Save any questions for a bit till I get a chance on my desktop to do this right.

    Just install...... Apply this Ops mod....... And enjoy.! http://d-h.st/QhW
    5
    I'll submit the required patches to CM at the weekend (I promise :p) that should at least get things going for CM based ROMs.

    I am also hoping to release something based on the Xposed framework for people who either don't have a CM based ROM or don't want to change/update. Using Xposed should make the patch more compatible and stable across devices, it will also allows patching the fixed volume limitation when a USB DAC is connected. The volume patch is extremely simple when built into a ROM but it becomes tricky when patching at runtime.