<?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>233473</bug_id>
          
          <creation_ts>2021-11-24 07:05:21 -0800</creation_ts>
          <short_desc>audio track error: A MediaStreamTrack ended due to a capture failure</short_desc>
          <delta_ts>2023-03-01 03:50:50 -0800</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 15</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>macOS 12</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="Vadim">vad.filippov</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>andy</cc>
    
    <cc>a.xalilov1997</cc>
    
    <cc>bfulgham</cc>
    
    <cc>csantos</cc>
    
    <cc>daginge</cc>
    
    <cc>daniel.stabel</cc>
    
    <cc>francesco.durighetto</cc>
    
    <cc>jesmith</cc>
    
    <cc>petez</cc>
    
    <cc>stuartmemo</cc>
    
    <cc>tal.bar2005</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1817641</commentid>
    <comment_count>0</comment_count>
    <who name="Vadim">vad.filippov</who>
    <bug_when>2021-11-24 07:05:21 -0800</bug_when>
    <thetext>In Safari on macOS 15.1 Beta when audio track is acquired in Safari it always ended immediately with error &apos;A MediaStreamTrack ended due to a capture failure&apos;.
Could be reproduced using https://webrtc.github.io/samples/src/content/getusermedia/audio/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1817651</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-11-24 08:32:51 -0800</bug_when>
    <thetext>&lt;rdar://problem/85729477&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1824730</commentid>
    <comment_count>2</comment_count>
    <who name="Tal Bar">tal.bar2005</who>
    <bug_when>2021-12-16 05:51:35 -0800</bug_when>
    <thetext>We are also encountering this error with Safari 15.1 on MacOS. 
For us, it seems to only occur when the application makes use of the AudioContext API. 
The example provided by Vadim doesn&apos;t reproduce this error for us. 

This is a significant problem, as our application includes WebRTC based video-chat and outputs dynamic sounds. 

In Chrome / Firefox and Safari versions pre 15, this issue doesn&apos;t occur at all. 

It seems that there are other bug reports in Bugzilla which may be related to this one, but it&apos;s really hard to pin point exactly.. 

As more users are gradually updating their Safari version to 15.1, this issue is affecting more and more users.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1829568</commentid>
    <comment_count>3</comment_count>
    <who name="Charlie">csantos</who>
    <bug_when>2022-01-10 11:17:39 -0800</bug_when>
    <thetext>A lot of our customers are also starting to see this error. For us, it happens on USB and Bluetooth devices and when the application uses Web Audio API.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1838595</commentid>
    <comment_count>4</comment_count>
    <who name="Francesco Durighetto (kekkokk)">francesco.durighetto</who>
    <bug_when>2022-02-08 03:27:47 -0800</bug_when>
    <thetext>Safari 15.3 bug still present.

Can riproduce even without webAudio APIs.

Steps to reproduce:
- connect bluetooth headphones
- go to system preferences, audio, input. Set the default input device as the internal microphone instead of Bluetooth device.
- open: https://jsfiddle.net/bkwLzcjo/1/
- allow permission to capture and inspect console
- select from the dropdown menu the bluetooth input
- &quot;A MediaStreamTrack ended due to a capture failure&quot; appears after few seconds in console

It&apos;s P2 an adequate priority?

If we add audioContexts to the page this became even more messy and broken and the majority of conference apps uses the audioContext to display audioLevel...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1838671</commentid>
    <comment_count>5</comment_count>
    <who name="Dag-Inge Aas">daginge</who>
    <bug_when>2022-02-08 08:00:03 -0800</bug_when>
    <thetext>Possibly dupe or related to https://bugs.webkit.org/show_bug.cgi?id=221192. I guess in this case a PC isn&apos;t involved so might be a separate issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1844743</commentid>
    <comment_count>6</comment_count>
    <who name="Peter">petez</who>
    <bug_when>2022-02-22 09:22:49 -0800</bug_when>
    <thetext>Happening to us regularly now with USB audio devices, Safari is (once again) basically unusable for WebRTC.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1846450</commentid>
    <comment_count>7</comment_count>
    <who name="Andrew McGregor">andy</who>
    <bug_when>2022-02-27 09:19:38 -0800</bug_when>
    <thetext>I get the same error on Safari on both Intel and iPhone with this app https://mdn.github.io/web-dictaphone/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1876945</commentid>
    <comment_count>8</comment_count>
    <who name="Abror">a.xalilov1997</who>
    <bug_when>2022-06-21 04:55:19 -0700</bug_when>
    <thetext>Any updates on this? We are still facing this problem in our webrtc app?
For us, capturing an audio device is failing when AudioContext API is used in Safari 15.x.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1885654</commentid>
    <comment_count>9</comment_count>
    <who name="Abror">a.xalilov1997</who>
    <bug_when>2022-07-20 23:52:27 -0700</bug_when>
    <thetext>The issue is fixed for me in Safari 15.6</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887061</commentid>
    <comment_count>10</comment_count>
    <who name="Joshua Smith">jesmith</who>
    <bug_when>2022-07-27 08:50:00 -0700</bug_when>
    <thetext>Although the error message is no longer being reported, switching audio devices still does not work. If you open the audio device you want, it now will work correctly with the device chosen (this wasn&apos;t working before). But if you then close that and try to open a different device, things still fall apart.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887062</commentid>
    <comment_count>11</comment_count>
    <who name="Peter">petez</who>
    <bug_when>2022-07-27 08:51:06 -0700</bug_when>
    <thetext>Are you sure about that? I tested it and was able to change devices.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887076</commentid>
    <comment_count>12</comment_count>
    <who name="Joshua Smith">jesmith</who>
    <bug_when>2022-07-27 09:14:12 -0700</bug_when>
    <thetext>After some more testing, it turns out that changing devices *does* work. The problem is that when I have bluetooth headphones connected, the gain on the internal mic is dropping to almost zero. This only happens in Safari (I can switch audio input no problem in Firefox, for example, and the gain stays correct).

This seems to be a new problem, in that the internal mic gain is super low even if that&apos;s the only device I ever use. So it&apos;s not related to switching.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887082</commentid>
    <comment_count>13</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2022-07-27 09:28:37 -0700</bug_when>
    <thetext>(In reply to Joshua Smith from comment #12)
&gt; After some more testing, it turns out that changing devices *does* work. The
&gt; problem is that when I have bluetooth headphones connected, the gain on the
&gt; internal mic is dropping to almost zero. This only happens in Safari (I can
&gt; switch audio input no problem in Firefox, for example, and the gain stays
&gt; correct).
&gt; 
&gt; This seems to be a new problem, in that the internal mic gain is super low
&gt; even if that&apos;s the only device I ever use. So it&apos;s not related to switching.

This seems like a different bug, could you file a bug?
Also, which Safari version are you using?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887083</commentid>
    <comment_count>14</comment_count>
    <who name="Joshua Smith">jesmith</who>
    <bug_when>2022-07-27 09:33:28 -0700</bug_when>
    <thetext>I&apos;ll file a bug. I&apos;m using Version 15.6 (16613.3.9.1.7, 16613) on MacOS 11.6.7</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887133</commentid>
    <comment_count>15</comment_count>
    <who name="Joshua Smith">jesmith</who>
    <bug_when>2022-07-27 12:47:55 -0700</bug_when>
    <thetext>Here&apos;s the bug, including a test app to demonstrate it.
https://bugs.webkit.org/show_bug.cgi?id=243260</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1908665</commentid>
    <comment_count>16</comment_count>
    <who name="Tal Bar">tal.bar2005</who>
    <bug_when>2022-10-27 02:38:57 -0700</bug_when>
    <thetext>This bug is definitely NOT resolved! 
I&apos;m still encountering this bug on Safari Version 16.0 (17614.1.25.9.10, 17614).
When selecting bluetooth headphones (WH-1000XM2) as audio input device, I&apos;m getting &quot;A MediaStreamTrack ended due to a capture failure&quot;.
I was able to reproduce it in Google Meet. 
This bug makes using Safari + bluetooth headphones for video calls impossible!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1908667</commentid>
    <comment_count>17</comment_count>
    <who name="Tal Bar">tal.bar2005</who>
    <bug_when>2022-10-27 02:51:05 -0700</bug_when>
    <thetext>As Francesco Durighetto described, this error occurs when the OS default input device is set at anything other than bluetooth headphones. 
Still, this issue doesn&apos;t occur using Chrome or Firefox. Only Safari..</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1908668</commentid>
    <comment_count>18</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2022-10-27 02:55:33 -0700</bug_when>
    <thetext>@Tal Bar, can you file a new bug?
And mention the macOS version (plus ideally send me a sysdiagnose to me at youenn@apple.com)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>