[HD2 Android NAND Development] memin1857:
How to test

Step by step how to test:

1) Download tytung r11 test kernel from this post:http://xdaforums.com/showpost.php?p=17031938&postcount=97

2) Flash it via clockworkmod recovery. (make a backup beforehand)

3) Install "Terminal Emulator" from market

4) Delete htcleo.acdb (if it still exists) from /system/etc/firmware/ with Root Explorer or similar file manager. (You may need to make system read-write beforehand. Look for system rw in the market and also you may need to set full permissions to htcleo.acdb before deleting with some roms) Make sure you have the unmodified default.acdb file in the same folder.

5) Make a call to another phone. Put HD2 on the table. Mute the "other phone" and put it on your ear. (Or just call a friend and ask)

6) Press home key on your hd2 and launch terminal emulator while inside a call.

7) Try this command in terminal while talking or with tv/audio playing in the background:

echo '0 200' > /proc/mic_level

You should instantly hear the change in mic gain of your hd2 by hearing less from the "other" phone on your ear. (It works in realtime even while inside a call) Pay attention to spaces.

echo '1 600' > /proc/mic_level

to set speakerphone level

It seems in speakerphone, the remote party "may" hear their own voice (echo) when gain is more than 300. Please confirm. Note that echo was present whenever mic gain levels were set to high with hd2 android, so that remains something else to be fixed. This seem to be dependent on operator.

The script (sh) file attached to this post sets normal gain to 200 and speakerphone gain to 600 and display set values when run from gscript app. You can directly create a shortcut on the home screen. The zip file is not for recovery flashing, just extract the sh file and import it to gscript lite app.

You can edit the sh script file and make many alternatives and just tap them to test different gain levels while inside a call. Please note that levels will be very different if htcleo.acdb file exists. (With htcleo.acdb file present you will already have normal level gain but you can't increase the speakerphone because max level is 1000 and it does not seem very stable with the htcleo.acdb file, just delete htcleo.acdb and so it will use default.acdb) You can set the levels by running the script at bootup with tasker + locale execute plugin or any similar method.

From my testing it seems using default.acdb with the above command makes normal talking mode normal gain level, speakerphone mode high gain level and audio playback also high in volume which is perfect.

You can check /proc/mic_level file by opening it as txt to see how it is used and what are the other device ids. (0= normal mode, 1=speakerphone etc)

The levels will be lost after reboot, but for now this is for testing only anyway. You can use gscript lite to issue the command by single tapping.

If it is not working, use the debug kernel from post 97. Follow the instructions on post 97 and post the dmesg log for mdebeljuh to investigate.

For me IT IS WORKING with the NexusHD2 2.9 ROM from tytung.

Once enough people report it working, a permanent and easier fix would be made, please post your results.