Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gst-plugins-bad gst-plugins-bad
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 985
    • Issues 985
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 132
    • Merge requests 132
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GStreamer
  • gst-plugins-badgst-plugins-bad
  • Issues
  • #1229

Closed
Open
Created Feb 28, 2020 by Matthew Read@motownreadContributor

openslessink cannot handle 48kHz

On Android I'm playing an mp4 containing a 48kHz audio stream, on a device with a native output sample rate of 48kHz. When setting the playbin flag GST_PLAY_FLAG_NATIVE_AUDIO playback does not work because openslessink cannot handle 48kHz.

In sys/opensles/openslessink.c there is a comment:

/* According to Android's NDK doc the following are the supported rates */
#define RATES "8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100"
/* 48000 Hz is also claimed to be supported but the AudioFlinger downsampling
 * doesn't seems to work properly so we relay GStreamer audioresample element
 * to cope with this samplerate. */

Adding 48000 to the RATES list fixes playback with GST_PLAY_FLAG_NATIVE_AUDIO.

Without this fix then 48kHz streams will be downsampled to 44.1kHz by GstAudioResample then possibly upsampled back to 48kHz by the OS, which seems very wasteful.

Assignee
Assign to
Time tracking