summaryrefslogtreecommitdiff
path: root/cesar/ce/rx/bitloading/src/transition.c
blob: 1a2edb3ba5a0348f1fa8e42417a00d6c012e2eb0 (plain)
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
/* Cesar project {{{
 *
 * Copyright (C) 2009 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    ce/rx/bitloading/src/transition.c
 * \brief   Transitions of the CE RX Bit Loading FSM.
 * \ingroup ce_rx
 *
 * This file contains the transitions of the FSM of the CE RX Bit Loading.
 */
#include "common/std.h"

#include "ce/rx/bitloading/inc/transition.h"
#include "ce/rx/bitloading/inc/nsr.h"
#include "ce/rx/bitloading/inc/ber.h"
#include "ce/rx/bitloading/inc/initial.h"
#include "ce/rx/bitloading/inc/common.h"
#include "ce/rx/bitloading/bitloading.h"
#include "ce/rx/inc/measure.h"
#include "ce/rx/cp/inc/cp.h"
#include "ce/rx/cp/mme.h"
#include "ce/rx/inc/rx.h"
#include "ce/debug/gpio/gpio.h"
#include "mac/common/tonemap.h"
#include "mac/pbproc/pbproc.h"
#include "cp/sta/mgr/sta_mgr.h"

#include <cyg/kernel/kapi.h>

/**
 * Common handler for initial CE when receiving measure for sound frames.
 * \param  ce_rx  the context of the CE in RX
 * \param  sta  the peer station
 * \param  measure  a measure for sound frames
 * \param  first_sound  if this is the first sound frame, set it to true
 * \return  true if the sound received is the last one
 *
 * This function will initialize (if first sound is true) or add it to the sum
 * of NSR. If this is the last sound, it will compute the mean and them launch
 * an initial CE.
 */
static inline bool
ce_rx_bl__common_initial_sound_measure_received (ce_rx_t *ce_rx, sta_t *sta,
                                                 ce_rx_measure_mbox_t
                                                 *measure, bool first_sound)
{
    /* Check parameters. */
    dbg_assert (measure);
    dbg_assert (measure->rx_params.sound);
    dbg_assert (sta);

    if (first_sound)
        /* Initialize sum of NSR. */
        ce_rx_bl_nsr_sum_init (&sta->ce_rx_bt, measure->chan_data,
                               measure->chan_data_count);
    else
        /* Add it to the sum of NSR. */
        ce_rx_bl_nsr_sum_add (&sta->ce_rx_bt, measure->chan_data,
                              measure->chan_data_count);
    /* Sound complete? */
    if (measure->rx_params.sound_complete)
    {
        ce_debug_gpio_event
            (CE_DEBUG_GPIO_EVENT_CE_RX_BL_MEASURE_SOUND_COMPLETE, true);
        dbg_assert (ce_rx);
        dbg_assert (ce_rx->mac_config);
        /* Compute NSR mean (in every case). */
        ce_rx_bl_nsr_compute_mean (&sta->ce_rx_bt);
        /* Start initial tone map. */
        ce_rx_bl_start_bl (ce_rx, sta, &ce_rx->mac_config->tonemask_info);
        return true;
    }
    ce_debug_gpio_event
        (CE_DEBUG_GPIO_EVENT_CE_RX_BL_MEASURE_SOUND, true);
    return false;
}

/**
 * Common handler to restart CE in RX.
 * \param  ce_rx  the CE RX context
 * \param  sta  the peer station
 */
static void
ce_rx_bl__common__restart_ce_rx (ce_rx_t *ce_rx, sta_t *sta)
{
    /* Check parameter. */
    dbg_assert (sta);

    /* In RX, reset default tone map and remove tone maps. */
    tonemaps_reset (sta->rx_tonemaps, &ce_rx->tonemap_release_list);

    /* Reset NSR. */
    ce_rx_bl_nsr_clean (&sta->ce_rx_bt);
    /* Reset high PB error rate counter. */
    sta->ce_rx_bt.high_pb_error_rate_frame_counter = 0;
    /* Reset BER sliding means. */
    ce_rx_bl_ber_sliding_mean_reset (&sta->ce_rx_bt);
}

/**
 * Common handler to restart CE.
 * \param  ce_rx  the CE RX context
 * \param  sta  the peer station
 */
static void
ce_rx_bl__common__restart_ce (ce_rx_t *ce_rx, sta_t *sta)
{
    /* Check parameter. */
    dbg_assert (sta);

    /* Restart CE in RX. */
    ce_rx_bl__common__restart_ce_rx (ce_rx, sta);

    /* Send MME to restart CE. */
    ce_rx_cp_send_mme_restart_initial_ce (ce_rx, sta);

    /* In TX, reset default tone map and remove tone maps. */
    /* FIXME: this is a dirty hack: we force the TX to re-estimate the
     * channel, in order to transmit the MME to the other side.
     * In reality, we need to use the SACKI. */
    tonemaps_reset (sta->tx_tonemaps, &ce_rx->tonemap_release_list);
}

/**
 * Increase statistics before a CE restart.
 * \param  bl  the bit loading structure
 * \param  sta  peer
 * \param  reason  reason to restart the CE
 */
static inline void
ce_rx_bl_stats_update (ce_rx_bitloading_t *bl,
                       sta_t *sta,
                       ce_rx_bitloading_restart_reason_t reason)
{
    /* Check parameters. */
    dbg_assert (bl);
    dbg_assert (sta);
    dbg_assert (reason < CE_RX_BL_RESTART_REASON_NB);

    bl->stats.restart_reason[reason]++;
    bl->stats.last_restart_reason = reason;

    dbg_assert (sta->rx_tonemaps);
    uint tmi = sta->rx_tonemaps->default_tmi;
    if (TONEMAP_INDEX_IS_NEGOTIATED (tmi))
    {
        tonemap_t *tm = sta->rx_tonemaps->tm[tmi];
        dbg_assert (tm);
        bl->stats.prev_ber_target
            = tm->ber_target;
        bl->stats.prev_ber_target_reached
            = tm->ber_target_reached;
    }
    else
    {
        /* ROBO statistics are unknown. */
        bl->stats.prev_ber_target =
            bl->stats.prev_ber_target_reached = 0;
    }
    /* Copy old means. */
    int i;
    for (i = 0; i < CE_RX_BL_BER_SLIDING_MEAN_NB; i++)
        bl->stats.prev_ber_mean[i] = bl->stats.curr_ber_mean[i];
    bl->stats.prev_pberr_rate_mean = bl->stats.curr_pberr_rate_mean;
}

ce_rx_bl_fsm_branch_t
ce_rx_bl_fsm__IDLE__sound_completed (
    ce_rx_t *ce_rx,
    sta_t *sta,
    ce_rx_bitloading_fsm_event_param_t data)
{
    ce_rx_bl__common_initial_sound_measure_received (ce_rx,
                                                     sta,
                                                     data.measure,
                                                     true);
    return ce_rx_bl_fsm_next_branch (IDLE, sound_completed, no_mode_interval);
}

ce_rx_bl_fsm_branch_t
ce_rx_bl_fsm__IDLE__sound (ce_rx_t *ce_rx,
                           sta_t *sta,
                           ce_rx_bitloading_fsm_event_param_t data)
{
    ce_rx_bl__common_initial_sound_measure_received (ce_rx,
                                                     sta,
                                                     data.measure,
                                                     true);
    return ce_rx_bl_fsm_next (IDLE, sound);
}

ce_rx_bl_fsm_branch_t
ce_rx_bl_fsm__IDLE__data (ce_rx_t *ce_rx,
                          sta_t *sta,
                          ce_rx_bitloading_fsm_event_param_t data)
{
    ce_debug_gpio_event
        (CE_DEBUG_GPIO_EVENT_CE_RX_BL_MEASURE_DATA_NORMAL, true);
    return ce_rx_bl_fsm_next (IDLE, data);
}

ce_rx_bl_fsm_branch_t
ce_rx_bl_fsm__INITIAL__sound_completed (
    ce_rx_t *ce_rx,
    sta_t *sta,
    ce_rx_bitloading_fsm_event_param_t data)
{
    ce_rx_bl__common_initial_sound_measure_received (ce_rx,
                                                     sta,
                                                     data.measure,
                                                     false);
    return ce_rx_bl_fsm_next_branch (INITIAL,
                                     sound_completed,
                                     no_mode_interval);
}

ce_rx_bl_fsm_branch_t
ce_rx_bl_fsm__INITIAL__sound (ce_rx_t *ce_rx,
                              sta_t *sta,
                              ce_rx_bitloading_fsm_event_param_t data)
{
    ce_rx_bl__common_initial_sound_measure_received (ce_rx,
                                                     sta,
                                                     data.measure,
                                                     false);
    return ce_rx_bl_fsm_next (INITIAL, sound);
}

ce_rx_bl_fsm_branch_t
ce_rx_bl_fsm__INITIAL__data (ce_rx_t *ce_rx,
                             sta_t *sta,
                             ce_rx_bitloading_fsm_event_param_t data)
{
    ce_debug_gpio_event
        (CE_DEBUG_GPIO_EVENT_CE_RX_BL_MEASURE_DATA_NORMAL, true);
    return ce_rx_bl_fsm_next (INITIAL, data);
}

ce_rx_bl_fsm_branch_t
ce_rx_bl_fsm__TRACKING__sound_completed (
    ce_rx_t *ce_rx,
    sta_t *sta,
    ce_rx_bitloading_fsm_event_param_t data)
{
    ce_debug_gpio_event
        (CE_DEBUG_GPIO_EVENT_CE_RX_BL_MEASURE_SOUND_COMPLETE, true);
    /* Maybe more than one sound complete flag. Let's ignore it. */
    return ce_rx_bl_fsm_next (TRACKING, sound_completed);
}

ce_rx_bl_fsm_branch_t
ce_rx_bl_fsm__TRACKING__sound (ce_rx_t *ce_rx,
                               sta_t *sta,
                               ce_rx_bitloading_fsm_event_param_t data)
{
    /* Check parameters. */
    dbg_assert (sta);
    dbg_assert (data.measure);

    ce_debug_gpio_event
        (CE_DEBUG_GPIO_EVENT_CE_RX_BL_MEASURE_SOUND, true);
    /* Restart CE in RX. */
    CE_RX_TRACE (RESTART_FORCED, sta->tei);
    ce_rx_bl_stats_update (&sta->ce_rx_bt, sta,
                           CE_RX_BL_RESTART_REASON_PEER_REQUEST);
    ce_rx_bl__common__restart_ce_rx (ce_rx, sta);
    /* Initialize sum of NSR. */
    ce_rx_bl_nsr_sum_init (&sta->ce_rx_bt,
                           data.measure->chan_data,
                           data.measure->chan_data_count);
    return ce_rx_bl_fsm_next (TRACKING, sound);
}


ce_rx_bl_fsm_branch_t
ce_rx_bl_fsm__TRACKING__data (ce_rx_t *ce_rx,
                              sta_t *sta,
                              ce_rx_bitloading_fsm_event_param_t data)
{
    dbg_assert (sta);
    dbg_assert (ce_rx);

    uint i;

    /* Get measure. */
    ce_rx_measure_mbox_t *measure = data.measure;
    dbg_assert (measure);

    dbg_assert (sta->rx_tonemaps);

    sta->rx_tonemaps->sound_frame_counter = TONEMAP_SOUND_FRAME_COUNTER;

    bool tm_is_negotiated =
        TONEMAP_INDEX_IS_NEGOTIATED (measure->rx_params.tmi_av);

    tonemap_t *tm;
    if (tm_is_negotiated)
    {
        tm = sta->rx_tonemaps->tm[measure->rx_params.tmi_av];
    }

    /* Increase CE statistics. */
    /* If measure is a negotiated tone map. */
    if (tm_is_negotiated && tm)
    {
        /* Update statistics. */
        tm->nb_frame++;
        tm->nb_pb += measure->total_pb_count;
    }

    /* Measure should only be processed if the TMI used is the one we are
     * expecting.
     * FIXME: this will not work with intervals. */
    if (sta->rx_tonemaps->default_tmi == measure->rx_params.tmi_av)
    {
        ce_rx_bitloading_t *bl = &sta->ce_rx_bt;
        dbg_assert (bl);

        u8 good_pb_count = measure->total_pb_count - measure->false_pb_count;
        u16 pb_size =
            (measure->rx_params.pb_size == PHY_PB_SIZE_136 ? 136 : 520) * 8;
        /* Update BER sliding means. */
        if (good_pb_count)
            ce_rx_bl_ber_sliding_mean_update
                (bl, ce_rx_bl_ber_quantify
                 (measure->ber_sum, good_pb_count, pb_size));

        /* Update PB Error Rate sliding mean. */
        ce_rx_bl_pber_sliding_mean_update (bl,
                                           measure->total_pb_count,
                                           measure->false_pb_count);

        /* Update statistics. */
        bl->stats.curr_nb_pb = measure->total_pb_count;
        bl->stats.curr_nb_pb_crc_false = measure->false_pb_count;
        bl->stats.curr_ber_sum = measure->ber_sum;
        for (i = 0; i < CE_RX_BL_BER_SLIDING_MEAN_NB; i++)
            bl->stats.curr_ber_mean[i] = bl->ber_sliding_mean[i];
        bl->stats.curr_pberr_rate_mean = sta->ce_rx_bt.pber_sliding_mean;

        /* High PB Error rate (not on small frame)? */
        if (tm_is_negotiated
            && (measure->total_pb_count >= ce_rx_bl_min_pb_per_frame_)
            && (ce_rx_bl_pb_total_factor_ * measure->false_pb_count
                > ce_rx_bl_pb_false_factor_ * measure->total_pb_count))
        {
            /* Increase frame counter. */
            bl->high_pb_error_rate_frame_counter++;
            CE_RX_TRACE_VERBOSE
                (PB_ERR_RATE_HIGH, sta->tei,
                 measure->rx_params.tmi_av,  measure->false_pb_count,
                 measure->total_pb_count,
                 bl->high_pb_error_rate_frame_counter);
            /* Enough frame in this case and not too soon? */
            if ((bl->high_pb_error_rate_frame_counter
                 >= ce_rx_bl_min_frame_with_high_pb_err_rate_)
                && lesseq_mod2p32
                (bl->next_date_min_for_restart_rtc_date[0],
                 cyg_current_time ()))
            {
                ce_debug_gpio_event
                (CE_DEBUG_GPIO_EVENT_CE_RX_BL_MEASURE_DATA_HIGH_PB_ERROR_RATE,
                 true);
                CE_RX_TRACE (RESTART_PB_ERR, sta->tei,
                             bl->high_pb_error_rate_frame_counter);
                ce_rx_bl_stats_update (bl, sta,
                                       CE_RX_BL_RESTART_REASON_PBERR_HIGH);
                /* Restart CE. */
                ce_rx_bl__common__restart_ce (ce_rx, sta);

                return ce_rx_bl_fsm_next_branch (TRACKING,
                                                 data,
                                                 pb_err_rate_high);
            }
        }
        else
        {
            /* Reset frame counter. */
            bl->high_pb_error_rate_frame_counter = 0;
            /* If this is not negotiated tone map (ROBO)
               or the tone map is not at the maximum
               and not too soon. */
            if ((!tm_is_negotiated
                 ||
                 ((tm)
                  && (tm->bits_per_symbol
                      < (ce_rx->mac_config->tonemask_info.carrier_nb
                         * CE_BIT_PER_MOD[CE_MOD_COUNT - 1]))))
                && lesseq_mod2p32
                (bl->next_date_min_for_restart_rtc_date[1],
                 cyg_current_time ()))
            {
                /* Compute lower bound. */
                u64 ber_target;
                if (!tm_is_negotiated)
                {
                    ber_target = ce_rx_bl_ber_pt_robo
                        (ce_rx->mac_config->tonemask_info.carrier_nb);
                }
                else
                {
                    ber_target = tm->ber_target_reached;
                }

                u64 lower_bound = ber_target
                    - (ber_target * ce_rx_bl_ber_lower_bound_
                       / CE_RX_BL_BER_LOWER_BOUND_UNIT);
                /* Get BER sliding means. */
                s64 *bsm = bl->ber_sliding_mean;
                if (((u64) bsm[CE_RX_BL_BER_SLIDING_MEAN_FAST]
                     < lower_bound)
                    && ((u64) bsm[CE_RX_BL_BER_SLIDING_MEAN_SLOW]
                        < lower_bound))
                {
                    ce_debug_gpio_event (
                        CE_DEBUG_GPIO_EVENT_CE_RX_BL_MEASURE_DATA_BER_LOW,
                        true);
                    CE_RX_TRACE (RESTART_BER, sta->tei);
                    ce_rx_bl_stats_update (bl, sta,
                                           CE_RX_BL_RESTART_REASON_BER_LOW);
                    /* Restart CE. */
                    ce_rx_bl__common__restart_ce (ce_rx, sta);
                    return ce_rx_bl_fsm_next_branch (TRACKING,
                                                     data,
                                                     ber_too_low);
                }
            }
        }
    }
    ce_debug_gpio_event
        (CE_DEBUG_GPIO_EVENT_CE_RX_BL_MEASURE_DATA_NORMAL, true);
    return ce_rx_bl_fsm_next_branch (TRACKING, data, no_channel_change);
}

ce_rx_bl_fsm_branch_t
ce_rx_bl_fsm__INTERVALS__sound (ce_rx_t *ce_rx,
                                sta_t *sta,
                                ce_rx_bitloading_fsm_event_param_t data)
{
    /* TODO, we should not execute this for the moment. */
    dbg_assert_default ();
    return ce_rx_bl_fsm_next (INTERVALS, sound);
}

ce_rx_bl_fsm_branch_t
ce_rx_bl_fsm__INTERVALS__sound_completed (
    ce_rx_t *ce_rx,
    sta_t *sta,
    ce_rx_bitloading_fsm_event_param_t data)
{
    /* TODO, we should not execute this for the moment. */
    dbg_assert_default ();
    return ce_rx_bl_fsm_next (INTERVALS, sound_completed);
}

ce_rx_bl_fsm_branch_t
ce_rx_bl_fsm__INTERVAL_TRACKING__interval_sound (
    ce_rx_t *ce_rx,
    sta_t *sta,
    ce_rx_bitloading_fsm_event_param_t data)
{
    /* TODO, we should not execute this for the moment. */
    dbg_assert_default ();
    return ce_rx_bl_fsm_next (INTERVAL_TRACKING, interval_sound);
}

ce_rx_bl_fsm_branch_t
ce_rx_bl_fsm__INTERVAL_TRACKING__interval_sound_completed (
    ce_rx_t *ce_rx,
    sta_t *sta,
    ce_rx_bitloading_fsm_event_param_t data)
{
    /* TODO, we should not execute this for the moment. */
    dbg_assert_default ();
    return ce_rx_bl_fsm_next (INTERVAL_TRACKING, interval_sound_completed);
}

ce_rx_bl_fsm_branch_t
ce_rx_bl_fsm__INTERVAL_TRACKING__interval_data (
    ce_rx_t *ce_rx,
    sta_t *sta,
    ce_rx_bitloading_fsm_event_param_t data)
{
    /* TODO, we should not execute this for the moment. */
    dbg_assert_default ();
    return ce_rx_bl_fsm_next_branch (INTERVAL_TRACKING,
                                     interval_data,
                                     no_channel_change);
    return ce_rx_bl_fsm_next_branch (INTERVAL_TRACKING,
                                     interval_data,
                                     pb_err_rate_high);
    return ce_rx_bl_fsm_next_branch (INTERVAL_TRACKING,
                                     interval_data,
                                     ber_too_low);
}

ce_rx_bl_fsm_branch_t
ce_rx_bl_fsm__INTERVAL_SOUND__interval_sound (
    ce_rx_t *ce_rx,
    sta_t *sta,
    ce_rx_bitloading_fsm_event_param_t data)
{
    /* TODO, we should not execute this for the moment. */
    dbg_assert_default ();
    return ce_rx_bl_fsm_next (INTERVAL_SOUND, interval_sound);
}

ce_rx_bl_fsm_branch_t
ce_rx_bl_fsm__INTERVAL_SOUND__interval_sound_completed (
    ce_rx_t *ce_rx,
    sta_t *sta,
    ce_rx_bitloading_fsm_event_param_t data)
{
    /* TODO, we should not execute this for the moment. */
    dbg_assert_default ();
    return ce_rx_bl_fsm_next (INTERVAL_SOUND, interval_sound_completed);
}

ce_rx_bl_fsm_branch_t
ce_rx_bl_fsm__INTERVAL_SOUND__interval_data (
    ce_rx_t *ce_rx,
    sta_t *sta,
    ce_rx_bitloading_fsm_event_param_t data)
{
    /* TODO, we should not execute this for the moment. */
    dbg_assert_default ();
    return ce_rx_bl_fsm_next (INTERVAL_SOUND, interval_data);
}

ce_rx_bl_fsm_branch_t
ce_rx_bl_fsm__INTERVAL_SOUND_WAIT__interval_sound (
    ce_rx_t *ce_rx,
    sta_t *sta,
    ce_rx_bitloading_fsm_event_param_t data)
{
    /* TODO, we should not execute this for the moment. */
    dbg_assert_default ();
    return ce_rx_bl_fsm_next (INTERVAL_SOUND_WAIT, interval_sound);
}

ce_rx_bl_fsm_branch_t
ce_rx_bl_fsm__INTERVAL_SOUND_WAIT__interval_sound_completed (
    ce_rx_t *ce_rx,
    sta_t *sta,
    ce_rx_bitloading_fsm_event_param_t data)
{
    /* TODO, we should not execute this for the moment. */
    dbg_assert_default ();
    return ce_rx_bl_fsm_next (INTERVAL_SOUND_WAIT, interval_sound_completed);
}

ce_rx_bl_fsm_branch_t
ce_rx_bl_fsm__INTERVAL_SOUND_WAIT__interval_data (
    ce_rx_t *ce_rx,
    sta_t *sta,
    ce_rx_bitloading_fsm_event_param_t data)
{
    /* TODO, we should not execute this for the moment. */
    dbg_assert_default ();
    return ce_rx_bl_fsm_next (INTERVAL_SOUND_WAIT, interval_data);
}