关于android RTP驱动的问题

刚解决了linphone两方通话没声音问题,测试中突然发现有时候单向是没有声音的。以为是bug没解决掉,Wireshark抓包确认通话两方RTP收发正常。

只是语言包没有被喇叭播放出来。问题点估计出在声音解码或者消混音程序上。但app侧调查了几天,也不能对问题进行定位。

问题又丢到我这边了。对问题现象进行分析首先,确定问题点。

出现问题的地方主要有三个:

1.app应用问题

2.android系统问题

3.开发版声音驱动问题

那么只能一个个排除了。确认是不是应用问题,可以通过多个手段,比如单独写个播放声音的应用来侧等等,但考虑到通话状态变更等,可以从网上

找个其他公司开发的sip应用来测试下。通过使用Zoiper来测试发现,确实有振铃音播放不出来的情况。这样问题应该排除掉是开发的app应用了。

那到底是开发板驱动问题还算android系统问题呢?因为外公司的驱动开发人员不积极配合调查,只能先从android系统方面排除问题了。

android系统的声音部分也是很复杂的,想要确定问题点必须用写手段,单独走读代码无法办到。手段还是最原始的办法,

在android系统声音处理的关键部分埋入log。怎么知道android系统声音处理的关键部分,只能百度了哈哈。

买入log后多次测试发现,正常出声哈不出声时,log确实有些区别。

---->log如下

I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallCreated : userId=371033005 callId=371033041
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallCodecNegotiated callId: 371033041
I/PowerManagerService( 1751): Waking up from sleep...
I/PhoneWindowManager( 1751): No lock screen!
I/ActivityManager( 1751): START u0 {act=android.intent.action.MAIN flg=0x10840000 cmp=com.zoiper.android.noinapp.app/com.zoiper.android.ui.InCallScreen} from pid 15440
D/hwcomposer( 1188): int hwc_prepare(hwc_composer_device_1_t*, size_t, hwc_display_contents_1_t**): display[0] numHwLayer:1 less then 2
D/hwcomposer( 1188): int hwc_prepare(hwc_composer_device_1_t*, size_t, hwc_display_contents_1_t**): display[0] numHwLayer:1 less then 2
I/qtaguid ( 1751): Failed write_ctrl(s 1 10037) res=-1 errno=1
W/NetworkManagementSocketTagger( 1751): setKernelCountSet(10037, 1) failed with errno -1
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState
D/Ringtone(15440): #### =================>Successfully created local player
D/hwcomposer( 1188): int hwc_prepare(hwc_composer_device_1_t*, size_t, hwc_display_contents_1_t**): display[0] numHwLayer:1 less then 2
D/PowerManagerService-JNI( 1751): Excessive delay in autosuspend_disable() while turning screen on: 338ms
D/SurfaceFlinger( 1188): Screen acquired, type=0 flinger=0x40fd8370
E/audio_hw_primary( 1202): #### ==============================================>pcm_open() ***fs:44100,ch:2
E/alsa_pcm( 1202): #### &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& pcm.c pcm_open()
E/alsa_pcm( 1202): #### &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&  pcm.c pcm_open() [ Success ] gettid()=[1650]
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState
D/gralloc ( 1188): ==USE CPU CACHE OP usage = 0x933==
I/SurfaceFlinger( 1188): GraphicBufferAlloc::createGraphicBuffer
V/TabletStatusBar( 1902): setLightsOn(true)
D/gralloc ( 1188): ==USE CPU CACHE OP usage = 0x933==
I/SurfaceFlinger( 1188): GraphicBufferAlloc::createGraphicBuffer
D/gralloc ( 1188): ==USE CPU CACHE OP usage = 0x933==
I/SurfaceFlinger( 1188): GraphicBufferAlloc::createGraphicBuffer
D/InCallTouchUi(15440): onDialTrigger(whichHandle = 1)...
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - acceptCall : incoming...
I/Zoiper  (15440): [PhoneUtils] (tid=1) setAudioMode() changed : MODE_RINGTONE
D/InCallTouchUi(15440): updateState: Too soon after last action; not drawing!
W/libOpenSLES(15440): class OutputMix interface 0 requested but unavailable MPH=43
E/AudioFlinger( 1202): #### =================>AudioFlinger.cpp standby()
D/audio_hw_primary( 1202): start_input_stream:  rate:44100
V/alsa_pcm( 1202): #### &&&&&&&&&&&&&&&&&&&&&&&&&&pcm_open_req, capture card: 0, device: 0, req_rate: 44100
V/alsa_pcm( 1202): force capture stereo audio
E/alsa_pcm( 1202): #### &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&pcm.c pcm_open_req() pcm_open() [ Success ] gettid()=[23950]
V/alsa_pcm( 1202): pcm_open_req try rate: 44100
V/alsa_pcm( 1202): pcm_open_req OK config->rate: 44100
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallAccepted : callId = 371033041
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState : newState=OFFHOOK
D/BluetoothAdapter(15440): 1101034584: getState() :  mService = null. Returning STATE_OFF
I/Zoiper  (15440): [PhoneUtils] (tid=1) setAudioMode() changed : MODE_IN_COMMUNICATION
E/AudioFlinger( 1202): #### =================>AudioFlinger.cpp standby()
E/alsa_pcm( 1202): #### ------------->pcm.c pcm_close() pcm->fd=[19],gettid()=[23950]
E/audio_hw_primary( 1202): #### ===========>audio_hw.c do_input_standby() pcm_close() adev->mode=[3],iRet=[0]
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallHangup: callId=371033041
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState : newState=IDLE
D/CallNotifier(15440): - onDisconnect: cause = NORMAL, incoming = true, date = 1488437194454
I/Zoiper  (15440): [PhoneUtils] (tid=405) setAudioMode() changed : MODE_NORMAL
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallCreated : userId=371033005 callId=371033042
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallCodecNegotiated callId: 371033042
I/ActivityManager( 1751): START u0 {act=android.intent.action.MAIN flg=0x10840000 cmp=com.zoiper.android.noinapp.app/com.zoiper.android.ui.InCallScreen} from pid 15440
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState
D/Ringtone(15440): #### =================>Successfully created local player
D/InCallTouchUi(15440): onDialTrigger(whichHandle = 2)...
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - hangup callId=371033042
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState : newState=IDLE
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState
D/InCallTouchUi(15440): updateState: Too soon after last action; not drawing!
D/CallNotifier(15440): - onDisconnect: cause = LOCAL, incoming = true, date = 1488437199341
D/InCallTouchUi(15440): updateState: Too soon after last action; not drawing!
D/InCallTouchUi(15440): updateState: Too soon after last action; not drawing!
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState
I/ActivityManager( 1751): START u0 {act=com.zoiper.android.noinapp.app.action.CALL_LOGS_TAB flg=0x10010000 cmp=com.zoiper.android.noinapp.app/com.zoiper.android.ui.ZoiperTab} from pid 15440
I/Zoiper  (15440): [PhoneUtils] (tid=412) setAudioMode() no change : MODE_NORMAL
D/dalvikvm( 1751): GC_FOR_ALLOC freed 1838K, 37% free 7450K/11784K, paused 75ms, total 75ms
I/ActivityManager( 1751): moveTaskToBack: 10
V/TabletStatusBar( 1902): setLightsOn(true)
D/gralloc ( 1188): ==USE CPU CACHE OP usage = 0x933==
I/SurfaceFlinger( 1188): GraphicBufferAlloc::createGraphicBuffer
D/gralloc ( 1188): ==USE CPU CACHE OP usage = 0x933==
I/SurfaceFlinger( 1188): GraphicBufferAlloc::createGraphicBuffer
D/gralloc ( 1188): ==USE CPU CACHE OP usage = 0x933==
I/SurfaceFlinger( 1188): GraphicBufferAlloc::createGraphicBuffer
E/AudioFlinger( 1202): #### ======================>AudioFlinger.cpp syncTime===>
E/AudioFlinger( 1202): #### ======================>AudioFlinger.cpp threadLoop()
E/audio_hw_primary( 1202): #### ============>audio_hw.c do_output_standby() pcm_close()
E/alsa_pcm( 1202): #### ------------->pcm.c pcm_close() pcm->fd=[33],gettid()=[1650]
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallCreated : userId=371033005 callId=371033043
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallCodecNegotiated callId: 371033043
I/ActivityManager( 1751): START u0 {act=android.intent.action.MAIN flg=0x10840000 cmp=com.zoiper.android.noinapp.app/com.zoiper.android.ui.InCallScreen} from pid 15440
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState
D/Ringtone(15440): #### =================>Successfully created local player
D/gralloc ( 1188): ==USE CPU CACHE OP usage = 0x933==
I/SurfaceFlinger( 1188): GraphicBufferAlloc::createGraphicBuffer
D/dalvikvm( 1902): GC_CONCURRENT freed 1974K, 77% free 4921K/21076K, paused 3ms+32ms, total 107ms
V/TabletStatusBar( 1902): setLightsOn(true)
D/gralloc ( 1188): ==USE CPU CACHE OP usage = 0x933==
I/SurfaceFlinger( 1188): GraphicBufferAlloc::createGraphicBuffer
E/audio_hw_primary( 1202): #### ==============================================>pcm_open() ***fs:44100,ch:2
E/alsa_pcm( 1202): #### &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& pcm.c pcm_open()
E/alsa_pcm( 1202): #### &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&  pcm.c pcm_open() [ Success ] gettid()=[1650]
D/gralloc ( 1188): ==USE CPU CACHE OP usage = 0x933==
I/SurfaceFlinger( 1188): GraphicBufferAlloc::createGraphicBuffer
D/InCallTouchUi(15440): onDialTrigger(whichHandle = 1)...
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - acceptCall : incoming...
I/Zoiper  (15440): [PhoneUtils] (tid=1) setAudioMode() changed : MODE_RINGTONE
D/InCallTouchUi(15440): updateState: Too soon after last action; not drawing!
W/libOpenSLES(15440): class OutputMix interface 0 requested but unavailable MPH=43
E/AudioFlinger( 1202): #### =================>AudioFlinger.cpp standby()
D/audio_hw_primary( 1202): start_input_stream:  rate:44100
V/alsa_pcm( 1202): #### &&&&&&&&&&&&&&&&&&&&&&&&&&pcm_open_req, capture card: 0, device: 0, req_rate: 44100
V/alsa_pcm( 1202): force capture stereo audio
E/alsa_pcm( 1202): #### &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&pcm.c pcm_open_req() pcm_open() [ Success ] gettid()=[24201]
V/alsa_pcm( 1202): pcm_open_req try rate: 44100
V/alsa_pcm( 1202): pcm_open_req OK config->rate: 44100
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallAccepted : callId = 371033043
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState : newState=OFFHOOK
D/BluetoothAdapter(15440): 1101034584: getState() :  mService = null. Returning STATE_OFF
I/Zoiper  (15440): [PhoneUtils] (tid=1) setAudioMode() changed : MODE_IN_COMMUNICATION
E/AudioFlinger( 1202): #### =================>AudioFlinger.cpp standby()
E/alsa_pcm( 1202): #### ------------->pcm.c pcm_close() pcm->fd=[19],gettid()=[24201]
E/audio_hw_primary( 1202): #### ===========>audio_hw.c do_input_standby() pcm_close() adev->mode=[3],iRet=[0]
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallHangup: callId=371033043
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState : newState=IDLE
D/CallNotifier(15440): - onDisconnect: cause = NORMAL, incoming = true, date = 1488437205760
I/Zoiper  (15440): [PhoneUtils] (tid=422) setAudioMode() changed : MODE_NORMAL
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallCreated : userId=371033005 callId=371033044
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallCodecNegotiated callId: 371033044
I/ActivityManager( 1751): START u0 {act=android.intent.action.MAIN flg=0x10840000 cmp=com.zoiper.android.noinapp.app/com.zoiper.android.ui.InCallScreen} from pid 15440
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState
D/Ringtone(15440): #### =================>Successfully created local player
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState
D/InCallTouchUi(15440): onDialTrigger(whichHandle = 1)...
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - acceptCall : incoming...
I/Zoiper  (15440): [PhoneUtils] (tid=1) setAudioMode() changed : MODE_RINGTONE
D/InCallTouchUi(15440): updateState: Too soon after last action; not drawing!
W/libOpenSLES(15440): class OutputMix interface 0 requested but unavailable MPH=43
E/AudioFlinger( 1202): #### =================>AudioFlinger.cpp standby()
D/audio_hw_primary( 1202): start_input_stream:  rate:44100
V/alsa_pcm( 1202): #### &&&&&&&&&&&&&&&&&&&&&&&&&&pcm_open_req, capture card: 0, device: 0, req_rate: 44100
V/alsa_pcm( 1202): force capture stereo audio
E/alsa_pcm( 1202): #### &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&pcm.c pcm_open_req() pcm_open() [ Success ] gettid()=[24294]
V/alsa_pcm( 1202): pcm_open_req try rate: 44100
V/alsa_pcm( 1202): pcm_open_req OK config->rate: 44100
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallAccepted : callId = 371033044
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState : newState=OFFHOOK
D/BluetoothAdapter(15440): 1101034584: getState() :  mService = null. Returning STATE_OFF
I/Zoiper  (15440): [PhoneUtils] (tid=1) setAudioMode() changed : MODE_IN_COMMUNICATION
E/AudioFlinger( 1202): #### =================>AudioFlinger.cpp standby()
E/alsa_pcm( 1202): #### ------------->pcm.c pcm_close() pcm->fd=[19],gettid()=[24294]
E/audio_hw_primary( 1202): #### ===========>audio_hw.c do_input_standby() pcm_close() adev->mode=[3],iRet=[0]
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallHangup: callId=371033044
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState : newState=IDLE
D/CallNotifier(15440): - onDisconnect: cause = NORMAL, incoming = true, date = 1488437209833
I/Zoiper  (15440): [PhoneUtils] (tid=429) setAudioMode() changed : MODE_NORMAL
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallCreated : userId=371033005 callId=371033045
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallCodecNegotiated callId: 371033045
I/ActivityManager( 1751): START u0 {act=android.intent.action.MAIN flg=0x10840000 cmp=com.zoiper.android.noinapp.app/com.zoiper.android.ui.InCallScreen} from pid 15440
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState
D/Ringtone(15440): #### =================>Successfully created local player
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState
D/InCallTouchUi(15440): onDialTrigger(whichHandle = 1)...
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - acceptCall : incoming...
I/Zoiper  (15440): [PhoneUtils] (tid=1) setAudioMode() changed : MODE_RINGTONE
D/InCallTouchUi(15440): updateState: Too soon after last action; not drawing!
W/libOpenSLES(15440): class OutputMix interface 0 requested but unavailable MPH=43
D/audio_hw_primary( 1202): start_input_stream:  rate:44100
V/alsa_pcm( 1202): #### &&&&&&&&&&&&&&&&&&&&&&&&&&pcm_open_req, capture card: 0, device: 0, req_rate: 44100
V/alsa_pcm( 1202): force capture stereo audio
E/alsa_pcm( 1202): #### &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&pcm.c pcm_open_req() pcm_open() [ Success ] gettid()=[24392]
V/alsa_pcm( 1202): pcm_open_req try rate: 44100
V/alsa_pcm( 1202): pcm_open_req OK config->rate: 44100
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallAccepted : callId = 371033045
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState : newState=OFFHOOK
D/BluetoothAdapter(15440): 1101034584: getState() :  mService = null. Returning STATE_OFF
I/Zoiper  (15440): [PhoneUtils] (tid=1) setAudioMode() changed : MODE_IN_COMMUNICATION
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - hangup callId=371033045
E/AudioFlinger( 1202): #### =================>AudioFlinger.cpp standby()
E/alsa_pcm( 1202): #### ------------->pcm.c pcm_close() pcm->fd=[28],gettid()=[24392]
E/audio_hw_primary( 1202): #### ===========>audio_hw.c do_input_standby() pcm_close() adev->mode=[3],iRet=[0]
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState : newState=IDLE
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState
D/CallNotifier(15440): - onDisconnect: cause = LOCAL, incoming = true, date = 1488437213879
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallHangup: callId=371033045
I/------Econtol Auto Service----( 2401): Check Auto List
I/Zoiper  (15440): [PhoneUtils] (tid=437) setAudioMode() changed : MODE_NORMAL
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState
I/ActivityManager( 1751): START u0 {act=com.zoiper.android.noinapp.app.action.CALL_LOGS_TAB flg=0x10010000 cmp=com.zoiper.android.noinapp.app/com.zoiper.android.ui.ZoiperTab} from pid 15440
I/ActivityManager( 1751): moveTaskToBack: 10
V/TabletStatusBar( 1902): setLightsOn(true)
D/gralloc ( 1188): ==USE CPU CACHE OP usage = 0x933==
I/SurfaceFlinger( 1188): GraphicBufferAlloc::createGraphicBuffer
D/gralloc ( 1188): ==USE CPU CACHE OP usage = 0x933==
I/SurfaceFlinger( 1188): GraphicBufferAlloc::createGraphicBuffer
D/gralloc ( 1188): ==USE CPU CACHE OP usage = 0x933==
I/SurfaceFlinger( 1188): GraphicBufferAlloc::createGraphicBuffer
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallCreated : userId=371033005 callId=371033046
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallCodecNegotiated callId: 371033046
I/ActivityManager( 1751): START u0 {act=android.intent.action.MAIN flg=0x10840000 cmp=com.zoiper.android.noinapp.app/com.zoiper.android.ui.InCallScreen} from pid 15440
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState
D/Ringtone(15440): #### =================>Successfully created local player
D/gralloc ( 1188): ==USE CPU CACHE OP usage = 0x933==
I/SurfaceFlinger( 1188): GraphicBufferAlloc::createGraphicBuffer
V/TabletStatusBar( 1902): setLightsOn(true)
D/gralloc ( 1188): ==USE CPU CACHE OP usage = 0x933==
I/SurfaceFlinger( 1188): GraphicBufferAlloc::createGraphicBuffer
D/gralloc ( 1188): ==USE CPU CACHE OP usage = 0x933==
I/SurfaceFlinger( 1188): GraphicBufferAlloc::createGraphicBuffer
D/InCallTouchUi(15440): onDialTrigger(whichHandle = 1)...
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - acceptCall : incoming...
I/Zoiper  (15440): [PhoneUtils] (tid=1) setAudioMode() changed : MODE_RINGTONE
D/InCallTouchUi(15440): updateState: Too soon after last action; not drawing!
W/libOpenSLES(15440): class OutputMix interface 0 requested but unavailable MPH=43
E/AudioFlinger( 1202): #### =================>AudioFlinger.cpp standby()
D/audio_hw_primary( 1202): start_input_stream:  rate:44100
V/alsa_pcm( 1202): #### &&&&&&&&&&&&&&&&&&&&&&&&&&pcm_open_req, capture card: 0, device: 0, req_rate: 44100
V/alsa_pcm( 1202): force capture stereo audio
E/alsa_pcm( 1202): #### &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&pcm.c pcm_open_req() pcm_open() [ Success ] gettid()=[24584]
V/alsa_pcm( 1202): pcm_open_req try rate: 44100
V/alsa_pcm( 1202): pcm_open_req OK config->rate: 44100
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallAccepted : callId = 371033046
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState : newState=OFFHOOK
D/BluetoothAdapter(15440): 1101034584: getState() :  mService = null. Returning STATE_OFF
I/Zoiper  (15440): [PhoneUtils] (tid=1) setAudioMode() changed : MODE_IN_COMMUNICATION
E/AudioFlinger( 1202): #### =================>AudioFlinger.cpp standby()
E/alsa_pcm( 1202): #### ------------->pcm.c pcm_close() pcm->fd=[19],gettid()=[24584]
E/audio_hw_primary( 1202): #### ===========>audio_hw.c do_input_standby() pcm_close() adev->mode=[3],iRet=[0]
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallHangup: callId=371033046
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState : newState=IDLE
D/CallNotifier(15440): - onDisconnect: cause = NORMAL, incoming = true, date = 1488437218718
I/Zoiper  (15440): [PhoneUtils] (tid=446) setAudioMode() changed : MODE_NORMAL
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallCreated : userId=371033005 callId=371033047
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallCodecNegotiated callId: 371033047
D/dalvikvm( 1751): GC_EXPLICIT freed 1251K, 37% free 7483K/11784K, paused 14ms+10ms, total 220ms
I/ActivityManager( 1751): START u0 {act=android.intent.action.MAIN flg=0x10840000 cmp=com.zoiper.android.noinapp.app/com.zoiper.android.ui.InCallScreen} from pid 15440
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState
D/Ringtone(15440): #### =================>Successfully created local player
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState
D/InCallTouchUi(15440): onDialTrigger(whichHandle = 1)...
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - acceptCall : incoming...
I/Zoiper  (15440): [PhoneUtils] (tid=1) setAudioMode() changed : MODE_RINGTONE
D/InCallTouchUi(15440): updateState: Too soon after last action; not drawing!
W/libOpenSLES(15440): class OutputMix interface 0 requested but unavailable MPH=43
E/AudioFlinger( 1202): #### =================>AudioFlinger.cpp standby()
D/audio_hw_primary( 1202): start_input_stream:  rate:44100
V/alsa_pcm( 1202): #### &&&&&&&&&&&&&&&&&&&&&&&&&&pcm_open_req, capture card: 0, device: 0, req_rate: 44100
V/alsa_pcm( 1202): force capture stereo audio
E/alsa_pcm( 1202): #### &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&pcm.c pcm_open_req() pcm_open() [ Success ] gettid()=[24686]
V/alsa_pcm( 1202): pcm_open_req try rate: 44100
V/alsa_pcm( 1202): pcm_open_req OK config->rate: 44100
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallAccepted : callId = 371033047
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState : newState=OFFHOOK
D/BluetoothAdapter(15440): 1101034584: getState() :  mService = null. Returning STATE_OFF
I/Zoiper  (15440): [PhoneUtils] (tid=1) setAudioMode() changed : MODE_IN_COMMUNICATION
E/AudioFlinger( 1202): #### =================>AudioFlinger.cpp standby()
E/alsa_pcm( 1202): #### ------------->pcm.c pcm_close() pcm->fd=[19],gettid()=[24686]
E/audio_hw_primary( 1202): #### ===========>audio_hw.c do_input_standby() pcm_close() adev->mode=[3],iRet=[0]
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - hangup callId=371033047
W/InCallScreen(15440): zoiper.fj: callHangup | FAILURE
W/InCallScreen(15440):     at zoiper.fa.O(Native Method)
W/InCallScreen(15440):     at zoiper.eu.e(Unknown Source)
W/InCallScreen(15440):     at zoiper.eu.l(Unknown Source)
W/InCallScreen(15440):     at zoiper.ac.l(SourceFile:94)
W/InCallScreen(15440):     at zoiper.ep.cE(Unknown Source)
W/InCallScreen(15440):     at zoiper.fl.c(Unknown Source)
W/InCallScreen(15440):     at zoiper.fl.c(Unknown Source)
W/InCallScreen(15440):     at com.zoiper.android.ui.InCallScreen.m(SourceFile:1800)
W/InCallScreen(15440):     at com.zoiper.android.ui.InCallTouchUi.onClick(SourceFile:294)
W/InCallScreen(15440):     at android.view.View.performClick(View.java:4206)
W/InCallScreen(15440):     at android.view.View$PerformClick.run(View.java:17357)
W/InCallScreen(15440):     at android.os.Handler.handleCallback(Handler.java:725)
W/InCallScreen(15440):     at android.os.Handler.dispatchMessage(Handler.java:92)
W/InCallScreen(15440):     at android.os.Looper.loop(Looper.java:137)
W/InCallScreen(15440):     at android.app.ActivityThread.main(ActivityThread.java:5045)
W/InCallScreen(15440):     at java.lang.reflect.Method.invokeNative(Native Method)
W/InCallScreen(15440):     at java.lang.reflect.Method.invoke(Method.java:511)
W/InCallScreen(15440):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:818)
W/InCallScreen(15440):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
W/InCallScreen(15440):     at dalvik.system.NativeStart.main(Native Method)
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState : newState=IDLE
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallHangup: callId=371033047
D/CallNotifier(15440): - onDisconnect: cause = NORMAL, incoming = true, date = 1488437222786
I/Zoiper  (15440): [PhoneUtils] (tid=454) setAudioMode() changed : MODE_NORMAL
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallCreated : userId=371033005 callId=371033048
I/Zoiper  (15440): [AndroidCallTracker] (tid=129)  - updatePhoneState
I/Zoiper  (15440): [VoipContext] (tid=129)  - onCallCodecNegotiated callId: 371033048
I/ActivityManager( 1751): START u0 {act=android.intent.action.MAIN flg=0x10840000 cmp=com.zoiper.android.noinapp.app/com.zoiper.android.ui.InCallScreen} from pid 15440
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState
D/Ringtone(15440): #### =================>Successfully created local player
I/Zoiper  (15440): [AndroidCallTracker] (tid=1)  - updatePhoneState

通过对log分析发现有一个主线城负责喇叭放声,当接通后会启动一个子线程去混音双发通话。那么振铃无声音或通话单向无声音是不是问题出在主线程上呢。
这时候我们推测过是不是声音部分产生了死锁导致无法发声等。但只是推测,想深入调查,只能在pcm.c声音驱动部分埋入log来分析一下了。
因为这样可以确定的定位下出现无声音现象时,是不是有写数据到设备的操作等。通过现象再现,log分析发现,出现问题时确实有数据写声音设备,但写入操作都失败了。
定位到具体代码部分如下。


int pcm_write(struct pcm *pcm, const void *data, unsigned int count)
{
    struct snd_xferi x;

    if (pcm->flags & PCM_IN)
        return -EINVAL;

    x.buf = (void*)data;
    x.frames = count / (pcm->config.channels *
                        pcm_format_to_bits(pcm->config.format) / 8);

    for (;;) {
        if (!pcm->running) {
            if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_PREPARE))
                return oops(pcm, errno, "cannot prepare channel");
            if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_WRITEI_FRAMES, &x))
                return oops(pcm, errno, "cannot write initial data");
            pcm->running = 1;
            return 0;
        }
        if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_WRITEI_FRAMES, &x)) {
            pcm->running = 0;
            if (errno == EPIPE) {
                /* we failed to make our window -- try to restart if we are
                 * allowed to do so.  Otherwise, simply allow the EPIPE error to
                 * propagate up to the app level */
                pcm->underruns++;
就是这一部分写入出错。出错errno为EPIPE。
到了这里想问题就定位出来了基本上。

你可能感兴趣的:(关于android RTP驱动的问题)