livekit / components-js

Official open source React components and examples for building with LiveKit.
https://livekit.io
Apache License 2.0
184 stars 81 forks source link

No device selected in some cases #997

Open jakubjanousek opened 2 months ago

jakubjanousek commented 2 months ago

Select which package(s) are affected

\@livekit/components-react

Describe the bug

On some devices, LiveKit doesn't select audio device in PreJoin (nor inside call) even though LiveKit sees several audio devices. Camera is selected correctly. After joining call, the sound is transmitted correctly, but in MediaSelectDevice there is still nothing selected

image (1)

const audioDevices = useMediaDevices({ kind: 'audioinput' })
console.log('audioDevices length:', audioDevices.length) // audioDevices length: 2
console.log(userChoices.audioDeviceId) // ''
console.log(userChoices.videoDeviceId) // 'abc123def...'

it happens on https://meet.livekit.io as well

Logs:

image image2

Reproduction

This happens in meet.livekit.io as well. It can be reproduced there. You can see a camera is selected correctly, but not the microphone

Devices where it happens:

Devices where it works correctly:

image Screenshot_20241002_094848_Chrome Screenshot_20241002_094854_Chrome

Logs

No response

System Info

Devices where we reproduced it:
* Chrome, Linux: Ubuntu 22.04.4 LTS
* Chrome, Android 13

Worked correctly on:
* multiple browsers, MacOS
* multiple browsers, iOS

Severity

blocking all usage of LiveKit

Additional Information

No response

lukasIO commented 1 month ago

would it be possible for you to check whether https://github.com/livekit/components-js/pull/952 fixes the issue for you?

eyalfishler commented 3 weeks ago

@lukasIO same issue with latest build, audio device is showing as selected but its not really selected and require a re-selection for audio to be transmitted. I'm on iPhone 13pro iOS 18