mirror of https://github.com/thesofproject/sof.git
detector, kpb: change buffering and draining constants
This fix compensates host wakeup time. Here we limit max draining request to 2 seconds. History buffer size if one second bigger than max draining request allowed. Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This commit is contained in:
parent
dcd8d4c79e
commit
31949d0669
|
@ -1015,7 +1015,7 @@ static void kpb_init_draining(struct comp_dev *dev, struct kpb_client *cli)
|
|||
} else if (!is_sink_ready) {
|
||||
comp_err(dev, "kpb_init_draining(): sink not ready for draining");
|
||||
} else if (kpb->hd.buffered < drain_req ||
|
||||
kpb->hd.buffer_size < drain_req) {
|
||||
cli->drain_req > KPB_MAX_DRAINING_REQ) {
|
||||
comp_cl_err(&comp_kpb, "kpb_init_draining(): not enough data in history buffer");
|
||||
} else {
|
||||
/* Draining accepted, find proper buffer to start reading
|
||||
|
|
|
@ -15,7 +15,9 @@
|
|||
struct comp_buffer;
|
||||
|
||||
/* KPB internal defines */
|
||||
#define KPB_MAX_BUFF_TIME 2100 /**< time of buffering in miliseconds */
|
||||
#define KPB_MAX_BUFF_TIME 3000 /**< time of buffering in miliseconds */
|
||||
#define HOST_WAKEUP_TIME 1000 /* aprox. time of host DMA wakup from suspend [ms] */
|
||||
#define KPB_MAX_DRAINING_REQ (KPB_MAX_BUFF_TIME - HOST_WAKEUP_TIME)
|
||||
#define KPB_MAX_SUPPORTED_CHANNELS 2 /**< number of supported channels */
|
||||
/**< number of samples taken each milisecond */
|
||||
#define KPB_SAMPLES_PER_MS (KPB_SAMPLNG_FREQUENCY / 1000)
|
||||
|
|
|
@ -7,5 +7,5 @@ CONTROLBYTES_PRIV(DETECTOR_priv,
|
|||
` 0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,'
|
||||
` 0x00,0x00,0x00,0x00,0x34,0x08,0x00,0x00,'
|
||||
` 0x03,0x00,0x18,0x00,0x00,0x00,0x00,0x00,'
|
||||
` 0x34,0x08,0x00,0x00,0x00,0x00,0x00,0x00"'
|
||||
` 0xD0,0x07,0x00,0x00,0x00,0x00,0x00,0x00"'
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue