[Bug 297596] www/firefox: WebRTC fails when using H.264 for video

[email protected]
Newsgroups gmane.os.freebsd.devel.ports.bugs
Message-ID <[email protected]/bugzilla/>
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297596

            Bug ID: 297596
           Summary: www/firefox: WebRTC fails when using H.264 for video
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: [email protected]
          Reporter: [email protected]
             Flags: maintainer-feedback?([email protected])
          Assignee: [email protected]

I am unable to get Microsoft Teams, Webex or even a WebRTC test page
(https://webrtc.github.io/samples/src/content/peerconnection/change-codecs/) to
work with H.264 in Firefox.  For the first two, they seem dependent upon H.264
while the test site will work with VP8 and VP9, which means that WebRTC at
least
works.  In the past, Webex did work for me, but I have not used it for awhile
so
do not know when it stopped.

Another site that works is https://appr.tc/ unless you set it to H.264 by
setting the URL parameter "vsc=h264".  To restore, "vsc=vp8".

Using the webrtc.github.io test site is probably the easiest for debugging
purposes.  Just click Start, select H.264 with packetization then click Call.
Packetization in the codec is required else the test falls back to VP8.

With another tab open to about:webrtc, I can see that no frames nor bytes are
being sent by Firefox.  Expand RTCPeerConnection Statistics -> Show Details
(for
"Send: video/H264") and look for "outbound-rtp".  It should be increasing but
will be zero if H.264 is not working.

I have experimented with many preferences but none help.  Except
"media.webrtc.hw.h264.enabled" is needed else the little window showing your
camera view will be empty in Microsoft Teams.

After much debugging, I did find a couple of problems.  I think it would be
useful to fix these, which I may do but wanted to see first if anyone can
successfully use H.264 for WebRTC.

1. Firefox cannot find the .so to load from within the profile.  Typically, it
   is downloaded but not for FreeBSD.  If it cannot find it there, it gives up
   trying without looking anywhere else.  Exporting
   MOZ_GMP_PATH=/usr/local/lib/browser_plugins/gmp-gmpopenh264 does not change
   this.

   68734:
openat(AT_FDCWD,"/usr/local/lib/firefox/defaults/pref/gmpopenh264.js",O_RDONLY,00)
= 24 (0x18)
   68734: read(24,"pref("media.gmp-gmpopenh264.auto"...,151) = 151 (0x97)
   68734:
access("/home/testuser/.mozilla/firefox/ik75wg14.temppp/gmp-gmpopenh264/2.6.0/libgmpopenh264.so",F_OK)
ERR#2 'No such file or directory'
   68734:
chmod("/home/testuser/.mozilla/firefox/ik75wg14.temppp/gmp-gmpopenh264/2.6.0",0700)
ERR#2 'No such file or directory'
   68734:
open("/home/testuser/.mozilla/firefox/ik75wg14.temppp/gmp-gmpopenh264/2.6.0",O_RDONLY|O_DIRECTORY|O_CLOEXEC,00)
ERR#2 'No such file or directory'
   68734:
fstatat(AT_FDCWD,"/home/testuser/.mozilla/firefox/ik75wg14.temppp/gmp-gmpopenh264/2.6.0",0x2b9e8d649a30,AT_SYMLINK_NOFOLLOW)
ERR#2 'No such file or directory'

2. If the directory is manually created, the plugin crashes with "The
   gmpopenh264 plugin has crashed".

   mkdir -p
/home/testuser/.mozilla/firefox/ik75wg14.temppp/gmp-gmpopenh264/2.6.0
   cp -p /usr/local/lib/browser_plugins/gmp-gmpopenh264/* \
       /home/testuser/.mozilla/firefox/ik75wg14.temppp/gmp-gmpopenh264/2.6.0/.

   Logging (MOZ_LOG="GMP:9,GMPVideoEncoder:9,GMPService:9"):
   [Child 99094: Main Thread]: D/GMP GMPServiceChild::UpdateGMPCapabilities
{gmp-gmpopenh264 version=2.6.0
tags=[encode-video:h264:moz-h264-advanced:moz-h264-temporal-svc
decode-video:h264:moz-h264-advanced:moz-h264-temporal-svc], gmp-clearkey
version=1
tags=[chromium-cdm11-host4:org.w3.clearkey:org.mozilla.clearkey_with_protection_query]}
   [Child 99094: Main Thread]: D/GMP GeckoMediaPluginService created; Gecko
version=153.0.4 buildID=20260815144619
   [Child 99094: Main Thread]: D/GMP GMPServiceChild::Init
   [Child 99094: Main Thread]: D/GMP GMPServiceChild::AddShutdownBlocker
   [Child 99094: GMPThread]: D/GMP GMPServiceChild::SetServiceChild:
aServiceChild=0x2a57e288de00
   [Child 99094: GMPThread]: D/GMP
GMPContentParent::GMPContentParent(this=0x2a57e4822000), aParent=0x0
   [Child 99094: GMPThread]: D/GMP
GMPContentParent::GMPEventTarget(this=0x2a57e4822000)
   [Child 99094: GMPThread]: D/GMP
GMPContentParent::AddCloseBlocker(this=0x2a57e4822000) mCloseBlockerCount=1
   [Child 99094: GMPThread]: D/GMP
GMPContentParent::GetGMPVideoEncoder(this=0x2a57e4822000)
   [Child 99094: GMPThread]: D/GMP GMPVideoEncoderParent::InitEncode:
0x2a57e4829000
   [Child 99094: GMPThread]: D/GMP
GMPContentParent::RemoveCloseBlocker(this=0x2a57e4822000) mCloseBlockerCount=0
   [Child 99094: GMPThread]: D/GMP
GMPContentParent::CloseIfUnused(this=0x2a57e4822000)
mVideoDecoders.IsEmpty=true, mVideoEncoders.IsEmpty=false,
mChromiumCDMs.IsEmpty=true, mCloseBlockerCount=0
   [Child 99094: GMPThread]: D/GMP GMPVideoEncoderParent::ActorDestroy:
0x2a57e4829000 (4)
   [Child 99094: GMPThread]: D/GMP GMP Encoder Terminated: 0x2a57e4c35000
   [Child 99094: GMPThread]: D/GMP GMPVideoEncoderParent::Close: 0x2a57e4829000
   [Child 99094: GMPThread]: D/GMP GMPVideoEncoderParent::Shutdown:
0x2a57e4829000
   [Child 99094: GMPThread]: D/GMP
GMPContentParent::VideoEncoderDestroyed(this=0x2a57e4822000,
aEncoder=0x2a57e4829000)
   [Child 99094: GMPThread]: D/GMP
GMPContentParent::CloseIfUnused(this=0x2a57e4822000)
mVideoDecoders.IsEmpty=true, mVideoEncoders.IsEmpty=true,
mChromiumCDMs.IsEmpty=true, mCloseBlockerCount=0
   [Child 99094: GMPThread]: D/GMP GMPServiceChild::RemoveGMPContentParent:
aGMPContentParent=0x2a57e4822000, mServiceChild=0x2a57e288de00,
mShuttingDownOnGMPThread=false
   [Child 99094: GMPThread]: D/GMP GMPServiceChild::RemoveGMPContentParent:
aGMPContentParent removed, mServiceChild->HaveContentParents()=false
   [Child 99094: GMPThread]: D/GMP
GMPServiceChild::RemoveShutdownBlockerIfNeeded mPendingGetContentParents=0
mServiceChild->HaveContentParents()=false mShuttingDownOnGMPThread=false
   [Child 99094: GMPThread]: D/GMP
GMPContentParent::ActorDestroy(this=0x2a57e4822000, aWhy=4)
   [Child 99094: GMPThread]: D/GMP
GMPContentParent::~GMPContentParent(this=0x2a57e4822000)
mVideoDecoders.IsEmpty=true, mVideoEncoders.IsEmpty=true,
mChromiumCDMs.IsEmpty=true, mCloseBlockerCount=0
   [Child 99094: Main Thread]: D/GMP GMPService::RunPluginCrashCallbacks(2)
   [Child 99094: Main Thread]: D/GMP GMPService::RunPluginCrashCallbacks(2) No
crash helpers, not handling crash.
   [Child 99094: WebrtcWorker #1]: D/GMP GMP Released:

   Stack trace:
   #0  0x00001df765c6ac1b in
mozilla::gmp::GMPChild::GetUTF8LibPath(nsTSubstring<char>&) () from
/usr/local/lib/firefox/libxul.so
   [Current thread is 1 (LWP 1056015)]
   (gdb) where
   #0  0x00001df765c6ac1b in
mozilla::gmp::GMPChild::GetUTF8LibPath(nsTSubstring<char>&) () at
/usr/local/lib/firefox/libxul.so
   #1  0x00001df765c6b65e in
mozilla::gmp::GMPChild::RecvStartPlugin(nsTString<char16_t> const&) () at
/usr/local/lib/firefox/libxul.so
   #2  0x00001df765cae40a in
mozilla::gmp::PGMPChild::OnMessageReceived(IPC::Message const&,
std::__1::unique_ptr<IPC::Message, std::__1::default_delete<IPC::Message> >&)
() at /usr/local/lib/firefox/libxul.so
   #3  0x00001df763c409d8 in
mozilla::ipc::MessageChannel::DispatchSyncMessage(mozilla::ipc::ActorLifecycleProxy*,
IPC::Message const&, std::__1::unique_ptr<IPC::Message,
std::__1::default_delete<IPC::Message> >&)
       () at /usr/local/lib/firefox/libxul.so
   #4  0x00001df763c3feb9 in
mozilla::ipc::MessageChannel::DispatchMessage(mozilla::ipc::ActorLifecycleProxy*,
std::__1::unique_ptr<IPC::Message, std::__1::default_delete<IPC::Message> >) ()
       at /usr/local/lib/firefox/libxul.so
   #5  0x00001df763c40261 in
mozilla::ipc::MessageChannel::RunMessage(mozilla::ipc::ActorLifecycleProxy*,
mozilla::ipc::MessageChannel::MessageTask&) () at
/usr/local/lib/firefox/libxul.so
   #6  0x00001df763c406d4 in mozilla::ipc::MessageChannel::MessageTask::Run()
() at /usr/local/lib/firefox/libxul.so
   #7  0x00001df763ba2633 in mozilla::RunnableTask::Run() () at
/usr/local/lib/firefox/libxul.so
   #8  0x00001df763b9d83c in
mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&>
const&) () at /usr/local/lib/firefox/libxul.so
   #9  0x00001df763b9ca9b in
mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&>
const&) () at /usr/local/lib/firefox/libxul.so
   #10 0x00001df763ba20f8 in
mozilla::detail::RunnableFunction<mozilla::TaskController::TaskController()::$_0>::Run()
() at /usr/local/lib/firefox/libxul.so
   #11 0x00001df763baf194 in nsThread::ProcessNextEvent(bool, bool*) () at
/usr/local/lib/firefox/libxul.so
   #12 0x00001df763bb2e6f in NS_ProcessNextEvent(nsIThread*, bool) () at
/usr/local/lib/firefox/libxul.so
   #13 0x00001df763c43581 in
mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) () at
/usr/local/lib/firefox/libxul.so
   #14 0x00001df763bfb297 in MessageLoop::Run() () at
/usr/local/lib/firefox/libxul.so
   #15 0x00001df766d4d1d9 in nsBaseAppShell::Run() () at
/usr/local/lib/firefox/libxul.so
   #16 0x00001df766ddcbd7 in nsAppShell::Run() () at
/usr/local/lib/firefox/libxul.so
   #17 0x00001df7679073f0 in XRE_RunAppShell() () at
/usr/local/lib/firefox/libxul.so
   #18 0x00001df763bfb297 in MessageLoop::Run() () at
/usr/local/lib/firefox/libxul.so
   #19 0x00001df767906806 in XRE_InitChildProcess(int, char**, XREChildData
const*) () at /usr/local/lib/firefox/libxul.so
   #20 0x00001def19e87dda in main ()

   This stack trace matches
https://bugzilla.mozilla.org/show_bug.cgi?id=1829641.

-- 
You are receiving this mail because:
You are the assignee for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.