Closed
Bug 1112682
Opened 10 years ago
Closed 10 years ago
B2G WebRTC falls back to VP8 when H.264 is enabled
Categories
(Core :: WebRTC: Signaling, defect)
Tracking
()
RESOLVED
FIXED
mozilla37
People
(Reporter: diego, Assigned: bwc)
References
Details
Attachments
(2 files, 1 obsolete file)
2.47 KB,
patch
|
Details | Diff | Splinter Review | |
4.17 KB,
patch
|
jesup
:
review+
|
Details | Diff | Splinter Review |
This started happening at m-c at around December 10th.
Reporter | ||
Updated•10 years ago
|
Hardware: x86 → ARM
Version: unspecified → Trunk
Comment 1•10 years ago
|
||
This was very likely fallout from the negotiation rewrite (signaling) done in bug 1091242. Byron?
(it can be tricky to make sure the codec reservation rules are followed (and any temporary grab is released before grabbing it again, etc), and if not we could think it's in-use when it isn't. Or the landing simply broke HW codec usage.)
Assignee | ||
Comment 2•10 years ago
|
||
Seems plausible. I can try to look into it, but I do not have a device at present.
Assignee | ||
Comment 3•10 years ago
|
||
A couple of questions:
When the latest m-c code is the offerer, is H264 of any kind offered? If not, can I get nspr signaling:6 logging? (I'm interested in whether the string "H264 hardware codec available" appears)?
When the latest m-c code is the answerer, and release (or some other version prior to the 10th) is the offerer, what is in the offer/answer?
Flags: needinfo?(docfaraday) → needinfo?(dwilson)
Reporter | ||
Updated•10 years ago
|
Flags: needinfo?(dwilson) → needinfo?(rjesup)
Reporter | ||
Updated•10 years ago
|
Blocks: CAF-v2.2-metabug
Comment 4•10 years ago
|
||
I'm able to reproduce it with 20141219040202 flame build and Nightly (37.0a1 (2014-12-19)) on apprtc.
Desktop offered 120, 126, 97 as expected.
Flame chose 120 = VP8 out of that list.
Comment 5•10 years ago
|
||
So the Flame offers only VP8. Looks like we lost the ability to detect the H.264 hardware codec availability.
Assignee | ||
Comment 6•10 years ago
|
||
So this is the beginning of the block of code that configures out codec parameters, and disables codecs where necessary:
http://dxr.mozilla.org/mozilla-central/source/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp#797
I've looked over this a few times, and am not spotting any problems. Is it possible that something else is holding a reservation at this point (CreateOffer)? Or is there something that could be causing the prefs fetch to fail? Or were the reservations always failing before, and some other bug was masking the failure?
Assignee | ||
Comment 7•10 years ago
|
||
I've done a try push with some temporary debug logging that might give us an idea of what is happening (the logging uses __android_log_print(ANDROID_LOG_ERROR, "OMXCodecWrapper", ...) so it should show up without any trouble?).
https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=f5f05a76d919
Assignee | ||
Comment 8•10 years ago
|
||
Ugh, that macro isn't available there. Will try again in a few.
Assignee | ||
Comment 9•10 years ago
|
||
Ok, binaries with some logging are here:
http://ftp.mozilla.org/pub/mozilla.org/b2g/try-builds/bcampen@mozilla.com-6e4db50250b7/
If someone could reproduce and get the android logging, that should give me a better idea what is going on here.
Comment 10•10 years ago
|
||
The problem with the try builds is that they don't contain anything you can put on a real phone, only emulator builds :-(
Assignee | ||
Comment 11•10 years ago
|
||
Surely there is some way to get our build farm to build a custom b2g binary without requiring a push to inbound or a project branch...
Comment 12•10 years ago
|
||
No "H264 hardware codec available" in the signaling logs...
Assignee | ||
Comment 13•10 years ago
|
||
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → docfaraday
Status: NEW → ASSIGNED
Comment 14•10 years ago
|
||
right - that's what I expected; the codec reservation stuff is touchy, since you can only have one instance of encoder/decoder open at a time.
You need to look where it was allocated and freed.
Comment 15•10 years ago
|
||
According to my logging this condition is not/no longer (?) true:
http://dxr.mozilla.org/mozilla-central/source/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp#813
Severity: normal → major
Comment 16•10 years ago
|
||
So after adding this:
pref('media.peerconnection.video.h264_enabled', true);
to this file:
/system/b2g/defaults/pref/user.js
I can get the Flame to offer H264, but only as second codec after VP8.
Adding this setting:
pref('media.navigator.video.preferred_codec', 126);
To the same file no longer seem to have to desired effect. Neither gets 126 offered before 120, nor does 126 picked as the preferred code if it is offered.
Comment 17•10 years ago
|
||
Sorry did not mean to set the priority.
Randel: should enabling H264 and setting it as preferred code be part of our default builds, or is this something the vendors still have to activate in their builds?
Severity: major → normal
Comment 18•10 years ago
|
||
(In reply to Nils Ohlmeier [:drno] from comment #17)
> Sorry did not mean to set the priority.
>
> Randel: should enabling H264 and setting it as preferred code be part of our
> default builds, or is this something the vendors still have to activate in
> their builds?
It's vendor activation - we only support HW H.264 on specific devices (chipsets+firmware) that have been tested and verified. For example, until DSP code Flame 1530.x (IIRC) you couldn't modify the bitrate inbetween iframes. Earlier versions had a 2-second decode delay. So we can't reasonably enable-by-default. Even for Flames, you have to have an up-to-date base build.
(to earlier comment)
Ok, I would have added it to /data/b2g/mozilla/<profile>/prefs.js, but that probably works too.
Appearing second is wrong. That sounds like a regression from the sdparta rewrite. HW codecs, if enabled, are always supposed to have higher priority, then built-in, then GMP (OpenH264 - not on B2G)
Flags: needinfo?(rjesup) → needinfo?(docfaraday)
Assignee | ||
Comment 19•10 years ago
|
||
(In reply to Randell Jesup [:jesup] from comment #18)
> (In reply to Nils Ohlmeier [:drno] from comment #17)
> > Sorry did not mean to set the priority.
> >
> > Randel: should enabling H264 and setting it as preferred code be part of our
> > default builds, or is this something the vendors still have to activate in
> > their builds?
>
> It's vendor activation - we only support HW H.264 on specific devices
> (chipsets+firmware) that have been tested and verified. For example, until
> DSP code Flame 1530.x (IIRC) you couldn't modify the bitrate inbetween
> iframes. Earlier versions had a 2-second decode delay. So we can't
> reasonably enable-by-default. Even for Flames, you have to have an
> up-to-date base build.
>
> (to earlier comment)
> Ok, I would have added it to /data/b2g/mozilla/<profile>/prefs.js, but that
> probably works too.
> Appearing second is wrong. That sounds like a regression from the sdparta
> rewrite. HW codecs, if enabled, are always supposed to have higher
> priority, then built-in, then GMP (OpenH264 - not on B2G)
Ah, I did not know that we were preferring hardware codecs. I can fix that. So the calculation should prefer first the preferred codec set in prefs, then hardware codecs, then everything else?
Is the preference what this bug is really about? Do we actually have any evidence that h264 is not offered if it is enabled in prefs?
Flags: needinfo?(docfaraday) → needinfo?(rjesup)
Comment 20•10 years ago
|
||
(In reply to Byron Campen [:bwc] from comment #19)
> Ah, I did not know that we were preferring hardware codecs. I can fix
> that. So the calculation should prefer first the preferred codec set in
> prefs, then hardware codecs, then everything else?
Yes, that should have been documented in VcmSIPCCBindings.cpp. See the old code and compare.
> Is the preference what this bug is really about? Do we actually have any
> evidence that h264 is not offered if it is enabled in prefs?
It appears Nils' tests above show that it's offered (but second). Also his test shows "preferred_codec" got broken as well.
Flags: needinfo?(rjesup)
Assignee | ||
Comment 21•10 years ago
|
||
(In reply to Randell Jesup [:jesup] from comment #20)
> (In reply to Byron Campen [:bwc] from comment #19)
>
> > Is the preference what this bug is really about? Do we actually have any
> > evidence that h264 is not offered if it is enabled in prefs?
>
> It appears Nils' tests above show that it's offered (but second). Also his
> test shows "preferred_codec" got broken as well.
I've tested preferrec_codec myself and it worked. Not sure what the deal was there.
Assignee | ||
Comment 22•10 years ago
|
||
Assignee | ||
Comment 23•10 years ago
|
||
Comment on attachment 8543354 [details] [diff] [review]
Prefer hardware codecs.
Review of attachment 8543354 [details] [diff] [review]:
-----------------------------------------------------------------
try:
https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=24b827070fc7
Attachment #8543354 -
Flags: review?(rjesup)
Assignee | ||
Comment 24•10 years ago
|
||
Infra messed up that try. Here we go again.
https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=2525de070143
Comment 25•10 years ago
|
||
With the latest patch and the setting:
pref('media.peerconnection.video.h264_enabled', true);
I still get an offer like this:
m=video 9 RTP/SAVPF 120 126
If I'm not mistaken I should not have to use the preferred_codec setting, correct?
Assignee | ||
Comment 26•10 years ago
|
||
Fix prioritization.
Assignee | ||
Updated•10 years ago
|
Attachment #8543354 -
Attachment is obsolete: true
Attachment #8543354 -
Flags: review?(rjesup)
Assignee | ||
Comment 27•10 years ago
|
||
Comment on attachment 8544248 [details] [diff] [review]
Prefer hardware codecs
Review of attachment 8544248 [details] [diff] [review]:
-----------------------------------------------------------------
try:
https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=054f7d4a8a49
Attachment #8544248 -
Flags: review?(rjesup)
Comment 28•10 years ago
|
||
attachment 8544248 [details] [diff] [review] seems to do what we want it: with pref('media.peerconnection.video.h264_enabled', true); set my flame offered:
m=video 9 RTP/SAVPF 126 120
c=IN IP4 0.0.0.0
a=sendrecv
a=fmtp:126 PROFILE=0;LEVEL=0;profile-level-id=42e00c;packetization-mode=1;level-asymmetry-allowed=1;max-br=11880;parameter-add=1;usedtx=0;stereo=0;useinbandfec=0;cbr=0
a=fmtp:120 PROFILE=0;LEVEL=0;packetization-mode=0;level-asymmetry-allowed=1;max-fs=1200;max-fr=30;parameter-add=1;usedtx=0;stereo=0;useinbandfec=0;cbr=0
And the desktop picked H264 from that list.
Updated•10 years ago
|
blocking-b2g: --- → 2.2?
Updated•10 years ago
|
Attachment #8544248 -
Flags: review?(rjesup) → review+
Assignee | ||
Comment 29•10 years ago
|
||
Check back on try:
https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=b0c892078fce
Flags: needinfo?(docfaraday)
Assignee | ||
Comment 30•10 years ago
|
||
Flags: needinfo?(docfaraday)
Comment 31•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
Comment 32•10 years ago
|
||
Comment on attachment 8544248 [details] [diff] [review]
Prefer hardware codecs
NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.
[Approval Request Comment]
Bug caused by (feature/regressing bug #):
User impact if declined:
Testing completed:
Risk to taking this patch (and alternatives if risky):
String or UUID changes made by this patch:
Attachment #8544248 -
Flags: approval-mozilla-b2g37?
Comment 33•10 years ago
|
||
Comment on attachment 8544248 [details] [diff] [review]
Prefer hardware codecs
Per the target milestone flag, this landed on mozilla-central prior to b2g37 being branched. This changeset is already there.
https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/e672c279ff31
Attachment #8544248 -
Flags: approval-mozilla-b2g37?
Updated•10 years ago
|
status-b2g-v2.2:
--- → fixed
status-firefox35:
--- → wontfix
status-firefox36:
--- → wontfix
status-firefox37:
--- → fixed
Updated•10 years ago
|
blocking-b2g: 2.2? → ---
Blocks: CAF-v3.0-FL-metabug
No longer blocks: CAF-v3.0-FL-metabug
You need to log in
before you can comment on or make changes to this bug.
Description
•