sound lost if game screen sleep or switching apps on android

Report Construct 2 bugs here.

Post » Thu Nov 05, 2015 7:52 am

Problem Description
I am facing a strange error , if I run it with chrome android browser using wifi , then whenever i switch the windows suddenly it lost the sounds. I am running music behind the application which runs fine but other sounds stop working if i switch the windows. I thought maybe this error is due to the chrome browser so i have build it with crosswalk on XDK and then i ran the application directly on the device. In start everything works fine but if i do not touch the screen and device mode goes into sleep mode then if i wake up the device it get lost all sounds of the buttons except music. So it seems like this is coming from construct2 because running the app on chrome android browser or running as an apk both gives same results.


Attach a Capx
https://dl.dropboxusercontent.com/u/104 ... 0game.capx

Description of Capx
This is basic application sample space blaster which comes with construct2, i did not change anything in its default code. It runs background music and audio sounds.

Steps to Reproduce Bug
  • Step 1 : Run the application on wifi and open the chrome browser inside android
  • Step 2 : All sound and music will work fine , now start switching your window.
  • Step 3 : Then switch back to your game window and you will find the music is still running but it lost the object sounds.
  • Step4: Now close the game and restart it in order to hear proper sounds.
  • Step5: This time start the game again and just leave the screen without any touch.
  • Step6: You will see the sound is gone again just music is playing.
  • Step7: This situation happend randomly sometime if you press two or three times in order to produce this error.

Observed Result
I have tested with remote debugging of chrome from my computer and found following errors occours before i lose audio sounds.

Code: Select all
call.preview.js:1021
Uncaught (in promise) DOMException: A call to lockOrientation() or unlockOrientation() canceled this



Code: Select all
Uncaught (in promise) DOMException: A call to lockOrientation() or unlockOrientation() canceled this call.Runtime.tryLockOrientation @ preview.js:1021
Runtime.initRendererAndLoader @ preview.js:739
Runtime.loadProject @ preview.js:1655
xhr.onload @ preview.js:410


Image

Expected Result
It should not lose its sounds if i would switch the game in middle , music stays fine but it lost the sound clicks and effects.

Affected Browsers
  • Chrome: (YES)

Operating System and Service Pack
Android OS Lollipop
Nexus 5
android version 5.1

Construct 2 Version ID
Release 216

@Ashley
B
9
S
2
Posts: 108
Reputation: 1,010

Post » Thu Nov 12, 2015 12:37 pm

I can't reproduce this on a Moto X (2014) running Android 5.1 with the latest Chrome browser. I switched several times between the Facebook app and Chrome with preview-over-Wifi. The sound always came back. None of the errors you posted appear relevant to the issue (it just failed to lock the orientation because it's not fullscreen). Am I missing something?
Scirra Founder
B
398
S
236
G
88
Posts: 24,428
Reputation: 194,625

Post » Sun Nov 15, 2015 4:12 am

I had similar case before when testing my background mode plugin. At that time I used ordinary Cordova export and lost sound after the app is paused for one or two minutes. Then I switched to Crosswalk and the issue is gone.
Providence University, lecturer.

Tatung University, lecturer.



Consultant per question: USD$15 / time

Consultant by month: USD$300 / month

Customized project: USD$2500 / capx
B
78
S
17
G
4
Posts: 197
Reputation: 7,738

Post » Sun Nov 15, 2015 4:17 am

Oh~ try Crosswalk 14
Providence University, lecturer.

Tatung University, lecturer.



Consultant per question: USD$15 / time

Consultant by month: USD$300 / month

Customized project: USD$2500 / capx
B
78
S
17
G
4
Posts: 197
Reputation: 7,738


Return to Bugs

Who is online

Users browsing this forum: No registered users and 1 guest