Skip to content

SuperpoweredDecoder decodeAudio Blocks Indefinitely For Some Sources #779

Closed
@pmarino

Description

@pmarino

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions