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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>17697</bug_id>
          
          <creation_ts>2012-07-05 14:24:21 +0000</creation_ts>
          <short_desc>Limit total volume</short_desc>
          <delta_ts>2012-09-10 10:19:33 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>AudioWG</product>
          <component>Web Audio Processing: Use Cases and Requirements</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>TBD</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Olivier Thereaux">olivier.thereaux</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>cooper</cc>
    
    <cc>crogers</cc>
    
    <cc>jer.noble</cc>
    
    <cc>jussi.kalliokoski</cc>
    
    <cc>philipj</cc>
          
          <qa_contact>public-audio</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>69650</commentid>
    <comment_count>0</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2012-07-05 14:24:21 +0000</bug_when>
    <thetext>From “Review of Web Audio Processing: Use Cases and Requirements”
http://lists.w3.org/Archives/Public/public-audio/2012AprJun/0852.html

Are there issues with needing to provide a way for limits e.g., on total volume when multiple tracks layered, or is this handled by audio equipment? Wouldn&apos;t want combinatorial effects to create excessively loud spots. Consider users who have audio volume higher than usual because of hearing impairment, but still we can&apos;t allow eardrum-damaging levels to come out.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69836</commentid>
    <comment_count>1</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2012-07-11 15:49:28 +0000</bug_when>
    <thetext>My understanding is that this is a non-issue, but it could benefit from input by our audio specialists. 

1) Should we document this in the requirements or is it absolutely evident that the loudness of the sound processed through the web audio API would be limited by the constraints of the system-wide volume control?

2) If 1, then do how does the current web audio API fare with regards to these requirements?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71366</commentid>
    <comment_count>2</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2012-07-24 09:53:02 +0000</bug_when>
    <thetext>It seems to me that this, too, belongs at the operating system level, since multiple applications may be producing output.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72284</commentid>
    <comment_count>3</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2012-08-16 14:39:38 +0000</bug_when>
    <thetext>I can&apos;t quite find a hook for this requirement (indeed, as mentioned in Comment #2, more of an OS-level requirement) and audio processing requirements.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72297</commentid>
    <comment_count>4</comment_count>
    <who name="Jer Noble">jer.noble</who>
    <bug_when>2012-08-16 17:03:09 +0000</bug_when>
    <thetext>For what it&apos;s worth, we have already received bug reports that certain demos (like Jussi&apos;s http://niiden.com/orbisyn/ demo) cause deafeningly loud noise in the current shipping versions of Chrome and Safari for the Mac.  The output is so overwhelmingly loud that the system volume controls have no apparent effect.

So, while conceptually this is a task for the OS to regulate, UAs will have a great deal of pressure to add some kind of volume check to the WebAudio API.  The question is, will this limit be part of a spec or not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72298</commentid>
    <comment_count>5</comment_count>
    <who name="Jussi Kalliokoski">jussi.kalliokoski</who>
    <bug_when>2012-08-16 17:18:56 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; For what it&apos;s worth, we have already received bug reports that certain demos
&gt; (like Jussi&apos;s http://niiden.com/orbisyn/ demo) cause deafeningly loud noise in
&gt; the current shipping versions of Chrome and Safari for the Mac.  The output is
&gt; so overwhelmingly loud that the system volume controls have no apparent effect.
&gt; 
&gt; So, while conceptually this is a task for the OS to regulate, UAs will have a
&gt; great deal of pressure to add some kind of volume check to the WebAudio API. 
&gt; The question is, will this limit be part of a spec or not.

This is true. The issue with my demo is however a bit parallel with Bug 18539 [1]. The demo gets underruns which, due to the nature of JS nodes, cause the high Q low pass filters to have significant feedback.

My proposition for mitigating issues like this for Jer was to monitor the dB levels at the AudioContext&apos;s listener and mute for a certain amount of time if a certain threshold is topped. This is afaict common behaviour in popular DAWs as well. This threshold would preferably be above +0.0dB as it may become a nuisance if any distorted value mutes the output, although preferably developers should avoid levels like that by for example using a compressor. But this is not always in the developers hands, like in the DAW use case.

It might also be useful to notify the developer of the mute, for example with an event on the AudioContext.

[1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=18539</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72315</commentid>
    <comment_count>6</comment_count>
    <who name="Chris Rogers">crogers</who>
    <bug_when>2012-08-16 18:55:25 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; For what it&apos;s worth, we have already received bug reports that certain demos
&gt; (like Jussi&apos;s http://niiden.com/orbisyn/ demo) cause deafeningly loud noise in
&gt; the current shipping versions of Chrome and Safari for the Mac.  The output is
&gt; so overwhelmingly loud that the system volume controls have no apparent effect.

This part &quot;system volume controls have no apparent effect&quot; seems like an important clue to try to fix this problem.  I&apos;m guessing that what we need to do in the AudioDestination is to clip the final output to 0dBFS (a range from -1 -&gt; +1).  This is supposed to be the clipping point anyway, so I&apos;m interested if this helps fix the problem.  I&apos;m guessing that the rendered audio signal is so &quot;hot&quot; that even with drastic gain reductions using the system volume control, it won&apos;t help...



&gt; 
&gt; So, while conceptually this is a task for the OS to regulate, UAs will have a
&gt; great deal of pressure to add some kind of volume check to the WebAudio API. 
&gt; The question is, will this limit be part of a spec or not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72344</commentid>
    <comment_count>7</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2012-08-17 08:30:26 +0000</bug_when>
    <thetext>Thanks Jer, Jussi. You gave me enough material to add something to the requirements document. Let&apos;s continue the discussion about whether/how to add it to the spec in Bug 18539.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72346</commentid>
    <comment_count>8</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2012-08-17 08:36:04 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt; (In reply to comment #4)
&gt; &gt; For what it&apos;s worth, we have already received bug reports that certain demos
&gt; &gt; (like Jussi&apos;s http://niiden.com/orbisyn/ demo) cause deafeningly loud noise in
&gt; &gt; the current shipping versions of Chrome and Safari for the Mac.  The output is
&gt; &gt; so overwhelmingly loud that the system volume controls have no apparent effect.
&gt; 
&gt; This part &quot;system volume controls have no apparent effect&quot; seems like an
&gt; important clue to try to fix this problem.  I&apos;m guessing that what we need to
&gt; do in the AudioDestination is to clip the final output to 0dBFS (a range from
&gt; -1 -&gt; +1).  This is supposed to be the clipping point anyway, so I&apos;m interested
&gt; if this helps fix the problem.  I&apos;m guessing that the rendered audio signal is
&gt; so &quot;hot&quot; that even with drastic gain reductions using the system volume
&gt; control, it won&apos;t help...

Does this mean that the current WebKit implementation just passes the signal on to the OS without clamping to [-1, 1]?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72362</commentid>
    <comment_count>9</comment_count>
    <who name="Chris Rogers">crogers</who>
    <bug_when>2012-08-17 17:24:33 +0000</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #6)
&gt; &gt; (In reply to comment #4)
&gt; &gt; &gt; For what it&apos;s worth, we have already received bug reports that certain demos
&gt; &gt; &gt; (like Jussi&apos;s http://niiden.com/orbisyn/ demo) cause deafeningly loud noise in
&gt; &gt; &gt; the current shipping versions of Chrome and Safari for the Mac.  The output is
&gt; &gt; &gt; so overwhelmingly loud that the system volume controls have no apparent effect.
&gt; &gt; 
&gt; &gt; This part &quot;system volume controls have no apparent effect&quot; seems like an
&gt; &gt; important clue to try to fix this problem.  I&apos;m guessing that what we need to
&gt; &gt; do in the AudioDestination is to clip the final output to 0dBFS (a range from
&gt; &gt; -1 -&gt; +1).  This is supposed to be the clipping point anyway, so I&apos;m interested
&gt; &gt; if this helps fix the problem.  I&apos;m guessing that the rendered audio signal is
&gt; &gt; so &quot;hot&quot; that even with drastic gain reductions using the system volume
&gt; &gt; control, it won&apos;t help...
&gt; 
&gt; Does this mean that the current WebKit implementation just passes the signal on
&gt; to the OS without clamping to [-1, 1]?

Good question.  Come to think of it, It depends which port of WebKit.  I think that Apple&apos;s &quot;mac&quot; port does *not* clamp.  But, for Chrome the clamping happens somewhere deeper down inside the chromium-specific audio back-end.

It would be good if I could have a reproducible case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73166</commentid>
    <comment_count>10</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2012-09-03 14:08:06 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; Thanks Jer, Jussi. You gave me enough material to add something to the
&gt; requirements document. Let&apos;s continue the discussion about whether/how to add
&gt; it to the spec in Bug 18539.

I&apos;ve added this to a Use Case / Requirement, see http://dvcs.w3.org/hg/audio/rev/2a6431dcb680</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73534</commentid>
    <comment_count>11</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2012-09-10 10:19:33 +0000</bug_when>
    <thetext>Seeing no objection, closing.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>