5

I have a HTC One m7 international. It has root access. Android lollipop 5.0.2

The in call volume is too low despite being on max volume.

Which file in the root system should I modify to increase the max volume? What line of code corresponds to this setting?

Thanks vm

4
  • android version?
    – Manu
    Sep 26, 2015 at 2:30
  • It is lollipop 5.0.2
    – NK2013
    Sep 26, 2015 at 3:36
  • Turn on adb in phone,connect the phone to system and run this command in system connected adb shell service call audio 7 i32 3 i32 0 i32 1 Source: SO post
    – Manu
    Sep 26, 2015 at 3:40
  • 1
    Thankyou it seems to have increased the volume... Can you explain a bit what that line of code means and how it works?
    – NK2013
    Sep 26, 2015 at 4:41

2 Answers 2

5

This approach achieves desired functionality by communicating with Android APIs at AIDL level making use of ADB


Run the command:

adb shell service call audio 7 i32 3 i32 0 i32 1

Here, the service call refers to IAudioService. Click here for more info.

  • 7 is the function named setStreamVolume. It is the 7th in the list of functions in the interface IAudioService. Verify it here. (setStreamVolume takes 3 parameters streamType, index, flag)
  • i32 is to write the integer INT into the send parcel. (Alternatively we can make use of s16 for UTF-16 string)
  • 3 is streamTypevalue. (Value 1 → phone, 3 → speaker, 4 → alarm, 6 → bluetooth)
  • 0 is index value and 1 is flag value

See the source here.

3
  • 1
    But how can op set that for every call? Or is using it once persistent?
    – cde
    Sep 26, 2015 at 6:14
  • @cde Changing once is enough, no need to change it before every call
    – Manu
    Sep 26, 2015 at 11:04
  • "7 i32 3 i32 0 i32 1" - I don't get it, why is the index=0 ? Isn't it the volume value? And what is the meaning of flag=1 ? Can you, please, clear up this issues? Thanks. Apr 18, 2020 at 11:19
1

For Android 10

adb shell media volume --show --stream 1 --set 1

example :

/ $ media volume --show --stream 4 --set 1
[v] will control stream=4 (STREAM_ALARM)
[v] will set volume to index=1
[v] Connecting to AudioService

Specific usage

usage: media [subcommand] [options]
       media dispatch KEY
       media list-sessions
       media monitor <tag>
       media volume [options]

media dispatch: dispatch a media key to the system.
                KEY may be: play, pause, play-pause, mute, headsethook,
                stop, next, previous, rewind, record, fast-forword.
media list-sessions: print a list of the current sessions.
media monitor: monitor updates to the specified session.
                       Use the tag from list-sessions.
media volume:  the options are as follows:
                --stream STREAM selects the stream to control, see AudioManager.STREAM_*
                                controls AudioManager.STREAM_MUSIC if no stream is specified
                --set INDEX     sets the volume index value
                --adj DIRECTION adjusts the volume, use raise|same|lower for the direction
                --get           outputs the current volume
                --show          shows the UI during the volume change
        examples:
                adb shell media volume --show --stream 3 --set 11
                adb shell media volume --stream 0 --adj lower
                adb shell media volume --stream 3 --get

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .