owt-server 数据流程

1,/root/Projects/owt-server/dist/management_api/rpc/rpc.js

 

//Create the queue for send messages
                clientQueue = connection.queue('', function (q) {
                    log.info('ClientQueue ' + q.name + ' is open'+',clientQueue.name:'+clientQueue.name);
                    clientQueue.bind('owtRpc', clientQueue.name);
                    clientQueue.subscribe(function (message) {
                        if (map[message.corrID] !== undefined) {
                            map[message.corrID].fn[message.type](message.data, message.err);
                            clearTimeout(map[message.corrID].to);
                            delete map[message.corrID];
                        }
                    });
                });

发现owt采用的队列名是rabbitmq-server自己随机产生的队列名

 

2, owt-server组件架构图:

 

 

3,

root@cluster_manager$node .
2020-10-13 10:23:55.786  - INFO: AmqpClient - Connecting to rabbitMQ server OK, options: [Object: null prototype] { host: 'localhost', port: 5672, login: 'vzan' }
2020-10-13 10:23:55.793  - INFO: Main - Cluster manager up! id: 403728697
2020-10-13 10:23:55.794  - INFO: ClusterManager - Run as candidate.
2020-10-13 10:23:55.994  - INFO: ClusterManager - Run as master.
2020-10-13 10:23:56.012  - INFO: ClusterManager - Cluster manager is in service as master!
2020-10-13 10:23:56.043  - WARN: ClusterManager - workerJoin, purpose: video |worker: video-8e2cd52dcc415797a799@192.168.60.113 info: { ip: '192.168.60.113',
  purpose: 'video',
  state: 2,
  max_load: 0.85,
  capacity:
   { isps: [],
     regions: [],
     video: { decode: [Array], encode: [Array] } } }
2020-10-13 10:23:56.065  - WARN: ClusterManager - workerJoin, purpose: webrtc |worker: webrtc-7c8b15c2b2a839c97aef@192.168.60.113 info: { ip: '192.168.60.113',
  purpose: 'webrtc',
  state: 2,
  max_load: 0.85,
  capacity: { isps: [], regions: [] } }
2020-10-13 10:23:56.176  - WARN: ClusterManager - workerJoin, purpose: sip |worker: sip-ee60010a8ea684540b55@192.168.60.113 info: { ip: '192.168.60.113',
  purpose: 'sip',
  state: 2,
  max_load: 0.85,
  capacity: {} }
2020-10-13 10:23:56.269  - WARN: ClusterManager - workerJoin, purpose: analytics |worker: analytics-e0a44bf8aac93aa51216@192.168.60.113 info: { ip: '192.168.60.113',
  purpose: 'analytics',
  state: 2,
  max_load: 0.85,
  capacity:
   { isps: [],
     regions: [],
     algorithms:
      [ 'dc51138a8284436f873418a21ba8cfa7',
        'b849f44bee074b08bf3e627f3fc927c7' ] } }
2020-10-13 10:23:56.281  - WARN: ClusterManager - workerJoin, purpose: portal |worker: portal-5f2c0647fa517132fa9b@192.168.60.113 info: { ip: '192.168.60.113',
  hostname: '',
  port: 8080,
  via_host: '',
  ssl: true,
  state: 2,
  max_load: 0.85,
  capacity: { isps: [], regions: [] } }
2020-10-13 10:23:56.326  - WARN: ClusterManager - workerJoin, purpose: streaming |worker: streaming-ab011678ccb67fa465f8@192.168.60.113 info: { ip: '192.168.60.113',
  purpose: 'streaming',
  state: 2,
  max_load: 0.85,
  capacity: { isps: [], regions: [] } }
2020-10-13 10:23:56.428  - WARN: ClusterManager - workerJoin, purpose: audio |worker: audio-d0e383715b1bd505912a@192.168.60.113 info: { ip: '192.168.60.113',
  purpose: 'audio',
  state: 2,
  max_load: 0.85,
  capacity: { isps: [], regions: [] } }
2020-10-13 10:23:56.434  - WARN: ClusterManager - workerJoin, purpose: conference |worker: conference-7c3c3b015c97d1e742e5@192.168.60.113 info: { ip: '192.168.60.113',
  purpose: 'conference',
  state: 2,
  max_load: 0.85,
  capacity: {} }
2020-10-13 10:23:56.470  - WARN: ClusterManager - workerJoin, purpose: recording |worker: recording-f73079288a2b5013c919@192.168.60.113 info: { ip: '192.168.60.113',
  purpose: 'recording',
  state: 2,
  max_load: 0.85,
  capacity: {} }
 

单独运行cluster_manager之后,发现连接上来的purpose有:

  1. recording
  2. conference
  3. audio
  4. streaming
  5. portal
  6. analytics
  7. sip
  8. webrtc
  9. video

4,遇到音频混流问题:

==> logs/audio-d0e383715b1bd505912a@192.168.60.113_1.log <==
node: symbol lookup error: /root/Projects/owt-server/dist/audio_agent/audioMixer/build/Release/audioMixer.node: undefined symbol: WebRtcVad_InitCore

==> logs/audio-agent.stdout <==
2020-10-13 10:31:42.705  - INFO: NodeManager - Node audio-d0e383715b1bd505912a@192.168.60.113_1 is closed on unexpected code: 127
2020-10-13 10:31:42.776  - INFO: NodeManager - Node audio-d0e383715b1bd505912a@192.168.60.113_2 is closed on unexpected code: 127

==> logs/conference-7c3c3b015c97d1e742e5@192.168.60.113_0.log <==
2020-10-13 10:31:43.561  - ERROR: RoomController - subscribe failed, reason: Timeout to make rpc to audio-d0e383715b1bd505912a@192.168.60.113_0.generate
2020-10-13 10:31:43.561  - INFO: Conference - roomController.subscribe failed, reason: Timeout to make rpc to audio-d0e383715b1bd505912a@192.168.60.113_0.generate
2020-10-13 10:31:43.561  - INFO: Conference - Exception: roomController.subscribe failed, reason: Timeout to make rpc to audio-d0e383715b1bd505912a@192.168.60.113_0.generate
2020-10-13 10:31:44.701  - ERROR: RoomController - spreadStream failed, stream_id: 606272553558733400 reason: Timeout to make rpc to audio-d0e383715b1bd505912a@192.168.60.113_1.publish
2020-10-13 10:31:44.701  - INFO: Conference - roomController.mix failed, reason: Timeout to make rpc to audio-d0e383715b1bd505912a@192.168.60.113_1.publish
2020-10-13 10:31:44.702  - WARN: Conference - failed in controlStream, reason: Timeout to make rpc to audio-d0e383715b1bd505912a@192.168.60.113_1.publish

==> logs/app.stdout <==
Tue, 13 Oct 2020 02:31:44 GMT express deprecated res.send(status): Use res.sendStatus(status) instead at samplertcservice.js:339:9
PATCH /rooms/5f8066b6b67d299660406f1b/streams/606272553558733400 500 2065.788 ms - 21

==> logs/conference-7c3c3b015c97d1e742e5@192.168.60.113_0.log <==
2020-10-13 10:31:44.766  - ERROR: RoomController - spreadStream failed, stream_id: 606272553558733400 reason: Timeout to make rpc to audio-d0e383715b1bd505912a@192.168.60.113_2.publish
2020-10-13 10:31:44.767  - INFO: Conference - roomController.mix failed, reason: Timeout to make rpc to audio-d0e383715b1bd505912a@192.168.60.113_2.publish
2020-10-13 10:31:44.767  - WARN: Conference - failed in controlStream, reason: Timeout to make rpc to audio-d0e383715b1bd505912a@192.168.60.113_2.publish

==> logs/app.stdout <==
PATCH /rooms/5f8066b6b67d299660406f1b/streams/606272553558733400 500 2154.875 ms - 21

 出现这个问题的原因是编译webrtc的时候出错了,可是非常坑的是owt编译脚本并不停止下来并提示错误,误以为正常,直到运行的时候出现问题,又茫然不知所措。

../webrtc/common_audio/vad/vad_core.c:118:1: error: attributes should be specified before the declarator in a function definition
  118 | static inline int32_t OverflowingMulS16ByS32ToS32(int16_t a, int32_t b)
      | ^~~~~~
../webrtc/common_audio/vad/vad_core.c: In function ‘GmmProbability’:
../webrtc/common_audio/vad/vad_core.c:391:22: warning: implicit declaration of function ‘OverflowingMulS16ByS32ToS32’ [-Wimplicit-function-declaration]
  391 |           tmp2_s32 = OverflowingMulS16ByS32ToS32(tmp_s16, tmp1_s32);

修改代码吧,但是要注意控制脚本的运行,防止自动rm,重新git同步代码,不然白改了:

//文件:vad_core.cc

static inline int32_t OverflowingMulS16ByS32ToS32(int16_t a, int32_t b)
    RTC_NO_SANITIZE("signed-integer-overflow") {
  return a * b;
}

===>

static inline int32_t RTC_NO_SANITIZE("signed-integer-overflow") 
OverflowingMulS16ByS32ToS32(int16_t a, int32_t b) {
  return a * b;
}



//entropy_coding.c

static inline int32_t OverflowingMulS16S32ToS32(int16_t a, int32_t b)
    RTC_NO_SANITIZE("signed-integer-overflow") {
  return a * b;
}
static inline int32_t OverflowingAddS32S32ToS32(int32_t a, int32_t b)
    RTC_NO_SANITIZE("signed-integer-overflow") {
  return a + b;
}
static inline int32_t OverflowingSubS32S32ToS32(int32_t a, int32_t b)
    RTC_NO_SANITIZE("signed-integer-overflow") {
  return a - b;
}



===>

static inline int32_t RTC_NO_SANITIZE("signed-integer-overflow")
OverflowingMulS16S32ToS32(int16_t a, int32_t b) {
  return a * b;
}
static inline int32_t RTC_NO_SANITIZE("signed-integer-overflow")
OverflowingAddS32S32ToS32(int32_t a, int32_t b) {
  return a + b;
}
static inline int32_t RTC_NO_SANITIZE("signed-integer-overflow")  
OverflowingSubS32S32ToS32(int32_t a, int32_t b) {
  return a - b;
}



//lattice.c



static inline int32_t OverflowingLShiftS32(int32_t x, int shift)
    RTC_NO_SANITIZE("shift") {
  return x << shift;
}

==>

static inline int32_t RTC_NO_SANITIZE("shift") 
OverflowingLShiftS32(int32_t x, int shift) {
  return x << shift;
}

 

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页