audioswitch icon indicating copy to clipboard operation
audioswitch copied to clipboard

Selected audio device is speakerphone but sound always out from earpiece.(OPPO R15 Pro)

Open AminHong opened this issue 4 years ago • 18 comments

Describe the bug Selected audio device is speakerphone but sound always out from earpiece when used OPPO R15 Pro.

Application Logs 截圖 2021-06-01 上午11 53 45

AudioSwitch Version

  • Version: 1.1.1

Android Device (please complete the following information):

  • Device: OPPO R15 Pro (Android 10) ColorOS v7.1

Additional context When i tried set audio manager mode to Mode_In_Call still invalid.

AminHong avatar Jun 01 '21 04:06 AminHong

Thanks for reaching out @AminHong ! We'll try to take a further look into this issue soon.

Alton09 avatar Jun 01 '21 15:06 Alton09

For me, selected mode shows wired headset but voice is coming from speaker. Works fine if i change it to wired headset using select and activate methods. Not sure how to reproduce. Occuring sometimes.

kevinpatel20 avatar Aug 30 '21 12:08 kevinpatel20

@AminHong we have problems reproducing this issue with the same device. Is this still a problem on your side? Would it be possible for you to add logs with logginEnabled when you encounter this issue? Thanks

ocarevs avatar May 09 '23 11:05 ocarevs

I've same issue :)) , by code does not changing to speaker phone , only working with UI , means user must select speaker phone to change audio output.

misteloo avatar Oct 06 '23 08:10 misteloo

@misteloo What do you mean by "only working with UI"? Can you maybe add steps or code samples how you run in to the issue.

ocarevs avatar Oct 23 '23 08:10 ocarevs

Getting the same issue on a few different devices, but only sometimes. I haven't recorded how often it happens, but from personal experience I would guess it happens about 25-50% of the time, where the audio comes through the earpiece after confirming that the speakerphone device was selected and activated.

It doesn't seem like the device matters, but here's the list of devices I've been able to reproduce on:

  • Pixel 4
  • Pixel 8 Pro
  • Samsung Galaxy S10

AlanMTuring avatar Dec 01 '23 16:12 AlanMTuring

@AlanMTuring Does it happen initially when activating AudioSwitch, i.e. audio output is from different AudioDevice than selected, or when switching devices? Is there a specific scenario where this happens more often than not?

ocarevs avatar Dec 18 '23 12:12 ocarevs

We've only encountered the problem when switching devices, not on initial start.

As far as I can tell, there isn't a specific scenario when this happens. It can be on inbound and outbound calls, wifi or cellular. When it does happen, it's always for the duration of the call. So if it fails to switch at the beginning of the call, switching back to earpiece and waiting, then trying again always doesn't work. But if it works at the beginning of a call, we seem to be able to toggle successfully for the rest of the call.

When the audio switch gets started, I've put some logs in the AudioDeviceChangeListener and I've confirmed that after selectDevice and activate on the speaker get called, the new selectedAudioDevice is the speaker, but audio still comes quietly from the earpiece.

AlanMTuring avatar Dec 18 '23 14:12 AlanMTuring

@AlanMTuring I am struggling to reproduce the issue. Does this happen on your own app; can you reproduce the same issue on voice or video quickstarts? Also, is it possible for you to add some logs with AudioSwitch.loggingEnabled where you encounter the problem?

ocarevs avatar Dec 19 '23 13:12 ocarevs

This happens on my app, looking into the voice quickstart.

I enabled AudioSwitch's logging and got this from a simple inbound call. Logs show no user selected device (defaults to earpiece) then I select the speakerphone. After the speakerphone is selected and the logs show it's the selected device, sound still comes from the earpiece.

AS/AudioSwitch          ---    D  Available AudioDevice list updated: [Earpiece(name=Earpiece), Speakerphone(name=Speakerphone)]
AS/AudioSwitch          ---    D  Current user selected AudioDevice = null
AS/AudioSwitch          ---    D  Available AudioDevice list updated: [Earpiece(name=Earpiece), Speakerphone(name=Speakerphone)]
AS/AudioSwitch          ---    D  Current user selected AudioDevice = null
AS/AudioSwitch          ---    D  Available AudioDevice list updated: [BluetoothHeadset(name=Google Pixel Watch 01PE), Earpiece(name=Earpiece), Speakerphone(name=Speakerphone)]
AS/AudioSwitch          ---    D  Current user selected AudioDevice = null
AS/AudioSwitch          ---    D  Available AudioDevice list updated: [BluetoothHeadset(name=Google Pixel Watch 01PE), Earpiece(name=Earpiece), Speakerphone(name=Speakerphone)]
AS/AudioSwitch          ---    D  Current user selected AudioDevice = null
AS/AudioSwitch          ---    D  Available AudioDevice list updated: [Earpiece(name=Earpiece), Speakerphone(name=Speakerphone)]
AS/AudioSwitch          ---    D  Current user selected AudioDevice = null
AS/AudioSwitch          ---    D  Available AudioDevice list updated: [BluetoothHeadset(name=Google Pixel Watch 01PE), Earpiece(name=Earpiece), Speakerphone(name=Speakerphone)]
AS/AudioSwitch          ---    D  Current user selected AudioDevice = null
AS/AudioSwitch          ---    D  Selected AudioDevice = Speakerphone(name=Speakerphone)
AS/AudioSwitch          ---    D  Available AudioDevice list updated: [BluetoothHeadset(name=Google Pixel Watch 01PE), Earpiece(name=Earpiece), Speakerphone(name=Speakerphone)]
AS/AudioSwitch          ---    D  Current user selected AudioDevice = Speakerphone(name=Speakerphone)

AlanMTuring avatar Dec 19 '23 14:12 AlanMTuring

There doesn't seem to be anything out of ordinary with the logs provided. @AlanMTuring Let me know if you were able to reproduce the issue with quickstart.

ocarevs avatar Dec 20 '23 11:12 ocarevs

This happens to me as well. Using latest Audio com.twilio:audioswitch:1.1.8 and com.twilio:voice-android:6.4.0 Any resolution / work around?

softsan avatar Jan 05 '24 12:01 softsan

@softsan does this happen with the normal quickstart or with the ConnecitonService flavor?

afalls-twilio avatar Feb 26 '24 16:02 afalls-twilio

I have the same issue with Galaxy S10

chanphiromsok avatar Mar 13 '24 02:03 chanphiromsok

@chanphiromsok Thank you for reporting, did you have this issue with the QuickStart using ConnectionService?

afalls-twilio avatar Mar 18 '24 15:03 afalls-twilio

@softsan does this happen with the normal quickstart or with the ConnecitonService flavor?

With quickstart and with connectionService as well

softsan avatar Apr 03 '24 21:04 softsan

@chanphiromsok Thank you for reporting, did you have this issue with the QuickStart using ConnectionService?

I used this lib I don't know much about native it might hard to you https://github.com/jellyfish-dev/react-native-membrane-webrtc/tree/master whereas this fork repo from twilio is work fine on my device he commit and fixed audio switch https://github.com/davidliu/audioswitch

chanphiromsok avatar Apr 04 '24 01:04 chanphiromsok