-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuserful_tips.txt
213 lines (178 loc) · 18.3 KB
/
userful_tips.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
1.
//ios sdk log没有设置的情况下
xcode → window → Devices →选中相关设备 → 选中相应应用 → 应用列表下方设置按键 → Download Container → 已下载文件右键选择显示包内容 → AppData/Libary/Caches/agorasdk.log
2.
//Oppo R15 logcat 缓存区
adb logcat -G 2m
3.
解析转义 json 是否正确
https://www.bejson.com
4.
Log私有参数设置
打开SDK log:
OC:
[mRtcEngine setParameters:@"{\"rtc.log_filter\":65535}"];
[mRtcEngine setParameters:@"{\"rtc.log_filter\":32783}"];
[mRtcEngine setLogFile:path];
Android:
mRtcEngine.setParameters("{\"rtc.log_filter\":65535}");
mRtcEngine.setParameters("{\"rtc.log_filter\":32783}");
mRtcEngine.setLogFile("/sdcard/agorasdk.log") ;
Windows:
OpenLive设置私有参数,写入SDKLog到本地写法
diff --git a/OpenLive/AgoraObject.cpp b/OpenLive/AgoraObject.cpp
index 2e604d3..46b3b31 100644
--- a/OpenLive/AgoraObject.cpp
+++ b/OpenLive/AgoraObject.cpp
@@ -443,6 +443,20 @@ BOOL CAgoraObject::EnableLoopBack(BOOL bEnable)
return nRet == 0 ? TRUE : FALSE;
}
+BOOL CAgoraObject::EnableAPM(BOOL bEnable)
+{
+ int nRet = 0;
+
+ AParameter apm(*m_lpAgoraEngine);
+
+ if (bEnable)
+ nRet = apm->setParameters("{\"che.audio.bypass.apm\":true}");
+ else
+ nRet = apm->setParameters("{\"che.audio.bypass.apm\":false}");
+
+ return nRet == 0 ? TRUE : FALSE;
+}
+
BOOL CAgoraObject::IsLoopBackEnabled()
{
return m_bLoopBack;
diff --git a/OpenLive/AgoraObject.h b/OpenLive/AgoraObject.h
index ed47b07..da0cb5c 100644
--- a/OpenLive/AgoraObject.h
+++ b/OpenLive/AgoraObject.h
@@ -94,6 +94,8 @@ public:
BOOL EnableLoopBack(BOOL bEnable = TRUE);
BOOL IsLoopBackEnabled();
+ BOOL EnableAPM(BOOL bEnable = TRUE);
+
BOOL SetChannelProfile(BOOL bBroadcastMode);
BOOL IsBroadcastMode();
diff --git a/OpenLive/OpenLiveDlg.cpp b/OpenLive/OpenLiveDlg.cpp
index 48a0bc3..a5adb7e 100644
--- a/OpenLive/OpenLiveDlg.cpp
+++ b/OpenLive/OpenLiveDlg.cpp
@@ -354,7 +354,7 @@ LRESULT COpenLiveDlg::OnJoinChannel(WPARAM wParam, LPARAM lParam)
m_dlgVideo.SetWindowText(strChannelName);
lpRtcEngine->setupLocalVideo(vc);
lpRtcEngine->startPreview();
+ lpAgoraObject->SetLogFilter(LOG_FILTER_TYPE.LOG_FILTER_INFO,"D:\\test\\agorasdk.log");
lpAgoraObject->JoinChannel(strChannelName);
5.
Q:如果客户推的流是264*264 但是旁路的transcoding的size是360*640 竖屏, user的frame是0,0,360,640 这个服务端是怎么给做裁剪的?
A:当前推流的裁剪都是按照hidden方式,就是先按目标分辨率的宽高比例去裁原图,然后再等比例缩放到目标分辨率。
6.
推流机器人使用简单说明:
1) config.json脚本修改:
修改config.json 中global_settings的key,channel_name: 分别改成自己的appid,想要录制的channel;
默认是通信模式,如果想要改成直播模式,则还需要修改global_settings中的mode,根据comment进行修改;
2)start.sh 脚本修改:
修改#9行的channel_name,改成想要录制的channel
3)运行方式:
启动:./start.sh 0 起 1 路推流机器人在设定的频道内;./start.sh 1 起 2 路推流器人在设定的频道内,以此类推;
停止:./robots_stop.sh 停止所以推流机器人
7.
Q:聊天室麦下观众拉的是单流吗?比如一个主持8个嘉宾,连麦的混音是在服务器端做的还是拉下来再混的?
A:服务器端只是负责传输,拉下来混的
8.
Q:声网性能消耗这块有测试过吗?有没有一个IOS版本SDK性能消耗指标
A:IOS SDK 耗电量,我们内部基于一些比较老的机器(iphone6),测试的数据耗电占比(6%,30分钟直播纯音频)。
补充:耗电6%,不是一个可度量的单位,和电池容量有关,同一款手机,电池容量也有高达20%的差距,误差会比较大。我们的测试时基于demo测试,demo部分含有一点业务代码,SDK实际的耗电应略小于 6%
9.
WebSDK 与IOS 端互通注意:
1)ios端需要调用enableWebSdkInteroperability 接口
2)websdk createClient的时候可以提供很多模式,不要用webonly模式(比如用interop就行)
10.
channelInviteRefuse信令参数ChannelID,account两个参数用来确定拒绝的对象,uid参数废弃
11.
Q:app里的音视频等,播放不需要蓝牙权限即可走蓝牙耳机播放,系统控制路由;进入我们的声网频道后,需要添加蓝牙权限才可以走蓝牙耳机,他们考虑到google play上如果添加这个权限,不能静默自动升级,所以对于添加权限比较慎重,想不添加蓝牙权限也能走蓝牙耳机。所以想问下,这个问题有解么?
A:app 蓝牙不需要权限是因为A2DP 是系统默认行为。 要使用蓝牙SCO通话就必须添加蓝牙权限
12.
Q:H5直接依赖声网web sdk开发1对1通话的例子
A:例子暂时我们没有,我们的客户之前没有使用过这种搭配方式(app webview+ agora websdk )。
因为通常来说,移动端直接集成natvie端SDK,稳定体验好。通过WebView加载webSDK的方式理论上说体验肯定是输给native端的。
至于刚刚技术支持同学提及ios 不支持,是跑不通,这里之前有过失败的采坑经验。 Android webview 应该是跑的通的。但是就基于Android 的平台碎片化,webview 内核 webkit的兼容性,预估计坑不会少。
之前有客户试过,有问题,我们推荐用rect native 或者 apicloud 之类的方案,实际上IOS端还是native sdk实现的
ios上的几种webview对象uiwebview以及safariwebview都无法使用getusermedia访问设备的api,apple隐藏了,不排除未来会支持,目前ios上如果app要支持,只有使用PWA,PWA本质上是网页应用
13.
默认外放---> 插入耳机---> 拔掉耳机,音频路由切换关键日志
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| yimingdeMacBook-Pro:Agora-client-side-AV-capturing-for-streaming-Android yiming$ adb shell |
| shell@aries:/ $ logcat | grep AudioRoute |
| D/AGORA_SDK( 9048): DEBUG (17:50:22:194 | 8) 9124; [AudioRoute] sendEvent: [20], extra arg: 1... Handler (io.agora.rtc.internal.AudioRoutingController$EventHandler) {1fc6c3e0} |
| D/AGORA_SDK( 9048): DEBUG (17:50:22:209 | 12) 9124; [AudioRoute] StopState: onEvent: 20, info: 1 |
| D/AGORA_SDK( 9048): DEBUG (17:50:23:514 | 1) 9048; [AudioRoute] sendEvent: [14], extra arg: 0... Handler (io.agora.rtc.internal.AudioRoutingController$EventHandler) {1fc6c3e0} |
| D/AGORA_SDK( 9048): DEBUG (17:50:23:516 | 2) 9124; [AudioRoute] StopState: onEvent: 14, info: 0 |
| D/AGORA_SDK( 9048): DEBUG (17:50:24:509 | 4) 10618; [AudioRoute] sendEvent: [21], extra arg: 20... Handler (io.agora.rtc.internal.AudioRoutingController$EventHandler) {1fc6c3e0} |
| D/AGORA_SDK( 9048): DEBUG (17:50:24:510 | 1) 9124; [AudioRoute] StopState: onEvent: 21, info: 20 |
| I/AGORA_SDK( 9048): INFO (17:50:24:881 | 2) 10618; [AudioRoute] reset audio routing, default routing: Speakerphone, current routing: Default, target routing: Speakerphone, actual system routing: Speakerphone |
| I/AGORA_SDK( 9048): INFO (17:50:24:882 | 1) 10618; [AudioRoute] set audio output routing from Default to Speakerphone |
| D/AGORA_SDK( 9048): DEBUG (17:50:24:885 | 0) 10618; [AudioRoute] updateBluetoothSco sco started: false, audio route target: 3[Speakerphone] current: -1[Default], engine role: 20 |
| I/System.out( 9048): [Thread-1947] DEBUG MyEngineEventHandler$1 onAudioRouteChanged 3 |
| I/AGORA_SDK( 9048): INFO (17:50:24:889 | 4) 10618; [AudioRoute] audio routing changed to Speakerphone |
| I/AGORA_SDK( 9048): INFO (17:50:24:889 | 0) 10618; [AudioRoute] Monitor reset: default routing: Speakerphone, current routing: Speakerphone |
| I/AGORA_SDK( 9048): INFO (17:50:38:710 | 21) 9048; [AudioRoute] Headset w/ mic connected |
| D/AGORA_SDK( 9048): DEBUG (17:50:38:710 | 0) 9048; [AudioRoute] sendEvent: [1], extra arg: 0... Handler (io.agora.rtc.internal.AudioRoutingController$EventHandler) {1fc6c3e0} |
| D/AGORA_SDK( 9048): DEBUG (17:50:38:711 | 1) 9124; [AudioRoute] StartState: onEvent: 1, info: 0 |
| I/AGORA_SDK( 9048): INFO (17:50:38:711 | 0) 9124; [AudioRoute] set audio output routing from Speakerphone to Headset |
| D/AGORA_SDK( 9048): DEBUG (17:50:38:714 | 3) 9124; [AudioRoute] updateBluetoothSco sco started: false, audio route target: 0[Headset] current: 3[Speakerphone], engine role: 20 |
| I/System.out( 9048): [Thread-598] DEBUG MyEngineEventHandler$1 onAudioRouteChanged 0 |
| I/AGORA_SDK( 9048): INFO (17:50:38:723 | 2) 9124; [AudioRoute] audio routing changed to Headset |
| I/AGORA_SDK( 9048): INFO (17:50:49:954 | 10) 9048; [AudioRoute] Headset disconnected |
| D/AGORA_SDK( 9048): DEBUG (17:50:49:954 | 0) 9048; [AudioRoute] sendEvent: [1], extra arg: -1... Handler (io.agora.rtc.internal.AudioRoutingController$EventHandler) {1fc6c3e0} |
| D/AGORA_SDK( 9048): DEBUG (17:50:49:956 | 2) 9124; [AudioRoute] StartState: onEvent: 1, info: -1 |
| I/AGORA_SDK( 9048): INFO (17:50:49:958 | 2) 9124; [AudioRoute] reset audio routing, default routing: Speakerphone, current routing: Headset, target routing: Speakerphone, actual system routing: Earpiece |
| I/AGORA_SDK( 9048): INFO (17:50:49:958 | 0) 9124; [AudioRoute] set audio output routing from Headset to Speakerphone |
| I/System.out( 9048): [Thread-598] DEBUG MyEngineEventHandler$1 onAudioRouteChanged 3 |
| D/AGORA_SDK( 9048): DEBUG (17:50:49:960 | 2) 9124; [AudioRoute] updateBluetoothSco sco started: false, audio route target: 3[Speakerphone] current: 0[Headset], engine role: 20 |
| I/AGORA_SDK( 9048): INFO (17:50:49:967 | 1) 9124; [AudioRoute] audio routing changed to Speakerphone |
| I/AGORA_SDK( 9048): INFO (17:50:57:421 | 9) 9124; [AudioRoute] reset audio routing, default routing: Speakerphone, current routing: Speakerphone, target routing: Speakerphone, actual system routing: Earpiece |
| I/AGORA_SDK( 9048): INFO (17:50:57:423 | 2) 9124; [AudioRoute] set audio output routing from Speakerphone to Speakerphone |
| I/System.out( 9048): [Thread-598] DEBUG MyEngineEventHandler$1 onAudioRouteChanged 3 |
| D/AGORA_SDK( 9048): DEBUG (17:50:57:425 | 2) 9124; [AudioRoute] updateBluetoothSco sco started: false, audio route target: 3[Speakerphone] current: 3[Speakerphone], engine role: 20 |
| I/AGORA_SDK( 9048): INFO (17:50:57:434 | 7) 9124; [AudioRoute] audio routing changed to Speakerphone |
| D/AGORA_SDK( 9048): DEBUG (17:50:57:436 | 1) 9124; [AudioRoute] sendEvent: [14], extra arg: 0... Handler (io.agora.rtc.internal.AudioRoutingController$EventHandler) {1fc6c3e0} |
| D/AGORA_SDK( 9048): DEBUG (17:50:57:436 | 0) 9124; [AudioRoute] sendEvent: [12], extra arg: 0... Handler (io.agora.rtc.internal.AudioRoutingController$EventHandler) {1fc6c3e0} |
| D/AGORA_SDK( 9048): DEBUG (17:50:57:437 | 1) 9124; [AudioRoute] sendEvent: [13], extra arg: 0... Handler (io.agora.rtc.internal.AudioRoutingController$EventHandler) {1fc6c3e0} |
| D/AGORA_SDK( 9048): DEBUG (17:50:57:443 | 6) 9124; [AudioRoute] StopState: onEvent: 14, info: 0 |
| D/AGORA_SDK( 9048): DEBUG (17:50:57:443 | 0) 9124; [AudioRoute] StopState: onEvent: 12, info: 0 |
| D/AGORA_SDK( 9048): DEBUG (17:50:57:444 | 1) 9124; [AudioRoute] StopState: onEvent: 13, info: 0 |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
14.
Q:网宿NGB调度ip地址支持设置给声网旁路推流?
A:网宿NGB调度到的ip地址更适合客户端推流方式,应该这个ip是根据客户端所在网络调度到的最优ip,如果使用我们服务端推流,这个ip并不一定最优,更坏的情况如果我们服务器端和这个ip是跨网的,就有很大概率推流失败。所以建议给我们服务器端的推流地址使用域名,我们服务器端会进行域名解析,找到最优ip来推流
15.
Q:NDK jni打印int值
A:#include <android/log.h>
__android_log_print(ANDROID_LOG_DEBUG,"tagname","videoFrame.yStride=%d",videoFrame.yStride);
16.
Q:reportAudioVolumeIndicationOfSpeakers回调,在使用过程中,如果mutelocal,再突然断网,对端行为?
A:muteLocal不断网,对端能收到音量回调+uid,但是如果断网了,因为服务器端需要超过15秒踢掉当前主播,对端收到的回调数据在15秒内是不准确的,很可能是上次的缓存volume值,非0.
17.
Q:[rp]{"che.audio.record.signal.volume":0}]
对应上层Api调用为adjustRecordingSignalVolume(0), argus上会体现nearout 突然降到0 ,但是nearin正常
A:通常应该是App层mic采集正常,但是api把信号的增益设置成0了,之后没有声音了。编码器输出就没声音了。
18.
Q:uid重复,频道内会出现不同的端互踢的现象
A:是的,严格要求不能uid重复,否则会出现卡顿,变声等异常现象。
19.
Q:帧率下降一半,码率会对应同样下降一半么?
A:并不是,下降到原来的2/3,帧率下降,每一帧之间间距变大,冗余变小,但并非简单减半计算
20.
Q: 同一个编码器,QP值越大画质越好?
A:No, QP为0 ,代表原图,没有编码损失,QP越大画质越差。不同编码器不可比
21.
Q:关于变声如何恢复原音?
A:setLocalVoicePitch 文档写默认值为 1.0
setLocalVoiceEqualization(int bandFrequency, int bandGain); 10组参数,默认值 0
setLocalVoiceReverb(int reverbKey, int value) ;5组 reverbKey , 默认值 0
注意:
setLocalVoiceEqualization 要针对所有设置过的 BandFrequency,都要重置一次
setLocalVoiceReverb要针对所有设置过的reverbKey ,都要重置一次