Android JNI audio device multi-thread problem

RESOLVED INCOMPLETE

Status

()

Core
WebRTC: Audio/Video
RESOLVED INCOMPLETE
5 years ago
2 years ago

People

(Reporter: chiajung, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [getUserMedia][b2g-gum+][blocking-gum-])

(Reporter)

Description

5 years ago
This is a follow bug of Bug 825112

We found some member data access in Android audio_device do not protected by Mutex in Bug 825112.

Here is a list for problematic function/variable:
  AudioDeviceAndroidJni::Recording() : _recording
  AudioDeviceAndroidJni::PlayoutDelay() : _delayPlayout
  AudioDeviceAndroidJni::RecordingDelay : _delayRecording
  AudioDeviceAndroidJni::Playing() : _playing
  AudioDeviceAndroidJni::PlayoutBuffer() : _delayPlayout
  AudioDeviceAndroidJni::PlayoutWarning() : _playWarning
  AudioDeviceAndroidJni::PlayoutError() : _playError
  AudioDeviceAndroidJni::RecordingWarning() : _recWarning
  AudioDeviceAndroidJni::RecordingError() : _recError
  AudioDeviceAndroidJni::ClearPlayoutWarning() : _playWarning
  AudioDeviceAndroidJni::ClearPlayoutError() : _playError
  AudioDeviceAndroidJni::ClearRecordingWarning() : _recWarning
  AudioDeviceAndroidJni::ClearRecordingError() : _recError
  AudioDeviceAndroidJni::InitSampleRate() : _samplingFreqIn, _samplingFreqOut
  AudioDeviceAndroidJni::PlayThreadProcess() : _playing, _playWarning
  AudioDeviceAndroidJni::RecThreadProcess() : _recording, _recWarning

Furthermore, playback/record thread may cause some more problem when condition wait timeout. Since these thread functions use CriticalSectionScoped and unlock it manullay before condition wait. When the wait timeout, it do not acquire the mutex again and make CriticalSectionScoped out of scope.
Haven't started evangelizing these flags to groups yet, but might as well start setting this. I'll email this out to groups to indicate the whiteboard I've indicated here - which means blocking getUserMedia v1 ship for b2g support.
Whiteboard: [getUserMedia][b2g-gum+]
Whiteboard: [getUserMedia][b2g-gum+] → [getUserMedia][b2g-gum+][blocking-gum-]

Updated

2 years ago
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.