Skip to content

[Bug]: Timing is wrong when display is off #100

Closed

Description

@joemaro

For me it's essential that i can turn off the display during a session, but then brethap will not time the steps correctly. I've measured several cycles and the timing was correct about half the time and too late the other half ... The most off i've seen was 8 seconds late. It makes no difference whether my device (Xiaomi Poco m4 pro) is in energy saving mode or not.

To Reproduce
Steps to reproduce the behavior:

  1. Start a session
  2. Turn off the display
  3. measure whether the sounds or the vibration is on time

Expected behavior
well, i'd like it to be on time :)

Smartphone (please complete the following information):

  • Device: Xiaomi Poco m4 pro
  • OS: Android 12 SP1A.210812.016 running MIUI 13.0.2
  • Version: 1.7.16+108 (updated today in fact)

PS: Apart from that, i love the app and want to thank you for making it!!! <3

Activity

  1. added
    bug
    on May 8, 2023
  2. joemaro commented on May 8, 2023

    @joemaro
    Author

    Added the info that I installed this from F-Droid, but the edit doesn't seem to happen ...

  3. jithware commented on May 8, 2023

    @jithware
    Owner

    This behavior is because Brethap does not have permission to run in the background. I would prefer not to implement background capabilities as it would require additional permissions and a background service. Currently brethap only requires two permissions - vibrate (for vibration) and network access (for opening help/report from the about menu). I'd like to keep permissions to a minimum to ease users concerns about privacy.

    When running, brethap automatically keeps the display on until the session ends (unless of course you manually turn off the display). This is so it can continue to run in the foreground. If you have to have the display off, as a workaround you should be able to set the inhale/exhale audio to a tone and brethap will continue to run as long as an audio is played every few seconds or less. Not ideal but this works for the default preset (4 seconds inhale + tone 1 --> 4 seconds exhale + tone 3), from my testing anyway. I could add a 'silent' tone for the max breath length and in theory this could work for longer cycles.

  4. added a commit that references this issue on May 9, 2023
  5. jithware commented on May 9, 2023

    @jithware
    Owner

    Added additional silence to audio files that should allow for the cycle to continue when the display is off. If no sound is desired, set the audio to "Silence" for inhale and/or exhale audio when shutting off the display or to "None" when running normally.

    In release >= 1.7.17+110

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions