Issues in updating microphone device when there is a change in audio devices?

Options

Hi

In my web application in Desktops/Laptops, I am facing issues with updating microphone when I connect or disconnect bluetooth/wired earphones.

Steps to reproduce the issues.
I started my application after connecting the earphones.
step 1:
when I disconnect an audio device(Bluetooth/wired earphones), for the first time it is taking less than 10 seconds to get the updated list of microphones and to auto shift default microphone from bluetooth microphone to internal microphone.

step 2:
But, when I reconnect my bluetooth/earphones again, it is taking around 20 seconds to get the updated list of microphone devices and to auto shift default microphone from internal microphone to bluetooth microphone.

step 3:
when I disconnect my bluetooth/earphones again, it is taking around 80-90 seconds to get the updated list of microphones and to auto shift default microphone from bluetooth microphone to internal microphone.

step 4:
when I reconnect my bluetooth/earphones again, it is taking around 3 minutes to get the updated list of microphone devices and to auto shift default microphone from internal microphone to bluetooth microphone.

step 5:
when I disconnect my bluetooth/earphones again, it is taking more than 6 minutes to get the updated list of microphones and to auto shift default microphone from bluetooth microphone to internal microphone.

this issue is happening in Laptops/desktops not in mobile devices.

when I console current microphone device using the below code, I am getting 1000's of logs throught out these above mentioned steps.
import { useDevices } from '@daily-co/daily-react';
const { currentMic } = useDevices();

useEffect(() => { console.log('#testingTrainerMicrophone currentMic', currentMic) }, [currentMic])

I am using,
Daily version 0.47
Chrome version 119
mac os 13.4.1

Answers

  • mark_at_daily
    mark_at_daily Community Manager, Dailynista admin
    Options

    @svm_agilis that's certainly unexpected. We could use a little more information to repro:

    • What version of daily-react are you using?
    • Would you mind sharing a session ID where this is occurring?

    Also, can you gather some additional information for us? What I'm interested in understanding is whether this is an OS/browser interface issue or a slowness on the part of Daily's SDKs. Fortunately, there's an easy way to tell. When you connect a device, you can call navigator.mediaDevices.enumerateDevices(), which is a browser API that lists the available media devices. After you connect a device, can you let us know if you see enumerateDevices() also taking a very long time to return the new device? Separately, we can check to see if this is an issue with daily-react by listening to the available-devices-updated event, which is emitted when a device is added or removed.

    With this information, we can better understand and troubleshoot this issue with you.