Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using multi-channel audio support causes memory leaks #12

Open
OlafZwe opened this issue Feb 27, 2018 · 4 comments
Open

Using multi-channel audio support causes memory leaks #12

OlafZwe opened this issue Feb 27, 2018 · 4 comments

Comments

@OlafZwe
Copy link

OlafZwe commented Feb 27, 2018

A (native) memory leak occurs when using the following setup:
Enabling all audio channels by initializing the decoder with enableAllAudioCh = true.
Pulling that multi-channel audio data using the C# function getAllAudioChannelData.

This memory leak appears to occurs both when testing in the Unity editor, as well as in a standalone Windows build of the Unity app.

@kyo8568131
Copy link
Contributor

kyo8568131 commented Mar 2, 2018

Hi OlafZwe,
Thanks for the feedback. I'll check and fix it.

@kyo8568131
Copy link
Contributor

Hi, I had tried, but I can't find memory leak.
Could you help to provide more details and the test video?
Thanks.

@OlafZwe
Copy link
Author

OlafZwe commented Mar 6, 2018

To reproduce the memory leak (and CPU usage spike), make the following changes to the Demo scene:

  • Remove all but the 360Video and Camera objects
  • Point the VideoSourceController component in 360Video to any .mp4 file with audio track
  • in VideoSourceController.cs, change line 62 to: decoder.initDecoder(fileSeeker.getPath(), true);
  • in VideoSourceController.cs, add the following Update function:
public void Update()
{
	if (decoder != null && (int)decoder.getDecoderState() >= 3)
	{
		float[] audioBuffer;
		double time;
		int samplesPerChannel;
		decoder.getAllAudioChannelData(out audioBuffer, out time, out samplesPerChannel);
	}
}

Running this Demo scene spikes CPU and memory usage, and this usage does not go down when stopping the scene in the editor.

@kyo8568131
Copy link
Contributor

I do the same thing but the memory usage didn't raise over time.
So I think it may be not an issue of memory leak.
I'll keep monitoring it, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants