ciasaboark / Tacere

Android app to automatically silence the phone while a calendar event is active
Other
8 stars 1 forks source link

Option to disable changes in media volume #66

Open bbastin opened 7 years ago

bbastin commented 7 years ago

When an event with silencing options starts or ends the media volume suddenly gets changed to its last state during this particular silencing state. This often times leads to drastic de- or even worse increases in volume which are unwanted (especially with headphones or a large audio receiver connected).

Proposed solution:

Add an option in the settings to completely disable all changes in media volume.

smichel17 commented 6 years ago

This seems like a bug; when the setting to silence media volume is not checked, Tacere should not change the media volume. I don't think any additional setting is needed here.

smichel17 commented 6 years ago

There might be a related bug where the alarm volume is set to vibrate and not restored; I have not completely isolated it to this app, though.

smichel17 commented 6 years ago

I spent a short amount of time familiarizing myself with this portion of the code. I found what is likely that the direct cause of the bug:

When an event begins, if the setting to mute media volume is enabled, Tacere will save the current volume, then set the volume to 0. When the event ends, it restores the media volume if the previous volume was saved, even if the setting is disabled. This should be fine, since, if the setting is disabled, there should never be a saved value. I suspect that there is a bug somewhere that saves a value, even though the setting is disabled.

I walked through the sequence of events and did not spot a place where this would happen. I then downloaded the source and tried to build myself so I could debug it, but the build failed. In the process, I realized that F-Droid does not have the latest version, so it is possible this bug is actually fixed, just not released.

I don't have any more time to spend on this right now, nor am I interested in debugging build issues in general. If the build is fixed and/or F-droid gets updated, I'll come back and take another look at this.

ciasaboark commented 6 years ago

I'll try to take a look through the code in a few days. I have a few changes on disk that have not been pushed.