Skip to content

About

Android app to restore volume level after Android reduces it automatically when connected to an AUX cable.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Gjallarhorn

An Android app to counter the "hearing protection" volume lowering system implemented in Android when connected to an AUX cable.

Note: Please do not use this app to destroy your ear drums. You are responsible for protecting your own hearing!!!

The Problem?

Since Android 15, the Android operating system has the capability to decrease media volume when it detects loud volume output, specifically when an auxiliary audio device is connected. This feature cannot be simply disabled by the user of the device.

The intent of this feature is to protect the user's hearing when listening to music with headphones connected to the device. However, there are some flaws in this logic that can make this feature more of an inconvenience than a benefit to the user:

  1. The user cannot disable this behavior. This removes the user's choice of the use of this feature.

  2. This feature will not trigger twice within a ~22 hour period. The user can restore the media volume to what was previously set without the "hearing protection" feature activating for ~22 hours, making this feature more of a warning.

  3. This feature does not distinguish between an auxiliary speaker vs. headphones. For example, the user could be playing music at a public gathering using an external speaker, which could be interrupted by the "hearing protection" feature. This can be especially annoying when the Android device is not conveniently accessible.

How Does This App Solve the Problem?

According to my research and current knowledge, there is no way to specifically listen for the "hearing protection" feature on a non-rooted device. This feature is not meant to be disabled after all. Rather than listening specifically for the "hearing protection" feature to trigger, Gjallarhorn will instead monitor all volume changes, and will activate when all of the following conditions are met:

  • The gjallarhornEnabled toggle within the app is toggled to the true position. This can be verified by checking the variable values in the Developer Details section. If the line reading gjallarhornEnabled says true, then you are good to go!

  • An auxiliary audio device is connected. This specifically refers to any device with a physical / wired connection to the device. Bluetooth devices are not included (since I have not encountered the hearing protection feature while using Bluetooth audio devices).

  • The difference between the newly set media volume and previously set media volume is greater than the volume change value set by the user (default = 4).

    • Ex: On Google Pixel devices, it takes 25 consecutive presses of the volume up button to go from muted volume to the maximum volume, and vice versa to reach the minimum volume from the maximum. Assuming the maximum volume is equal to a value of 100%, we can divide that by the 25 presses to get a volume change value of 4. Therefore, every time the volume change button is pressed, it changes the volume by a value of 4.

    • Because this value may vary on devices other than Google Pixel, users can set the volume change value manually instead of using the default value. Users should start with their media volume muted, then press the volume up button consecutively, counting how many presses are required to reach the maximum media volume. The user should divide 100 / X, with X being the number of button presses required to reach maximum media volume from the minimum media volume.

    • This behavior works because the hearing protection feature will lower the user's volume by a large amount, so when Gjallarhorn detects a change large than the usual volume change value, it knows to restore the volume to what user had previously set it to.

About

Android app to restore volume level after Android reduces it automatically when connected to an AUX cable.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages