cybex-dev / twilio_voice

Flutter Twilio Voice Plugin
https://twilio-voice-web.web.app/
MIT License
39 stars 80 forks source link

Audio Not Transmitting to Dialed Number in Twilio Call #180

Closed hbsciw closed 10 months ago

hbsciw commented 11 months ago

Issue Summary

I'm experiencing an issue with the sound not being transferred from the source (client) to the destination (dialed number) when implementing a Twilio call. After the client calls the Twilio number and Twilio dials the number, the two parties are connected, but the sound from the source is not audible at the destination. This is unexpected behavior as the audio should be transmitted seamlessly between both connected numbers.

Steps to Reproduce

  1. Implement a Twilio call where the client calls a Twilio number.
  2. Program Twilio to dial another number upon receiving a call.
  3. Connect the source and destination.

Expected Behavior: The sound from the source should be transmitted and heard at the destination without issues.

Actual Behavior: The source and destination are connected, but the sound from the source is not reaching the destination, resulting in a one-way audio issue.

cybex-dev commented 11 months ago

Hi @hbsciw

Thanks for opening the issue - I'm investigating this issue at the moment. Additional information would be helpful.

On which Android SDK/OS versions do you experience this issue?

hbsciw commented 11 months ago

Hi @cybex-dev Thank you for your response

Android version 13 Device Galaxy A51 twilio_voice SDK v0.1.0

cybex-dev commented 11 months ago

@hbsciw wonderful, to confirm caller and recipient are both Android +13?

hbsciw commented 11 months ago

Caller is android 13, for recipient i test with different devices such as android 13, android 12, ...

For your information the recipient is not app or sdk. recipient is phone number.

hbsciw commented 11 months ago

@cybex-dev Is there a way to revert to a previous version until the issue is resolved?

cybex-dev commented 11 months ago

Caller is android 13, for recipient i test with different devices such as android 13, android 12, ...

For your information the recipient is not app or sdk. recipient is phone number.

Thanks for the info.

cybex-dev commented 11 months ago

@cybex-dev Is there a way to revert to a previous version until the issue is resolved?

The only alternative is reverting back to 0.0.9 - though keep in mind there are many additional fixes, etc in the latest version.

We have several clients affected by this issue and am actively investigating the cause.

hbsciw commented 11 months ago

@cybex-dev Is there a way to revert to a previous version until the issue is resolved?

The only alternative is reverting back to 0.0.9 - though keep in mind there are many additional fixes, etc in the latest version.

We have several clients affected by this issue and am actively investigating the cause.

Than you.

Could you give me the branch or the commit relates to this version?

hbsciw commented 11 months ago

@cybex-dev Is there a way to revert to a previous version until the issue is resolved?

The only alternative is reverting back to 0.0.9 - though keep in mind there are many additional fixes, etc in the latest version.

We have several clients affected by this issue and am actively investigating the cause.

Thank you for your valuable contribution

ardeshir-33033 commented 11 months ago

Same issue here, hope its gonna fixed soon. we have many angry clients.

ardeshir-33033 commented 11 months ago

@cybex-dev is there anything you can point us to so we might be able to help you.

cybex-dev commented 11 months ago

@ardeshir-33033 @hbsciw

@cybex-dev is there anything you can point us to so we might be able to help you.

Thank you for offering, what would be helpful is to understand what's happening in the background when this issue occurs.

If you could provide Android log outputs (via logcat) when placing the call until it is answered. This would assist in tracking down the issue faster.

cybex-dev commented 11 months ago

1 2 3

4

Thanks for the screenshots, but it doesn't help that much.

Could you copy/paste from logcat instead when you experienced this issue - would help alot, thanks.

cybex-dev commented 11 months ago

I've revised the required implementation for Android +13, to my knowledge all required functionality has been implemented. A change brought along with Android 14 is Foreground Service Types which has been implemented, however this issue remains.

I've been able to replicate this issue using:

For the record, I've opened an issue on Android 14 QPR, I hope to have some feedback soon to resolve this issue. https://issuetracker.google.com/issues/304335430

mohsen-jalali commented 11 months ago

I faced this issue as well, I tried with different type of devices but could not be able to receive caller audio from callee. @cybex-dev

cybex-dev commented 11 months ago

Hi @mohsen-jalali, thanks for the report.

I've been able to consistently reproduce this issue, I'd like to ask everyone who has experienced this issue to assist in testing this scenario:

Please grab the latest version twilio_voice/tree/fix_android_14_microphone_audio, then replicate with the following actions:

Note - this is 100% reproducible on first call, but further on it occurs intermittently regardless of caller.

Note - this seems to be more reliable, however the same issue is faced with microphone input working intermittently.


Please contribute to the bug tracker link, reposted here - it will help draw attention to this issue. https://issuetracker.google.com/issues/304335430

mohsen-jalali commented 11 months ago

I found the solution, the issue was because of not starting foreground service on outgoing calls. I created a pull request for it and fixed it. https://github.com/cybex-dev/twilio_voice/pull/181 @cybex-dev

cybex-dev commented 11 months ago

I found the solution, the issue was because of not starting foreground service on outgoing calls. I created a pull request for it and fixed it. #181 @cybex-dev

Absolutely amazing - that would explain the Op codes error. I'll review, merge and push latest update today. Many thanks @mohsen-jalali!

cybex-dev commented 11 months ago

@mohsen-jalali initial testing on Google API 34 emulator (the only platform I can reliably and consistently reproduce this issue), does not seem to resolve this no microphone on outgoing calls.

2023-10-14 12:25:12.050   416-432   PermissionCache         audioserver                          D  checking android.permission.CALL_AUDIO_INTERCEPTION for uid=10204 => denied (599 us)
2023-10-14 12:25:12.056   416-6318  AudioFlinger            audioserver                          I  AudioFlinger's thread 0x77d19e0d4bb0 tid=6318 ready to run
2023-10-14 12:25:12.062   416-432   AudioPolicyService      audioserver                          I  App op 27 missing, silencing record AttributionSourceState{pid: 6050, uid: 10204, packageName: com.twilio.twilio_voice_example, attributionTag: (null), token: binder:0x77d0d1caf660, renouncedPermissions: [], next: []}
2023-10-14 12:25:12.065  6050-6253  tvo.webrtc.Logging      com.twilio.twilio_voice_example      I  WebRtcAudioEffectsExternal: enable(audioSession=257)
2023-10-14 12:25:12.065  6050-6253  tvo.webrtc.Logging      com.twilio.twilio_voice_example      I  WebRtcAudioRecordExternal: AudioRecord: session ID: 257, channels: 1, sample rate: 48000
2023-10-14 12:25:12.066  6050-6253  tvo.webrtc.Logging      com.twilio.twilio_voice_example      I  WebRtcAudioRecordExternal: AudioRecord: buffer size in frames: 2880
2023-10-14 12:25:12.067  6050-6253  tvo.webrtc.Logging      com.twilio.twilio_voice_example      I  WebRtcAudioRecordExternal: Number of active recording sessions: 0
2023-10-14 12:25:12.068  6050-6253  tvo.webrtc.Logging      com.twilio.twilio_voice_example      I  WebRtcAudioRecordExternal: startRecording
2023-10-14 12:25:12.071   585-1409  AppOps                  system_server                        E  Operation not started: uid=10204 pkg=com.twilio.twilio_voice_example(null) op=RECORD_AUDIO
2023-10-14 12:25:12.075   416-6318  audioserver             audioserver                          D  FGS Logger Transaction failed
2023-10-14 12:25:12.075   416-6318  audioserver             audioserver                          D  -129
2023-10-14 12:25:12.075   416-6318  audioserver             audioserver                          D  FGS Logger Transaction failed
2023-10-14 12:25:12.076   416-6318  audioserver             audioserver                          D  -129

This should resolve microphone access issues for prior Android 13 devices - will merge but we're not out of the water yet.

cybex-dev commented 11 months ago

Re-opening issue for Android 14.