设备检测时有时会卡顿,然后获取不到设备


#1

调用IAudioDeviceCollection 的 getCount 获取不到音频设备,并且会卡顿。烦请看看,日志贴出 :

 
 
Local Date: 十二月 03 2018 Local Time: 14:01:25
Build info: Dec  6 2017 11:24:31 r

INFO    14:01:25:929   4868; [che] onVideoSizeChanged: uid 0 480x360 rotate 0
INFO    14:01:27:607  10516; [rp] {"che.audio.test.start_playback_device":"D:/Client/Projects/agoraNative/UnityProject/Assets/StreamingAssets/teacherPlayerTest.wav"}
INFO    14:01:27:608   9616; Thread with name:EngineMonitorThread started 
INFO    14:01:27:608  10516;   OS info: Microsoft Windows 7  Service Pack 1 (build 7601), 64-bit
INFO    14:01:27:608  10516; [WIN_CORE] ===================Render Devices Enumeration===================
INFO    14:01:27:608  10516; [WIN_CORE] #rendering endpoint devices (counting all): 1
INFO    14:01:27:608  10516; [WIN_CORE] ++Endpoint  0:
INFO    14:01:27:608  10516; [WIN_CORE] ID string    : {0.0.0.00000000}.{f1ebc957-414c-4814-8007-3bd226fe3762}
INFO    14:01:27:609  10516; [WIN_CORE] friendly name: "鎵0鍣?(2- Realtek High Definition Audio)"
INFO    14:01:27:609  10516; [WIN_CORE] state (0x8)  : UNPLUGGED
INFO    14:01:27:609  10516; [WIN_CORE] #channels    : 2
INFO    14:01:27:609  10516; [WIN_CORE] =========================EnumDeviceEnd==========================
INFO    14:01:27:610  10516; [WIN_CORE] ==================Capture Devices Enumeration===================
INFO    14:01:27:610  10516; [WIN_CORE] #capturing endpoint devices (counting all): 4
INFO    14:01:27:610  10516; [WIN_CORE] ++Endpoint  0:
INFO    14:01:27:611  10516; [WIN_CORE] ID string    : {0.0.1.00000000}.{00d5e965-a8ad-400d-a026-26a6fbc2b85b}
INFO    14:01:27:613  10516; [WIN_CORE] friendly name: "楹﹀厠椋?(Aoni Microphone)"
INFO    14:01:27:613  10516; [WIN_CORE] state (0x1)  : *ACTIVE*
INFO    14:01:27:614  10516; [WIN_CORE] #channels    : 1
INFO    14:01:27:614  10516; [WIN_CORE] ++Endpoint  1:
INFO    14:01:27:614  10516; [WIN_CORE] ID string    : {0.0.1.00000000}.{38983f9c-b4ca-48aa-90bb-cbdb3f29257c}
INFO    14:01:27:614  10516; [WIN_CORE] friendly name: "楹﹀厠椋?(2- Realtek High Definition Audio)"
INFO    14:01:27:614  10516; [WIN_CORE] state (0x8)  : UNPLUGGED
INFO    14:01:27:615  10516; [WIN_CORE] #channels    : 2
INFO    14:01:27:615  10516; [WIN_CORE] ++Endpoint  2:
INFO    14:01:27:615  10516; [WIN_CORE] ID string    : {0.0.1.00000000}.{73ebef2e-fa32-4a00-9852-563118e2463e}
INFO    14:01:27:615  10516; [WIN_CORE] friendly name: "绔嬩綋澹版贩闊?(2- Realtek High Definition Audio)"
INFO    14:01:27:615  10516; [WIN_CORE] state (0x2)  : DISABLED
INFO    14:01:27:615  10516; [WIN_CORE] #channels    : 2
INFO    14:01:27:615  10516; [WIN_CORE] ++Endpoint  3:
INFO    14:01:27:615  10516; [WIN_CORE] ID string    : {0.0.1.00000000}.{ddd08c3b-915b-458a-b876-cd4788283fcc}
INFO    14:01:27:616  10516; [WIN_CORE] friendly name: "绾胯矾杈撳叆 (2- Realtek High Definition Audio)"
INFO    14:01:27:616  10516; [WIN_CORE] state (0x8)  : UNPLUGGED
INFO    14:01:27:616  10516; [WIN_CORE] #channels    : 2
INFO    14:01:27:616  10516; [WIN_CORE] =========================EnumDeviceEnd==========================
ERROR   14:01:27:616  10516; [WIN_CORE] Core Audio method failed (hr=0x80070490) : 80070490
ERROR   14:01:27:616  10516; [WIN_CORE] Error details: Element not found.
ERROR   14:01:27:617  10516; [WIN_CORE] Core Audio method failed (hr=0x80070490) : 80070490
ERROR   14:01:27:617  10516; [WIN_CORE] Error details: Element not found.
ERROR   14:01:27:617  10516; [WIN_CORE] Core Audio method failed (hr=0x80070490) : 80070490
ERROR   14:01:27:617  10516; [WIN_CORE] Error details: Element not found.
ERROR   14:01:27:617  10516; [WIN_CORE] failed to initialize the rendering enpoint device
ERROR   14:01:27:640  10516; [WIN_CORE] Core Audio method failed (hr=0x80070490) : 80070490
ERROR   14:01:27:640  10516; [WIN_CORE] Error details: Element not found.
ERROR   14:01:27:640  10516; [WIN_CORE] Core Audio method failed (hr=0x80070490) : 80070490
ERROR   14:01:27:640  10516; [WIN_CORE] Error details: Element not found.
ERROR   14:01:27:641  10516; [WIN_CORE] failed to initialize the rendering enpoint device
WARN    14:01:27:641  10516; [WIN_CORE] InitSpeaker() failed
WARN    14:01:27:641  10516; [WIN_CORE] InitPlayout() _ptrDeviceOut is nullptr
ERROR   14:01:27:641  10516; StartTestPlayout() failed to initialize playout
INFO    14:01:28:995  10224; AgoraRTC::videocapturemodule::VideoCaptureImpl::printFrameLog :width 640, height 480,ystride:0
INFO    14:01:29:681  10520; API call to stop echo test
INFO    14:01:29:681  10516; [rp] {"che.audio.test.stop_playback_device":true}
INFO    14:01:29:681   9616; Thread with name:EngineMonitorThread stopped
ERROR   14:01:29:682  10516; failed to stop echo test due to NOT in ECHO TEST
INFO    14:01:29:682  10516; [rp] ["che.audio.enum_recording"]
INFO    14:01:29:685  10516; [rp] res: {"che.audio.enum_recording":[[0,"{0.0.1.00000000}.{00d5e965-a8ad-400d-a026-26a6fbc2b85b}","楹﹀厠椋?(Aoni Microphone)"]]} 
INFO    14:01:29:685  10516; [rp] ["che.audio.enum_recording"]
INFO    14:01:29:688  10516; [rp] res: {"che.audio.enum_recording":[[0,"{0.0.1.00000000}.{00d5e965-a8ad-400d-a026-26a6fbc2b85b}","楹﹀厠椋?(Aoni Microphone)"]]} 
INFO    14:01:29:691  10516; [rp] {"che.audio.test.stop_playback_device":true}
INFO    14:01:29:691  10520; API call to stop echo test
INFO    14:01:29:691  10516; [rp] {"che.audio.test.stop_playback_device":true}
ERROR   14:01:29:691  10516; failed to stop echo test due to NOT in ECHO TEST
INFO    14:01:29:693  10516; [rp] {"che.audio.set_recording_device":"{0.0.1.00000000}.{00d5e965-a8ad-400d-a026-26a6fbc2b85b}"}
WARN    14:01:29:694  10516; SetRecordingChannel() unable to set the recording channel (error=10028)
INFO    14:01:29:695  10516; [WIN_CORE] Set recording device on Windows by guid: friendly name: "楹﹀厠椋?(Aoni Microphone)"
WARN    14:01:29:695  10516; SetRecordingDevice() cannot access microphone (error=9004)
WARN    14:01:29:695  10516; StereoRecordingIsAvailable() failed to query stereo recording (error=8090)
INFO    14:01:29:695  10516; AgoraRTC::ChEHardwareImpl::SetRecordingDevicePart2:SetStereoRecording, stereo recording=0
WARN    14:01:29:695  10516; SetRecordingDevice() failed to set mono recording mode (error=8090)
INFO    14:01:29:695  10516; agora::media::AudioEngineWrapper::setRecordingDevice : trying to set device ID = {0.0.1.00000000}.{00d5e965-a8ad-400d-a026-26a6fbc2b85b}, name = 楹﹀厠椋?(Aoni Microphone)
INFO    14:01:31:480  10516; [rp] {"che.audio.test.stop_playback_device":true}
INFO    14:01:31:480  10520; API call to stop echo test
ERROR   14:01:31:480  10516; failed to stop echo test due to NOT in ECHO TEST
INFO    14:01:31:483  10516; [rp] ["rtc.addref_media_engine"]
INFO    14:01:31:483  10516; addRef of media engine, ref=3
INFO    14:01:31:483  10516; [rp] res: {"rtc.addref_media_engine":0} 
INFO    14:01:31:483  10516; [rp] ["che.video.local.enum_camera"]
INFO    14:01:31:489  10516; Camera Name:Aoni HD Camera
INFO    14:01:31:489  10516; Camera uniqueID:\\?\usb#vid_1bcf&pid_2283&mi_00#6&3912cd3b&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
INFO    14:01:31:489  10516; [rp] res: {"che.video.local.enum_camera":[[0,"\\\\?\\usb#vid_1bcf&pid_2283&mi_00#6&3912cd3b&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\\global","Aoni HD Camera"]]} 
INFO    14:01:31:489  10516; [rp] ["che.video.local.enum_camera"]
INFO    14:01:31:494  10516; Camera Name:Aoni HD Camera
INFO    14:01:31:494  10516; Camera uniqueID:\\?\usb#vid_1bcf&pid_2283&mi_00#6&3912cd3b&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
INFO    14:01:31:494  10516; [rp] res: {"che.video.local.enum_camera":[[0,"\\\\?\\usb#vid_1bcf&pid_2283&mi_00#6&3912cd3b&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\\global","Aoni HD Camera"]]} 
INFO    14:01:31:494  10516; [rp] {"che.audio.test.stop_playback_device":true}
INFO    14:01:31:494  10520; API call to stop echo test
ERROR   14:01:31:494  10516; failed to stop echo test due to NOT in ECHO TEST
INFO    14:01:31:496  10516; [rp] ["che.video.local.enum_camera"]
INFO    14:01:31:501  10516; Camera Name:Aoni HD Camera
INFO    14:01:31:501  10516; Camera uniqueID:\\?\usb#vid_1bcf&pid_2283&mi_00#6&3912cd3b&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
INFO    14:01:31:501  10516; [rp] res: {"che.video.local.enum_camera":[[0,"\\\\?\\usb#vid_1bcf&pid_2283&mi_00#6&3912cd3b&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\\global","Aoni HD Camera"]]} 
INFO    14:01:31:501  10516; [rp] {"che.video.local.camera_id":"\\\\?\\usb#vid_1bcf&pid_2283&mi_00#6&3912cd3b&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\\global"}
INFO    14:01:31:501  10516; agora::media::VideoEngine::setCaptureDevice: deviceId=\\?\usb#vid_1bcf&pid_2283&mi_00#6&3912cd3b&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
INFO    14:01:31:515  10516; Camera Name:Aoni HD Camera
INFO    14:01:31:515  10516; Camera uniqueID:\\?\usb#vid_1bcf&pid_2283&mi_00#6&3912cd3b&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
INFO    14:01:31:515  10516; agora::media::VideoEngine::setCaptureDevice: index=0
INFO    14:01:31:519  10516; Camera Name:Aoni HD Camera
INFO    14:01:31:519  10516; Camera uniqueID:\\?\usb#vid_1bcf&pid_2283&mi_00#6&3912cd3b&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
INFO    14:01:32:083  10224; AgoraRTC::videocapturemodule::VideoCaptureImpl::printFrameLog :width 640, height 480,ystride:0
INFO    14:01:33:428  10520; API call to stop echo test
INFO    14:01:33:428  10516; [rp] {"che.audio.test.stop_playback_device":true}
ERROR   14:01:33:429  10516; failed to stop echo test due to NOT in ECHO TEST
INFO    14:01:33:431  10516; [rp] {"che.audio.test.stop_playback_device":true}
INFO    14:01:33:431  10520; API call to stop echo test
ERROR   14:01:33:431  10516; failed to stop echo test due to NOT in ECHO TEST
INFO    14:01:35:078  10520; API call to leave channel
INFO    14:01:35:078  10520; API call to stop preview
ERROR   14:01:35:078  10516; failed to leave channel due to NOT in CALL
INFO    14:01:35:078  10516; [rp] {"rtc.video.preview":false}
INFO    14:01:35:078  10516; API call to stop video preview
INFO    14:01:35:079  10516; delRef of media engine, ref=2
INFO    14:01:35:079  10516; agora::media::VideoEngine::stopLocalRender: Cannot stop renderer 4097 (not exist)
INFO    14:01:35:205   4868; Thread with name:ViECaptureThread stopped
INFO    14:01:35:727  10516; agora::media::VideoEngine::stopCapture: stopCapture success
INFO    14:01:35:739  10516; Camera Name:Aoni HD Camera
INFO    14:01:35:739  10516; Camera uniqueID:\\?\usb#vid_1bcf&pid_2283&mi_00#6&3912cd3b&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
INFO    14:01:35:739  10516; agora::media::VideoEngine::stopRemoteRender
 

#2

Hi,

使用的是哪个版本的sdk呢?
是调用getcount时会报错吗?还是更换设备过程中报错?
这个问题时必现还是偶现?
 
看到log里有报错:
ERROR   14:01:27:616  10516; [WIN_CORE] Core Audio method failed (hr=0x80070490) : 80070490
ERROR   14:01:27:616  10516; [WIN_CORE] Error details: Element not found.
你检查一下驱动是否有问题?