How to Automatically Disable the High Volume Warning without Root

WRITTEN BY: supportmymoto.com STAFF

These of you who stay in one of many member nations of the European Union have in all probability come throughout the warning when attempting to lift the quantity of your headphone as proven within the characteristic picture above.

Based on laws set by the European Committee for Electrotechnical Standarisation (CENELEC), all digital gadgets able to media playback bought after February 2013 will need to have a default output quantity degree of a most 85 dB. Customers can select to override the warning to extend the quantity to a most of 100 dB, however in doing so the warning should re-appear after 20 hours of music playback.

Whereas we aren’t going to get right into a debate concerning the efficacy of this regulation in selling good well being, customers who continuously select to bypass this warning usually surprise if this course of will be automated. There are lots of circumstances the place it’s relatively annoying having to manually comply with override the quantity restrict, corresponding to while you begin music playback remotely on a Bluetooth gadget, so we wished to set about determining a solution to robotically bypass this warning.

Options to bypass the “protected quantity restrict” exist already if you happen to search our boards, however thus far all the options have required you to put in an Xposed Module. This essentially limits who can use it, because the Xposed Framework requires you to have root entry (which suggests an unlocked bootloader on most telephones) in addition to being on pre-Nougat variations of Android. However after digging into AOSP and numerous system settings, I’ve found a solution to bypass the excessive quantity/protected audio restrict on all gadgets with out requiring root.

By following this information, you settle for any dangers concerned with listening to media at excessive quantity ranges.


Protected Audio Warning Bypass Tutorial

In the event you’ve learn my earlier article on enabling Immersive Mode with out root entry, then you’ll have began enjoying round with a few of the settings you’ll find hidden in your cellphone. In the event you haven’t, I extremely advocate you do, as I’ve discovered that just about each gadget has a ton of goodies simply ready to be found. This trick isn’t any totally different as we’ll be utilizing a system property to bypass the protected audio warning.

Particularly, we will probably be modifying the System.International property audio_safe_volume_state each on boot and periodically so Android will all the time suppose you might have consented to bypass the warning. This property is outlined in AOSP, which we’re reproducing under. There are a number of states this property can take, starting from 0-3. 30 seconds after boot or after each 20 hours of steady music playback, the state is ready to ‘0’ or ‘not configured.’ It’s then set to ‘1’ for ‘disabled’ or ‘3’ for ‘enabled’ relying in your Cell Nation Code. In the event you stay within the E.U., this property is ready to ‘3’ by default however is modified to ‘2’ for ‘inactive’ at any time when the person manually bypasses the quantity warning. We will probably be altering the worth of this property to the ‘inactive’ state (altering it to ‘disabled’ by no means labored for me, in case you’re questioning).

See also  Logic Puzzle With Nine People and Nine Baseball Positions!?!?

Protected Media Quantity Implementation in AOSP


//==========================================================================================
    // Protected media quantity administration.
    // MUSIC stream quantity degree is restricted when headphones are linked in keeping with security
    // regulation. When the person makes an attempt to lift the quantity above the restrict, a warning is
    // displayed and the person has to acknowlegde earlier than the quantity is definitely modified.
    // The amount index similar to the restrict is saved in config_safe_media_volume_index
    // property. Platforms with a special restrict should set this property accordingly of their
    // overlay.
    //==========================================================================================
    // mSafeMediaVolumeState signifies whether or not the media quantity is restricted over headphones.
    // It's SAFE_MEDIA_VOLUME_NOT_CONFIGURED at boot time till a community service is linked
    // or the configure time is elapsed. It's then set to SAFE_MEDIA_VOLUME_ACTIVE or
    // SAFE_MEDIA_VOLUME_DISABLED in keeping with nation choice. If not SAFE_MEDIA_VOLUME_DISABLED, it
    // will be set to SAFE_MEDIA_VOLUME_INACTIVE by calling AudioService.disableSafeMediaVolume()
    // (when person opts out).
    personal last int SAFE_MEDIA_VOLUME_NOT_CONFIGURED = 0;
    personal last int SAFE_MEDIA_VOLUME_DISABLED = 1;
    personal last int SAFE_MEDIA_VOLUME_INACTIVE = 2;
    personal last int SAFE_MEDIA_VOLUME_ACTIVE = 3;
    personal Integer mSafeMediaVolumeState;
    personal int mMcc = 0;
    // mSafeMediaVolumeIndex is the cached worth of config_safe_media_volume_index property
    personal int mSafeMediaVolumeIndex;
    // mSafeMediaVolumeDevices lists the gadgets for which protected media quantity is enforced,
    personal last int mSafeMediaVolumeDevices = AudioSystem.DEVICE_OUT_WIRED_HEADSET |
                                                AudioSystem.DEVICE_OUT_WIRED_HEADPHONE;
    // mMusicActiveMs is the cumulative time of music exercise since protected quantity was disabled.
    // When this time reaches UNSAFE_VOLUME_MUSIC_ACTIVE_MS_MAX, the protected media quantity is re-enabled
    // robotically. mMusicActiveMs is rounded to a a number of of MUSIC_ACTIVE_POLL_PERIOD_MS.
    personal int mMusicActiveMs;
    personal static last int UNSAFE_VOLUME_MUSIC_ACTIVE_MS_MAX = (20 * 3600 * 1000); // 20 hours
    personal static last int MUSIC_ACTIVE_POLL_PERIOD_MS = 60000;  // 1 minute polling interval
    personal static last int SAFE_VOLUME_CONFIGURE_TIMEOUT_MS = 30000;  // 30s after boot accomplished

You’ll first want to put in Tasker and AutoTools so we are able to automate this trick. Technically, every other automation app other than Tasker can be utilized, however I’m solely aware of Tasker so that you’ll need to make changes by yourself if you happen to desire utilizing a special app. AutoTools, although, is important to this trick as this plug-in will permit us to regulate Safe Settings on our gadget.

As defined in my article on toggling Immersive Mode, we have to grant the WRITE_SECURE_SETTINGS permission to AutoTools. It’s because the command for controlling the protected audio quantity state is outlined below the Settings.International class, although the precise syntax for the command is hidden in AOSP (similar to it was for Immersive Mode). In the event you’ve already granted the WRITE_SECURE_SETTINGS permission to AutoTools after having learn my earlier tutorial on Immersive Mode, then you possibly can skip the subsequent part. If not, then you definitely’ll need to set it up.


Granting Safe Settings Permission to AutoTools

Beneath Android’s permission administration system, functions outline the permissions they wish to be granted within the Manifest file. Customers can then grant or deny permissions on set up (pre-Marshmallow) or on demand (Marshmallow+). Nevertheless, there are particular permissions that functions can’t be granted even when they request it within the Manifest, corresponding to WRITE_SECURE_SETTINGS. It’s because granting any software a permission as highly effective as this could give that app a ton of management over your gadget.

See also  The Main Advantages of Windows Over Other Operating Systems

However there may be one workaround that we are able to use to grant the WRITE_SECURE_SETTINGS permission to any app we would like. Through the use of ADB‘s package deal supervisor (pm) software, we are able to grant any permission to any software we would like (offered that software requests that permission within the Manifest file).

The very first thing you’ll must do is set up the ADB binary onto your pc adopted by the correct driver to your gadget. Then, allow USB Debugging in Developer Choices (go to Settings –> About Cellphone and faucet on Construct quantity 7 instances if you happen to haven’t already) and join your cellphone to your pc. Lastly, ship the next command when you’ve opened up a terminal:

adb shell pm grant com.joaomgcd.autotools android.permission.WRITE_SECURE_SETTINGS

Now AutoTools could have the flexibility to vary any International, Safe, or System setting in your gadget. There are numerous methods you possibly can mess around with these settings, and the checklist of accessible settings in every class fully is dependent upon your gadget and software program construct, however that dialogue is for an additional time. In any case, we’ll transfer on present you methods to use AutoTools to regulate the protected quantity state.


Disabling Protected Audio Warning on Boot

Right here’s the outline of the profile for these of you who’re aware of Tasker. In the event you aren’t aware of Tasker, learn on for step-by-step directions.

Disable Protected Audio on Boot

Profile: Disable Protected Audio On Boot (6)
	Occasion: Monitor Begin
Enter: Anon (7)
	A1: Wait [ MS:0 Seconds:30 Minutes:0 Hours:0 Days:0 ] 
	A2: AutoTools Safe Settings [ Configuration:Setting Type: Global
Name: audio_safe_volume_state
Input Type: Int
Value: 2 Timeout (Seconds):60 ]

Open up Tasker so we are able to create a brand new profile. On the backside proper hand nook faucet on the + icon to create a brand new profile. Add an new Occasion context and go to Tasker –> Monitor Begin. We’re utilizing this Occasion context which triggers when Tasker begins up relatively than the Occasion context which prompts when the cellphone boots as a result of the previous is way extra dependable than the latter.

In any case, press the again button as we’ll now create a Job related to this profile. Title the Job something because it doesn’t matter. When you enter the Job creation display screen, press on the + icon within the backside center of the display screen to create a brand new Motion. For the primary motion, go to Job –> Wait and have it await 30 seconds. This accounts for the “30 second after boot” rule utilized in Android to set the protected quantity state.

Subsequent, create a brand new Motion and go to Plugin –> AutoTools –> Safe Settings. Press the pencil to open the configuration display screen for AutoTools. Go to Customized Setting. For the Setting Kind enter International. For the Title enter audio_safe_volume_state. For the Enter Kind make it int. For the Worth make it 2. Verify to ensure you put all the pieces appropriately, the configuration ought to match the center screenshot under. The command have to be despatched precisely as I’ve written or it is not going to have any have an effect on.

See also  Solution to Windows Update error 0xe0000100

When you’re executed, again out to the principle menu of Tasker as we’ll must create one other profile. The one we simply created accounts for when the protected quantity state is ready 30 seconds after boot, however for these of you who nearly by no means reboot your gadget we’ll make one other profile to periodically set this worth.


Disable Protected Audio Warning Periodically

Right here’s the outline of the profile for these of you who’re aware of Tasker. In the event you aren’t aware of Tasker, learn on for step-by-step directions.

Disable Protected Audio Periodically

Profile: Disable Protected Audio Periodically (21)
	Time: 11:59PM
Enter: Anon (122)
	A1: AutoTools Safe Settings [ Configuration:Setting Type: Global
Name: audio_safe_volume_state
Input Type: Int
Value: 2 Timeout (Seconds):60 ]

Create a brand new profile, this time with a Time context. Sadly I’m not conscious of any technique to get the present cumulative time of media playback with out root, so we’ll as a substitute simply periodically set the protected quantity state to inactive as soon as each 24 hours (… it’s not such as you guys truly hear to twenty hours of music inside a 24 hour interval, proper?). Anyhow, Tasker’s interface for setting a periodic Job is type of horrible, however the gist of it’s that you simply wish to set the “From” and the “To” time to the identical time. This manner, Tasker will deal with it such as you need the Job to solely set off as soon as at a set time (I made it 1 minute earlier than midnight).

As for the Job, simply copy what you probably did for Motion #2 within the earlier profile. There’s no new or totally different Motion on this case, as all we’re doing is altering the worth of this International system property as soon as each 24 hours.

Now that you simply’ve arrange each of those profiles, you’re executed! Reboot your cellphone and you must now not see the “protected quantity” warning while you plug in your headphones.


Obtain and Import to Tasker

As all the time, we’re offering the scripts’ XML file which you could obtain and import. Merely obtain the recordsdata from the hyperlink under and put it aside wherever in your inside storage. Open up Tasker and disable Newbie Mode in Preferences. Then, return to the principle display screen and long-press on the “Profile” tab up prime. You must see a pop-up with one of many choices being “Import.” Faucet on that and browse to the place you saved the .prf.xml recordsdata and choose that file to import. Repeat for the second profile.

Obtain the ‘Disable Protected Audio Warning on Boot’ Profile Obtain the ‘Disable Protected Audio Warning Periodically’ Profile

We hope you discover this tip helpful. Tell us within the feedback under if this works for you!

NOTE : Please do not copy - https://supportmymoto.com

Leave a Reply