After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 783991 - openslessink: Unable to use native sample rate(48000) for low latency audio playback on most Android devices
openslessink: Unable to use native sample rate(48000) for low latency audio p...
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.x
Other other
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-06-20 12:26 UTC by Domas
Modified: 2018-11-03 14:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
48000 Hz sample rate support added to sink element (1.42 KB, patch)
2017-11-09 14:18 UTC, Tadas
none Details | Review

Description Domas 2017-06-20 12:26:19 UTC
To obtain the lowest output latency on android (~20 ms), you must supply audio data that matches the device's optimal sample rate and buffer size. Otherwise output latency is 100 - 200 ms, which for some projects is a big deal.
openslessink should be able to accept all provided sample rates (including 48000 Hz) and have a parameter for setting optimal buffer size.

More on this:
https://developer.android.com/ndk/guides/audio/audio-latency.html#output-latency
Comment 1 Sebastian Dröge (slomo) 2017-06-20 12:45:06 UTC
In earlier versions of Android at least, rates other than 48000 didn't work and there was no API to query the supported rates. Is there something for that now at the OpenSL ES level, or only at the Java layer?

Would you like to provide a patch?
Comment 2 Domas 2017-06-21 09:21:26 UTC
It is definitely possible to get supported rates from Java layer, but there is also a change that it is possible to get it from OpenSL ES level. We will do more research and update you on issue and probably provide a patch.
Comment 3 Tadas 2017-11-09 14:18:16 UTC
Created attachment 363291 [details] [review]
48000 Hz sample rate support added to sink element

Fix has been that we use in our company internally. It basically only adds 48000 Hz as supported sample rate. In previous commit this sample rate was omitted because of downsampling to this rate issues, but we never encountered them and low audio latency was more important for us.

To obtain the lowest output latency (25 - 40 ms) on Android, you must supply data that matches the device's optimal sample rate. In most cases on new devices it is 48000 Hz. Optimal sample rate uses android's fast mixer path to reduce latency. Optimal sample rate can only be retrieved in JAVA.

Reference: https://developer.android.com/ndk/guides/audio/audio-latency.html
Comment 4 GStreamer system administrator 2018-11-03 14:09:56 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/572.