Saturday, February 11, 2017

How to Add more Steps to your Volume Slider [Root]

In my quest to discover interesting tweaks to share with the XDA-Developers community, I frequently came across one request across many different forums:

"How do I add more steps to the volume slider?" – No one in particular

While looking up methods to reliably add more volume granularity, I found that most of the applications on the Google Play Store simply do not work for most modern devices. Another solution I've found involved the use of the Xposed module VolumeSteps+, which unfortunately means the method is restricted to rooted devices that support the Xposed Framework (meaning, no Android Nougat support). Finally, the last method that many of you are well aware of is to flash a custom ROM, but for those of us that don't have many options in that regard (the Huawei Mate 9 is lacking in development love at the moment) or want to remain with a stock rooted build, that option is difficult to stomach.

Fortunately, there's a simple way to add more steps to your call or media volume that doesn't require the Xposed Framework and works on Android 6.0+ as well. Best of all, you can stay on your stock rooted setup if you want! All you need to do is take advantage of a simple, yet totally unpublicized build.prop tweak.

Note: the device I tested this on are two Google Nexus 6 phones running Android 6.0 Marshmallow and 7.1 Nougat. I have no way of testing this tweak on every device with every software variation. This tweak is derived from looking at AOSP, but without testing other devices or looking at their source I can't say exactly which devices it will work on.


Granular Volume Control with a Build.Prop Tweak

Android's open source documentation lays out exactly how the software's audio service is implemented in AudioService.java. Within the code, there is a certain section that defines how the volume levels are initialized on boot.

          // Initialize volume          int maxVolume = SystemProperties.getInt("ro.config.vc_call_vol_steps",                  MAX_STREAM_VOLUME[AudioSystem.STREAM_VOICE_CALL]);          if (maxVolume != MAX_STREAM_VOLUME[AudioSystem.STREAM_VOICE_CALL]) {              MAX_STREAM_VOLUME[AudioSystem.STREAM_VOICE_CALL] = maxVolume;              AudioSystem.DEFAULT_STREAM_VOLUME[AudioSystem.STREAM_VOICE_CALL] = (maxVolume * 3) / 4;          }          maxVolume = SystemProperties.getInt("ro.config.media_vol_steps",                  MAX_STREAM_VOLUME[AudioSystem.STREAM_MUSIC]);          if (maxVolume != MAX_STREAM_VOLUME[AudioSystem.STREAM_MUSIC]) {              MAX_STREAM_VOLUME[AudioSystem.STREAM_MUSIC] = maxVolume;              AudioSystem.DEFAULT_STREAM_VOLUME[AudioSystem.STREAM_MUSIC] = (maxVolume * 3) / 4;          }    

The two terms that I bolded above look awfully similar to lines in the build.prop file located in /system, don't they? That's because they are, though by default you won't see these properties within the build.prop file. Luckily, if you define these properties yourself, you can manually set the number of volume steps.

If you are familiar with how to edit and add lines to your build.prop, then go ahead and get cracking! If not, here's a simple method to get you started.

Download BuildProp Editor by JRummy on the Google Play Store and open it up. Tap on the "pencil" icon in the top right to bring up the manual editing mode. Scroll all the way to the bottom and add either of the build.prop lines mentioned above and set it equal to the number of volume steps you want to have. For example, entering these two commands at the end will double the number of in-call volume steps and media volume steps respectively.

ro.config.vc_call_vol_steps=14
ro.config.media_vol_steps=30

Once you've entered these commands, reboot your phone. If it worked, you should now have as many volume steps as you specified in build.prop.

Enjoy this nifty tweak! Let us know in the comments below if it worked for your device and build version.



from xda-developers http://ift.tt/2kfk30y
via IFTTT

No comments:

Post a Comment