twilio / twilio-video-ios

Programmable Video SDK by Twilio
http://twilio.com/video
Other
64 stars 22 forks source link

Remote audio not working on Apple Silicon (M1) #182

Open erisvaldojunior opened 3 years ago

erisvaldojunior commented 3 years ago

Description

If you generate an .app for Apple Silicon and try to call an iPhone or iPad (running the same app), everything works great, except that the MacOS user can't listen to the mobile one (remote audio doesn't work).

Steps to Reproduce

  1. Open Xcode and Run app on My Mac (Designed for iPad) / product -> archive it as a Mac app on a Apple Silicon machine
  2. Make a video call with another user running the same app on an iPhone or iPad
  3. Everything works perfect except for remote audio (camera is fine, local audio is fine, remote user - that is using the same app on an iPhone or iPad - can listen to you but you can't listen remote user)

Code

// Code that helps reproduce the issue

Expected Behavior

Everything (both video and remote audio) should work normally, just like on iOS devices (iphone and ipad).

Actual Behavior

Everything works perfect, except remote audio

Reproduces How Often

100%

Versions

All relevant version information for the issue.

Video iOS SDK

4.1

Xcode

12.4

MacOS Version

Big Sur (11.2.3)

MacOS Device

MacBook Pro 13-inch M1 2020

iOS Version

14.4.2

iOS Device

iPhone 8 Plus

erisvaldojunior commented 3 years ago

Any news regarding this? Thanks

paynerc commented 3 years ago

@erisvaldojunior,

Are you able to send logs from the application that is running on the Apple Silicon Mac? I am looking into an issue that appears to be similar, but I would like to verify that this is the same root cause.

Thank you,

Ryan

janremes commented 2 years ago

@ceaglest Please any news on fix availability? Thanks

ceaglest commented 2 years ago

Hi @janremes,

I'm looking into a similar issue regarding use of the microphone (#195) for our next release 4.6.0. The only M1 machine I have available to test is a Mac Mini, but I can say that audio does not function correctly with the arm64 simulator in 4.6.0-beta1 due to a requirement to use both input and output.

At this point archiving an arm64 iPad app to run on an M1 Mac is not a supported configuration in the sense that we do not test it automatically with each release. I think that fixing #195 will make improvements here, but I can't guarantee it. I will at least validate the changes manually to give a heads up on this ticket if they will make improvements for running iPad apps on an Apple Silicon Mac.

Best, Chris

wolfspy commented 2 years ago

This issue is partially resolved with the release of Twilio Video iOS SDK 5.0.0:

The issue is resolved in cases where you unpublish your local audio track from the M1 simulator. This isn't much but it's a start.

toseefahmedMP commented 2 years ago

Hi Folks,

I am also facing a similar kind of issue in the latest TwilioVoice SDK (v6.4.1) where I am able to initiate a call successfully. Still, I am unable to hear audio on either side. It's like it is a similar issue where I installed the iPad application on silicon MAC where the voice is not audible.

It will be really great If someone throws any light on this issue.

iksudnik commented 1 year ago

I've encountered this issue previously and solved it by using a custom AudioDevice. I employed the Swift version of AVAudioEngineDevice. In the audioUnitDescription() method, I added these lines: if ProcessInfo.processInfo.isiOSAppOnMac { audioUnitDescription.componentSubType = kAudioUnitSubType_RemoteIO } else { audioUnitDescription.componentSubType = kAudioUnitSubType_VoiceProcessingIO } While this solution works, I am not entirely satisfied with it because AVAudioEngineDevice seems to contain numerous bugs.