Skip to content
This repository has been archived by the owner on Mar 22, 2022. It is now read-only.

Error init PeerConnection #141

Closed
Ken2050 opened this issue Dec 10, 2019 · 11 comments
Closed

Error init PeerConnection #141

Ken2050 opened this issue Dec 10, 2019 · 11 comments
Labels
duplicate This issue or pull request already exists external bug Bug in upstream dependency

Comments

@Ken2050
Copy link

Ken2050 commented Dec 10, 2019

Hi,

Using C# "TestNetCoreConsole" , v1.0.2 of Microsoft.MixedReality.WebRTC (nuget) and latest VS2019. .NET Core 3.0

I get this error after a few sec after calling:

await pc.InitializeAsync(config);

Fatal error in: ../../media/engine/webrtcvoiceengine.cc, line 253
last system error: 0
Check failed: adm()

What am I doing wrong here?

@djee-ms
Copy link
Member

djee-ms commented Dec 10, 2019

ADM is Audio Device Module. I assume you don't have a microphone, or you have a connected audio device that is not supported. Due to some bug in the Google code, this makes ADM initializing fail, and there is nothing we can do about it for now. See #140, #124 and the Google bug https://bugs.chromium.org/p/webrtc/issues/detail?id=11081. If you can please confirm this is a likely reason, I will close this bug as Duplicate of #124.

@Ken2050
Copy link
Author

Ken2050 commented Dec 10, 2019

I have plenty of audio devices (35 input devices to be exact...) on the Win10 computer, the default is a microphone. I just tried a to set a different input device as default but same result.

Follow up question, will I be able to feed the Local audio with PCM data, and not use a sound card directly?

@djee-ms
Copy link
Member

djee-ms commented Dec 10, 2019

Not at the moment. I am working on this feature for video right now (#35), as this is the one feature everyone seems to want, and depending on how much signal we get from other users about the need for that for audio data we can also consider adding it. That would make sense I think. But it is not planned at the moment.

Currently audio data goes directly from a sound card (capture) to another remote sound card (output) without any possible way to intervene; this is how it is implemented by Google. There is some on-going work to open up the PCM data on the receiving side, for example to inject it into the Unity DSP engine and enable spatial audio etc., see #92 and #99.

@djee-ms djee-ms added the external bug Bug in upstream dependency label Dec 10, 2019
@djee-ms
Copy link
Member

djee-ms commented Dec 10, 2019

Note that if 1 audio device is not supported, then no matter which one you select, the ADM init will fail. The only workaround is to physically disconnect the unsupported device(s). For example anything that has not 1/2/4 audio channels, like Azure Kinect DK (7-microphone array) will make ADM init fail. There is a patch on Google's master branch to fix that strange behavior, and only test the actually selected device (not all the available one) but it's not merged into MixedReality-WebRTC.

@Ken2050
Copy link
Author

Ken2050 commented Dec 10, 2019

In my case I 'm only interested in audio (no need for video at all). But I need to be able to feed and receive PCM data. Preferably that the WebRTC handles the jitter and buffer, and with a callback for when PCM data is available (for receiving).

And future feature request is to be able to use other audio codecs, even Linear PCM. I know browsers do not support that, but P2P between two Windows App will work.

@Ken2050
Copy link
Author

Ken2050 commented Dec 10, 2019

I will try the code on a laptop where I have only the standard audio devices,
not a boat load full of IP-Audio devices...

@djee-ms
Copy link
Member

djee-ms commented Dec 10, 2019

For audio codecs, PCM mu-law (PCMU) and A-law (PCMA) are both supported. Here's the full list of audio codecs I get on my local Desktop machine:

a=rtpmap:111 opus/48000/2
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:9 G722/8000
a=rtpmap:102 ILBC/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:106 CN/32000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:112 telephone-event/32000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000

@Ken2050
Copy link
Author

Ken2050 commented Dec 10, 2019

Those are the typical WebRTC codecs, OPUS is great.

The audio transport in WebRTC is RTP and what you fill the payload with could be a custom Codec (say MP3). It will not work to a browser to between two Win Console app as long as I have control over the RTP.

Any way that's not important for now, PCM in/out instead of sound-card so I can integrate this hopefully great WebRTC library is what I need most.

@Ken2050
Copy link
Author

Ken2050 commented Dec 10, 2019

Just to confirm, when testing on my laptop with just the standard audio devices. I get no ADM error. It works, I can connect and pass audio between two console apps.

@djee-ms djee-ms added the duplicate This issue or pull request already exists label Dec 10, 2019
@djee-ms
Copy link
Member

djee-ms commented Dec 10, 2019

Right, thanks for the feedback. I am pretty sure this is ADM1 again doing it's overly aggressive checks. I will see if we can backport that fix from Google.
I am closing this as duplicate of #124 as they have the same root cause.

@burakkaraceylan
Copy link

burakkaraceylan commented Nov 1, 2021

Still no fix for this for Unity Editor?

Edit: I had to disable the Oculus microphone. Working fine now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists external bug Bug in upstream dependency
Projects
None yet
Development

No branches or pull requests

3 participants