b) I assume you are using the Platform audio path but can you please confirm?
Now to your problems:
For Platform audio, I sometimes noticed the same behaviour you see in #1. and #2. I have a fix probably similar to yours calling into Android APIs, but mine is reordering the priorities to Bluetooth > Speaker > Earpice. So it should solve your issues #1 and #2 at the same time. Have a look at the Android specific code here:
For your issue #3 I can not really say anything myself as I don’t have a Samsung phone on me. But to narrow down the issue, you could compare against using the Unity audio route and also compare against using the standard Meet sample.
Thanks for the update. I tested the latest changes using the Meet Sample and wanted to share my feedback.
For this test, I added PlatformAudioController.cs exactly as provided in the GitHub repository and updated MeetManager.cs to match the latest GitHub version. Here are the results:
Headset routing: Audio is now routed correctly to a wired headset or Bluetooth headset if it is already connected before joining the room. However, if I connect or switch to a headset after joining, the playback audio does not switch to the headset.
Fallback after disconnecting a headset: If I join the room with a headset connected, playback works correctly through the headset. However, after disconnecting it, the playback falls back to the earpiece speaker instead of the device’s media/loud speaker.
Samsung microphone issue: The low microphone volume issue still exists. I’m not yet certain whether this is specific to Samsung devices, but so far I’ve tested on 4 Samsung devices, and all of them had the same very low microphone volume problem. I also tested on 2 non-Samsung devices, and they did not have this issue. I tested both the Unity Audio implementation and the Meet Sample (PlatformAudio), and both exhibited the same barely audible microphone volume on the affected Samsung devices.
Additional observation: On the affected Samsung devices, if I use a wired or Bluetooth headset for the call, the low microphone volume issue disappears. The problem only occurs when using the phone’s built-in microphone.
Please let me know if there is any additional logging or information I can provide to help investigate these remaining issues.
@Alireza_Karimy, Max’s PR #364 handles #1 and #2, so the open one is #3. Quick map:
#1/#2: Platform Audio routes playback through the native WebRTC ADM, which defaults to the earpiece on Android. PR #364 reorders it to Bluetooth > Speaker > Earpiece. Pull that in and both should resolve.
#3 cause: Platform Audio applies auto gain control and hardware processing on the mic capture, the README lists it as unlocking “echo cancellation, noise suppression, auto gain control.” That AGC is the mic-level knob, and on some Samsung units it clamps the captured level hard, which fits your symptom exactly: quiet transmitted audio while your own playback is fine.
No SDK knob today: the audio session is hardcoded (the iOS side is tracked in #330); there is no exposed Android audio-mode or source setting.
The quick diagnostic and workaround is to publish the mic through the Unity Audio path instead, which does not run that native AGC/processing:
var micObject = new GameObject("my-audio-source");
var rtcSource = new MicrophoneSource(Microphone.devices[0], micObject);
var track = LocalAudioTrack.CreateAudioTrack("mic", rtcSource, room);
var options = new TrackPublishOptions { Source = TrackSource.SourceMicrophone };
yield return room.LocalParticipant.PublishTrack(track, options);
rtcSource.Start();
If the Samsung level jumps back, the native AGC was it. Realistic trade-off: Unity Audio drops the hardware echo cancellation Platform Audio gave you, so on an open loudspeaker you may need software AEC or push-to-talk. If you want to stay on Platform Audio and still fix the gain, a focused issue with the exact Samsung models is the route.
Regarding #1 and #2, I’ve already posted my test results after trying Max’s PR, so I’m waiting for Max’s response.
Regarding your suggestion for diagnosing #3, I actually started with the Unity Audio path before Platform Audio was introduced. I implemented microphone publishing using MicrophoneSource, as you suggested, and the low microphone volume issue was still present on the affected Samsung devices. So unfortunately, the problem doesn’t seem to be specific to Platform Audio or its AGC.
At this point, it seems more likely that the issue is either device-specific or somewhere deeper in the Android/Unity/WebRTC audio stack.