[GUIDE] Unlink System and Ringer volumes on Jelly Bean

Search This thread

abex181

Member
Feb 23, 2012
19
38
Toronto
Having updated to Jelly Bean (CM10) and finding, to my dismay, the inflexibility that Google has introduced by linking System and Ringer volumes, I decided to do something about it. Hours of searching later....yielded no results except for others with similar gripes. :confused:

To be sure, this guide is not about unlinking Ringer and Notification volumes; CM10 already has an option for that. Not too sure about other AOSP-based ROMs or OEM skinned favours of Jelly Bean. I can only report my own experiences.

WHY?
Say for instance, you want your ringtone to be suitably loud...without your keypress/keyboard feedback sound/camera shutter/Google Now bleeps and bloops being equally loud. This is my use case, at least. I use AudioManager to adjust the System volume since it doesn't have a slider in the system settings.

HOW
Enough storytime, let's get down to business:

You need:
  • framework.jar from deodexed ROM
  • some form of archiving software to extract classes.dex from framework.jar
  • smali/baksmali tool to disassemble classes.dex
  • notepad software to make edits (I prefer Notepad++)

You also need read-write access to /system, i.e. the ability push/pull files from /system

Steps:
  1. pull /system/framework/framework.jar from your ROM
  2. extract classes.dex from framework.jar using archiving software (e.g. 7zip, winrar, windows explorer)
  3. run the baksmali tool on classes.dex (details can be found using a google search)
  4. find and open /android/media/AudioService.smali from the disassembled classes.dex
  5. search for STREAM_VOLUME_ALIAS
  6. above that line, you should see something like, "fill-array-data.... array_xxx", where xxx refers to the array that is being called
  7. search for "array_xxx", you should find a block of "0x0t 0x0t 0x0t 0x0t" etc.
  8. Notice how this is similar to the increased audio steps mod (the relevant array is nearby); this mod works just fine with it.
  9. See the code example for the line that you want to change
  10. save AudioService.smali
  11. reassemble classes.dex using smali
  12. replace classes.dex in framework.jar with your modified version
  13. push the modified framework.jar to /system/framework/ or otherwise copy & replace it there (you may have to do this in recovery or else risk forcing a reboot)
  14. set permissions (rw-r--r-- or 644)
  15. reboot / wipe dalvik cache

Search for STREAM_VOLUME_ALIAS:
Code:
    .line 240
    const/16 v0, 0xa

    new-array v0, v0, [I

    fill-array-data v0, :[COLOR="Red"]array_2ec[/COLOR]

    iput-object v0, p0, Landroid/media/AudioService;->STREAM_VOLUME_ALIAS:[I

Search for array_xxx (above, it is 2ec); comments added for clarity:
Code:
    .line 240
    :array_2ec
    .array-data 0x4
        0x0t 0x0t 0x0t 0x0t 	        //Voice Call
       [COLOR="Red"] 0x2t[/COLOR] 0x0t 0x0t 0x0t		//System
        0x2t 0x0t 0x0t 0x0t		//Ringer
        0x3t 0x0t 0x0t 0x0t		//Media
        0x4t 0x0t 0x0t 0x0t		//Alarm
        0x2t 0x0t 0x0t 0x0t		//Notification
        0x6t 0x0t 0x0t 0x0t		//Bluetooth
       [COLOR="Red"] 0x2t[/COLOR] 0x0t 0x0t 0x0t		//System Enforced
        0x2t 0x0t 0x0t 0x0t		//DTMF
        0x3t 0x0t 0x0t 0x0t		//TTS
    .end array-data

Change the value of 0x2t for System and System Enforced to 0x1t:
Code:
    .array-data 0x4
        0x0t 0x0t 0x0t 0x0t 	        //Voice Call
       [COLOR="Red"] 0x1t[/COLOR] 0x0t 0x0t 0x0t		//System
        0x2t 0x0t 0x0t 0x0t		//Ringer
        0x3t 0x0t 0x0t 0x0t		//Media
        0x4t 0x0t 0x0t 0x0t		//Alarm
        0x2t 0x0t 0x0t 0x0t		//Notification
        0x6t 0x0t 0x0t 0x0t		//Bluetooth
        [COLOR="Red"]0x1t[/COLOR] 0x0t 0x0t 0x0t		//System Enforced
        0x2t 0x0t 0x0t 0x0t		//DTMF
        0x3t 0x0t 0x0t 0x0t		//TTS
    .end array-data

Remarks
So far I've only tested this on my HTC OneXL running JellyBam-121412-nightly (CM10-based, with AOKP rom control and PA). However, since it is a framework.jar edit, it should be applicable to most Android phones. Ice Cream Sandwich phones did not have this problem (to the best of my knowledge). Please test and report if you do!

Only attempt if you've read this whole post and understand the steps. This will be done at your own risk, I am not responsible for and damages/bricking that is induced by your step through of this process or the edits themselves. I haven't experienced any issues at least.

I can post pictures of the process or a demonstration of it working if necessary, and when I have enough posts. (but I have exams currently..)
If any clarification is needed, just ask. (but again, I should be studying..)
 
Last edited:

phaze3131

Senior Member
Feb 11, 2010
291
27
OMG this worked for me on CM 10.2 Android 4.3!

With Abex181's help I was able to unsync my system audio with my ringer audio!

Abex181 told me the syntax changed a bit and they got rid of the "t" and also made it only 1 column, see this, which shows what I changed specifically in my AudioServices.smali file:

**********************************************************
Make the changes as follows:
0x0
0x2 -> 0x1
0x2
0x3
0x4
0x2
0x6
0x2 -> 0x1
0x2
0x3

**********************************************************

If you are having trouble with CMD commands please see this thread here:
http://forum.xda-developers.com/showthread.php?p=44871263#post44871263

and here:
http://forum.xda-developers.com/showthread.php?t=549309


Backup all files on your phone that you want to change using some type of file explorer application.

And of course do a nandroid backup, duh :)


SUPER THANKS to Abex181 , he personally helped me via messages to get this done for me on CM 10.2

Now I can type in silence while also having the option to hear my ringer or not :)

I'm so happy, literally!

TYTYTY


Travis
 

KonstiDee

Senior Member
Jun 20, 2013
106
28
OMG this worked for me on CM 10.2 Android 4.3!

With Abex181's help I was able to unsync my system audio with my ringer audio!

Abex181 told me the syntax changed a bit and they got rid of the "t" and also made it only 1 column, see this, which shows what I changed specifically in my AudioServices.smali file:

**********************************************************
Make the changes as follows:
0x0
0x2 -> 0x1
0x2
0x3
0x4
0x2
0x6
0x2 -> 0x1
0x2
0x3

**********************************************************

If you are having trouble with CMD commands please see this thread here:
http://forum.xda-developers.com/showthread.php?p=44871263#post44871263

and here:
http://forum.xda-developers.com/showthread.php?t=549309


Backup all files on your phone that you want to change using some type of file explorer application.

And of course do a nandroid backup, duh :)


SUPER THANKS to Abex181 , he personally helped me via messages to get this done for me on CM 10.2

Now I can type in silence while also having the option to hear my ringer or not :)

I'm so happy, literally!

TYTYTY


Travis

It won't work for me on HTC One GE 4.3. :(

Gesendet von meinem HTC One mit Tapatalk 4
 

KonstiDee

Senior Member
Jun 20, 2013
106
28
It completes but they are still linked, I've tried several volume control apps of the play store but no changes.
I'm on TrickDroid GE 2.0, so theire is no expandable volume control in the stock settings. ^^

Gesendet von meinem HTC One mit Tapatalk 4

---------- Post added at 06:24 PM ---------- Previous post was at 05:47 PM ----------

How far does it go?

Is there an error message?

Does it complete and the 2 sounds are still linked?

How do you know they are still linked what app are you using?

I can send you my framework.jar and maybe you can try it for me, but I think I have done it correctly cause I followed exactly the instructions.

Gesendet von meinem HTC One mit Tapatalk 4
 

phaze3131

Senior Member
Feb 11, 2010
291
27
I can send you my framework.jar and maybe you can try it for me, but I think I have done it correctly cause I followed exactly the instructions.

Gesendet von meinem HTC One mit Tapatalk 4


I'm thinking it is probably the Rom you are running that is different somehow and thats why this exact code change is not working.
 

tdunham

Recognized Contributor
Jun 21, 2008
13,686
36,462
TampaBay
Update for JB Touchwiz users

Here is an update for JB Touchwiz users.
The array is a bit different (at least for our JB 4.1.2 build).

Before:
Code:
    :array_404
    .array-data 0x4
        0x0t 0x0t 0x0t 0x0t
        0x1t 0x0t 0x0t 0x0t
        [COLOR="Red"]0x2t 0x0t 0x0t 0x0t[/COLOR]
        0x3t 0x0t 0x0t 0x0t
        0x4t 0x0t 0x0t 0x0t
        0x5t 0x0t 0x0t 0x0t
        0x6t 0x0t 0x0t 0x0t
        [COLOR="Red"]0x7t 0x0t 0x0t 0x0t[/COLOR]
        0x0t 0x0t 0x0t 0x0t
        0x3t 0x0t 0x0t 0x0t
        0x3t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x0t 0x0t
    .end array-data

After:
Code:
    :array_404
    .array-data 0x4
        0x0t 0x0t 0x0t 0x0t
        0x1t 0x0t 0x0t 0x0t
        [COLOR="Blue"]0x1t 0x0t 0x0t 0x0t[/COLOR]
        0x3t 0x0t 0x0t 0x0t
        0x4t 0x0t 0x0t 0x0t
        0x5t 0x0t 0x0t 0x0t
        0x6t 0x0t 0x0t 0x0t
        [COLOR="Blue"]0x1t 0x0t 0x0t 0x0t[/COLOR]
        0x0t 0x0t 0x0t 0x0t
        0x3t 0x0t 0x0t 0x0t
        0x3t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x0t 0x0t
        0x0t 0x0t 0x0t 0x0t
    .end array-data
 

CyberChulo

Senior Member
Apr 27, 2011
134
10
Mine looks totally different. I pulled this from Paranoid Android 4.3 rom. Does anyone know what to change to get the system unlinked?


fill-array-data v0, :array_354

iput-object v0, p0, Landroid/media/AudioService;->STREAM_VOLUME_ALIAS_NON_VOICE:[I

.line 266
const/16 v0, 0xa

new-array v0, v0, [Ljava/lang/String;

const/4 v1, 0x0

const-string v2, "STREAM_VOICE_CALL"

aput-object v2, v0, v1

const/4 v1, 0x1

const-string v2, "STREAM_SYSTEM"

aput-object v2, v0, v1

const/4 v1, 0x2

const-string v2, "STREAM_RING"

aput-object v2, v0, v1

const/4 v1, 0x3

const-string v2, "STREAM_MUSIC"

aput-object v2, v0, v1

const/4 v1, 0x4

const-string v2, "STREAM_ALARM"

aput-object v2, v0, v1

const/4 v1, 0x5

const-string v2, "STREAM_NOTIFICATION"

aput-object v2, v0, v1

const/4 v1, 0x6

const-string v2, "STREAM_BLUETOOTH_SCO"

aput-object v2, v0, v1

const/4 v1, 0x7

const-string v2, "STREAM_SYSTEM_ENFORCED"

aput-object v2, v0, v1

const/16 v1, 0x8

const-string v2, "STREAM_DTMF"

aput-object v2, v0, v1

const/16 v1, 0x9

const-string v2, "STREAM_TTS"

aput-object v2, v0, v1

iput-object v0, p0, Landroid/media/AudioService;->STREAM_NAMES:[Ljava/lang/String;
 

erico458i

Senior Member
Sep 7, 2012
208
28
Gilas Pinas
Thank you. I really can relate to this. Its just that, everything was linked. Xposed, has some modules, but they can only unlink ringer and notification, system is still linked to somewhere between the two. There is another problem, i have. My phone does not have an option, to enable or disable vibrate. Its in vibrate by default. I use vibrafix app, but it gets killed by the system.
 

eXtremeDevil

Senior Member
Jun 19, 2012
476
29
Seville
Thanks a lot!! I can confirm this is working with my current configuration!!

I think I found a bug. This modification active, along with the Xposed app "StaturbarVolume" seems to be the cause of a soft reboot when I try to change the volume when in a call.

I can't be 100% sure this is the faliure scenario because the bug is a little bit random, but I am 99% sure anyway.

My current config:

ROM: Resurrection Remix 5.1.5 (KK 4.4.2) + Xposed Framework + Gapps Minimal
Kernel: Devil2 2.3.2

EDIT

Not sure if the cause is the volume unlink, or the Statusbarvolume overlay failing to show up in call if it has never been invoked outside of a call before since the phone startup. May be a mix of the two things.
 
Last edited:

MPK99

Senior Member
Jun 25, 2017
276
65
then what about custom roms with lollipop and above versions. It can't seem the same structure as those of jellybeans. Can anyone know how unlink system & ring volumes for latest roms?
 
  • Like
Reactions: kaidelorenzo

Top Liked Posts

  • There are no posts matching your filters.
  • 12
    Having updated to Jelly Bean (CM10) and finding, to my dismay, the inflexibility that Google has introduced by linking System and Ringer volumes, I decided to do something about it. Hours of searching later....yielded no results except for others with similar gripes. :confused:

    To be sure, this guide is not about unlinking Ringer and Notification volumes; CM10 already has an option for that. Not too sure about other AOSP-based ROMs or OEM skinned favours of Jelly Bean. I can only report my own experiences.

    WHY?
    Say for instance, you want your ringtone to be suitably loud...without your keypress/keyboard feedback sound/camera shutter/Google Now bleeps and bloops being equally loud. This is my use case, at least. I use AudioManager to adjust the System volume since it doesn't have a slider in the system settings.

    HOW
    Enough storytime, let's get down to business:

    You need:
    • framework.jar from deodexed ROM
    • some form of archiving software to extract classes.dex from framework.jar
    • smali/baksmali tool to disassemble classes.dex
    • notepad software to make edits (I prefer Notepad++)

    You also need read-write access to /system, i.e. the ability push/pull files from /system

    Steps:
    1. pull /system/framework/framework.jar from your ROM
    2. extract classes.dex from framework.jar using archiving software (e.g. 7zip, winrar, windows explorer)
    3. run the baksmali tool on classes.dex (details can be found using a google search)
    4. find and open /android/media/AudioService.smali from the disassembled classes.dex
    5. search for STREAM_VOLUME_ALIAS
    6. above that line, you should see something like, "fill-array-data.... array_xxx", where xxx refers to the array that is being called
    7. search for "array_xxx", you should find a block of "0x0t 0x0t 0x0t 0x0t" etc.
    8. Notice how this is similar to the increased audio steps mod (the relevant array is nearby); this mod works just fine with it.
    9. See the code example for the line that you want to change
    10. save AudioService.smali
    11. reassemble classes.dex using smali
    12. replace classes.dex in framework.jar with your modified version
    13. push the modified framework.jar to /system/framework/ or otherwise copy & replace it there (you may have to do this in recovery or else risk forcing a reboot)
    14. set permissions (rw-r--r-- or 644)
    15. reboot / wipe dalvik cache

    Search for STREAM_VOLUME_ALIAS:
    Code:
        .line 240
        const/16 v0, 0xa
    
        new-array v0, v0, [I
    
        fill-array-data v0, :[COLOR="Red"]array_2ec[/COLOR]
    
        iput-object v0, p0, Landroid/media/AudioService;->STREAM_VOLUME_ALIAS:[I

    Search for array_xxx (above, it is 2ec); comments added for clarity:
    Code:
        .line 240
        :array_2ec
        .array-data 0x4
            0x0t 0x0t 0x0t 0x0t 	        //Voice Call
           [COLOR="Red"] 0x2t[/COLOR] 0x0t 0x0t 0x0t		//System
            0x2t 0x0t 0x0t 0x0t		//Ringer
            0x3t 0x0t 0x0t 0x0t		//Media
            0x4t 0x0t 0x0t 0x0t		//Alarm
            0x2t 0x0t 0x0t 0x0t		//Notification
            0x6t 0x0t 0x0t 0x0t		//Bluetooth
           [COLOR="Red"] 0x2t[/COLOR] 0x0t 0x0t 0x0t		//System Enforced
            0x2t 0x0t 0x0t 0x0t		//DTMF
            0x3t 0x0t 0x0t 0x0t		//TTS
        .end array-data

    Change the value of 0x2t for System and System Enforced to 0x1t:
    Code:
        .array-data 0x4
            0x0t 0x0t 0x0t 0x0t 	        //Voice Call
           [COLOR="Red"] 0x1t[/COLOR] 0x0t 0x0t 0x0t		//System
            0x2t 0x0t 0x0t 0x0t		//Ringer
            0x3t 0x0t 0x0t 0x0t		//Media
            0x4t 0x0t 0x0t 0x0t		//Alarm
            0x2t 0x0t 0x0t 0x0t		//Notification
            0x6t 0x0t 0x0t 0x0t		//Bluetooth
            [COLOR="Red"]0x1t[/COLOR] 0x0t 0x0t 0x0t		//System Enforced
            0x2t 0x0t 0x0t 0x0t		//DTMF
            0x3t 0x0t 0x0t 0x0t		//TTS
        .end array-data

    Remarks
    So far I've only tested this on my HTC OneXL running JellyBam-121412-nightly (CM10-based, with AOKP rom control and PA). However, since it is a framework.jar edit, it should be applicable to most Android phones. Ice Cream Sandwich phones did not have this problem (to the best of my knowledge). Please test and report if you do!

    Only attempt if you've read this whole post and understand the steps. This will be done at your own risk, I am not responsible for and damages/bricking that is induced by your step through of this process or the edits themselves. I haven't experienced any issues at least.

    I can post pictures of the process or a demonstration of it working if necessary, and when I have enough posts. (but I have exams currently..)
    If any clarification is needed, just ask. (but again, I should be studying..)
    1
    It worked! Finally someone looked to fix SYSTEM volume linked to ringer instead of NOTIFICATIONS. My device is an SGS3 running SlimBean 4.2.2.

    Thanks button pressed!
    1
    then what about custom roms with lollipop and above versions. It can't seem the same structure as those of jellybeans. Can anyone know how unlink system & ring volumes for latest roms?
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone