[General Topics] facuarmo:
First of all, but not less important...

I'm not responsible for anything that happens with your phone, also, some people experienced some bricks on certain devices, so, just take care where you put paths and data because your phone maybe vulnerable to bricks!

This audio modding guide is intended for experienced users. Mainly, in the Linux handling area, like customizing the kernel and playing with system internal parameters. Please don't play with this, you could overheat and/or damage your smartphone's motherboard if you mess with this menu options.​

Requirements:

A rooted LG device.

Stock ROM (includes customized or modded stock)

Universal Init.d

BusyBox

And remember, the curiosity killed the cat, don't be a cat.

System requirements:

Any LG device running ICS (or higher) stock ROM.

Procedure:

First part: setting up the environment

1. Open "Play Store", search for "BusyBox Free" (or open the play store link written above).

2. Tap the first result and install it, then open.

3. Now, install BusyBox binaries in your device. Just tap "Install".

4. All done. If you see this, close the app.

5. Now, get back to "Play Store" and search for "Universal Init.d" (or open the play store link written above). Tap the first result.

6. Install it.

7. Open it.

8. Here, move the switch from "Off" to "On".

9. Close the app. The environment set up is done.

Second part: testing device's hardware limits

1. Go to the phone's launcher and tap "Phone".

2. Dial 3845#*<your model's numeric part>#. Mine's LG Optimus L9 (Argentina version), it's model number is P778G, in that case, I should dial 3845#*778#.

3. You'll now see the "Hidden Menu" window. There tap "H/W Device Test".

4. Now pick "Sound Test".

5. Tap "Audio CAL Tool".

6. Pick "SetGain".

7. Tap in the list menu next to "Device Type" and pick "headset".

8. Here, you'll see that there's an item called "HS_DL" and next to it a box where you can type a value. This value should be from 0 to 21. This is you headphone output's gain. Mine's default is 13. The maximum for me is 16, it starts crackling if higher. I suggest you to set it to 16.

9. After setting the value, tap "Ok".

10. Exit the menu.

11. Now, to test your new setting, unplug (if plugged) and plug your headphones again.

Third part: sticking your changes

By default, your device will reset everything as it was before with every reboot. What we gotta do to save those changes? We'll save the files you change when you tap "Ok" to another folder and then retrieve it every time the device boots. How? Here you'll see that:

1. Unplug the USB Cable (if plugged), go to Settings > Developer options and enable "USB Debugging".

2. Plug you device to a computer which has ADB (Android Debugging Bridge) installed. (will work on both Windows and Linux) Don't you know if you have it? Type "adb" at the command line, or "sudo adb" (sudo, just in case) in a Linux Terminal. If you see something similar to the next screenshot, you're okay.

3. Open up a command prompt (or Terminal, in Linux). Type:

adb shell su -c "cp '/data/audio/gain.table.0 /data/local/'"

4. Open a text editor and create a new file. In Linux, use whatever you like to (includes command line and GUI). In Windows, use Notepad++.

4.1 Only if using Windows:

Right click the bar at the bottom saying "Windows (CR LF)" and pick "Convert to UNIX format".

5. Type (or copy-paste) the next code:

cp -f /data/local/gain.table.0 /data/audio/
chmod 600 /data/audio/gain.table.0

6. Save the file as 02setaudiogain somewhere in your PC.

7. Go to the folder you saved the file in your PC and then, type those commands:

adb push 02setaudiogain /sdcard/
adb shell su -c 'mount -o remount,rw /system'
adb shell su -c 'cp /sdcard/02setaudiogain /system/etc/init.d/'
adb shell su -c 'chmod 755 /system/etc/init.d/02setaudiogain'
adb shell su -c 'mount -o remount,ro /system'

8. All done, reboot your device to test ;). Liked the commands part? Reboot it with this command if you don't like the UI anymore:

adb shell su -c 'reboot'

Fourth part: troubleshooting

Can't install BusyBox or turn on Universal Init.d?

Check for permission denials at SuperSu's (or your root permission management app) logs.

Device not booting anymore?

Restore a backup over recovery or use LG Mobile Support tool (included in LG PCSuite) to re-flash your device.

Fifth part: how it works

As stated by the logs I took from

logcat

, what you do when you tap "Ok" in the "Audio CAL Tool" is save some fields to a file called gain.table.0 in /data/audio (/data/audio/gain.table.0)

logcat:

Changes it makes:

​

Credits:

To [MENTION=5032426]pauliero[/MENTION] 's post for the hidden menu code: http://xdaforums.com/showthread.php?t=2126949