Increase the Number of Volume Steps in Android

This tutorial will show you how to increase the number of steps of volume control in Android.  The default number of steps (for music/media volume) is 15, which is fine for most people.  However, I have a pair of headphones which are very loud even at the lowest volume setting, so I changed it to 30 steps.

Warnings

  • You will need ROOT on your device. We are modifying android system files, so there is a chance you will break your OS.  It would be a good idea to make a nandroid backup first. This is not for the computer-illiterate or faint of heart. Read through the whole tutorial first to make sure you want to do this before starting.
  • This may not work well on all devices. On my HTC Thunderbolt, certain numbers of steps seemed to cause the volume to bounce up and down every step.

Required Hardware

  • A rooted android device. I have tested this on a Toshiba Thrive (Android 3.2.1) and an HTC Thunderbolt (Android 2.3.4)
  • A computer running Windows. You could certainly use Mac or Linux, but this tutorial is written for Windows users.

Required Windows Software

Process

Install Prerequisites

Install JDK, 7-Zip, and Notepad++

Setup ADB (Android Debug Bridge)

Unzip Android SDK.  Add the folder that adb is in to the windows PATH. This will allow you to run adb from any folder.

In Windows 7, search the start menu for environmental variables:

You can also right click on My Computer -> Advanced System Settings -> Advanced Tab -> Environmental Variables

Edit the PATH variable.  There should be several folder paths already. Go to the end of the text field, type ; (semicolon) followed by the path to adb.  For example, I unzipped Android SDK to F:Downloadsandroid-sdk-windows, so my path to adb is F:Downloadsandroid-sdk-windowsplatform-tools.

Test adb: Open a command prompt (Win+R and type cmd), then type adb version and hit Enter. A response like below should be shown.

Install USB Drivers

Enable USB Debugging on your device:

Press Home, Menu > Settings > Applications > Development. Ensure USB debugging is checked.

Plug in your device via USB.

In the command prompt, type adb devices. You should see a device listed (with serial number).

If you see a device, continue to the next step. If not, you will have to install drivers, by following the steps here.

Get framework.jar

Download and unzip Smali/Baksmali Manager (link above).

Open a command prompt in the folder where you unzipped smali/baksmali. Hold shift and right click on the folder, then click Open command window here.

Type adb pull /system/framework/framework.jar.  This will copy the framework.jar file to the smali/baksmali folder.

Extract (baksmali) and edit framework.jar

Open the smali/baksmali folder and run baksmali Manager.bat

Type 4 (select file), then 2 (framework.jar).

Type 1 to baksmali the framework.jar.  This decompresses it to files and folders. Leave this window open.

In the smali/baksmali folder, open frameworkandroidmediaAudioService.smali

Search for 0xft 0x0t 0x0t 0x0t

You should find a table that looks like the one below, with 10 or 11 lines.

The first entry in each line is the number of steps. Line 4 is music/media, and is currently 0xf, which is hexadecimal for 15

Let’s say I want to change this to 45.  Open up Windows calculator, and Witch to View -> Programmer mode. Type in 45 then hit hex, which converts 45 to hexadecimal.  The result is 2d.  You can do this for any number.

Change the value in the table to your desired value (for example 0x2dt. You can also modify the steps for the other parameters, such as bluetooth or ringers. Save AudioService.smali.

 

Repack framework.jar

In the baksmali Manager.bat window, press 2 to smali (this will create a new classes.dex file).

If you accidently closed the window, you will have to open it again and hit 4 and 2 to reselect the file.

Open framework.jar with 7-Zip. Drag classes.dex into the archive in 7-Zip

Replace framework.jar on device

Method 1:

Go back to the window that had adb open in the smali/baksmali folder. Type adb remount and hit enter. Then type adb push framework.jar /system/framework/framework.jar  This will copy framework.jar over your old framework.jar

Run adb shell

Run cd /system/framework

Run chmod 644 framework.jar

I also ran ls -l to ensure framework.jar has copied and the permissions are correct.

Restart the device. Type adb reboot

 

Method 2 (if method 1 did not work):

Go back to the window that had adb open in the smali/baksmali folder. Type adb push framework.jar /sdcard/framework.jar  This will copy framework.jar to the root of your SD card (or maybe internal storage) on the device.

Get a file browser that can access the whole filesystem, such as ES File Explorer or Root Browser. Go into options and make sure mount filesystem as writable (or similar) is enabled.

Browse to the /sdcard (this is also /mnt/sdcard). Copy framework.jar, navigate to /system/framework, and paste it, overwriting the old framework.jar

Go to properties and change permissions like is shown below

Restart the device.

Test

Play some music and rack through the volume to make sure it works right.

 

 

Sources

 

12 Responses

  1. Ben

    Thanks, your tutorial is great, and it works : I now have 45 steps instead of 15 !
    However, I have the following issue : I now have 45 steps, but after step 15 sound goes back to mute, then increase until step 30, then mute, then increase until step 45. Basically, I have 3 loops of 15 steps.

    Moreover, my initial problem was the volume level which is too loud even at step 1, and sound reach max level at step 5. Do you now where it is possible to set each step level (let assume that step 1 is currently 50% of max sound level. I would like to set it at 2%) ? I hope it is a very close manipulation to what is explained in your tutorial.

    I’m using Galaxy S 2 with Resurrection Remix 3.1.2 (Android 4.1.2, kernel Siyah 5.0).

    Thanks again for your help !

  2. Thank you very much! It’s working! ^_^

    SE Xperia Arc S

  3. Jet

    I’d like to do this, but just want to first confirm that this will work for the Samsung Galaxy S4?

  4. onyong

    I also want to know if it’ll work with the Galaxy S4!

    Did anyone try it out?

    The small number of volume levels is very annoying!!

  5. gai daigoji

    this works on galaxy s3 (4.2.1) perfectly

  6. I started to try this for the Galaxy S4 (4.2.2), but as soon as I attempt to baksmali the framework.jar file, I receive an exception stating that framework.jar doesn’t contain a classes.dex file. I can’t tell if the problem is with the S4 or Android 4.2.2, but either way, it looks like the framework.jar file is different.

  7. Rick

    This procedure worked great on my Runbo X3. Unfortunately the speaker installed in this device is just too powerful, the lowest volume step is still teeth gnaringly loud. If anyone comes across a way of making the lowest volume lower, I’d be very interested to know! Here are the hex values I used for reference…

    :array_1fe
    .array-data 0×4
    0x6t 0x0t 0x0t 0x0t
    0xet 0x0t 0x0t 0x0t
    0xet 0x0t 0x0t 0x0t
    0x32t 0x0t 0x0t 0x0t
    0x7t 0x0t 0x0t 0x0t
    0x7t 0x0t 0x0t 0x0t
    0xft 0x0t 0x0t 0x0t
    0x7t 0x0t 0x0t 0x0t
    0xft 0x0t 0x0t 0x0t
    0xft 0x0t 0x0t 0x0t
    0xdt 0x0t 0x0t 0x0t
    0xdt 0x0t 0x0t 0x0t
    .end array-data

Leave a Reply