AudioListener linearRampToValueAtTime execution grows over time to eventually dominate the frame time

Has anyone here noticed an issue with AudioListener eventually dominating the performance graph after running for long periods? I have an app with an AudioListener, and after leaving it running for 6 hours, it gradually slows down… if I then pause it and .remove the audioListener from the scene… fps suddenly goes back up to 60

notice the “linearRampToValueAtTime” is dominating the frame…
That method is used inside three to interpolate audio listener parameters, Inside updateMatrixWorld… And it uses a THREE.Clock deltaT internally to select the interpolant values…

Curious if anyone has seen a similar issue?

1 Like

Related:

I’ve already asked the OP at github to file an issue at: https://bugs.chromium.org/p/chromium/issues/list

But it seems he has not done it so dar. Can you file an issue instead, please? I mean you’ve already gathered the relevant performance data.

Ahhh thanks for the reference/links… I’ll do some more investigating…

I’m not sure that it’s a browser bug per-se, more that its an inherently thorny problem.

Saw this… possibly related:
https://bugs.chromium.org/p/chromium/issues/detail?id=930005&q=linearRampToValueAtTime&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified

I’ll keep looking into it.

1 Like

I posted a synopsis of my questions on that chromium bug I linked… perhaps getting some more google eyes on it will yield more information… I’ll keep looking into it… Thanks again, @Mugen87 !

still getting the same issue, is there any workaround,aside from programming all audio outside of THREE.js?

  • my audio context is loaded on TouchStart / Mousedown
  • I notice the issue mainly on mobile safari
        if (!audioContextStarted) {
	        const listener = new THREE.AudioListener();
	        game.camera.add(listener);
	        game.sound = new THREE.Audio(listener);
	        const audioLoader = new THREE.AudioLoader();
	        var self = game;
	        audioLoader.load('mp3/powerup2.mp3', function(buffer) {
	            self.sound.setBuffer(buffer);
	            self.sound.setLoop(false);
	            self.sound.setVolume(0.0);
	            // self.sound.play();
	        });
	        game.sound2 = new THREE.Audio(listener);
	        audioLoader.load('mp3/hit.mp3', function(buffer) {
	            self.sound2.setBuffer(buffer);
	            self.sound2.setLoop(false);
	            self.sound2.setVolume(0.0);
	            // self.sound.play();
	        });
	        game.sound3 = new THREE.Audio(listener);
	        audioLoader.load('mp3/lickshots.mp3', function(buffer) {
	            self.sound3.setBuffer(buffer);
	            self.sound3.setLoop(false);
	            //self.sound3.setVolume( 0.0 );
	            self.sound3.setVolume(0.8);
	            // self.sound.play();
	        });

	        audioContextStarted = true;
	    }