Closed Bug 862681 Opened 11 years ago Closed 9 years ago

Android JNI audio device multi-thread problem

Categories

(Core :: WebRTC: Audio/Video, defect)

ARM
Android
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: chiajung, Unassigned)

Details

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

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-]
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.