components-js icon indicating copy to clipboard operation
components-js copied to clipboard

No device selected in some cases

Open jakubjanousek opened this issue 1 year ago • 3 comments

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:

  • Chrome, Linux: Ubuntu 22.04.4 LTS
  • Chrome, Android 13

Devices where it works correctly:

  • any browser on MacOS & iOS

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

jakubjanousek avatar Oct 02 '24 08:10 jakubjanousek

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

lukasIO avatar Oct 08 '24 07:10 lukasIO

@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

eyalfishler avatar Nov 09 '24 00:11 eyalfishler

I'm running into a similar issue where trying to change the microphone or camera on the prejoin screen doesn't update every time. No error is being thrown but it just doesn't update.

I think something is going wrong in the setActiveMediaDevice function.

daviddelusenet avatar Feb 07 '25 08:02 daviddelusenet

thanks for your patience on this. We applied some changes recently to improve the situation with device handling across our SDKs. Feel free to open a new issue if you're still running into problems with this

lukasIO avatar Jun 23 '25 13:06 lukasIO