love-android-sdl2 does not respect the mute or vibrate mode.

Create issue
Issue #53 invalid
Seppi created an issue

While love-android-sdl2 respects the current volume, it does not respect it when the volume is all the way up, but the system is in mute|vibrate mode.

Expected result: love-android-sdl2 will not play sounds when the system is muted or in vibrate mode.

Actual result: love-android-sdl2 plays sounds at the current set volume.

Steps to reproduce:

  • clone and build from tip (atm f09239788a9dc78d4e182a2f92224d0b17ec0883) and use the attached game.love in assets/
  • build and install the apk
  • set the volume of the device to full
  • set the device to mute or vibrate mode.
  • run the apk, and touch the screen to play the sound.

Comments (14)

  1. Pablo Mayobre

    Just one question. Should it work that way?

    I mean in my cellphone at least you have 2 volumes, one for calls and notifications sounds and other for media, the first one can be in mute or vibrate mode while the other wont be affected at all. And the one that affects LÖVE is the second one.

  2. Alex Szpakowski

    I've never owned an Android phone so I can't comment on how it works there, but on iOS it's exactly like @PabloMayobre says too.

  3. Martin Felis repo owner

    Actually not sure whether that is a bug. All the games I have on my phone do not respect the ringer settings. So... should we try "fix" in this port?

  4. Pablo Mayobre

    It respects the sound volume that I expect it to respect, not sure if it should respect the ringer volume since I would have to turn it on every time I play a game and then set it to vibrate mode when it ends... So I don't really want this to be "fixed" but as you please

  5. Martin Felis repo owner

    As it is it follows the common strategy of keeping the game volume separate of the ringer mode.

  6. Seppi reporter

    Well, here's the scenario I have in mind: I put my phone on mute, and go into a meeting, and decide to play a game. It starts blaring sound anyway.

    Perhaps we could at least consider exposing something like love.system.getMute|getVibrate|respectMuteVibrate ? Otherwise, there's no way to work around this issue as a developer. Regardless if it's a "common strategy" as you say, I still feel that this would seriously deter me from using sound in a love-android-sdl2 port.

    I would even be happy if you could write a patch that would be separate from the main branch, as I have little SDL2&Java experience. I'd be happy to maintain that against tip as well.

  7. Seppi reporter

    @slime73 I understand now.

    There are three sections: Media, Ringtone and Notifications. love-android-sdl2 respects Media, as it should. My apologies.

    This was entirely my confusion. Thanks!

  8. Log in to comment