Win Phone 8.1 App crashes randomly after adding Audio (CAPX)

Bugs will be moved here once resolved.

Post » Tue Sep 09, 2014 8:53 pm

CAPX Included!

Problem Description
*EDIT:* Same set of sound files were getting triggered at once when player overlaps with a group enemies. Now I used Trigger Once and the crash rate has reduced.
However after I included BG music and exported to Windows Phone/Emulator, the music stops as soon one or two sound files is played. My CAPX file will show you this happening. I think this is happening with lengthier sound/music files only. (Eg: bgmusic and cricket sounds files are more than 20 seconds in length, and these two files stop playing after few seconds.)

Continuing my App from my previous post(viewtopic.php?f=152&t=114976) where I resolved the Image Distortion issue by Cropping the large PNG files. The App worked wonderfully without any issue until I added the Audio Object.

I am playing a single Music file background and various other sound files (like Footsteps, Enemy sounds, Player Hurt, etc). When I exported the game as an Universal App to my Windows Phone Lumia 720, I noticed that the game crashes after about 2 to 3 mins of gameplay. I decided to debug on the Emulator (512MB). I found that it regularly throws up error at this point:

'WWAHOST.EXE' (Script): Loaded 'Script Code (MSAppHost/2.0)'.
Exception was thrown at line 14761, column 6 in ms-appx://94047361-e2dc-4b28-9958-c9485e8983ae/c2runtime.js
0x80004005 - JavaScript runtime error: Unspecified error.

The program '[1120] WWAHOST.EXE' has exited with code 1 (0x1).



I went to the c2runtime.js file line #14761. Exactly the code that's supposed to play the Sound file!! If you see there is a Win 8.1 comment from the Developers too.

Code: Select all
if (this.is_music && isMusicWorkaround && !audRuntime.isInUserInputEvent)
            musicPlayNextTouch.push(this);
         else
         {
            try {
--------line #14761-------------------->this.instanceObject.play();
            }
            catch (e) {}   // sometimes throws on WP8.1... try not to kill the app
         }


I started Disabling Audio Play commands until I had only the Foot steps sounds.. Now the rate at which the APP crashed reduced! Infact it seems to run without any issues!

Now my question is., could format of a file by any means cause this issue? All sounds files are in M4A format since I am only developing for Windows Platform. Any help would be greatly appreciated!

Attach a Capx
h*t*t*p*s://drive.google.com/file/d/0B3-U8v4LYOJNQXZmaVM2dms0T1U/edit?usp=sharing

Description of Capx
A Platformer prototype, where platform is scrolling to the left with random enemies. Press Left/Right key to dodge them. Space to jump.
I am using multiple BG music files which plays randomly. Enemies have bite and cry sounds played randomly. As time goes, I play a Night sounds with dogs howling. Day time you hear Crows.

Steps to Reproduce Bug
  • Export the Project to VS2013 - Universal app
  • Set Windows Phone Project as Start Up
  • Run on 512 MB, Emulator or Windows Phone (mine is Lumia 720)
  • Press Start Button when loaded
  • Game starts BG music, you can see the Player Sprite and platform moving
  • As soon as player collides with enemy and it makes sounds, the BG music stops.
  • Continuing to play, the game crashes or report the above mentioned JS error.

Observed Result


Expected Result


Affected Browsers
  • Chrome: (NO)
  • FireFox: (NO)
  • Internet Explorer: (NO)

Operating System and Service Pack
Windows Phone 8.1 latest updates
512MB RAM (both Emulator and Phone)

Construct 2 Version ID
r178 64Bit
Last edited by SamRock on Fri Sep 12, 2014 12:52 pm, edited 2 times in total.
Create your own Isometric Runner Game using C2:

Image

Check out my game "Last of the Survivors":
Play Store
App Store
B
58
S
13
G
2
Posts: 421
Reputation: 5,397

Post » Thu Sep 11, 2014 9:45 am

Dear @Ashley
Could your or team please help me with this issue? I have attached a CAPX for your reference too.
Create your own Isometric Runner Game using C2:

Image

Check out my game "Last of the Survivors":
Play Store
App Store
B
58
S
13
G
2
Posts: 421
Reputation: 5,397

Post » Fri Sep 12, 2014 1:22 pm

I noticed that same set of sound files were getting triggered at once when player overlaps with a group enemies. Now I used Trigger Once and the crash rate has reduced drastically.

However after I included BG music and exported to Windows Phone/Emulator, the music stops as soon one or two other sound files is played. My CAPX file will show you this happening.

I think this is happening with lengthier sound/music files only. (Eg: bgmusic and cricket sounds files are more than 20 seconds in length, and these two files stop playing after few seconds.)
Create your own Isometric Runner Game using C2:

Image

Check out my game "Last of the Survivors":
Play Store
App Store
B
58
S
13
G
2
Posts: 421
Reputation: 5,397

Post » Fri Sep 12, 2014 2:13 pm

So I've noticed this with Space Blaster, and I'm afraid it's a crash in IE or the Windows Phone OS. There's not much we can do about it. The very line you point out is to play some audio, and it's already wrapped in a try/catch because I'd noticed in the past it would randomly fail and crash the game, so the try/catch is there to catch any exceptions and try to carry on running the game normally. But that's not enough, eventually the whole app crashes.

I posted a bug report to Microsoft here: https://connect.microsoft.com/IE/feedbackdetail/view/970180/audio-crashes-windows-phone-html5-games

All we can do is hope Microsoft fix it quickly.
Scirra Founder
B
398
S
236
G
88
Posts: 24,441
Reputation: 194,661

Post » Fri Sep 12, 2014 2:22 pm

Wow thanks @Ashley!

I think I found a fix to my issue... the solution is to play less sound files :D
I mostly use condition isPlaying("tag"), to check if a set of audio file is playing or not. If not, play the sound file. This has brought down the Crash to ZERO!! yes ZERO :D

Now the only problem I have is with the Music going silent after few seconds of playing. Mostly after another sound file is played. Do you thik there is a work around? I just read that converting to .WAV format helps. I need to test this after I go back home.
Create your own Isometric Runner Game using C2:

Image

Check out my game "Last of the Survivors":
Play Store
App Store
B
58
S
13
G
2
Posts: 421
Reputation: 5,397

Post » Fri Sep 12, 2014 2:48 pm

It looks like Windows Phone has really buggy audio support. The best fix is to get Microsoft to fix these issues instead of having to work around everything.

Apparently Web Audio API support is in development for IE and should make a future update to Windows Phone, so hopefully that will resolve all audio issues on Windows Phone if nothing else does.
Scirra Founder
B
398
S
236
G
88
Posts: 24,441
Reputation: 194,661

Post » Fri Sep 12, 2014 2:58 pm

Thanks again @Ashley.

If the .WAV file doesnt fix my issue, I will disable Background music for now. Hopefully MS will come up with some kind of update soon. They have extensively marketed about being able to create HTML5 +JS based apps for Windows 8+. So they should put all their efforts on supporting this area.

Before finishing the thread, could you please point me to some article that talks about adding Ads and IAP to a Win 8.1 universal app? I cant seem to find anything here. Everything is for Windows 8/WP8.
Create your own Isometric Runner Game using C2:

Image

Check out my game "Last of the Survivors":
Play Store
App Store
B
58
S
13
G
2
Posts: 421
Reputation: 5,397

Post » Fri Sep 12, 2014 3:26 pm

@SamRock - the built-in IAP plugin should work on Windows Store universal apps (both desktop and mobile). I'm not aware of which ad services actually work in Windows Store apps - if you point me in the direction of one I can look in to supporting it.
Scirra Founder
B
398
S
236
G
88
Posts: 24,441
Reputation: 194,661

Post » Fri Sep 12, 2014 5:46 pm

Hi @Ashley For now, I am planning to use the Microsoft Pub Center. I am very new to the world of Ads and my game on Construct 2 will be my very first App on Win8 Platform.

I have already reached the 100 event limit.. and planning to buy a license sometime this month. Thank you so much for being generous and allowing us to try all option. I have created 70% of my intended game using the Free version! And it already looks great :)
Will buy the license to complete rest of the planned features
Create your own Isometric Runner Game using C2:

Image

Check out my game "Last of the Survivors":
Play Store
App Store
B
58
S
13
G
2
Posts: 421
Reputation: 5,397

Post » Mon Sep 22, 2014 5:54 pm

@Ashley I hope you too were on the Twitter #GameDevChat conversation with MS Developer/Evangelists.
(h^t^t^ps://twitter.com/hashtag/GameDevChat?src=hash )

I brought up the Audio and Ads issues on WP8.1!!
It good attention.. I hope they will work with IE and WP developers to fix this ASAP!
Create your own Isometric Runner Game using C2:

Image

Check out my game "Last of the Survivors":
Play Store
App Store
B
58
S
13
G
2
Posts: 421
Reputation: 5,397

Next

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest