<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>220362</bug_id>
          
          <creation_ts>2021-01-06 06:13:32 -0800</creation_ts>
          <short_desc>Muted video track stops sending packets if receive RTCP PLI request</short_desc>
          <delta_ts>2021-05-17 02:10:03 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebRTC</component>
          <version>Safari 14</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>macOS 11</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Igor">igor</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1717634</commentid>
    <comment_count>0</comment_count>
    <who name="Igor">igor</who>
    <bug_when>2021-01-06 06:13:32 -0800</bug_when>
    <thetext>Browser version: Safari 14.0.2 (16610.3.7.1.9)

Issue: muted video track stops to send any video packet after receiving RTCP PLI message

How to reproduce: 
1. Safari: open https://demo.flashphoner.com/client2/examples/demo/streaming/media_devices_manager/media_device_manager.html
2. Click Connect, then Publish
3. See Pli Count
4. Switch Video Mute to On, wait for Pli Count increase, then unmute video by switching to Off
5. After getting PLI in muted state Safari will stop video packets.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1717637</commentid>
    <comment_count>1</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2021-01-06 06:21:15 -0800</bug_when>
    <thetext>Thanks for the report.

I tried the repro steps on Safari Tech Preview and was not able to reproduce.
Can you try it on your side?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1717646</commentid>
    <comment_count>2</comment_count>
    <who name="Igor">igor</who>
    <bug_when>2021-01-06 07:57:15 -0800</bug_when>
    <thetext>Reproduced with latest Safari Tech Preview.

I forgot to say that you need to change resolution to 640x360 instead of default 640x480</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1717651</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-01-06 08:06:19 -0800</bug_when>
    <thetext>&lt;rdar://problem/72851967&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1717653</commentid>
    <comment_count>4</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2021-01-06 08:20:32 -0800</bug_when>
    <thetext>I am still seeing &quot;Packets Sent&quot; increasing after unmuting.
When muting, the number of packets increases slowly as expected.
When unmuting, the number of packets increases steadily.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1718210</commentid>
    <comment_count>5</comment_count>
    <who name="Igor">igor</who>
    <bug_when>2021-01-07 21:24:19 -0800</bug_when>
    <thetext>(In reply to youenn fablet from comment #4)
&gt; I am still seeing &quot;Packets Sent&quot; increasing after unmuting.
&gt; When muting, the number of packets increases slowly as expected.
&gt; When unmuting, the number of packets increases steadily.

I recorded screen cast with the issue, you can check it here: https://filebin.net/dodb62j775ou92t1

Did you wait for PLI count increasing before unmuting the video?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1718280</commentid>
    <comment_count>6</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2021-01-08 05:50:27 -0800</bug_when>
    <thetext>&gt; I recorded screen cast with the issue, you can check it here:
&gt; https://filebin.net/dodb62j775ou92t1

That is interesting.
In your case, when you mute the track, the number of packets sent gets frozen, the bitrate is down to zero. It is as if the sender is fully stopped or something like sender.replaceTrack(null);

On my side, I continue to see a small bitrate, packets sent increase...
This is due to the fact that a muted track will trigger sending one black frame per second.

Can you verify this?
Alternatively, you can enable web inspector, set WebRTC logging to verbose and look at WebRTC logging (in system console or web inspector console).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1718625</commentid>
    <comment_count>7</comment_count>
    <who name="Igor">igor</who>
    <bug_when>2021-01-11 00:17:10 -0800</bug_when>
    <thetext>(In reply to youenn fablet from comment #6)
&gt; Can you verify this?
&gt; Alternatively, you can enable web inspector, set WebRTC logging to verbose
&gt; and look at WebRTC logging (in system console or web inspector console).

Here is another screen cast, https://filebin.net/izr4g99jp4ry9zfd

I increased PLI interval up to 20 seconds. From video you can see that after muting video track still sends packets before getting the new PLI request.

I checked media track state, it has only one changed property - &apos;enabled = false&apos;, also checked RTCRtpSender with getSenders() - there are two senders before and after muting - sender with audio track and sender with video track. 

WebRTC logging shows that webrtc stack sends black frame, but no packets on outbound connection.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1720471</commentid>
    <comment_count>8</comment_count>
    <who name="Igor">igor</who>
    <bug_when>2021-01-18 21:39:16 -0800</bug_when>
    <thetext>Any updates with this bug?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1760699</commentid>
    <comment_count>9</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2021-05-17 02:10:03 -0700</bug_when>
    <thetext>@Igor, this is a video encoder issue.
I passed it down to the corresponding team which fixed it.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>