@@ -57,149 +57,6 @@ static const struct e1inp_line_ops dummy_e1_line_ops = {
57
57
.sign_link = NULL ,
58
58
};
59
59
60
- /* The following EFR TRAU-DL frame is a dummy to be transmitted in the absence
61
- * of RTP-derived TRAU-DL frames. The payload bit content here is the decoder
62
- * homing frame (DHF) of TS 46.060 section 8.2 Table 7 - the best we can do
63
- * in the absence of a proper TFO transform for EFR - while the full TRAU-DL
64
- * frame was generated by passing said EFR DHF through osmo_rtp2trau().
65
- */
66
- static const ubit_t idle_tf_efr [] = {
67
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
68
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
69
- 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 ,
70
- 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 ,
71
- 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 ,
72
- 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 ,
73
- 1 , 1 , 0 , 1 , 0 , 1 , 1 , 0 ,
74
- 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 ,
75
- 1 , 0 , 0 , 0 , 1 , 1 , 1 , 1 ,
76
- 1 , 0 , 0 , 1 , 0 , 1 , 0 , 1 ,
77
- 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 ,
78
- 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 ,
79
- 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 ,
80
- 0 , 0 , 0 , 1 , 1 , 1 , 0 , 1 ,
81
- 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 ,
82
- 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 ,
83
- 1 , 0 , 0 , 0 , 1 , 1 , 1 , 1 ,
84
- 0 , 1 , 1 , 0 , 1 , 1 , 0 , 0 ,
85
- 1 , 0 , 0 , 1 , 1 , 0 , 0 , 0 ,
86
- 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 ,
87
- 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 ,
88
- 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
89
- 1 , 0 , 1 , 0 , 0 , 1 , 0 , 0 ,
90
- 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 ,
91
- 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 ,
92
- 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 ,
93
- 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
94
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
95
- 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
96
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
97
- 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
98
- 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 ,
99
- 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 ,
100
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
101
- 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
102
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
103
- 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
104
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
105
- 1 , 0 , 0 , 0 , 1 , 1 , 1 , 1 ,
106
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
107
- };
108
-
109
- /* The following FRv1 TRAU-DL frame is a dummy to be transmitted in the absence
110
- * of RTP-derived TRAU-DL frames. The payload bit content here is the silence
111
- * frame of TS 46.011 Table 1 - the best we can do without integrating the
112
- * TFO transform for FRv1 from Themyscira libgsmfr2 - while the full TRAU-DL
113
- * frame was generated by passing said FRv1 silence frame through
114
- * osmo_rtp2trau().
115
- */
116
- static const ubit_t idle_tf_fr [] = {
117
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
118
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
119
- 1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 1 , 1 ,
177
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
178
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
179
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
180
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
181
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
182
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
183
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
184
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
185
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
186
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
187
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
188
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
189
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
190
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
191
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
192
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
193
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
194
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
195
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
196
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
197
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
198
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
199
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 ,
200
- 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
201
- };
202
-
203
60
/* If the RTP transmission has dropouts for some reason the I.460 TX-Queue may
204
61
* run empty. In order to make sure that the TRAU frame transmission continues
205
62
* we generate idle TRAU frames here. */
@@ -208,33 +65,54 @@ static void e1_i460_mux_empty_cb(struct osmo_i460_subchan *schan, void *user_dat
208
65
struct mgcp_endpoint * endp = user_data ;
209
66
struct rate_ctr_group * rate_ctrs = endp -> trunk -> ratectr .e1_stats ;
210
67
struct msgb * msg = msgb_alloc_c (endp -> trunk , E1_TRAU_BITS_MSGB , "E1-I.460-IDLE-TX-TRAU-frame" );
211
- uint8_t * ptr ;
212
- const uint8_t * ptr_ft ;
213
- enum osmo_trau_frame_type ft ;
68
+ const uint8_t * dummy_fill_pl ;
69
+ unsigned dummy_fill_pl_len ;
70
+ struct osmo_trau_frame tf ;
71
+ int rc ;
214
72
215
73
rate_ctr_inc (rate_ctr_group_get_ctr (rate_ctrs , E1_I460_TRAU_MUX_EMPTY_CTR ));
216
74
217
- /* Choose an appropiate idle frame type */
218
- ft = endp -> e1 .trau_rtp_st -> type ;
219
- switch (ft ) {
75
+ /* choose dummy fill frame payload based on current codec */
76
+ switch (endp -> e1 .trau_rtp_st -> type ) {
220
77
case OSMO_TRAU16_FT_FR :
221
- ptr_ft = idle_tf_fr ;
78
+ dummy_fill_pl = osmo_gsm611_silence_frame ;
79
+ dummy_fill_pl_len = GSM_FR_BYTES ;
222
80
break ;
223
81
case OSMO_TRAU16_FT_EFR :
224
- ptr_ft = idle_tf_efr ;
82
+ dummy_fill_pl = osmo_gsm660_homing_frame ;
83
+ dummy_fill_pl_len = GSM_EFR_BYTES ;
225
84
break ;
226
85
default :
227
- /* FIXME: What about 8k subslots and AMR frames? */
228
- ptr_ft = idle_tf_spch ;
86
+ LOGPENDP ( endp , DE1 , LOGL_ERROR , "E1-I.460-IDLE-TX: unsupported frame type\n" );
87
+ goto skip ;
229
88
}
230
89
231
- /* Put the replacement into a message buffer and enqueue it into the
232
- * I.460 multiplexer */
233
- ptr = msgb_put (msg , E1_TRAU_BITS );
234
- memcpy (ptr , ptr_ft , E1_TRAU_BITS );
90
+ /* turn it into a TRAU-DL frame */
91
+ memset (& tf , 0 , sizeof (tf ));
92
+ tf .dir = OSMO_TRAU_DIR_DL ;
93
+ rc = osmo_rtp2trau (& tf , dummy_fill_pl , dummy_fill_pl_len , endp -> e1 .trau_rtp_st );
94
+ if (rc < 0 ) {
95
+ LOGPENDP (endp , DE1 , LOGL_ERROR ,
96
+ "E1-I.460-IDLE-TX: error converting dummy fill frame!\n" );
97
+ goto skip ;
98
+ }
99
+ rc = osmo_trau_frame_encode (msgb_data (msg ), msg -> data_len , & tf );
100
+ if (rc < 0 ) {
101
+ LOGPENDP (endp , DE1 , LOGL_ERROR ,
102
+ "E1-I.460-IDLE-TX: error encoding dummy fill frame!\n" );
103
+ goto skip ;
104
+ }
105
+ msgb_put (msg , rc );
106
+
107
+ /* enqueue it into the I.460 multiplexer */
235
108
LOGPENDP (endp , DE1 , LOGL_DEBUG , "E1-I.460-IDLE-TX: enquing %u trau frame bits: %s...\n" , msgb_length (msg ),
236
109
osmo_ubit_dump (msgb_data (msg ), msgb_length (msg ) > DEBUG_BITS_MAX ? DEBUG_BITS_MAX : msgb_length (msg )));
237
110
osmo_i460_mux_enqueue (endp -> e1 .schan , msg );
111
+ return ;
112
+
113
+ skip :
114
+ rate_ctr_inc (rate_ctr_group_get_ctr (rate_ctrs , E1_I460_TRAU_TX_FAIL_CTR ));
115
+ msgb_free (msg );
238
116
}
239
117
240
118
/* called by I.460 de-multiplexer; feed output of I.460 demux into TRAU frame sync */
0 commit comments