Closed
Bug 859805
Opened 12 years ago
Closed 12 years ago
libcubeb fails to initialize on Android 2.3.6
Categories
(Core :: Audio/Video, defect)
Tracking
()
RESOLVED
FIXED
mozilla23
People
(Reporter: gcp, Assigned: padenot)
References
Details
(Whiteboard: [android-gum+][qa-])
Attachments
(1 file, 1 obsolete file)
I'm getting working video WebRTC calls on a Galaxy S2 with Android 2.3.6, but audio fails. Looking at the logs seems to indicate libcubeb doesn't work correctly on Android 2.3.x:
E/libOpenSLES(25487): slCreateEngine while another engine 0x513918 is active
E/libOpenSLES(25487): slCreateEngine while another engine 0x513918 is active
I/WindowOrientationListener( 2705): orientation = 344.26178 Tilt = 33.827026 -- -2 , 7 , 5
W/AudioFlinger( 2588): RecordThread: buffer overflow
E/libOpenSLES(25487): slCreateEngine while another engine 0x513918 is active
I/Gecko - Cubeb(25487): _ZN7android10AudioTrackC1EijiiijPFviPvS1_ES1_iitm: OK
I/Gecko - Cubeb(25487): _ZN7android10AudioTrackD1Evtm: OK
I/Gecko - Cubeb(25487): _ZNK7android10AudioTrack7latencyEvtm: OK
I/Gecko - Cubeb(25487): _ZNK7android10AudioTrack9initCheckEvtm: OK
I/Gecko - Cubeb(25487): error while loading _ZN7android10AudioTrack16getMinFrameCountEPi19audio_stream_type_tjtm: Symbol not found: tm
I/Gecko - Cubeb(25487): _ZN7android10AudioTrack5startEvtm: OK
I/Gecko - Cubeb(25487): _ZN7android10AudioTrack5pauseEvtm: OK
I/Gecko - Cubeb(25487): _ZN7android10AudioTrack11getPositionEPjtm: OK
I/Gecko - Cubeb(25487): _ZN7android10AudioTrack17setMarkerPositionEjtm: OK
I/Gecko - Cubeb(25487): Could not find all the symbols we need.
I/Gecko (25487): WARNING: cubeb_init failed: file /home/morbo/hg/mozilla-central/content/media/AudioStream.cpp, line 90
Reporter | ||
Updated•12 years ago
|
Whiteboard: [android-gum+]
Reporter | ||
Updated•12 years ago
|
Blocks: android-webrtc
Comment 1•12 years ago
|
||
We assume that if the AudioTrack has a ctor signature of _ZN7android10AudioTrackC1EijiiijPFviPvS1_ES1_ii then we're on Android 2.3+ and that _ZN7android10AudioTrack16getMinFrameCountEPi19audio_stream_type_tj will be available.
In this case, the former symbol is present and the latter is not. It should be easy to fix this by changing the detection to look for getMinFrameCount directly and fall back to the Froyo code if not available.
Comment 2•12 years ago
|
||
Er, wait, shouldn't get be getting the OpenSL libcubeb backend on 2.3 anyway?
Comment 3•12 years ago
|
||
This compiles, but I haven't been able to test it.
Updated•12 years ago
|
Attachment #735573 -
Flags: review?(paul)
Updated•12 years ago
|
Assignee: nobody → kinetik
Assignee | ||
Comment 4•12 years ago
|
||
So, on Gingerbread (2.3), the mangled symbold for getMinFrameCount is:
_ZN7android10AudioTrack16getMinFrameCountEPiij android::AudioTrack::getMinFrameCount(int*, int, unsigned int)
while on ICS, the second int is a |audio_stream_type_t|, which is an enum with
the same values, so we can load the old symbol, but pass the same value (3) as
second parameter.
However the enum that define the channel layout is similar on froyo and
gingerbread, but different on ICS, so I made more adjustments to the code.
And yeah, you're right that we should be using OpenSL on 2.3 (in fact, I had to
comment out the opensl in cubeb.c so that cubeb picked the audiotrack backend,
on my 2.3 device), but it could be great the audiotrack backend as a fallback,
if, like here, OpenSL does not work for some reason.
Attachment #735777 -
Flags: review?(kinetik)
Assignee | ||
Updated•12 years ago
|
Assignee: kinetik → paul
Comment 5•12 years ago
|
||
Comment on attachment 735777 [details] [diff] [review]
Add the mangled symbol for legacy getMinFrameCount on Android 2.3.x, and similar adjustments. r=
Thanks, this is better than my approach.
Attachment #735777 -
Flags: review?(kinetik) → review+
Updated•12 years ago
|
Attachment #735573 -
Attachment is obsolete: true
Attachment #735573 -
Flags: review?(paul)
Comment 6•12 years ago
|
||
Oh, and "E/libOpenSLES(25487): slCreateEngine while another engine 0x513918 is active" probably explains the AudioTrack fallback, because according to http://mobilepearls.com/labs/native-android-api/opensles/, "OpenSL ES for Android supports a single engine per application, and up to 32 objects." :-(
Reporter | ||
Comment 7•12 years ago
|
||
That's going to hurt, because both WebRTC and libcubeb will try to open OpenSLES. I'm surprised things work on Android 4+ at all, they must have lifted that restriction.
Assignee | ||
Comment 8•12 years ago
|
||
Assignee | ||
Comment 9•12 years ago
|
||
Comment 10•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/76166b14908a
https://hg.mozilla.org/mozilla-central/rev/f41f0742351b
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
Updated•12 years ago
|
Whiteboard: [android-gum+] → [android-gum+][qa-]
You need to log in
before you can comment on or make changes to this bug.
Description
•