C2 audio broken - Starts jittering more the longer you play

Bugs will be moved here once resolved.

Post » Tue Oct 03, 2017 9:24 pm

Problem Description
So I've lately been encountering issues with audio. Especially on mobile. I'm making a music game, so it's quite devestating to find that the audio clarity and playback speed gets gradually lowered the longer the playsession. This happens on all devices, and all platforms. At first I thought maybe it's inconsistent internet, but I find this happening even on exported NWjs/Cordova projects. I also did tests to ensure that it's not just the fact I'm switching songs around too rapidly causing the issue. This always eventually happens, even if you just play one track, and wait for minutes at a time before changing. I find it seems directly related to amount of times tracks are changed, and processing power.

This becomes apparent way faster on mobile over PC. On my S7 this becomes a problem already after maybe 20 seconds of tapping. After about 1 minute the music's inaudable. On a beast of a desktop I have to hold in the mouse for maybe up to 2-5 minutes to recreate the issue. Considering I'm targeting mobile though... This is a bug so severe I have to cancel the game if it can't be fixed. :(

Attach a Capx
https://drive.google.com/file/d/0B1n4Fd ... sp=sharing

Description of Capx
Includes 4 tracks that gets unloaded, stopped and played at random when in touch every 0.05 seconds. Changing it to 0.1, 0.2, 1, 2 will trigger the same results just take longer.

Steps to Reproduce Bug
  • Preview on device and browser of choice
  • Hold in touch/left mouse button on given device
  • Notice the audio becoming more jaggy and inaudable as it goes on. Keep doing this long enough and it should turn into nightmare fuel.

Observed Result
Audio quality and playback speed gets gradually reduced. Almost as if the unloading or stopping of music doesn't work

Expected Result
It should be clean audio till the end of time. The player shouldn't have to reboot the game every 15 minute to enjoy my game.

Affected Browsers
  • Chrome: (YES)
  • FireFox: (YES)
  • Internet Explorer: (Inconclusive. Audio playback takes so long to start that it would take ages to test on my beefy computer. Sorry...)

Operating System and Service Pack
Win 7 SP1

Construct 2 Version ID
247
B
38
S
10
Posts: 393
Reputation: 3,393

Post » Tue Oct 03, 2017 9:30 pm

I know the work around for this.. it sounds weird, but it works.

create a short 1 second of silent audio.

Add a System event to trigger playing it Every 1 second (not looping)

that should do it, it worked for me.. don't ask why!
B
103
S
35
G
16
Posts: 1,244
Reputation: 17,240

Post » Tue Oct 03, 2017 10:34 pm

@jobel Huh... I gotta test that tomorrow! ö_o
B
38
S
10
Posts: 393
Reputation: 3,393

Post » Tue Oct 03, 2017 11:38 pm

it definitely happens in cordova>cocoonIO>Andriod and that seemed to fix it.

my audio skipped, distorted, muted, repeated non-stop etc.. but what I thought was weird was that none of the Music folder sounds were effected. That silent audio fixed the problem.
B
103
S
35
G
16
Posts: 1,244
Reputation: 17,240

Post » Wed Oct 04, 2017 12:38 am

The upload throws a javascript error at 0.05.
0.25, not so much.

Moved files to sounds folder. Outcome was far worse.
As in don't even try it. Had to manually close Chrome.
W10
Dell P.o.s.
Image ImageImage
B
179
S
50
G
207
Posts: 8,719
Reputation: 128,306

Post » Wed Oct 04, 2017 9:49 am

@jobel Hmm not sure we have the same issue then. This bug refers especially to the music folder. Was the silent audio file placed in the sound or music folder?

Edit: Tried it. Didn't fix the issue for me, even when I had one silent in both music and sound. :(
B
38
S
10
Posts: 393
Reputation: 3,393

Post » Sun Oct 08, 2017 7:47 pm

Gonna need a statement on this issue soon. Thanks @ashley
B
38
S
10
Posts: 393
Reputation: 3,393

Post » Mon Oct 09, 2017 11:03 am

It turns out we leaked an audio node when unloading music tracks. I'm not sure why this would degrade audio quality (why would extra silent nodes affect anything?) but it's definitely a problem, and properly cleaning up the nodes seems to fix the problem.

Rather than wait for the next build you can try pasting this updated runtime.js file for the Audio plugin in to your install directory & restart C2: https://www.dropbox.com/s/3bh36yk099y4gzh/audio-runtime-r248.zip?dl=0

Let me know if that solves it.
Scirra Founder
B
415
S
248
G
92
Posts: 25,288
Reputation: 200,960

Post » Mon Oct 09, 2017 11:21 am

@Ashley Yes that seems to have fixed it. I'm unable to recreate the issue now. I'm glad it turned out to be an easy fix! :) Thank you very much!
B
38
S
10
Posts: 393
Reputation: 3,393

Post » Mon Oct 09, 2017 1:18 pm

Glad to hear it's sorted!
Scirra Founder
B
415
S
248
G
92
Posts: 25,288
Reputation: 200,960


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests