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

SuperpoweredDecoder decodeAudio Blocks Indefinitely For Some Sources #779

Open
pmarino opened this issue May 6, 2024 · 1 comment
Open

Comments

@pmarino
Copy link

pmarino commented May 6, 2024

Superpowered version: 2.6.7

Describe the bug
When loading some sources into SuperpoweredDecoder, decodeAudio will block indefinitely. I am able to reproduce the issue on numerous Android devices as well as macOS and Linux environments.

I’ve attached a 32KHz / Mono .m4a which exhibits this issue in some of the latest Superpowered samples — the audio was directly exported from the Google Pixel Recorder app.

Steps to Reproduce

  1. Download the following source: example_recording.m4a.zip
  2. Replace the test.m4a source in the root of the Examples_Linux directory with the source above
  3. Build the Linux examples with the source above
  4. Run offline1, offline2 and offline3 examples

Expected behavior

  1. The Superpowered Linux examples should finish processing or log an error if the file can’t be opened
  2. If there is an issue decoding, SuperpoweredDecoder should return an error code

Actual behavior

  1. decodeAudio blocks indefinitely and maxes out CPU usage
    int framesDecoded = decoder->decodeAudio(intBuffer, decoder->getFramesPerChunk());

Device information
As noted above, I have been able to reproduce this issue on numerous Android devices and on macOS & Linux. I’ve attached device information for the Linux device that was used for testing the samples in this repository.

  • OS: Ubuntu 22.04.4 LTS (6.5.0-26-generic x86_64)
  • CPU: Intel Core i5-4570 CPU @ 3.20GHz

Additional context
Here is the output from afinfo for the attached source exhibiting the issue:
example_recording.m4a.zip

File:           example_recording.m4a
File type ID:   mp4f
Num Tracks:     1
----
Data format:     1 ch,  32000 Hz, aac  (0x00000000) 0 bits/channel, 0 bytes/packet, 1024 frames/packet, 0 bytes/frame
                no channel layout.
estimated duration: 59.358000 sec
audio bytes: 356835
audio packets: 1857
bit rate: 48039 bits per second
packet size upper bound: 285
maximum packet size: 285
audio data file offset: 15816
optimized
audio 1899456 valid frames + 2112 priming + 0 remainder = 1901568
format list:
[ 0] format:	  1 ch,  32000 Hz, aac  (0x00000000) 0 bits/channel, 0 bytes/packet, 1024 frames/packet, 0 bytes/frame
Channel layout: Mono

The attached source plays as expected in various other players across iOS, Android and macOS, etc.

@ivannador
Copy link
Contributor

ivannador commented May 9, 2024

Hey @pmarino,

I can confirm that the issue can be reproduced. The decoder runs into an infinite loop while decoding this file.

Please stay tuned while we further investigate the issue.

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