Bug 236439

Summary: Audio volume reduces on stopping and restarting audio track after enabling / disabling the mic capture
Product: WebKit Reporter: asanand
Component: WebRTCAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: webkit-bug-importer, youennf
Priority: P1 Keywords: InRadar
Version: Safari 15   
Hardware: iPhone / iPad   
OS: iOS 15   

Description asanand 2022-02-10 06:51:00 PST
Earlier issue - Audio Volume reduces considerably on accepting the mic permissions 
https://bugs.webkit.org/show_bug.cgi?id=218012

From the 15.4 beta version the earlier issue got fixed. But it reproes again if we enable / disable the mic permission and then minimizing and then again maximize the safari.

Steps :-
a) Start the audio rendering of webRTC stream via HTML element in safari browser
b) Enable the mic capture. Disable the mic capture. Minimize the page.
c) Open the page again. Low audio volume issue reproes.
Comment 1 Radar WebKit Bug Importer 2022-02-14 19:55:06 PST
<rdar://problem/88943506>
Comment 2 asanand 2022-02-24 07:24:03 PST
Please use the below steps to to repro this issue on a standalone app
Case 1
a) Open https://ashishanand26cs.github.io/lowvolume on safari
b) Press "Start" button. Audio tone will play
c) Press "MicAccess" button. Mic capture will start.
d) Press "MicAccessStop" button. Mic capture will stop.
e) Press "ResetAudio" button. Observer the audio tone volume reduces 

Case 2
a) Open https://ashishanand26cs.github.io/lowvolume on safari
b) Press "Start" button. Audio tone will play
c) Press "ResetAudio" button. Observer the audio tone volume remains same.


If we enable/disable the mic access then the volume of audio track reduces considerably
Comment 3 youenn fablet 2022-03-11 06:50:44 PST
(In reply to asanand from comment #2)
> Please use the below steps to to repro this issue on a standalone app
> Case 1
> a) Open https://ashishanand26cs.github.io/lowvolume on safari
> b) Press "Start" button. Audio tone will play
> c) Press "MicAccess" button. Mic capture will start.
> d) Press "MicAccessStop" button. Mic capture will stop.
> e) Press "ResetAudio" button. Observer the audio tone volume reduces 
> 
> Case 2
> a) Open https://ashishanand26cs.github.io/lowvolume on safari
> b) Press "Start" button. Audio tone will play
> c) Press "ResetAudio" button. Observer the audio tone volume remains same.
> 
> 
> If we enable/disable the mic access then the volume of audio track reduces
> considerably

On iOS, there are two audio levels that the user can tweak: an audio level when playing regular audio and an audio level when capturing audio.

The audio level in use currently change when starting to capture.
When stopping to capture, we keep using the same audio level until the audio is stopped.

Can you try and make sure the same audio levels are roughly the same?
If that solves the issue, your request might be that you would like the page to stick with one audio level throughout the audio rendering. Is that correct?
Comment 4 asanand 2022-03-16 06:24:28 PDT
(In reply to youenn fablet from comment #3)
> (In reply to asanand from comment #2)
> > Please use the below steps to to repro this issue on a standalone app
> > Case 1
> > a) Open https://ashishanand26cs.github.io/lowvolume on safari
> > b) Press "Start" button. Audio tone will play
> > c) Press "MicAccess" button. Mic capture will start.
> > d) Press "MicAccessStop" button. Mic capture will stop.
> > e) Press "ResetAudio" button. Observer the audio tone volume reduces 
> > 
> > Case 2
> > a) Open https://ashishanand26cs.github.io/lowvolume on safari
> > b) Press "Start" button. Audio tone will play
> > c) Press "ResetAudio" button. Observer the audio tone volume remains same.
> > 
> > 
> > If we enable/disable the mic access then the volume of audio track reduces
> > considerably
> 
> On iOS, there are two audio levels that the user can tweak: an audio level
> when playing regular audio and an audio level when capturing audio.
> 
> The audio level in use currently change when starting to capture.
> When stopping to capture, we keep using the same audio level until the audio
> is stopped.
> 
> Can you try and make sure the same audio levels are roughly the same?
> If that solves the issue, your request might be that you would like the page
> to stick with one audio level throughout the audio rendering. Is that
> correct?

Yes that will be really helpful. We would want to stick to one audio level on a page thought the audio rendering
Comment 5 asanand 2022-08-07 22:31:50 PDT
(In reply to asanand from comment #4)
> (In reply to youenn fablet from comment #3)
> > (In reply to asanand from comment #2)
> > > Please use the below steps to to repro this issue on a standalone app
> > > Case 1
> > > a) Open https://ashishanand26cs.github.io/lowvolume on safari
> > > b) Press "Start" button. Audio tone will play
> > > c) Press "MicAccess" button. Mic capture will start.
> > > d) Press "MicAccessStop" button. Mic capture will stop.
> > > e) Press "ResetAudio" button. Observer the audio tone volume reduces 
> > > 
> > > Case 2
> > > a) Open https://ashishanand26cs.github.io/lowvolume on safari
> > > b) Press "Start" button. Audio tone will play
> > > c) Press "ResetAudio" button. Observer the audio tone volume remains same.
> > > 
> > > 
> > > If we enable/disable the mic access then the volume of audio track reduces
> > > considerably
> > 
> > On iOS, there are two audio levels that the user can tweak: an audio level
> > when playing regular audio and an audio level when capturing audio.
> > 
> > The audio level in use currently change when starting to capture.
> > When stopping to capture, we keep using the same audio level until the audio
> > is stopped.
> > 
> > Can you try and make sure the same audio levels are roughly the same?
> > If that solves the issue, your request might be that you would like the page
> > to stick with one audio level throughout the audio rendering. Is that
> > correct?
> 
> Yes that will be really helpful. We would want to stick to one audio level
> on a page thought the audio rendering

We are still seeing this issue repro on iOS 16 beta 3.
Is this possible to keep the audio volume constant on a page?