Closed Bug 721835 Opened 12 years ago Closed 12 years ago

ANPAudio::trackLatency is not implemented

Categories

(Firefox for Android Graveyard :: General, defect, P4)

ARM
Android
defect

Tracking

(firefox14 verified, firefox15 verified, blocking-fennec1.0 soft)

VERIFIED FIXED
Tracking Status
firefox14 --- verified
firefox15 --- verified
blocking-fennec1.0 --- soft

People

(Reporter: snorp, Assigned: cpeterson)

References

Details

Attachments

(1 file)

Newer plugin API added some track latency call that we have not implemented.
blocking-fennec1.0: --- → ?
snorp, who uses this call?
(In reply to Damon Sicore (:damons) from comment #2)
> snorp, who uses this call?

Flash uses it, presumably to do audio/video synchronization.
blocking-fennec1.0: ? → soft
Flash calls trackLatency() on Android >= Honeycomb. For earlier versions, Flash hardcodes latency values for some known devices (ranging from ~50 to ~90 ms).

Flash really wants the value returned from android::AudioSystem::getOutputLatency(), but that function is not officially part of the NDK.
I see lots of ANP errors in console when loading http://www.wechoosethemoon.org/

E/GeckoPlugins( 7401): !!!!!!!!!!!!!!  uint32_t anp_audio_trackLatency(ANPAudioTrack*) not implemented /builds/slave/m-cen-andrd-ntly/build/dom/plugins/base/android/ANPAudio.cpp, 391
E/GeckoPlugins( 7401): !!!!!!!!!!!!!!  uint32_t anp_audio_trackLatency(ANPAudioTrack*) not implemented /builds/slave/m-cen-andrd-ntly/build/dom/plugins/base/android/ANPAudio.cpp, 391
E/GeckoPlugins( 7401): !!!!!!!!!!!!!!  uint32_t anp_audio_trackLatency(ANPAudioTrack*) not implemented /builds/slave/m-cen-andrd-ntly/build/dom/plugins/base/android/ANPAudio.cpp, 391

--
Firefox 15.0a1 (2012-05-14)
Device: Galaxy Nexus
OS: Android 4.0.2
snorp, we can't implement trackLatency() without calling private Android APIs. Flash already hardcodes similar latency estimates for pre-Honeycomb devices that do not support ANPAudioTrackInterfaceV1's trackLatency(). In practice, this is good enough, but we can revisit this if we get reports about bad audio sync for videos.

The Android stock browser calls android::AudioTrack::latency(), an internal Android API that is not available in the public NDK:

https://github.com/android/platform_external_webkit/commit/49bf866973cb3b2a6c74c0eab864e9562e4cbab1
Assignee: nobody → cpeterson
Status: NEW → ASSIGNED
Attachment #624920 - Flags: review?(snorp)
Comment on attachment 624920 [details] [diff] [review]
bug-721835-estimate-audio-latency.patch

Review of attachment 624920 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me, thanks
Attachment #624920 - Flags: review?(snorp) → review+
Comment on attachment 624920 [details] [diff] [review]
bug-721835-estimate-audio-latency.patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 
User impact if declined: Flash content that plays audio will continue to flood logcat with error messages about unimplemented API.
Testing completed (on m-c, etc.): 
Risk to taking this patch (and alternatives if risky): Low risk of audio/video sync issues. blocking-fennec1.0=soft
String or UUID changes made by this patch: N/A
Attachment #624920 - Flags: approval-mozilla-aurora?
https://hg.mozilla.org/mozilla-central/rev/b72c41ab1bd3
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Comment on attachment 624920 [details] [diff] [review]
bug-721835-estimate-audio-latency.patch

fairly low risk, android-only - approved.
Attachment #624920 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Verified fixed on:

Firefox 15.0a1 (2012-05-25)
Firefox 14.0a2 (2012-05-25)
Firefox 14.0b3 (2012-05-25)

Device: Galaxy Nexus
OS: Android 4.0.2
Status: RESOLVED → VERIFIED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: