Anuken / Mindustry

The automation tower defense RTS
https://mindustrygame.github.io
GNU General Public License v3.0
22.16k stars 2.93k forks source link

No way to listen to music while game runs even with sound at 0% #1507

Closed andreyorst closed 4 years ago

andreyorst commented 4 years ago

Platform: Android

Build: 103.4

Issue: When I start the game my music shuts down it's audio, while still being played. I'm using google play music player and I would like to continue listening while playing Mindastry as it works in other games which can disable in-game music.

Steps to reproduce:

  1. launch google play music, start playback
  2. launch mindastry, start the game
  3. Music is not paused, but no audio. In-game audio shutters, music plays silently and songs change.
  4. Pause music, ingame audio works fine.

Even if audio is at 0% in settings. Toggle switch also would be nice to have


It seems that mindastry tries to make it's audio source higher priority, because two application actually fight for audio output.

deltanedas commented 4 years ago

will try to replicate on simple music player from fdroid and latest master

deltanedas commented 4 years ago

works fine for me, try on BE? or get https://f-droid.org/en/packages/com.simplemobiletools.musicplayer/ its what i use and ive had no issues with it

deltanedas commented 4 years ago

even my earphone control thingy works, not sure what would cause it to not be muted very strange

andreyorst commented 4 years ago

Very weird, but I've tried to do screen capture, but while I was capturing there were no sound issues.

I've downloaded suggested player and it had similar issues, however if I launch mindustry while music plays there's no sound in mindustry. If I pause music, sound in mindustry is back, and after resuming there's no sound in the player itself. If I pause the playback and left my phone after it sleeps music resumes from pause by itself, though it may be player itself.

deltanedas commented 4 years ago

i can listen to hotline miami ost and mindustry music at the same time... idk man works fine even if i lock and unlock (music doesnt pause but mindustry does, and resumes when locked) cant replicate, sorry

andreyorst commented 4 years ago

I've should have mentioned my phone specs: Xiaomi Mi9T with it's stock MiUI10.3.10.0(PFJRUXM) Stable, Android 9. Perhaps let's keep this issue for a while, maybe I'll figure out something or it will be fixed occasionally with future updates.

deltanedas commented 4 years ago

also on android 9, samsung a20e

Anuken commented 4 years ago

Works fine for me using a different music player; when music is enabled, I can hear both the game music and the player, and when the game music is at 0% everything works normally. I would guess that the issue is caused by your player automatically stopping when any track is played in the background, even at 0% volume.

Might be fixed by the next commit; I disabled all play() calls when volume is 0.

andreyorst commented 4 years ago

Thanks for the fix.

Works fine for me using a different music player; when music is enabled, I can hear both the game music and the player, and when the game music is at 0% everything works normally.

I'll try different players soon. I have Aimp, Poweramp, and shuttle+

I would guess that the issue is caused by your player automatically

stopping when any track is played in the background, even at 0% volume.

I don't think so. When I listen to music and open YouTube video - music is literally paused. When I open video in Telegram both music and video are being played at the same time with no issue (which is not super convenient though). However, when I launch Mindustry music is silenced, but not paused and seems like continues to progress very slowly, because if I time launch of Mindustry at the very end of the track (4-5 seconds remaining) the track changes after longer time and sound is back until Mindustry plays some of its sounds.

Might be fixed by the next commit; I disabled all play() calls when volume is 0.

This is a good change, will wait for update in Google Play or FDroid, thanks.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Anuken/Mindustry/issues/1507?email_source=notifications&email_token=AEUROT4V3EDNMR2AAGVRPCTRBYCIBA5CNFSM4KPSBC6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELFETYI#issuecomment-583682529, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEUROT5AA5AWIJDG4VO7CHLRBYCIBANCNFSM4KPSBC6A .

andreyorst commented 4 years ago

I've tried several players an this happens only with google play music. However this doesn't happen when I play other games.

Thanks for the fix.

Works fine for me using a different music player; when music is enabled, I can hear both the game music and the player, and when the game music is at 0% everything works normally.

I'll try different players soon. I have Aimp, Poweramp, and shuttle+

I would guess that the issue is caused by your player automatically

stopping when any track is played in the background, even at 0% volume.

I don't think so. When I listen to music and open YouTube video - music is literally paused. When I open video in Telegram both music and video are being played at the same time with no issue (which is not super convenient though). However, when I launch Mindustry music is silenced, but not paused and seems like continues to progress very slowly, because if I time launch of Mindustry at the very end of the track (4-5 seconds remaining) the track changes after longer time and sound is back until Mindustry plays some of its sounds.

Might be fixed by the next commit; I disabled all play() calls when volume is 0.

This is a good change, will wait for update in Google Play or FDroid, thanks.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Anuken/Mindustry/issues/1507?email_source=notifications&email_token=AEUROT4V3EDNMR2AAGVRPCTRBYCIBA5CNFSM4KPSBC6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELFETYI#issuecomment-583682529, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEUROT5AA5AWIJDG4VO7CHLRBYCIBANCNFSM4KPSBC6A .