[Android (C)] need to enable FastTrack on android - 44.1khz sound ok on android but faster on Windows/macOS and 48khz ok on Windows/macOS but slower on android
- Dominant language
- C++
- Stars
- 3.3k
- Forks
- 353
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 1
Description
Hi there,
a 44100khz wav/ogg sound will play fine on android at the correct speed but then it will play much faster on Windows and MacOS.
This is occurring when the device sample rate is at 48000khz and the sound used has a 44100khz sample rate.
by default :
- android has a 44100khz sampling rate when fast track is not available
- steam / windows 10 is set to 48000khz and 24 bits
- macOS is by default at 48000khz
solution 1 :
use music files at the following sample rate on :
android at 44100khz
win10 at 48000khz
macOS at 48000khz
possible solution 2:
enable fast track on android so we can use 48000khz sounds everywhere.
so far this is what I get on android when trying to use a 48000khz sound, fast track is denied and the sound will play very very slowly.
To fix it there is a need to find a way to enable FastTrack on android.
the part of the android log related to audio is :
```
2019-11-06 18:19:45.171 27310-27366/tech.kode.kore W/AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 1, track 44100 Hz, output 48000 Hz
2019-11-06 18:19:45.174 27310-27366/tech.kode.kore I/AudioTrack: FastTrack denied resize maxNoti fc 590, new 882, enable throttle
2019-11-06 18:19:45.174 27310-27366/tech.kode.kore D/AudioTrack: Client defaulted notificationFrames to 590 for frameCount 1772
2019-11-06 18:19:45.175 27310-27366/tech.kode.kore I/AudioTrack: updateAudioTranstionLength FadeIn[0] FadeOut[0] FadeInRing[0]
```
**System**
Armory: armorySDK1910
OS: win 10 / macOS Mojave / android Oreo
the full android log:
```
2019-11-06 18:19:44.415 27310-27310/? E/Zygote: isWhitelistProcess - Process is Whitelisted
2019-11-06 18:19:44.416 27310-27310/? E/libpersona: scanKnoxPersonas
2019-11-06 18:19:44.416 27310-27310/? E/libpersona: Couldn't open the File - /data/system/users/0/personalist.xml - No such file or directory
2019-11-06 18:19:44.417 27310-27310/? W/SELinux: SELinux selinux_android_compute_policy_index : Policy Index[2], Con:u:r:zygote:s0 RAM:SEPF_SM-A750FN_8.0.0_0017, [-1 -1 -1 -1 0 1]
2019-11-06 18:19:44.418 27310-27310/? I/SELinux: SELinux: seapp_context_lookup: seinfo=untrusted, level=s0:c512,c768, pkgname=tech.kode.kore
2019-11-06 18:19:44.421 27310-27310/? I/zygote64: Late-enabling -Xcheck:jni
2019-11-06 18:19:44.467 27310-27310/? D/TimaKeyStoreProvider: TimaKeyStore is not enabled: cannot add TimaSignature Service and generateKeyPair Service
2019-11-06 18:19:44.467 27310-27310/? D/ActivityThread: Added TimaKeyStore provider
2019-11-06 18:19:44.672 27310-27310/tech.kode.kore I/zygote64: no shared libraies, dex_files: 1
2019-11-06 18:19:44.936 27310-27310/tech.kode.kore V/threaded_app: Creating: 0x73ec8a8000
2019-11-06 18:19:44.937 27310-27366/tech.kode.kore V/threaded_app: Config: mcc=208 mnc=26 lang=fr cnt=FR orien=2 touch=3 dens=420 keys=1 nav=1 keysHid=3 navHid=0 sdk=26 size=2 long=2 modetype=1 modenight=1
2019-11-06 18:19:44.953 27310-27310/tech.kode.kore V/threaded_app: Start: 0x73ec8a8000
2019-11-06 18:19:44.953 27310-27366/tech.kode.kore V/threaded_app: activityState=10
2019-11-06 18:19:44.961 27310-27310/tech.kode.kore V/threaded_app: Resume: 0x73ec8a8000
2019-11-06 18:19:44.961 27310-27366/tech.kode.kore V/threaded_app: activityState=11
2019-11-06 18:19:45.001 27310-27310/tech.kode.kore D/InputTransport: Input channel constructed: fd=70
2019-11-06 18:19:45.002 27310-27310/tech.kode.kore V/threaded_app: InputQueueCreated: 0x73ec8a8000 -- 0x73ec8a88c0
2019-11-06 18:19:45.002 27310-27366/tech.kode.kore V/threaded_app: APP_CMD_INPUT_CHANGED
2019-11-06 18:19:45.002 27310-27366/tech.kode.kore V/threaded_app: Attaching input queue to looper
2019-11-06 18:19:45.003 27310-27310/tech.kode.kore D/ViewRootImpl@bfa377[KoreActivity]: setView = DecorView@a710be4[KoreActivity] TM=true MM=false
2019-11-06 18:19:45.009 27310-27310/tech.kode.kore D/ViewRootImpl@bfa377[KoreActivity]: dispatchAttachedToWindow
2019-11-06 18:19:45.038 27310-27310/tech.kode.kore V/Surface: sf_framedrop debug : 0x4f4c, game : false, logging : 0
2019-11-06 18:19:45.040 27310-27310/tech.kode.kore D/ViewRootImpl@bfa377[KoreActivity]: Relayout returned: old=[0,0][0,0] new=[0,0][2220,1080] result=0x7 surface={valid=true 497888096256} changed=true
2019-11-06 18:19:45.043 27310-27310/tech.kode.kore D/ViewRootImpl@bfa377[KoreActivity]: ViewRootImpl >> surfaceCreated
2019-11-06 18:19:45.043 27310-27310/tech.kode.kore V/threaded_app: NativeWindowCreated: 0x73ec8a8000 -- 0x73ec717010
2019-11-06 18:19:45.043 27310-27366/tech.kode.kore V/threaded_app: APP_CMD_INIT_WINDOW
2019-11-06 18:19:45.045 27310-27310/tech.kode.kore D/ViewRootImpl@bfa377[KoreActivity]: ViewRootImpl >> surfaceChanged W=2220, H=1080)
2019-11-06 18:19:45.050 27310-27366/tech.kode.kore D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000, [2220x1080]-format:2
2019-11-06 18:19:45.051 27310-27310/tech.kode.kore D/ViewRootImpl@bfa377[KoreActivity]: MSG_RESIZED_REPORT: frame=Rect(0, 0 - 2220, 1080) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 63 - 0, 0) or=2
2019-11-06 18:19:45.052 27310-27310/tech.kode.kore D/ViewRootImpl@bfa377[KoreActivity]: MSG_WINDOW_FOCUS_CHANGED 1
2019-11-06 18:19:45.053 27310-27310/tech.kode.kore V/threaded_app: WindowFocusChanged: 0x73ec8a8000 -- 1
2019-11-06 18:19:45.054 27310-27310/tech.kode.kore V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@ba91f02 nm : tech.kode.kore ic=null
2019-11-06 18:19:45.054 27310-27310/tech.kode.kore I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
2019-11-06 18:19:45.059 27310-27327/tech.kode.kore D/InputTransport: Input channel constructed: fd=81
2019-11-06 18:19:45.062 27310-27310/tech.kode.kore V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@c010013 nm : tech.kode.kore ic=null
2019-11-06 18:19:45.113 27310-27310/tech.kode.kore D/ViewRootImpl@bfa377[KoreActivity]: MSG_RESIZED_REPORT: frame=Rect(0, 0 - 2220, 1080) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=2
2019-11-06 18:19:45.146 27310-27366/tech.kode.kore I/Kinc: Starting KoreHL
2019-11-06 18:19:45.165 27310-27366/tech.kode.kore W/libOpenSLES: class OutputMix interface 0 requested but unavailable MPH=43
2019-11-06 18:19:45.169 27310-27366/tech.kode.kore I/libOpenSLES: Emulating old channel mask behavior (ignoring positional mask 0x3, using default mask 0x3 based on channel count of 2)
2019-11-06 18:19:45.171 27310-27366/tech.kode.kore W/AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 1, track 44100 Hz, output 48000 Hz
2019-11-06 18:19:45.174 27310-27366/tech.kode.kore I/AudioTrack: FastTrack denied resize maxNoti fc 590, new 882, enable throttle
2019-11-06 18:19:45.174 27310-27366/tech.kode.kore D/AudioTrack: Client defaulted notificationFrames to 590 for frameCount 1772
2019-11-06 18:19:45.175 27310-27366/tech.kode.kore I/AudioTrack: updateAudioTranstionLength FadeIn[0] FadeOut[0] FadeInRing[0]
2019-11-06 18:19:45.325 27310-27366/tech.kode.kore D/libGLESv2: STS_GLApi : DTS, ODTC are not allowed for Package : tech.kode.kore
2019-11-06 18:19:45.377 27310-27310/tech.kode.kore D/ViewRootImpl@bfa377[KoreActivity]: Relayout returned: old=[0,0][2220,1080] new=[0,0][2220,1080] result=0x1 surface={valid=true 497888096256} changed=false
2019-11-06 18:19:45.761 27310-27366/tech.kode.kore W/Kinc: Uniform N not found.
2019-11-06 18:19:45.761 27310-27366/tech.kode.kore W/Kinc: Uniform sunCol not found.
2019-11-06 18:19:45.761 27310-27366/tech.kode.kore W/Kinc: Uniform sunDir not found.
2019-11-06 18:19:45.761 27310-27366/tech.kode.kore W/Kinc: Uniform LWVP not found.
2019-11-06 18:19:45.761 27310-27366/tech.kode.kore W/Kinc: Uniform shadowsBias not found.
2019-11-06 18:19:45.761 27310-27366/tech.kode.kore W/Kinc: Uniform envmapStrength not found.
```
Contributor guide
No contributing guide indexed for this repository
Research direction
No source file, test, or entry point is named. Start by locating the Android audio path that produces the supplied AudioTrack log, then reproduce playback with 44.1 kHz and 48 kHz assets on Android, Windows, and macOS. Done means playback speed is correct across the reported configurations, or the supported limitation and configuration are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, c
- Domain
- audio-video-rtc, mobile-dev
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100