Skip to content

Inconsistent audio device enumeration on mobile browsers (iOS / Android): only default device returned, Bluetooth headsets not reliably detected #3135

@vakhoooo

Description

@vakhoooo

What happened and what did you expect to happen?

We have a web application built with Vue 3 + TypeScript using Amazon Chime SDK for JavaScript. The application is deployed via AWS Amplify and Lambda. Audio works correctly on desktop browsers, but on mobile browsers (iOS Safari, iOS Chrome, Android Chrome) audio device enumeration behaves inconsistently.

On some iPhone and Android devices, listAudioInputDevices() and listAudioOutputDevices() return only a single device with deviceId: "default". In many cases device labels are empty. Bluetooth headsets are not reliably detected: sometimes only the microphone is available without output devices, sometimes only output devices without a microphone, and sometimes the Bluetooth headset does not appear at all.

This happens even after the user explicitly grants microphone permission and after calling getUserMedia({ audio: true }). The same user and device can behave differently between sessions. On desktop browsers the same code consistently lists all available input and output devices, including Bluetooth headsets.

We already tried requesting microphone permission via navigator.mediaDevices.getUserMedia, enumerating devices only after permissions are granted, forcing usage of the "default" device, and keeping the audio session active. Despite this, Bluetooth audio devices are still inconsistently exposed on mobile browsers.

We understand that mobile browsers have OS-level and privacy limitations, but the current behavior is inconsistent across devices and sessions, and it is unclear whether this is an expected limitation of mobile web, a known limitation of Amazon Chime SDK on mobile browsers, or if there is a recommended approach to handle Bluetooth audio devices on mobile web.

`await navigator.mediaDevices.getUserMedia({ audio: true });

const { inputs, outputs } = await Promise.all([
session.audioVideo.listAudioInputDevices(true),
session.audioVideo.listAudioOutputDevices(true),
]);

// On mobile browsers inputs/outputs often contain only one device: "default"
`

Have you reviewed our existing documentation?

Reproduction steps

Open the web application on a mobile browser (Safari or Chrome) on an iPhone (observed on some iPhone 15 and newer devices). Join a meeting and grant microphone permission when prompted. Connect a Bluetooth headset (for example wireless headphones) before or after opening the page. Once permission is granted, the application calls getUserMedia({ audio: true }) and then enumerates audio devices using listAudioInputDevices() and listAudioOutputDevices() from Amazon Chime SDK.

On some devices and Bluetooth headsets, only a single default device is returned. In some cases only a microphone is listed without any output devices, in other cases only output devices are listed without a microphone. Sometimes the Bluetooth headset is not listed at all. The same steps on desktop browsers consistently return all available audio devices.

Amazon Chime SDK for JavaScript version

"@aws-sdk/client-chime-sdk-meetings": "^3.954.0", "amazon-chime-sdk-js": "^3.29.0"

What browsers are you seeing the problem on?

safari/chrome

Browser version

16+

Meeting and Attendee ID Information.

No response

Browser console logs

[12:41:03.112] INFO Requesting microphone permission
[12:41:03.845] INFO Microphone permission granted

[12:41:03.846] INFO Calling getUserMedia({ audio: true })
[12:41:04.021] INFO getUserMedia resolved successfully

[12:41:04.024] INFO Enumerating audio devices via Amazon Chime SDK
[12:41:04.035] INFO listAudioInputDevices(forceUpdate=true) called
[12:41:04.061] INFO listAudioInputDevices result:
[
{
deviceId: "default",
kind: "audioinput",
label: ""
}
]

[12:41:04.064] INFO listAudioOutputDevices(forceUpdate=true) called
[12:41:04.089] INFO listAudioOutputDevices result:
[]

[12:41:04.092] INFO Selected audio input device: default
[12:41:04.094] INFO No audio output devices returned, falling back to system default

[12:41:04.098] INFO Audio session started

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions