|
|
Index: webrtc/voice_engine/channel_proxy.cc |
diff --git a/webrtc/voice_engine/channel_proxy.cc b/webrtc/voice_engine/channel_proxy.cc |
index fc22180566ccba2948cfa9e093ed58dcc6fcb185..5f0c0f6a60638a6786a84ce40a7f0f89928f8f27 100644 |
--- a/webrtc/voice_engine/channel_proxy.cc |
+++ b/webrtc/voice_engine/channel_proxy.cc |
@@ -214,6 +214,13 @@ void ChannelProxy::SetRtcEventLog(RtcEventLog* event_log) { |
channel()->SetRtcEventLog(event_log); |
} |
+// From MixerAudioSource |
+MixerAudioSource::AudioFrameWithMuted ChannelProxy::GetAudioFrameWithMuted( |
+ int32_t id, |
+ int sample_rate_hz) { |
+ return channel()->GetAudioFrameWithMuted(id, sample_rate_hz); |
the sun
2016/10/03 11:41:26
Add separate thread checker for audio output threa
Add separate thread checker for audio output thread.
aleloi
2016/10/03 12:57:28
That would probably have to wait a little while, b
On 2016/10/03 11:41:26, the sun wrote:
> Add separate thread checker for audio output thread.
That would probably have to wait a little while, because audio is requested from
two different threads in OpenSL ES: the first two frames are requested by the
user thread that does PeerConnection API calls (at least I think it's the user
thread, I've pasted a stack trace below). henrika@ has told me that this could
be changed. Alternatively we could wait actually connecting the mixer until the
behavior is changed.
(frames now shown:
ChannelProxy::GetAudioFrameWithMuted()
AudioReceiveStream::GetAudioFrameWithMuted()
AudioMixerImpl::GetNonAnonymousAudio()
)
0 in webrtc::AudioMixerImpl::Mix of
../../webrtc/modules/audio_mixer/audio_mixer_impl.cc:194
1 in webrtc::(anonymous namespace)::MiMAudioTransport::NeedMorePlayData of
../../webrtc/audio/audio_state.cc:71
2 in webrtc::AudioDeviceBuffer::RequestPlayoutData of
../../webrtc/modules/audio_device/audio_device_buffer.cc:347
3 in webrtc::FineAudioBuffer::GetPlayoutData of
../../webrtc/modules/audio_device/fine_audio_buffer.cc:88
4 in webrtc::OpenSLESPlayer::EnqueuePlayoutData of
../../webrtc/modules/audio_device/android/opensles_player.cc:396
5 in webrtc::OpenSLESPlayer::StartPlayout of
../../webrtc/modules/audio_device/android/opensles_player.cc:123
6 in webrtc::AudioDeviceTemplate<webrtc::AudioRecordJni,
webrtc::OpenSLESPlayer>::StartPlayout of
../../webrtc/modules/audio_device/android/audio_device_template.h:183
7 in webrtc::AudioDeviceModuleImpl::StartPlayout of
../../webrtc/modules/audio_device/audio_device_impl.cc:1405
8 in webrtc::internal::AudioReceiveStream::Start of
../../webrtc/audio/audio_receive_stream.cc:177
9 in cricket::WebRtcVoiceMediaChannel::WebRtcAudioReceiveStream::SetPlayout of
../../webrtc/media/engine/webrtcvoiceengine.cc:1425
10 in cricket::WebRtcVoiceMediaChannel::AddRecvStream of
../../webrtc/media/engine/webrtcvoiceengine.cc:2236
11 in cricket::BaseChannel::AddRecvStream_w of ../../webrtc/pc/channel.cc:1239
12 in cricket::BaseChannel::UpdateRemoteStreams_w of
../../webrtc/pc/channel.cc:1380
13 in cricket::VoiceChannel::SetRemoteContent_w of
../../webrtc/pc/channel.cc:1765
14 in rtc::MethodFunctor3<cricket::VoiceChannel, bool
(cricket::VoiceChannel::*)(unsigned int, int, int), bool, unsigned int, int,
int>::operator() of ../../webrtc/base/bind.h:389
15 in rtc::FunctorMessageHandler<bool,
rtc::MethodFunctor3<cricket::VoiceChannel, bool
(cricket::VoiceChannel::*)(unsigned int, int, int), bool, unsigned int, int,
int> >::OnMessage of ../../webrtc/base/messagehandler.h:44
16 in rtc::Thread::Send of ../../webrtc/base/thread.cc:361
17 in rtc::Thread::InvokeInternal of ../../webrtc/base/thread.cc:455
18 in rtc::Thread::Invoke<bool, rtc::MethodFunctor3<cricket::BaseChannel, bool
(cricket::BaseChannel::*)(cricket::MediaContentDescription const*,
cricket::ContentAction, std::__ndk1::basic_string<char,
std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >*), bool,
cricket::MediaContentDescription const*, cricket::ContentAction,
std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>,
std::__ndk1::allocator<char> >*> > of ../../webrtc/base/thread.h:170
19 in
cricket::BaseChannel::InvokeOnWorker<rtc::MethodFunctor3<cricket::BaseChannel,
bool (cricket::BaseChannel::*)(cricket::MediaContentDescription const*,
cricket::ContentAction, std::__ndk1::basic_string<char,
std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >*), bool,
cricket::MediaContentDescription const*, cricket::ContentAction,
std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>,
std::__ndk1::allocator<char> >*> > of ../../webrtc/pc/channel.h:352
20 in cricket::BaseChannel::SetRemoteContent of ../../webrtc/pc/channel.cc:440
21 in cricket::BaseChannel::PushdownRemoteDescription of
../../webrtc/pc/channel.cc:860
22 in webrtc::WebRtcSession::PushdownMediaDescription of
../../webrtc/api/webrtcsession.cc:935
23 in webrtc::WebRtcSession::UpdateSessionState of
../../webrtc/api/webrtcsession.cc:897
24 in webrtc::WebRtcSession::SetRemoteDescription of
../../webrtc/api/webrtcsession.cc:766
25 in webrtc::PeerConnection::SetRemoteDescription of
../../webrtc/api/peerconnection.cc:1169
26 in webrtc::MethodCall2<webrtc::PeerConnectionInterface, void,
webrtc::SetSessionDescriptionObserver*,
webrtc::SessionDescriptionInterface*>::Marshal of ../../webrtc/api/proxy.h:218
27 in
webrtc::PeerConnectionProxyWithInternal<webrtc::PeerConnectionInterface>::SetRemoteDescription
of ../../webrtc/api/peerconnectionproxy.h:64
28 in PeerConnectionInterfaceTest::DoSetSessionDescription of
../../webrtc/api/peerconnectioninterface_unittest.cc:782
29 in PeerConnectionInterfaceTest::DoSetRemoteDescription of
../../webrtc/api/peerconnectioninterface_unittest.cc:795
30 in PeerConnectionInterfaceTest::CreateAnswerAsRemoteDescription of
../../webrtc/api/peerconnectioninterface_unittest.cc:919
31 in PeerConnectionInterfaceTest::CreateOfferReceiveAnswer of
../../webrtc/api/peerconnectioninterface_unittest.cc:889
32 in PeerConnectionInterfaceTest::InitiateCall of
../../webrtc/api/peerconnectioninterface_unittest.cc:815
the sun
2016/10/04 20:41:12
Discussed offline: use RaceChecker and e.g. RTC_DC
On 2016/10/03 12:57:28, aleloi wrote:
> On 2016/10/03 11:41:26, the sun wrote:
> > Add separate thread checker for audio output thread.
>
> That would probably have to wait a little while, because audio is requested
from
> two different threads in OpenSL ES: the first two frames are requested by the
> user thread that does PeerConnection API calls (at least I think it's the user
> thread, I've pasted a stack trace below). henrika@ has told me that this could
> be changed. Alternatively we could wait actually connecting the mixer until
the
> behavior is changed.
>
> (frames now shown:
> ChannelProxy::GetAudioFrameWithMuted()
> AudioReceiveStream::GetAudioFrameWithMuted()
> AudioMixerImpl::GetNonAnonymousAudio()
> )
>
> 0 in webrtc::AudioMixerImpl::Mix of
> ../../webrtc/modules/audio_mixer/audio_mixer_impl.cc:194
> 1 in webrtc::(anonymous namespace)::MiMAudioTransport::NeedMorePlayData of
> ../../webrtc/audio/audio_state.cc:71
> 2 in webrtc::AudioDeviceBuffer::RequestPlayoutData of
> ../../webrtc/modules/audio_device/audio_device_buffer.cc:347
> 3 in webrtc::FineAudioBuffer::GetPlayoutData of
> ../../webrtc/modules/audio_device/fine_audio_buffer.cc:88
> 4 in webrtc::OpenSLESPlayer::EnqueuePlayoutData of
> ../../webrtc/modules/audio_device/android/opensles_player.cc:396
> 5 in webrtc::OpenSLESPlayer::StartPlayout of
> ../../webrtc/modules/audio_device/android/opensles_player.cc:123
> 6 in webrtc::AudioDeviceTemplate<webrtc::AudioRecordJni,
> webrtc::OpenSLESPlayer>::StartPlayout of
> ../../webrtc/modules/audio_device/android/audio_device_template.h:183
> 7 in webrtc::AudioDeviceModuleImpl::StartPlayout of
> ../../webrtc/modules/audio_device/audio_device_impl.cc:1405
> 8 in webrtc::internal::AudioReceiveStream::Start of
> ../../webrtc/audio/audio_receive_stream.cc:177
> 9 in cricket::WebRtcVoiceMediaChannel::WebRtcAudioReceiveStream::SetPlayout
of
> ../../webrtc/media/engine/webrtcvoiceengine.cc:1425
> 10 in cricket::WebRtcVoiceMediaChannel::AddRecvStream of
> ../../webrtc/media/engine/webrtcvoiceengine.cc:2236
> 11 in cricket::BaseChannel::AddRecvStream_w of ../../webrtc/pc/channel.cc:1239
> 12 in cricket::BaseChannel::UpdateRemoteStreams_w of
> ../../webrtc/pc/channel.cc:1380
> 13 in cricket::VoiceChannel::SetRemoteContent_w of
> ../../webrtc/pc/channel.cc:1765
> 14 in rtc::MethodFunctor3<cricket::VoiceChannel, bool
> (cricket::VoiceChannel::*)(unsigned int, int, int), bool, unsigned int, int,
> int>::operator() of ../../webrtc/base/bind.h:389
> 15 in rtc::FunctorMessageHandler<bool,
> rtc::MethodFunctor3<cricket::VoiceChannel, bool
> (cricket::VoiceChannel::*)(unsigned int, int, int), bool, unsigned int, int,
> int> >::OnMessage of ../../webrtc/base/messagehandler.h:44
> 16 in rtc::Thread::Send of ../../webrtc/base/thread.cc:361
> 17 in rtc::Thread::InvokeInternal of ../../webrtc/base/thread.cc:455
> 18 in rtc::Thread::Invoke<bool, rtc::MethodFunctor3<cricket::BaseChannel, bool
> (cricket::BaseChannel::*)(cricket::MediaContentDescription const*,
> cricket::ContentAction, std::__ndk1::basic_string<char,
> std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >*), bool,
> cricket::MediaContentDescription const*, cricket::ContentAction,
> std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>,
> std::__ndk1::allocator<char> >*> > of ../../webrtc/base/thread.h:170
> 19 in
> cricket::BaseChannel::InvokeOnWorker<rtc::MethodFunctor3<cricket::BaseChannel,
> bool (cricket::BaseChannel::*)(cricket::MediaContentDescription const*,
> cricket::ContentAction, std::__ndk1::basic_string<char,
> std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >*), bool,
> cricket::MediaContentDescription const*, cricket::ContentAction,
> std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>,
> std::__ndk1::allocator<char> >*> > of ../../webrtc/pc/channel.h:352
> 20 in cricket::BaseChannel::SetRemoteContent of ../../webrtc/pc/channel.cc:440
> 21 in cricket::BaseChannel::PushdownRemoteDescription of
> ../../webrtc/pc/channel.cc:860
> 22 in webrtc::WebRtcSession::PushdownMediaDescription of
> ../../webrtc/api/webrtcsession.cc:935
> 23 in webrtc::WebRtcSession::UpdateSessionState of
> ../../webrtc/api/webrtcsession.cc:897
> 24 in webrtc::WebRtcSession::SetRemoteDescription of
> ../../webrtc/api/webrtcsession.cc:766
> 25 in webrtc::PeerConnection::SetRemoteDescription of
> ../../webrtc/api/peerconnection.cc:1169
> 26 in webrtc::MethodCall2<webrtc::PeerConnectionInterface, void,
> webrtc::SetSessionDescriptionObserver*,
> webrtc::SessionDescriptionInterface*>::Marshal of ../../webrtc/api/proxy.h:218
> 27 in
>
webrtc::PeerConnectionProxyWithInternal<webrtc::PeerConnectionInterface>::SetRemoteDescription
> of ../../webrtc/api/peerconnectionproxy.h:64
> 28 in PeerConnectionInterfaceTest::DoSetSessionDescription of
> ../../webrtc/api/peerconnectioninterface_unittest.cc:782
> 29 in PeerConnectionInterfaceTest::DoSetRemoteDescription of
> ../../webrtc/api/peerconnectioninterface_unittest.cc:795
> 30 in PeerConnectionInterfaceTest::CreateAnswerAsRemoteDescription of
> ../../webrtc/api/peerconnectioninterface_unittest.cc:919
> 31 in PeerConnectionInterfaceTest::CreateOfferReceiveAnswer of
> ../../webrtc/api/peerconnectioninterface_unittest.cc:889
> 32 in PeerConnectionInterfaceTest::InitiateCall of
> ../../webrtc/api/peerconnectioninterface_unittest.cc:815
Discussed offline: use RaceChecker and e.g. RTC_DCHECK_RUNS_SERIALIZED(x).
aleloi
2016/10/05 13:56:51
Done.
On 2016/10/04 20:41:12, the sun wrote:
> On 2016/10/03 12:57:28, aleloi wrote:
> > On 2016/10/03 11:41:26, the sun wrote:
> > > Add separate thread checker for audio output thread.
> >
> > That would probably have to wait a little while, because audio is requested
> from
> > two different threads in OpenSL ES: the first two frames are requested by
the
> > user thread that does PeerConnection API calls (at least I think it's the
user
> > thread, I've pasted a stack trace below). henrika@ has told me that this
could
> > be changed. Alternatively we could wait actually connecting the mixer until
> the
> > behavior is changed.
> >
> > (frames now shown:
> > ChannelProxy::GetAudioFrameWithMuted()
> > AudioReceiveStream::GetAudioFrameWithMuted()
> > AudioMixerImpl::GetNonAnonymousAudio()
> > )
> >
> > 0 in webrtc::AudioMixerImpl::Mix of
> > ../../webrtc/modules/audio_mixer/audio_mixer_impl.cc:194
> > 1 in webrtc::(anonymous namespace)::MiMAudioTransport::NeedMorePlayData of
> > ../../webrtc/audio/audio_state.cc:71
> > 2 in webrtc::AudioDeviceBuffer::RequestPlayoutData of
> > ../../webrtc/modules/audio_device/audio_device_buffer.cc:347
> > 3 in webrtc::FineAudioBuffer::GetPlayoutData of
> > ../../webrtc/modules/audio_device/fine_audio_buffer.cc:88
> > 4 in webrtc::OpenSLESPlayer::EnqueuePlayoutData of
> > ../../webrtc/modules/audio_device/android/opensles_player.cc:396
> > 5 in webrtc::OpenSLESPlayer::StartPlayout of
> > ../../webrtc/modules/audio_device/android/opensles_player.cc:123
> > 6 in webrtc::AudioDeviceTemplate<webrtc::AudioRecordJni,
> > webrtc::OpenSLESPlayer>::StartPlayout of
> > ../../webrtc/modules/audio_device/android/audio_device_template.h:183
> > 7 in webrtc::AudioDeviceModuleImpl::StartPlayout of
> > ../../webrtc/modules/audio_device/audio_device_impl.cc:1405
> > 8 in webrtc::internal::AudioReceiveStream::Start of
> > ../../webrtc/audio/audio_receive_stream.cc:177
> > 9 in cricket::WebRtcVoiceMediaChannel::WebRtcAudioReceiveStream::SetPlayout
> of
> > ../../webrtc/media/engine/webrtcvoiceengine.cc:1425
> > 10 in cricket::WebRtcVoiceMediaChannel::AddRecvStream of
> > ../../webrtc/media/engine/webrtcvoiceengine.cc:2236
> > 11 in cricket::BaseChannel::AddRecvStream_w of
../../webrtc/pc/channel.cc:1239
> > 12 in cricket::BaseChannel::UpdateRemoteStreams_w of
> > ../../webrtc/pc/channel.cc:1380
> > 13 in cricket::VoiceChannel::SetRemoteContent_w of
> > ../../webrtc/pc/channel.cc:1765
> > 14 in rtc::MethodFunctor3<cricket::VoiceChannel, bool
> > (cricket::VoiceChannel::*)(unsigned int, int, int), bool, unsigned int, int,
> > int>::operator() of ../../webrtc/base/bind.h:389
> > 15 in rtc::FunctorMessageHandler<bool,
> > rtc::MethodFunctor3<cricket::VoiceChannel, bool
> > (cricket::VoiceChannel::*)(unsigned int, int, int), bool, unsigned int, int,
> > int> >::OnMessage of ../../webrtc/base/messagehandler.h:44
> > 16 in rtc::Thread::Send of ../../webrtc/base/thread.cc:361
> > 17 in rtc::Thread::InvokeInternal of ../../webrtc/base/thread.cc:455
> > 18 in rtc::Thread::Invoke<bool, rtc::MethodFunctor3<cricket::BaseChannel,
bool
> > (cricket::BaseChannel::*)(cricket::MediaContentDescription const*,
> > cricket::ContentAction, std::__ndk1::basic_string<char,
> > std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >*), bool,
> > cricket::MediaContentDescription const*, cricket::ContentAction,
> > std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>,
> > std::__ndk1::allocator<char> >*> > of ../../webrtc/base/thread.h:170
> > 19 in
> >
cricket::BaseChannel::InvokeOnWorker<rtc::MethodFunctor3<cricket::BaseChannel,
> > bool (cricket::BaseChannel::*)(cricket::MediaContentDescription const*,
> > cricket::ContentAction, std::__ndk1::basic_string<char,
> > std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >*), bool,
> > cricket::MediaContentDescription const*, cricket::ContentAction,
> > std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>,
> > std::__ndk1::allocator<char> >*> > of ../../webrtc/pc/channel.h:352
> > 20 in cricket::BaseChannel::SetRemoteContent of
../../webrtc/pc/channel.cc:440
> > 21 in cricket::BaseChannel::PushdownRemoteDescription of
> > ../../webrtc/pc/channel.cc:860
> > 22 in webrtc::WebRtcSession::PushdownMediaDescription of
> > ../../webrtc/api/webrtcsession.cc:935
> > 23 in webrtc::WebRtcSession::UpdateSessionState of
> > ../../webrtc/api/webrtcsession.cc:897
> > 24 in webrtc::WebRtcSession::SetRemoteDescription of
> > ../../webrtc/api/webrtcsession.cc:766
> > 25 in webrtc::PeerConnection::SetRemoteDescription of
> > ../../webrtc/api/peerconnection.cc:1169
> > 26 in webrtc::MethodCall2<webrtc::PeerConnectionInterface, void,
> > webrtc::SetSessionDescriptionObserver*,
> > webrtc::SessionDescriptionInterface*>::Marshal of
../../webrtc/api/proxy.h:218
> > 27 in
> >
>
webrtc::PeerConnectionProxyWithInternal<webrtc::PeerConnectionInterface>::SetRemoteDescription
> > of ../../webrtc/api/peerconnectionproxy.h:64
> > 28 in PeerConnectionInterfaceTest::DoSetSessionDescription of
> > ../../webrtc/api/peerconnectioninterface_unittest.cc:782
> > 29 in PeerConnectionInterfaceTest::DoSetRemoteDescription of
> > ../../webrtc/api/peerconnectioninterface_unittest.cc:795
> > 30 in PeerConnectionInterfaceTest::CreateAnswerAsRemoteDescription of
> > ../../webrtc/api/peerconnectioninterface_unittest.cc:919
> > 31 in PeerConnectionInterfaceTest::CreateOfferReceiveAnswer of
> > ../../webrtc/api/peerconnectioninterface_unittest.cc:889
> > 32 in PeerConnectionInterfaceTest::InitiateCall of
> > ../../webrtc/api/peerconnectioninterface_unittest.cc:815
>
> Discussed offline: use RaceChecker and e.g. RTC_DCHECK_RUNS_SERIALIZED(x).
Done.
|
+} |
+ |
Channel* ChannelProxy::channel() const { |
RTC_DCHECK(channel_owner_.channel()); |
return channel_owner_.channel(); |