InnovateAsterisk / Browser-Phone

A fully featured browser based WebRTC SIP phone for Asterisk
https://www.innovateasterisk.com
GNU Affero General Public License v3.0
499 stars 245 forks source link

failed to allocate videosource #414

Closed vieridipaola closed 1 year ago

vieridipaola commented 1 year ago

Hi,

On a Windows client running Firefox I'm seeing the following error in the console log despite enabling/allowing the microphone:

failed to allocate videosource

The client hardware is a laptop with a webcam. However, the user does not necessarily want to use the webcam.

If I list the MediaDevices I can see there's a "VGA Webcam" (videoinput) and a "Realtek HD audio" (audioinput).

The GetUserMEdia object phone.js shows in he console log contains both audio and video.

How can I "force" phone.js to ignore all videocam inputs and take into account ONLY the audioinputs?

I'm not sure it will work anyway... The "failed to allocate videosource" message seems to mean another program is using the video source, but I don't know if that's true (trying to kill processes with no success).

vieridipaola commented 1 year ago

In phone.js I forced removal of the video source with this:

                    else if (deviceInfos[i].kind === "videoinput") {
                        VideoFound = true;
                        if(savedVideoDevice != "default" && deviceInfos[i].deviceId == savedVideoDevice)
                            videoDeviceFound = true;
                        }
                        // Custom removal:
                        VideoFound = false;
                        videoDeviceFound = false;
                    }

Now the console does not give me any errors regarding the webcam and the audioinput devices are set as expected.

When I go to Audio & Video I'm expecting to see a drop-down for Speaker, Ring Device and Microphone. However, the Ring Device section is absent, the microphone drop-down is OK even though the sound level does not change when speaking, and the Speaker drop-down is without elements but plays the test file speech_orig.mp3.

On call establishment (rings OK and answers OK) no audio is heard on this laptop, and the remote party does not hear the laptop user. So, the audiooutput (speaker) is working fine when playing files but not when streaming audio from the call.

I don't know what else to try.

InnovateAsterisk commented 1 year ago

If you are on the latest version, you can turn off video. EnableVideoCalling set to false, and it should remove any attempt to connect to the video source. https://github.com/InnovateAsterisk/Browser-Phone/blob/12061962af0ba09899c432cdc1e18a2f2297740e/Phone/phone.js#L14198

vieridipaola commented 1 year ago

Thanks! It ended up being an OS issue (very high CPU and Disk I/O usage). After a lot of patience it started working as expected. The videoinput error is still there, but it can be safely ignored. The audio calls work fine now.

Closing issue.