Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change output device due to race condition #512

Open
francescoc93 opened this issue Jan 3, 2020 · 0 comments
Open

Change output device due to race condition #512

francescoc93 opened this issue Jan 3, 2020 · 0 comments

Comments

@francescoc93
Copy link

Description

When there are a lot of output device, sometimes when answer the call, the output device change randomly. This problem is due to a race condition in Devices class (package org.jitsi.impl.neomedia.device) method getSelectedDevice(List activeDevices).
When some threads reload the list of devices preference (method loadDevicePreferences) , they empty the list of preferences and, when a thread try to get the device where to send the stream, it find an empty list of preferences and then pick up the first active device detected

Current behavior

sometimes when answer the call, the output device change randomly

Expected Behavior

always send the stream to the first first detected device in the list of preferences

Possible Solution

include the block of code from line 174 to line 217 in the synchronized block at the line 221

Steps to reproduce

it's hard reproduce this bug. To facilitate the reproduce of this bug, it's possibile insert a semaphore in loadDevicePreferences' method (acquire the resource at the begginin and release at the end of method) and a semaphore in getSelectedDevice method (acquire resource at line 173 and release at line 175)

Environment details


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant