yashsingh1/xdaforums huggingface dataset:
[Nexus 7 Q&A, Help & Troubleshooting] papatel:
Thanks to the trinity kernel, morfic and a very nice FiiO E10 USB dac, I have excellent audio quality in my car through my dash mounted nexus 7. It has worked flawlessly for weeks without issue.

Unfortunately as morfic pointed out in his kernel thread, with a USB DAC enabled and his asound.conf changes, we destroy the audio input. No IP phone calls/ video recording... they crash since the audio input configuration is messed up.

We need to merge the asound.conf USB DAC output changes with the stock asound.conf. I've tried all permutations of this that I think make sense and I've had zero luck. Heck, if I go back to the stock asound.conf my USB DAC still works and audio input is still broken.

If there are any alsa gurus out there, please speak up and give us 10 minutes of your time. I've spent hours on this, reading alsa docs and trying asound.conf changes.

Not sure if it matters, but I'm using the stock JB rom with just the upgraded trinity kernel.

for reference: the stock asound.conf is:

The updated changes from morfic are:

Thanks!
[Nexus 7 Q&A, Help & Troubleshooting] mrruin:
did you have a look at this yet?

http://rootzwiki.com/topic/30129-kernel-nexus-7-cifsnfsusb-otg-gpu-oc-cpu-oc-072912/
[Nexus 7 Q&A, Help & Troubleshooting] papatel:
Tried that kernel, same results as trinity.
[Nexus 7 Q&A, Help & Troubleshooting] davieslacker:
I'm pretty well stuck in the same situation. My main reason for wanting usb audio is for connecting a better mic to the nexus 7.

I tried some variations in the asound.conf with no impact either.

It is supposed to be asound.conf in /system/etc correct? I ask, because I completely emptied the file, and everything still works exactly the same. Normal mic and internal sound, and usb sound out after a reboot.... my asound.conf still currently sits empty.

Maybe this information will help get things started. Here's stuff from my /proc/asound directory with the usb device plugged in.

sh-3.2# ls -a /proc/asound/
. Tegra card2 hwdep timers
.. card0 cards pcm version
Device card1 devices tegrart5640

sh-3.2# cat /proc/asound/devices
2: [ 0- 3]: digital audio playback
3: [ 0] : control
4: [ 1- 0]: digital audio playback
5: [ 1- 0]: digital audio capture
6: [ 1] : control
7: [ 2- 2]: digital audio playback
8: [ 2- 2]: digital audio capture
9: [ 2- 1]: digital audio playback
10: [ 2- 1]: digital audio capture
11: [ 2- 0]: digital audio playback
12: [ 2- 0]: digital audio capture
13: [ 2- 0]: hardware dependent
14: [ 2] : control
33: : timer

sh-3.2# cat cards
0 [Tegra ]: HDA-Intel - HDA NVIDIA Tegra
HDA NVIDIA Tegra at 0x70038000 irq 113
1 [Device ]: USB-Audio - USB PnP Sound Device
C-Media Electronics Inc. USB PnP Sound Device at usb-tegra-ehci.0-1, full speed
2 [tegrart5640 ]: tegra-rt5640 - tegra-rt5640
tegra-rt5640

sh-3.2# ls Device
id pcm0c pcm0p stream0 usbbus usbid usbmixer

sh-3.2# cat pcm
00-03: HDMI 0 : HDMI 0 : playback 1
01-00: USB Audio : USB Audio : playback 1 : capture 1
02-00: RT5640 PCM rt5640-aif1-0 : : playback 1 : capture 1
02-01: SPDIF PCM dit-hifi-1 : : playback 1 : capture 1
02-02: BT SCO PCM dit-hifi-2 : : playback 1 : capture 1
[Nexus 7 Q&A, Help & Troubleshooting] davieslacker:
More information.

bash-3.2# lsusb
Bus 002 Device 001: ID 1d6b:0002
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 002: ID 0d8c:0139

First device is present in lsusb before I plug the usb device in. Dmesg seems to show the second as the host controller..

Some dmesg output right after plugging in.

[ 586.426776] usb 2-1: new full speed USB device number 2 using tegra-ehci
[ 586.473084] usb 2-1: New USB device found, idVendor=0d8c, idProduct=0139
[ 586.473493] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 586.473712] usb 2-1: Product: USB PnP Sound Device
[ 586.474095] usb 2-1: Manufacturer: C-Media Electronics Inc.
[ 586.499589] input: C-Media Electronics Inc. USB PnP Sound Device as /devices/platform/tegra-ehci.0/usb2/2-1/2-1:1.3/input/input4
[ 586.500399] keychord: using input dev C-Media Electronics Inc. USB PnP Sound Device for fevent
[ 586.500701] generic-usb 0003:0D8C:0139.0002: input: USB HID v1.00 Device [C-Media Electronics Inc. USB PnP Sound Device] on usb-tegra-ehci.0-1/input3
[Nexus 7 Q&A, Help & Troubleshooting] davieslacker:
This is my first time participating in any forum. I've always been an irc geek. So I'm not entirely sure how to promote an interest in this topic, or if we need a new specific thread. Also.. excuse any newb annoyances on my part as I adjust...

I'm pretty well willing to try anything with my nexus 7. No consern for loosing data or starting from scratch... any rom, kernel, tweak.. if anybody has suggestions or want me to try/test something.

I have a feeling this is configuration related, maybe not asound.conf... I messed with audio_policy.conf no luck, but it did have an impact on my input when I tried a few input lines similar to top lines for internal, but in USB section at bottom. I ended up with a continuous buzz on input, and it was still buzzing on input when I pulled the USB device. No change in wave form when tapping mics.. so no good, but I was excited that I had an impact on the input channel at all. Might just be bad lines I used.. was just guessing at config based on rest of file.

I'll try to remember to post what I put in audio_policy.conf later.

Wish I had aplay and arecord to test each device. Tried tinycap with no luck.
[Nexus 7 Q&A, Help & Troubleshooting] papatel:
Glad someone else is excited about getting this working!

I believe you can grab alsa binaries from the play store for free. I played with it a few weeks back and the alsa tools seem to work.
[Nexus 7 Q&A, Help & Troubleshooting] davieslacker:
I haven't seen those? I was looking for alsa tools for android tools the other day and could only come up with tinycap, tinymix, and tinyplay with a libtinyalsa.so on another forum... but they aren't utilizing the right devices when I give them device numbers and only throw errors. If you could point me at the tools, that'd be cool.
[Nexus 7 Q&A, Help & Troubleshooting] davieslacker:
Do you think we need to start a thread on a different part of the forum? like in a development section? or... ionno...

I honestly don't really know how this works. I am seeing the importance of threads vs just sharing info on irc as I get older... and if/when I do a little bit of work towards something or digging of information.. I do like that it gets passed along to somebody else, is discoverable by others using google, and that it is a contribution to the geek community that I have always been proud to consider myself a part of.
[Nexus 7 Q&A, Help & Troubleshooting] papatel:
I think here is a good place to start. Someone out there definitely knows exactly how to do this and the more exposure the better. XDA is awesome for that.

As per your previous question, search for alsa mixer in the market. You'll need to install busy box as well.

Can you post your audio_policy.conf changes? I'll try to fiddle with it as well.
[Nexus 7 Q&A, Help & Troubleshooting] chdloc:
OP, the problem that I'm seeing that you now have two default devices, i.e. two definitions of "pcm.!default" (BTW, the exclamation mark overrides built-in defaults) and the latter one takes precedence, I think. Hence, any application using the sound card using the default parameters, as most apps (minus built-in ones) would probably do will grab your DAC which does not have a microphone input. If you had a DAC+ADC you can make this probably work fairly easily. I'm not an ALSA "guru", but someone who has had quite some exposure. I hesitate giving you blind suggestions, but a good place to start is the asoundrc documentation on the alsa-project web pages (can't post links yet)

You may want to look into setting up "multi", "dmix", and/or "dnsoop" devices that combine your DAC with the built-in one. Good luck.
[Nexus 7 Q&A, Help & Troubleshooting] papatel:
Thanks for the pointers. I've read through much of that documentation but I'll be honest I really got lost. I'll try it again.

I only have one pcm.!default definition in each config file. I do not append the changes from morfic, I replace the entire file.

I'm a little concerned that as we've discovered, we can delete the asound.conf file or put completely invalid junk in it and we are unable to change the behavior... I don't want to spend hours perhaps crossing over a correct asound.conf only to realize something else was preventing my configuration from being successful...

Right now, I'm just trying to get any change from asound.conf to reflect the audio configuration of android. Maybe asound.conf is ignored if there is an invalid config and I've yet to put a valid config?
[Nexus 7 Q&A, Help & Troubleshooting] davieslacker:
I'll post the audio_policy.conf tomorrow when I get to work. I'll have a little extra time, I really just based what I added on how the entries above it looked... I'm probably way off.

Also... I do honestly believe the asound.conf has no impact on the audio at all... Mine's still empty... works the same...
[Nexus 7 Q&A, Help & Troubleshooting] davieslacker:
The changes I made, just the bottom usb section of audio_policy.conf. I left everything above it the same.

usb {
inputs {
usb_accessory {
sampling_rates 44100
channel_masks AUDIO_CHANNEL_IN_MONO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_IN_USB_ACCESSORY
}
usb_device {
sampling_rates 44100
channel_masks AUDIO_CHANNEL_IN_MONO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_IN_USB_DEVICE
}
}
outputs {
usb_accessory {
sampling_rates 44100
channel_masks AUDIO_CHANNEL_OUT_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_OUT_USB_ACCESSORY
}
usb_device {
sampling_rates 44100
channel_masks AUDIO_CHANNEL_OUT_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_OUT_USB_DEVICE
}
}
}
}

Like I said, this did nothing except create a continuous buzz on the input channel, even after checking it with usb device in, and then pulling the device and checking again without the device.... still buzzing... but as I said, I was just pleased that I managed to find something that actually had an impact on the input channel at all. Maybe with a little more fiddling, the right settings, maybe this is the file to focus on... until somebody more informed tells me otherwise.. lol.

---------- Post added at 03:43 PM ---------- Previous post was at 03:35 PM ----------

ah... sorry. There's an extra close bracket, it's cause I pasted the whole bottom of the file, and that last bracket closes off the configuration for the entire file, not just the usb section. Just noticed that and didn't want anybody to get messed up or confused... just make sure each section is opened and closed I guess when you're done editing.
[Nexus 7 Q&A, Help & Troubleshooting] chdloc:
Just in case anybody is interested, I just built the necessary kernel modules (and the snd-aloop device that we may need to get this to work) for the stock kernel (3.1.10-g52027f9) to allow USB audio without having to install a custom kernel. The modules load fine.

I currently don't have access to my USB sound card to test further, but I'll play around with it once I get it back.

(I'm not sure I can attach files yet, so PM me if you are interested.)
[Nexus 7 Q&A, Help & Troubleshooting] davieslacker:
That sounds good, I'd be willing to give it a shot. I will hit you up when I have a little time. Perhaps you could consider hosting them on dropbox or something similar. I find myself using it a lot these days.
[Nexus 7 Q&A, Help & Troubleshooting] MetalMan2:
Any update on this? Getting my N7 prepped for car use.

Have it set up so I can do full USB OTG with USB audio through a DAC, and charge simultaneously (I can even run the N7 in this configuration with the battery connector disconnected). I thought this was the hard part.

But with this installation going into my car, having the ability to control functions with my voice will be very critical! So... has anybody successfully enabled hooking a microphone up to the DAC for audio-in to their Nexus 7?
[Nexus 7 Q&A, Help & Troubleshooting] davieslacker:
I've been juggling a lot of things lately and can't even get to my "GOOD" pc... but as soon as I get myself organized, I'm jumping right back into trying to solve this.

I really hope some other people are interested enough to be working on it still too.

It's a pretty important issue to me as a musician... I'm thinking the N7 could be the first android device to do some light multi-tracking on... Not looking for a pocket studio, but it sure would be nice to sit down with just my guitar and a good mic hooked to the n7 to work out some ideas.
[Nexus 7 Q&A, Help & Troubleshooting] jbinary:
So, I compiled the modules for usb-audio for my tf101 too, loaded them into kernel and played some noise via aplay. Then I checked lsof and noticed that the sound is handled by the "mediaserver" process, then I went to grep the android sources.

I found that android has hardcoded it's audio devices files, so it's pretty hard to make usb audio work with asoundrc (i.e. impossible), but also I noticed that there is actually support of usb audio (that has hardcoded to the card number 1 though, but this is something and better than nothing) and the system has to be built with the QCOM_USBAUDIO_ENABLED flag to get this work.

Who will test it first? ;)
[Nexus 7 Q&A, Help & Troubleshooting] jbinary:
hm. this code is specific for the qcom hardware... so need dive deeper to the code... :(
[Nexus 7 Q&A, Help & Troubleshooting] jbinary:
Continuing my investigations. Please, reply if someone is interested to discuss about it.
[Nexus 7 Q&A, Help & Troubleshooting] jacknorris:
I have gotten this working on a Nexus 7. USB DAC + microphone works without needing to reboot

I'll post the required changes in a few hours. :)
[Nexus 7 Q&A, Help & Troubleshooting] MetalMan2:
Sounds great! Really looking forward to reading how you managed to make this function.
[Nexus 7 Q&A, Help & Troubleshooting] brutog:
Super excited for this. This was a huge kink in my Nexus 7 carputer implementation.
[Nexus 7 Q&A, Help & Troubleshooting] jacknorris:
That's my goal also ;). Sorry for the delay I will post details today I promise.

The changes are unfortunately not config based, so you will need to roll your own copy of your favourite firmware with the patches included.

I will include prebuilt copies of the affected files that you should in theory be able to replace on your device to avoid the need to compile your own firmware but I cannot guarantee compatibility with all firmwares, I am currently basing my changes on AOSP/CyanogenMod.
[Nexus 7 Q&A, Help & Troubleshooting] brutog:
My Nexus 7 is in the mail. Hopefully you can figure out a good way to package this.
[Nexus 7 Q&A, Help & Troubleshooting] jacknorris:
I have posted the details in a new thread -> xdaforums.com/showthread.php?t=2029728

I can't post links yet so I am afraid you are going to need to copy paste it :)

I would appreciate it if you could let me know how it works for you.
[Nexus 7 Q&A, Help & Troubleshooting] brutog:
Should be here in a couple days. I will try it then and let you know. Thank you for your work on this. Next step, some kind of external Mic! I don't know how well the internal one will do in a car.

Out of interest, what DAC are you using?
[Nexus 7 Q&A, Help & Troubleshooting] jacknorris:
Originally a cheap £1.50 USB sound card from ebay in order to test a proof of concept without wasting money.

I now use a Fiio E7 without issue and from what I understand the E17 works as long as you turn USB charging off.

As for the external microphone, that too shouldn't be that difficult. The code, just like with USB audio output is all there for the input it's just a matter of telling the audio policy manager to start switching. I'll take a look over the next few days a see what can be done.

My current plan is to have 3 USB sound cards, 1x for audio output and 2x for audio input. The two audio inputs will be for radio (3G data around here is hit and miss) and bluetooth handsfree.

I intend to design both a USB controlled radio and USB controlled bluetooth handsfree, both of which will route audio back to the tablet via the additional sound cards. Once I am happy that it works I may then look into building a USB audio chip directly into the radio/handsfree. If your interested in any of this I will be publishing all of the information online.

There is a kernel mod out there that allows you to charge the N7 via USB while in host mode so long as you supply your USB devices with external power so providing everything goes smoothly this should be able to replace my head unit entirely.

The final issue is persistent device naming, depending on the order that the devices are connected they will all be assigned different names which will end up breaking things later down the line. I ported udev to the N7 to solve this and assign devices based on their position in the USB hub but it's all a bit bloated and I have yet to make the device boot on it's own with udev enabled. I may just write a more slimline version directly into the android core.

Anyway enough ranting! Good luck!
[Nexus 7 Q&A, Help & Troubleshooting] brutog:
sioradi and

I would absolutely be interested in some kind of external microphone input.

I am planning on the kernel mod for charging in OTG mode. Definitely an absolute necessity for what we are trying to do. To be honest, I think you should roll all these changes into a kernel and release it. There are tons of people doing car builds for N7 and I think it'd be a great idea for a one stop shop for all of it. I've been scouring everywhere to gather together all the knowledge/fixes/patches to get a perfect car head unit replacement.

Here is a list of things I think carputer N7 builds are looking for:

OTG while charging

USB DAC support (no hiccups, reboots, other problems)

Write support for a filesystem other than FAT32 (NTFS, EXT4). Some kernels already have NTFS

Working external microphone for voice commands

I will probably be using a Carnetix P5USB hub. It's nice cause it has a 5 or 25 minute delayed shutdown. I plan to power an external bluetooth GPS, usb hard drive, JoyCon Ex, and the DAC through this. I think it would be useful for them to stay on for a period of time (gas station, rsyncing music to the HD when I get home).
[Nexus 7 Q&A, Help & Troubleshooting] jbinary:
Got it work on my tf101. Still without hotplug, but reboot isn't needed to switch the output.
[Nexus 7 Q&A, Help & Troubleshooting] jacknorris:
Could you explain further? I always classed hotplug as making something work without having to power down or reboot.
[Nexus 7 Q&A, Help & Troubleshooting] jbinary:
The thing is that you don't need to reboot the device but you do need to lock it to make it sleep and then wake. Then the driver will reopen pcm and detect if there other devices are plugged in (than default one) and will open it.

Also, I still have no a microphone support and automatic PCM parameters detection, but this is just a question of time and not a real problem.

To do real hotplug, I'll need to find a place where android tracks that new audio device is plugged, don't know if I really interested to do it :)
[Nexus 7 Q&A, Help & Troubleshooting] jacknorris:
As discussed earlier in the thread this is actually something I have managed to get working -> http://xdaforums.com/showthread.php?t=2029728

It probably wont work correctly on other devices but I am working on an alternative solution that should work across devices + roms.
[Nexus 7 Q&A, Help & Troubleshooting] jbinary:
That's very interesting stuff, thanks! I'll try to apply it for my tf101 and will reply about the results.
[Nexus 7 Q&A, Help & Troubleshooting] jbinary:
So I applied your patches to my tf101 device tree and replaced the services.jar file on my device, then rebooted and the usb audio works perfect now (except of some clicks on youtube app), so great work!

The other thing is that when your patch is applied, on-screen keyboard appears even if my dock is connected. There was no such behavior before. Don't understand how your patch could lead to such bug, maybe this is actually the bug of my device tree though. Will look forward about the problem.

Thanks again!
[Nexus 7 Q&A, Help & Troubleshooting] Kuchar09:
Do you add the updated changes to the end, beginning or replace completely?
[Nexus 7 Q&A, Help & Troubleshooting] josifn:
I have the same problem?:(
[HTC Rezound] putney1477:
Anyone else having problems with the website? The problem I am having is that when I open the site, it runs for about 30 seconds, then stops. I can't close out, I can't toggle other pages. Nada....eventually I have to force shut down. Kinda sucks when I work from home nights and I can't even have it up and running and toggle between pages. I thought it was my laptop and even brought it in to be looked at and cleaned up.

Am I the only one? App works perfect.
[HTC Rezound] GrayBoltWolf:
XDA has hundreds of thousands of users online at any given moment, so every now and then the site gets slowed down. Just wait a bit and it always comes back.
[Sony Ericsson Xperia Mini, Mini Pro, Xperia Pro, A] Junior Iqfar:
This is my first post, I apologize if I am wrong in making the thread...

I just share my work...

:cowboy:

I'm using a custom rom Real ICS r6 made ​​by Kobzar666, don't forget to say thank you to him...

Screenshoot

In Attach File

Download v1

docs.google.com/open?id=0Bz9j9DxzNl4qbUJDd0NTbjJwdjQ

Download v2

docs.google.com/open?id=0Bz9j9DxzNl4qRHJrSDREdkxKY1k

How To Download

Click File

Select Download (CTRL + S)

Install

Download file

Copy to sdcard

Go to CWM Recovery

Flash in CWM

Reboot system
[Sony Ericsson Xperia Mini, Mini Pro, Xperia Pro, A] Spex:
nice work ;)

very nice wallpapers :)

btw u should make wallpapers available for downloading
[Sony Ericsson Xperia Mini, Mini Pro, Xperia Pro, A] Junior Iqfar:
Ok thanks for your attention...

I will update later...
[Sony Ericsson Xperia Mini, Mini Pro, Xperia Pro, A] aguiab:
Make a theme with BENFICA (SLB Portugal), please?!

Excellent work. I wonder, can you do a theme Benfica (SLB de Portugal), as in Portugal and abroad, are over 130 million followers, and it would be interesting to have a theme about the club Benfica.

I enclose some pictures, for that matter.

If possible, tell anything.

Again thank you for this excellent work

aguiab
[Sony Ericsson Xperia Mini, Mini Pro, Xperia Pro, A] eltonpestana:
Nice Job man. I'm add your theme on my Next version Pestanoid v3. Thank you
[Sony Ericsson Xperia Mini, Mini Pro, Xperia Pro, A] Junior Iqfar:
Update Natural Themes v2

this is the screenshoot in the attach files
[Sony Ericsson Xperia Mini, Mini Pro, Xperia Pro, A] Junior Iqfar:
I am still in the learning process

so maybe later the result was not so good

I only share my own work

I'm sorry guys

ok thanks, don't forget my name guys...

:laugh:
[Sony Ericsson Xperia Mini, Mini Pro, Xperia Pro, A] ethanusha:
Hey man! Great work you have done! But can you please post a new link for diwnloading the themes! :)
[Sony Ericsson Xperia Mini, Mini Pro, Xperia Pro, A] Junior Iqfar:
Download link are true guys...

You must login in your account gmail...