[Nexus 4 General] simobile:
I posted this in General/LTE but I feel it will be easily found here.

This is to run stock 4.2.2/.33 or lower radio and not have audio issues.

Well after working a 10 hour day at a start-up, I came home and spent another 6 hours debugging our no in-call audio issue. This issue is specific to T-mobile USA customers with a certain N4 configuration. I'll explain it, only because some people will stumble upon this post and won't use the SEARCH!

You'll experience no audio during a call. No audio in the earpiece and no audio going in the mic. This is when you have:

Stock 4.2.2 (It's possible that it works on other roms that have this issue as well. Not sure.)

Either RIL file that is available. (doesn't matter)

Either bootloader (also doesn't matter)

.33 radio or lower

As I mentioned in a prior post, Google changed the sound table file for 4.2.2. This may have been to anger us but I feel like they were trying to enable an audio channel for the new HD calling or whatever. Not sure. Anyway, I verified that these entries are not in AOKP roms and that must be our issue. 4.2.2 radio has some kind of symbolic linking that matches that file and when we install .33, the rom expects that TMUS audio entry to be there and it's not. Any attempt to edit out those entries or use a straight AOKP file would cause a stuck boot animation and I'd have to do a restore...

I spent the last 6 hours tracing where each audio address was hooking too. As well as running logs to see what was going on. In a nutshell, all the audio triggers were reversed because of bad addressing. When you made a call, it would actually DISABLE mic and ear speaker audio! I didn't know how to remedy this as I didn't understand the audio "calibration database" system. So I studied it a bit and I wished I had earlier. The pattern I saw was that the main entity in a group has a set address. Something like 3:1. If any others fit in that main group, they also get 3:1. In the case of audio, think loudspeaker or loudspeaker with "dolby". Both are basically the same, so they can share the upper ranks. So imagine a loudspeaker that is much smaller and takes a different voltage, etc. That would be labeled in the next group of 6:1. So from what I saw, they basically doubled like that pretty often.

Without any further interruptions. The fix!

Your gonna need a root file manager. I like ES file explorer. It'll need to have root access enabled in the settings. You'll also need a text editor. You can use ES built in one but it really sucks. I use 920 text editor. Both those are free apps people. Do a backup before you start this as I had lots of booting issues trying to work this one out.

Now open ES (or other file manager) and navigate to root "/" on your phone. Click on the etc folder and then the snd_soc-msm folder. There will only be one file in there, snd_soc_msm_2x_Fusion3. Do whatever you have to do to change file permissions on that file. In ES, you hold down on file and go down until it brings up a box. Scroll down to the bottom and go to properties. It'll bring up the permissions. Click on the "change" box. Note it's default properties. Write them down if you have to! Now click all the check boxes. Make it a really open file! Then hit OK and go back to the directory. Click on file to open. An "Open As" box will pop up. Open as text in your 920 or whatever your app is.

You'll see the long ass Fusion3 file outlining all sound properties of your device. Were interested in changing line 1804 and 2736. If you have a good text editor, these will be listed on the left. Scroll down to line 1804 and you'll see the ACDBID or audio calibration database ID. Like this...

We need to change the ACDBID 81:1 at line 1804 to ACDBID 7:1. You can just erase the 81 and change it to 7. Just make sure spacing is the same. 1 space between the letters and the 7. Now go down to line 2736 and change the ACDBID 91:2 to ACDBID 6:2. Now you need to save that file. You won't be able to save directly over that file. You'll have to do a "save as" to somewhere that's easy to find. I just chose my download folder. Now go back into ES manager and find your file you made and copy it. Go to the snd_soc-msm folder and delete the original file and then paste your modified one in.

Now go to the properties of your new file and change the permissions back to the original default settings. This is very important. If left unprotected, someone could control any audio settings at will. This includes your microphone. Not cool.

Last but not least, reboot.

Don't forget to backup before starting procedure.

I'm not responsible for dead puppies or bricked phones.

etc. etc. etc.

Forgive any 3am grammar mistakes and enjoy your stock/TM-US/LTE! =)