Bug 219424 - When receiving audio only stream, you can barely hear anything even when volume is maxed
Summary: When receiving audio only stream, you can barely hear anything even when volu...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari 14
Hardware: iPhone / iPad Unspecified
: P2 Major
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-12-02 00:59 PST by Markus M
Modified: 2021-01-14 01:06 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus M 2020-12-02 00:59:59 PST
On iOS/iPadOS Safari 14.2 when a stream is received with audio only you can't almost hear anything. 
But when the stream send from peer contains video, and even when that stream is consumed by an audio tag, everything works great.
Comment 1 Alexey Proskuryakov 2020-12-02 19:35:54 PST
Could you please provide an example URL, or another form of reproducible test?
Comment 2 Markus M 2020-12-03 23:26:25 PST
(In reply to Alexey Proskuryakov from comment #1)
> Could you please provide an example URL, or another form of reproducible
> test?

Hi, thank you for reply.

Here is an example URL, where this can be tested(not mine, but easy place to test just audio) 
https://kraken.fm

This also happens on my own WebRTC web app. What is interesting, is that first audio worked fine, but after a couple of tries(code was not changed) audio went to mode where it is very low.

If more tests are required, I am happy to provide.
Comment 3 Smoley 2020-12-07 10:34:17 PST
Thanks for filing, I can reproduce this using kraken.fm on iOS 14.2.1, but it seems to be fixed in the 14.3 beta.

Markus are you able to try this on the latest beta?
Comment 4 Radar WebKit Bug Importer 2020-12-07 10:35:40 PST
<rdar://problem/72053673>
Comment 5 Markus M 2020-12-08 02:00:04 PST
(In reply to Smoley from comment #3)
> Thanks for filing, I can reproduce this using kraken.fm on iOS 14.2.1, but
> it seems to be fixed in the 14.3 beta.
> 
> Markus are you able to try this on the latest beta?

I installed iOS public beta 14.3 on my iPhone 8, but problem persists both on kraken.fm and my own app.
Comment 6 youenn fablet 2020-12-08 03:11:48 PST
(In reply to Markus M from comment #2)
> (In reply to Alexey Proskuryakov from comment #1)
> > Could you please provide an example URL, or another form of reproducible
> > test?
> 
> Hi, thank you for reply.
> 
> Here is an example URL, where this can be tested(not mine, but easy place to
> test just audio) 
> https://kraken.fm
> 
> This also happens on my own WebRTC web app. What is interesting, is that
> first audio worked fine, but after a couple of tries(code was not changed)
> audio went to mode where it is very low.
> 
> If more tests are required, I am happy to provide.

It might be related to starting to capture audio.
Did you see a behavior change specific to 14.2?
Comment 7 Markus M 2020-12-08 05:15:44 PST
(In reply to youenn fablet from comment #6)
> (In reply to Markus M from comment #2)
> > (In reply to Alexey Proskuryakov from comment #1)
> > > Could you please provide an example URL, or another form of reproducible
> > > test?
> > 
> > Hi, thank you for reply.
> > 
> > Here is an example URL, where this can be tested(not mine, but easy place to
> > test just audio) 
> > https://kraken.fm
> > 
> > This also happens on my own WebRTC web app. What is interesting, is that
> > first audio worked fine, but after a couple of tries(code was not changed)
> > audio went to mode where it is very low.
> > 
> > If more tests are required, I am happy to provide.
> 
> It might be related to starting to capture audio.
> Did you see a behavior change specific to 14.2?

Unfortunately I don't know if behaviour changed with 14.2. I tested WebRTC only with video in September when I started a project. We noticed audio issues in November when the project was at that stage where we switched to audio only.
Comment 8 youenn fablet 2020-12-17 09:09:23 PST
I had a look at kraken.fm and it seems that we get the right volume if we suspend the ongoing WebAudio context after starting the capture. We can then resume the context and it works fine.
Comment 9 youenn fablet 2020-12-17 09:12:17 PST
@Markus, are you also using WebAudio?
Comment 10 Markus M 2021-01-04 00:31:11 PST
(In reply to youenn fablet from comment #9)
> @Markus, are you also using WebAudio?

Sorry for the late reply. I am not using WebAudio, just WebRTC connected to audio-tag's srcObject.
Comment 11 youenn fablet 2021-01-04 09:24:35 PST
I wrote these two jsfiddles:
https://jsfiddle.net/4so0e2zj/
https://jsfiddle.net/nswj1eLh/

First one allows to start/stop getUserMedia while playing web audio.
The second one allows to start/stop getUserMedia while playing audio coming from PC (source being web audio though).

The level of audio is changing when doing some manipulations like:
1. start playing web audio
2. start capturing audio
3. end capturing audio
4. end playing web audio
5. start playing web audio

At that point, the audio level is lower in step 5 than in step 1.

I am not able to reproduce audio level changes without getUserMedia calls though.
The initial description of the bug does not induce using getUserMedia for audio capture.
@MarkusM, can you clarify whether your web page is using getUserMedia?
Comment 12 youenn fablet 2021-01-05 01:20:23 PST
Another repro steps:
1. Client A starts capturing
2. Client B sends audio to client A through WebRTC. Audio level is low
3. Client A stops capturing, audio level increases
Comment 13 youenn fablet 2021-01-05 03:08:34 PST
@Markus, we will investigate how to fix the issues I mentioned.

I do not think though that this will fix your issue.
It would be best if you could provide some repro cases.
Comment 14 Markus M 2021-01-14 01:06:35 PST
(In reply to youenn fablet from comment #11)
> I wrote these two jsfiddles:
> https://jsfiddle.net/4so0e2zj/
> https://jsfiddle.net/nswj1eLh/
> 
> First one allows to start/stop getUserMedia while playing web audio.
> The second one allows to start/stop getUserMedia while playing audio coming
> from PC (source being web audio though).
> 
> The level of audio is changing when doing some manipulations like:
> 1. start playing web audio
> 2. start capturing audio
> 3. end capturing audio
> 4. end playing web audio
> 5. start playing web audio
> 
> At that point, the audio level is lower in step 5 than in step 1.
> 
> I am not able to reproduce audio level changes without getUserMedia calls
> though.
> The initial description of the bug does not induce using getUserMedia for
> audio capture.
> @MarkusM, can you clarify whether your web page is using getUserMedia?

My web page is also using getUserMedia to capture audio. So basically a call between two parties who both use browsers as an audio source. Thank you for investigating and sorry if I missed something, English isn't my first language.

I'll try to produce repro cases.