mailman.alsa-project.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Sound-open-firmware

Thread Start a new thread
Download
Threads by month
  • ----- 2025 -----
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2018 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2017 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2016 -----
  • December
  • November
  • October
sound-open-firmware@alsa-project.org

  • 4 participants
  • 1568 discussions
[Sound-open-firmware] [PATCH] pipeline: fixed return value from preload_downstream
by Ranjani Sridharan 04 Sep '17

04 Sep '17
This patch fixes the return value from the preload_downstream() call in pipeline_params() Signed-off-by: Ranjani Sridharan <ranjani.sridharan(a)linux.intel.com> --- src/audio/pipeline.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/audio/pipeline.c b/src/audio/pipeline.c index 4327254..49a0c51 100644 --- a/src/audio/pipeline.c +++ b/src/audio/pipeline.c @@ -505,7 +505,7 @@ static int preload_downstream(struct comp_dev *start, struct comp_dev *current) int pipeline_prepare(struct pipeline *p, struct comp_dev *dev) { struct op_data op_data; - int ret, count, i; + int ret, i; trace_pipe("pre"); @@ -527,10 +527,10 @@ int pipeline_prepare(struct pipeline *p, struct comp_dev *dev) * trigger start */ for (i = 0; i < MAX_PRELOAD_SIZE; i++) { - count = preload_downstream(dev, dev); + ret = preload_downstream(dev, dev); /* complete ? */ - if (count <= 0) + if (ret <= 0) goto out; } -- 2.9.3
2 1
0 0
[Sound-open-firmware] [PATCH] rmbox: check for non printable chars in trace.
by Liam Girdwood 04 Sep '17

04 Sep '17
Non printable means trace is a value. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- rmbox/rmbox.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rmbox/rmbox.c b/rmbox/rmbox.c index 1f81e06..3ef6fb4 100644 --- a/rmbox/rmbox.c +++ b/rmbox/rmbox.c @@ -19,6 +19,7 @@ #include <stdint.h> #include <errno.h> #include <string.h> +#include <ctype.h> // TODO: include all this stuff @@ -135,6 +136,12 @@ static void show_trace(uint32_t val, uint32_t addr, uint32_t *timestamp, float c return; } + /* check for printable values - otherwise it's a value */ + if (!isprint((char)(val >> 16)) || !isprint((char)(val >> 8)) || !isprint((char)val)) { + printf("value 0x%8.8x\n", (uint32_t)val); + return; + } + class = val & 0xff000000; if (class == TRACE_CLASS_IRQ) trace = "irq"; -- 2.11.0
1 0
0 0
[Sound-open-firmware] [PATCH v1 1/3] comp: default function to set comp state
by Ranjani Sridharan 04 Sep '17

04 Sep '17
This patch adds a the comp_set_state() used for the mandatory pipeline commands, START, STOP, PAUSE and RELEASE. It also updates the cmd method in existing components to use comp_set_state(). Signed-off-by: Ranjani Sridharan <ranjani.sridharan(a)linux.intel.com> --- src/audio/component.c | 36 ++++++++++++++++++++++++++++++++++++ src/audio/eq_fir.c | 23 ++--------------------- src/audio/host.c | 16 ++++------------ src/audio/src.c | 26 +++----------------------- src/audio/tone.c | 26 +++----------------------- src/audio/volume.c | 20 +++----------------- src/include/reef/audio/component.h | 3 +++ 7 files changed, 54 insertions(+), 96 deletions(-) diff --git a/src/audio/component.c b/src/audio/component.c index 6369e2e..6f2e0c3 100644 --- a/src/audio/component.c +++ b/src/audio/component.c @@ -117,6 +117,42 @@ void comp_unregister(struct comp_driver *drv) spin_unlock(&cd->lock); } +int comp_set_state(struct comp_dev *dev, int cmd) +{ + int ret = 0; + + switch (cmd) { + case COMP_CMD_START: + case COMP_CMD_RELEASE: + dev->state = COMP_STATE_RUNNING; + break; + case COMP_CMD_STOP: + if (dev->state == COMP_STATE_RUNNING || + dev->state == COMP_STATE_DRAINING || + dev->state == COMP_STATE_PAUSED) { + comp_buffer_reset(dev); + dev->state = COMP_STATE_SETUP; + } else { + trace_comp_error("CEs"); + ret = -EINVAL; + } + break; + case COMP_CMD_PAUSE: + /* only support pausing for running */ + if (dev->state == COMP_STATE_RUNNING) + dev->state = COMP_STATE_PAUSED; + else { + trace_comp_error("CEp"); + ret = -EINVAL; + } + break; + default: + break; + } + + return ret; +} + void sys_comp_init(void) { cd = rzalloc(RZONE_SYS, RFLAGS_NONE, sizeof(*cd)); diff --git a/src/audio/eq_fir.c b/src/audio/eq_fir.c index 534a4a1..6380340 100644 --- a/src/audio/eq_fir.c +++ b/src/audio/eq_fir.c @@ -364,31 +364,12 @@ static int eq_fir_cmd(struct comp_dev *dev, int cmd, void *data) break; case COMP_CMD_START: - trace_src("EFs"); - dev->state = COMP_STATE_RUNNING; - break; case COMP_CMD_STOP: - trace_src("ESp"); - if (dev->state == COMP_STATE_RUNNING || - dev->state == COMP_STATE_DRAINING || - dev->state == COMP_STATE_PAUSED) { - comp_buffer_reset(dev); - dev->state = COMP_STATE_SETUP; - } - break; case COMP_CMD_PAUSE: - trace_src("EPe"); - /* only support pausing for running */ - if (dev->state == COMP_STATE_RUNNING) - dev->state = COMP_STATE_PAUSED; - - break; case COMP_CMD_RELEASE: - trace_src("ERl"); - dev->state = COMP_STATE_RUNNING; - break; default: - trace_src("EDf"); + ret = comp_set_state(dev, cmd); + break; } return ret; diff --git a/src/audio/host.c b/src/audio/host.c index e71e95f..f81fd66 100644 --- a/src/audio/host.c +++ b/src/audio/host.c @@ -553,28 +553,20 @@ static int host_cmd(struct comp_dev *dev, int cmd, void *data) // TODO: align cmd macros. switch (cmd) { - case COMP_CMD_PAUSE: - /* only support pausing for running, channel is paused by DAI */ - if (dev->state == COMP_STATE_RUNNING) - dev->state = COMP_STATE_PAUSED; - break; case COMP_CMD_STOP: if (dev->state == COMP_STATE_RUNNING || dev->state == COMP_STATE_DRAINING || dev->state == COMP_STATE_PAUSED) ret = host_stop(dev); break; - case COMP_CMD_RELEASE: - /* channel is released by DAI */ - dev->state = COMP_STATE_RUNNING; - break; - case COMP_CMD_START: - dev->state = COMP_STATE_RUNNING; - break; case COMP_CMD_SUSPEND: case COMP_CMD_RESUME: break; + case COMP_CMD_START: + case COMP_CMD_PAUSE: + case COMP_CMD_RELEASE: default: + ret = comp_set_state(dev, cmd); break; } diff --git a/src/audio/src.c b/src/audio/src.c index 0279841..0ecb48c 100644 --- a/src/audio/src.c +++ b/src/audio/src.c @@ -381,7 +381,7 @@ static int src_cmd(struct comp_dev *dev, int cmd, void *data) { trace_src("SCm"); struct comp_data *cd = comp_get_drvdata(dev); - int i; + int i, ret = 0; switch (cmd) { case COMP_CMD_SRC: @@ -400,35 +400,15 @@ static int src_cmd(struct comp_dev *dev, int cmd, void *data) break; case COMP_CMD_START: - trace_src("SSt"); - dev->state = COMP_STATE_RUNNING; - break; case COMP_CMD_STOP: - trace_src("SSp"); - if (dev->state == COMP_STATE_RUNNING || - dev->state == COMP_STATE_DRAINING || - dev->state == COMP_STATE_PAUSED) { - comp_buffer_reset(dev); - dev->state = COMP_STATE_SETUP; - } - break; case COMP_CMD_PAUSE: - trace_src("SPe"); - /* only support pausing for running */ - if (dev->state == COMP_STATE_RUNNING) - dev->state = COMP_STATE_PAUSED; - - break; case COMP_CMD_RELEASE: - trace_src("SRl"); - dev->state = COMP_STATE_RUNNING; - break; default: - trace_src("SDf"); + ret = comp_set_state(dev, cmd); break; } - return 0; + return ret; } /* copy and process stream data from source to sink buffers */ diff --git a/src/audio/tone.c b/src/audio/tone.c index cbc50ac..305563e 100644 --- a/src/audio/tone.c +++ b/src/audio/tone.c @@ -433,6 +433,7 @@ static int tone_cmd(struct comp_dev *dev, int cmd, void *data) { struct comp_data *cd = comp_get_drvdata(dev); struct sof_ipc_comp_tone *ct; + int ret = 0; trace_tone("tri"); @@ -456,36 +457,15 @@ static int tone_cmd(struct comp_dev *dev, int cmd, void *data) tonegen_unmute(&cd->sg); break; case COMP_CMD_START: - trace_tone("TSt"); - dev->state = COMP_STATE_RUNNING; - break; case COMP_CMD_STOP: - trace_tone("TSp"); - if (dev->state == COMP_STATE_RUNNING || - dev->state == COMP_STATE_DRAINING || - dev->state == COMP_STATE_PAUSED) { - comp_buffer_reset(dev); - dev->state = COMP_STATE_SETUP; - } - break; case COMP_CMD_PAUSE: - trace_tone("TPe"); - /* only support pausing for running */ - if (dev->state == COMP_STATE_RUNNING) - dev->state = COMP_STATE_PAUSED; - - break; case COMP_CMD_RELEASE: - trace_tone("TRl"); - dev->state = COMP_STATE_RUNNING; - break; default: - trace_tone("TDf"); - + ret = comp_set_state(dev, cmd); break; } - return 0; + return ret; } /* copy and process stream data from source to sink buffers */ diff --git a/src/audio/volume.c b/src/audio/volume.c index 93a3839..2e097d5 100644 --- a/src/audio/volume.c +++ b/src/audio/volume.c @@ -385,7 +385,7 @@ static int volume_cmd(struct comp_dev *dev, int cmd, void *data) { struct comp_data *cd = comp_get_drvdata(dev); struct sof_ipc_ctrl_values *cv; - int i, j; + int i, j, ret = 0; trace_volume("cmd"); @@ -425,29 +425,15 @@ static int volume_cmd(struct comp_dev *dev, int cmd, void *data) work_schedule_default(&cd->volwork, VOL_RAMP_US); break; case COMP_CMD_START: - dev->state = COMP_STATE_RUNNING; - break; case COMP_CMD_STOP: - if (dev->state == COMP_STATE_RUNNING || - dev->state == COMP_STATE_DRAINING || - dev->state == COMP_STATE_PAUSED) { - comp_buffer_reset(dev); - dev->state = COMP_STATE_SETUP; - } - break; case COMP_CMD_PAUSE: - /* only support pausing for running */ - if (dev->state == COMP_STATE_RUNNING) - dev->state = COMP_STATE_PAUSED; - break; case COMP_CMD_RELEASE: - dev->state = COMP_STATE_RUNNING; - break; default: + ret = comp_set_state(dev, cmd); break; } - return 0; + return ret; } /* copy and process stream data from source to sink buffers */ diff --git a/src/include/reef/audio/component.h b/src/include/reef/audio/component.h index e73a22a..cbd2356 100644 --- a/src/include/reef/audio/component.h +++ b/src/include/reef/audio/component.h @@ -215,6 +215,9 @@ static inline void comp_free(struct comp_dev *dev) dev->drv->ops.free(dev); } +/* component state set */ +int comp_set_state(struct comp_dev *dev, int cmd); + /* component parameter init - mandatory */ static inline int comp_params(struct comp_dev *dev) { -- 2.9.3
2 5
0 0
[Sound-open-firmware] [PATCH] alloc: Add support for allocating different types of memory from the heap
by Keyon Jie 04 Sep '17

04 Sep '17
To add support for different types of heap memory, here it will: 1. add handle for RFLAGS_DMA which will allocate DMA buffer blocks if exist; 2. refine free_block, which will free blocks of runtime heap, general buffer heap, or dma buffer heap. Signed-off-by: Keyon Jie <yang.jie(a)linux.intel.com> Tested-by: Zhang Keqiao <keqiao.zhang(a)intel.com> --- src/lib/alloc.c | 82 +++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 56 insertions(+), 26 deletions(-) diff --git a/src/lib/alloc.c b/src/lib/alloc.c index 86c2bc7..e28817b 100644 --- a/src/lib/alloc.c +++ b/src/lib/alloc.c @@ -334,20 +334,38 @@ found: /* free block(s) */ static void free_block(struct mm_heap *heap, void *ptr) { - struct block_map *map; + struct mm_heap * mm_heap; + struct block_map * block_map; struct block_hdr *hdr; - int i, block; + int i, block, array_size; /* sanity check */ if (ptr == NULL) return; + /* find mm_heap that ptr belongs to */ + if ((uint32_t)ptr >= memmap.runtime.heap && + (uint32_t)ptr < memmap.runtime.heap + memmap.runtime.size) { + mm_heap = &memmap.runtime; + array_size = ARRAY_SIZE(rt_heap_map); + } else if ((uint32_t)ptr >= memmap.buffer.heap && + (uint32_t)ptr < memmap.buffer.heap + memmap.buffer.size) { + mm_heap = &memmap.buffer; + array_size = ARRAY_SIZE(buf_heap_map); +#if (HEAP_DMA_BUFFER_SIZE > 0) + } else if ((uint32_t)ptr >= memmap.dma.heap && + (uint32_t)ptr < memmap.dma.heap + memmap.dma.size) { + mm_heap = &memmap.dma; + array_size = ARRAY_SIZE(dma_buf_heap_map); +#endif + } else + return; + /* find block that ptr belongs to */ - for (i = 0; i < ARRAY_SIZE(rt_heap_map) - 1; i ++) { + for (i = 0; i < array_size - 1; i ++) { /* is ptr in this block */ - if ((uint32_t)ptr >= rt_heap_map[i].base && - (uint32_t)ptr < rt_heap_map[i + 1].base) + if ((uint32_t)ptr < mm_heap->map[i + 1].base) goto found; } @@ -356,27 +374,29 @@ static void free_block(struct mm_heap *heap, void *ptr) return; found: + /* the block i is it */ + block_map = &mm_heap->map[i]; + /* calculate block header */ - map = &rt_heap_map[i]; - block = ((uint32_t)ptr - map->base) / map->block_size; - hdr = &map->block[block]; + block = ((uint32_t)ptr - block_map->base) / block_map->block_size; + hdr = &block_map->block[block]; /* free block header and continious blocks */ for (i = block; i < block + hdr->size; i++) { - hdr = &map->block[i]; + hdr = &block_map->block[i]; hdr->size = 0; hdr->flags = 0; - map->free_count++; - heap->info.used -= map->block_size; - heap->info.free += map->block_size; + block_map->free_count++; + heap->info.used -= block_map->block_size; + heap->info.free += block_map->block_size; } /* set first free */ - if (block < map->first_free) - map->first_free = block; + if (block < block_map->first_free) + block_map->first_free = block; #if DEBUG_BLOCK_FREE - alloc_memset_region(ptr, map->block_size * (i - 1), DEBUG_BLOCK_FREE_VALUE); + alloc_memset_region(ptr, block_map->block_size * (i - 1), DEBUG_BLOCK_FREE_VALUE); #endif } @@ -443,47 +463,57 @@ void *rzalloc(int zone, int bflags, size_t bytes) /* allocates continuous buffer on 1k boundary */ void *rballoc(int zone, int bflags, size_t bytes) { + struct block_map * block_map = buf_heap_map; + struct mm_heap * mm_heap = &memmap.buffer; + int i, array_size = ARRAY_SIZE(buf_heap_map); uint32_t flags; void *ptr = NULL; - int i; +#if (HEAP_DMA_BUFFER_SIZE > 0) + if (bflags & RFLAGS_DMA) { + mm_heap = &memmap.dma; + block_map = dma_buf_heap_map; + array_size = ARRAY_SIZE(dma_buf_heap_map); + } +#endif spin_lock_irq(&memmap.lock, flags); /* will request fit in single block */ - for (i = 0; i < ARRAY_SIZE(buf_heap_map); i++) { + for (i = 0; i < array_size; i++) { + trace_value(block_map[i].block_size); /* is block big enough */ - if (buf_heap_map[i].block_size < bytes) + if (block_map[i].block_size < bytes) continue; /* does block have free space */ - if (buf_heap_map[i].free_count == 0) + if (block_map[i].free_count == 0) continue; /* allocate block */ - ptr = alloc_block(&memmap.buffer, i, bflags); + ptr = alloc_block(mm_heap, i, bflags); goto out; } /* request spans > 1 block */ /* only 1 choice for block size */ - if (ARRAY_SIZE(buf_heap_map) == 1) { - ptr = alloc_cont_blocks(&memmap.buffer, 0, bflags, bytes); + if (array_size == 1) { + ptr = alloc_cont_blocks(mm_heap, 0, bflags, bytes); goto out; } else { /* find best block size for request */ - for (i = 0; i < ARRAY_SIZE(buf_heap_map); i++) { + for (i = 0; i < array_size; i++) { /* allocate is block size smaller than request */ - if (buf_heap_map[i].block_size < bytes) - alloc_cont_blocks(&memmap.buffer, i, bflags, + if (block_map[i].block_size < bytes) + alloc_cont_blocks(mm_heap, i, bflags, bytes); } } - ptr = alloc_cont_blocks(&memmap.buffer, ARRAY_SIZE(buf_heap_map) - 1, + ptr = alloc_cont_blocks(mm_heap, array_size - 1, bflags, bytes); out: -- 2.11.0
2 1
0 0
[Sound-open-firmware] [PATCH] sof: abi: Add component ABI header for host configuration
by Liam Girdwood 04 Sep '17

04 Sep '17
Add an ABI header to be pre-pended to all binary blobs or bespoke component data structures that will be passed from host to DSP component or vice versa (i.e via binary kcontrols). Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/include/uapi/Makefile.am | 3 ++- src/include/uapi/abi.h | 50 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 src/include/uapi/abi.h diff --git a/src/include/uapi/Makefile.am b/src/include/uapi/Makefile.am index b49560c..c4c2fe6 100644 --- a/src/include/uapi/Makefile.am +++ b/src/include/uapi/Makefile.am @@ -1,2 +1,3 @@ include_HEADERS = \ - ipc.h + ipc.h \ + abi.h diff --git a/src/include/uapi/abi.h b/src/include/uapi/abi.h new file mode 100644 index 0000000..66ec16a --- /dev/null +++ b/src/include/uapi/abi.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2016, Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Intel Corporation nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * Author: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> + */ + +#ifndef __INCLUDE_UAPI_ABI_H__ +#define __INCLUDE_UAPI_ABI_H__ + +#define SOF_ABI_VERSION 1 + +/* + * Header for all non IPC ABI data. Identifies data type, size and ABI. + * Used by any bespoke component data structures or binary blobs. + */ + +struct sof_abi_hdr { + char magic[4]; /* 'S', 'O', 'F', '\0' */ + uint32_t type; /* component specific type */ + uint32_t size; /* size in bytes of data excluding this struct */ + uint32_t abi; /* SOF ABI version */ + uint32_t comp_abi; /* component specific ABI version */ +} __attribute__((packed)); + +#endif + -- 2.11.0
1 0
0 0
[Sound-open-firmware] [PATCH 1/4] SRC: Bug fixes, add support for int16 coefficients, comments cleanup
by Seppo Ingalsuo 04 Sep '17

04 Sep '17
This patch fixes bugs in sink and source buffers handling and adds support for short coefficient type to save RAM in platforms with less space such as BYT. The patch introduces also a RAM saving minimum conversions set between 16, 44.1, and 48 kHz. A new possible rate 18.9 kHz was added to supported rates indication bits. SRC filters quality is also adjusted for lower default performance. The higher performance will need >16bit coefficients usage. The larger conversion set and 32 bit filter coefficients can be easily restored with the SRC tools in rimage. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo(a)linux.intel.com> --- src/audio/src.c | 62 +- src/audio/src_core.c | 67 +- src/audio/src_core.h | 11 + .../coefficients/src/src_int16_1_3_4375_5000.h | 251 +++++ .../coefficients/src/src_int16_20_21_4020_5000.h | 1066 ++++++++++++++++++++ .../coefficients/src/src_int16_21_20_4020_5000.h | 1056 +++++++++++++++++++ .../coefficients/src/src_int16_3_1_4375_5000.h | 252 +++++ .../coefficients/src/src_int16_7_8_4375_5000.h | 657 ++++++++++++ .../coefficients/src/src_int16_8_7_4375_5000.h | 662 ++++++++++++ .../reef/audio/coefficients/src/src_int16_define.h | 11 + .../reef/audio/coefficients/src/src_int16_table.h | 32 + 11 files changed, 4076 insertions(+), 51 deletions(-) create mode 100644 src/include/reef/audio/coefficients/src/src_int16_1_3_4375_5000.h create mode 100644 src/include/reef/audio/coefficients/src/src_int16_20_21_4020_5000.h create mode 100644 src/include/reef/audio/coefficients/src/src_int16_21_20_4020_5000.h create mode 100644 src/include/reef/audio/coefficients/src/src_int16_3_1_4375_5000.h create mode 100644 src/include/reef/audio/coefficients/src/src_int16_7_8_4375_5000.h create mode 100644 src/include/reef/audio/coefficients/src/src_int16_8_7_4375_5000.h create mode 100644 src/include/reef/audio/coefficients/src/src_int16_define.h create mode 100644 src/include/reef/audio/coefficients/src/src_int16_table.h diff --git a/src/audio/src.c b/src/audio/src.c index 074c041..0279841 100644 --- a/src/audio/src.c +++ b/src/audio/src.c @@ -60,7 +60,6 @@ struct comp_data { int scratch_length; uint32_t sink_rate; uint32_t source_rate; - //int32_t z[STAGE_BUF_SIZE]; void (*src_func)(struct comp_dev *dev, struct comp_buffer *source, struct comp_buffer *sink, @@ -117,8 +116,6 @@ static void fallback_s32(struct comp_dev *dev, { struct comp_data *cd = comp_get_drvdata(dev); - //int32_t *src = (int32_t*) source->r_ptr; - //int32_t *dest = (int32_t*) sink->w_ptr; int nch = dev->params.channels; int blk_in = cd->src[0].blk_in; int blk_out = cd->src[0].blk_out; @@ -253,7 +250,7 @@ static struct comp_dev *src_new(struct sof_ipc_comp *comp) { struct comp_dev *dev; struct sof_ipc_comp_src *src; - struct sof_ipc_comp_src *ipc_src = (struct sof_ipc_comp_src *)comp; + struct sof_ipc_comp_src *ipc_src = (struct sof_ipc_comp_src *) comp; struct comp_data *cd; int i; @@ -264,7 +261,7 @@ static struct comp_dev *src_new(struct sof_ipc_comp *comp) if (dev == NULL) return NULL; - src = (struct sof_ipc_comp_src *)&dev->comp; + src = (struct sof_ipc_comp_src *) &dev->comp; memcpy(src, ipc_src, sizeof(struct sof_ipc_comp_src)); cd = rzalloc(RZONE_RUNTIME, RFLAGS_NONE, sizeof(*cd)); @@ -312,7 +309,7 @@ static int src_params(struct comp_dev *dev) trace_src("par"); - /* EQ supports only S32_LE PCM format */ + /* SRC supports only S32_LE PCM format */ if (config->frame_fmt != SOF_IPC_FRAME_S32_LE) return -EINVAL; @@ -372,14 +369,9 @@ static int src_params(struct comp_dev *dev) break; } - /* Check that src blk_in and blk_out are less than params.period_frames. - * Return an error if the period is too short. - */ - if (src_polyphase_get_blk_in(&cd->src[0]) > dev->frames) - return -EINVAL; - - if (src_polyphase_get_blk_out(&cd->src[0]) > dev->frames) - return -EINVAL; + /* Need to compute this */ + dev->frame_bytes = + dev->params.sample_container_bytes * dev->params.channels; return 0; } @@ -389,15 +381,11 @@ static int src_cmd(struct comp_dev *dev, int cmd, void *data) { trace_src("SCm"); struct comp_data *cd = comp_get_drvdata(dev); -// struct sof_ipc_comp_src *cv; int i; switch (cmd) { case COMP_CMD_SRC: trace_src("SMa"); -// cv = (struct sof_ipc_comp_src *) data; -// cv->in_mask = src_input_rates(); -// cv->out_mask = src_output_rates(); break; case COMP_CMD_MUTE: trace_src("SMu"); @@ -447,11 +435,8 @@ static int src_cmd(struct comp_dev *dev, int cmd, void *data) static int src_copy(struct comp_dev *dev) { struct comp_data *cd = comp_get_drvdata(dev); - struct comp_buffer *source; - struct comp_buffer *sink; - uint32_t frames_source; - uint32_t frames_sink; - int need_source, need_sink, min_frames; + struct comp_buffer *source, *sink; + int need_source, need_sink, blk_in, blk_out, frames_source, frames_sink; trace_comp("SRC"); @@ -464,36 +449,23 @@ static int src_copy(struct comp_dev *dev) /* Check that source has enough frames available and sink enough * frames free. */ - frames_source = dev->frames; - frames_sink = dev->frames; - - min_frames = src_polyphase_get_blk_in(&cd->src[0]); - if (frames_source > min_frames) - need_source = frames_source * dev->frame_bytes; - else { - frames_source = min_frames; - need_source = min_frames * dev->frame_bytes; - } - - min_frames = src_polyphase_get_blk_out(&cd->src[0]); - if (frames_sink > min_frames) - need_sink = frames_sink * dev->frame_bytes; - else { - frames_sink = min_frames; - need_sink = min_frames * dev->frame_bytes; - } + blk_in = src_polyphase_get_blk_in(&cd->src[0]); + blk_out = src_polyphase_get_blk_out(&cd->src[0]); + frames_source = dev->frames * blk_in / blk_out; + frames_sink = frames_source * blk_out / blk_in; + need_source = frames_source * dev->frame_bytes; + need_sink = frames_sink * dev->frame_bytes; /* Run as many times as buffers allow */ while ((source->avail >= need_source) && (sink->free >= need_sink)) { /* Run src */ cd->src_func(dev, source, sink, frames_source, frames_sink); + /* calc new free and available */ + comp_update_buffer_consume(source, 0); + comp_update_buffer_produce(sink, 0); } - /* calc new free and available - offset calc by conversion func */ - comp_update_buffer_consume(source, 0); - comp_update_buffer_produce(sink, 0); - return 0; } diff --git a/src/audio/src_core.c b/src/audio/src_core.c index 7deae14..55f7062 100644 --- a/src/audio/src_core.c +++ b/src/audio/src_core.c @@ -45,14 +45,17 @@ #include "src_core.h" /* Include conversion tables */ +#if SRC_SHORT == 1 +#include <reef/audio/coefficients/src/src_int16_table.h> +#else #include <reef/audio/coefficients/src/src_int24_table.h> +#endif -#if 1 /* TODO: These should be defined somewhere else. */ -#define SOF_RATES_LENGTH 15 -int sof_rates[SOF_RATES_LENGTH] = {7350, 8000, 11025, 12000, 16000, 22050, - 24000, 32000, 44100, 48000, 64000, 88200, 96000, 176400, 192000}; -#endif +#define SOF_RATES_LENGTH 16 +int sof_rates[SOF_RATES_LENGTH] = {7350, 8000, 11025, 12000, 16000, 18900, + 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000, 176400, + 192000}; /* Calculates the needed FIR delay line length */ int src_fir_delay_length(struct src_stage *s) @@ -293,6 +296,23 @@ int src_polyphase_init(struct polyphase_src *src, int fs1, int fs2, return n_stages; } +#if SRC_SHORT == 1 + +/* Calculate a FIR filter part that does not need circular modification */ +static inline void fir_part(int64_t *y, int ntaps, const int16_t c[], int *ic, + int32_t d[], int *id) +{ + int64_t p; + int n; + + /* Data is Q1.31, coef is Q1.15, product is Q2.46 */ + for (n = 0; n < ntaps; n++) { + p = (int64_t) c[(*ic)++] * d[(*id)--]; + *y += p; + } +} +#else + /* Calculate a FIR filter part that does not need circular modification */ static inline void fir_part(int64_t *y, int ntaps, const int32_t c[], int *ic, int32_t d[], int *id) @@ -307,6 +327,40 @@ static inline void fir_part(int64_t *y, int ntaps, const int32_t c[], int *ic, *y += p; } } +#endif + +#if SRC_SHORT == 1 + +static inline int32_t fir_filter( + struct src_state *fir, const int16_t coefs[], + int *coefi, int filter_length, int shift) +{ + int64_t y = 0; + int n1; + int n2; + + n1 = fir->fir_ri + 1; + if (n1 > filter_length) { + /* No need to un-wrap fir read index, make sure fir_fi + * is ge 0 after FIR computation. + */ + fir_part(&y, filter_length, coefs, coefi, fir->fir_delay, + &fir->fir_ri); + } else { + n2 = filter_length - n1; + /* Part 1, loop n1 times, fir_ri becomes -1 */ + fir_part(&y, n1, coefs, coefi, fir->fir_delay, &fir->fir_ri); + + /* Part 2, unwrap fir_ri, continue rest of filter */ + fir->fir_ri = fir->fir_delay_size - 1; + fir_part(&y, n2, coefs, coefi, fir->fir_delay, &fir->fir_ri); + } + /* Q2.46 -> Q2.31, saturate to Q1.31 */ + y = y >> (15 + shift); + + return (int32_t) sat_int32(y); +} +#else static inline int32_t fir_filter( struct src_state *fir, const int32_t coefs[], @@ -335,8 +389,9 @@ static inline int32_t fir_filter( /* Q9.47 -> Q9.24, saturate to Q8.24 */ y = y >> (23 + shift); - return (int32_t)sat_int32(y); + return (int32_t) sat_int32(y); } +#endif void src_polyphase_stage_cir(struct src_stage_prm *s) { diff --git a/src/audio/src_core.h b/src/audio/src_core.h index 0444215..dae5e53 100644 --- a/src/audio/src_core.h +++ b/src/audio/src_core.h @@ -32,10 +32,17 @@ #ifndef SRC_CORE_H #define SRC_CORE_H +/* TODO: This should be made per platform configurable */ +#define SRC_SHORT 1 + #define MAX(a, b) (((a) > (b)) ? (a) : (b)) /* Include SRC min/max constants etc. */ +#if SRC_SHORT == 1 +#include <reef/audio/coefficients/src/src_int16_define.h> +#else #include <reef/audio/coefficients/src/src_int24_define.h> +#endif struct src_alloc { int fir_s1; @@ -57,7 +64,11 @@ struct src_stage { const int blk_out; const int halfband; const int shift; +#if SRC_SHORT == 1 + const int16_t *coefs; +#else const int32_t *coefs; +#endif }; struct src_state { diff --git a/src/include/reef/audio/coefficients/src/src_int16_1_3_4375_5000.h b/src/include/reef/audio/coefficients/src/src_int16_1_3_4375_5000.h new file mode 100644 index 0000000..34e177c --- /dev/null +++ b/src/include/reef/audio/coefficients/src/src_int16_1_3_4375_5000.h @@ -0,0 +1,251 @@ +const int16_t src_int16_1_3_4375_5000_fir[245] = { + 0, + 0, + -1, + 0, + 1, + 1, + 1, + -1, + -2, + -1, + 1, + 3, + 2, + 0, + -4, + -4, + 0, + 4, + 6, + 2, + -5, + -8, + -4, + 5, + 11, + 7, + -4, + -13, + -12, + 1, + 16, + 17, + 2, + -17, + -23, + -8, + 17, + 30, + 16, + -15, + -37, + -26, + 10, + 42, + 39, + -2, + -46, + -52, + -10, + 47, + 67, + 26, + -44, + -82, + -47, + 36, + 95, + 72, + -21, + -104, + -100, + -1, + 109, + 129, + 31, + -106, + -159, + -69, + 94, + 187, + 115, + -71, + -210, + -167, + 35, + 225, + 225, + 16, + -228, + -284, + -82, + 216, + 342, + 163, + -184, + -395, + -259, + 130, + 437, + 368, + -49, + -463, + -489, + -62, + 467, + 616, + 208, + -439, + -748, + -393, + 372, + 880, + 624, + -252, + -1007, + -914, + 60, + 1125, + 1285, + 240, + -1228, + -1791, + -720, + 1313, + 2565, + 1582, + -1377, + -4078, + -3627, + 1416, + 9650, + 17303, + 20414, + 17303, + 9650, + 1416, + -3627, + -4078, + -1377, + 1582, + 2565, + 1313, + -720, + -1791, + -1228, + 240, + 1285, + 1125, + 60, + -914, + -1007, + -252, + 624, + 880, + 372, + -393, + -748, + -439, + 208, + 616, + 467, + -62, + -489, + -463, + -49, + 368, + 437, + 130, + -259, + -395, + -184, + 163, + 342, + 216, + -82, + -284, + -228, + 16, + 225, + 225, + 35, + -167, + -210, + -71, + 115, + 187, + 94, + -69, + -159, + -106, + 31, + 129, + 109, + -1, + -100, + -104, + -21, + 72, + 95, + 36, + -47, + -82, + -44, + 26, + 67, + 47, + -10, + -52, + -46, + -2, + 39, + 42, + 10, + -26, + -37, + -15, + 16, + 30, + 17, + -8, + -23, + -17, + 2, + 17, + 16, + 1, + -12, + -13, + -4, + 7, + 11, + 5, + -4, + -8, + -5, + 2, + 6, + 4, + 0, + -4, + -4, + 0, + 2, + 3, + 1, + -1, + -2, + -1, + 1, + 1, + 1, + 0, + -1, + 0, + 0 + +}; +struct src_stage src_int16_1_3_4375_5000 = { + 1, 0, 1, 245, 245, 3, 1, 0, 1, + src_int16_1_3_4375_5000_fir}; diff --git a/src/include/reef/audio/coefficients/src/src_int16_20_21_4020_5000.h b/src/include/reef/audio/coefficients/src/src_int16_20_21_4020_5000.h new file mode 100644 index 0000000..51aade7 --- /dev/null +++ b/src/include/reef/audio/coefficients/src/src_int16_20_21_4020_5000.h @@ -0,0 +1,1066 @@ +const int16_t src_int16_20_21_4020_5000_fir[1060] = { + 1, + -2, + 2, + 1, + -8, + 19, + -34, + 46, + -47, + 28, + 20, + -96, + 188, + -274, + 316, + -277, + 125, + 150, + -525, + 939, + -1288, + 1439, + -1233, + 472, + 1182, + -4843, + 21640, + 18847, + -5651, + 2095, + -277, + -717, + 1157, + -1205, + 997, + -663, + 311, + -18, + -175, + 261, + -260, + 203, + -125, + 51, + 3, + -31, + 38, + -32, + 21, + -10, + 3, + 0, + -1, + 1, + -2, + 2, + 0, + -6, + 18, + -34, + 49, + -54, + 40, + 3, + -78, + 175, + -273, + 336, + -323, + 197, + 61, + -439, + 882, + -1296, + 1547, + -1470, + 856, + 658, + -4253, + 22894, + 17336, + -5873, + 2472, + -629, + -447, + 989, + -1132, + 999, + -713, + 382, + -88, + -120, + 228, + -247, + 205, + -135, + 64, + -9, + -23, + 34, + -31, + 21, + -11, + 4, + 0, + -1, + 1, + -2, + 3, + -2, + -4, + 16, + -33, + 51, + -61, + 52, + -14, + -58, + 159, + -268, + 351, + -364, + 266, + -30, + -343, + 808, + -1280, + 1629, + -1687, + 1237, + 97, + -3539, + 24033, + 15769, + -5978, + 2790, + -960, + -177, + 807, + -1040, + 983, + -749, + 444, + -155, + -64, + 191, + -229, + 203, + -143, + 76, + -21, + -14, + 29, + -29, + 21, + -12, + 5, + -1, + -1, + 1, + -3, + 4, + -3, + -2, + 14, + -32, + 52, + -66, + 63, + -32, + -37, + 139, + -257, + 359, + -400, + 333, + -123, + -238, + 718, + -1241, + 1683, + -1879, + 1608, + -491, + -2701, + 25047, + 14163, + -5972, + 3046, + -1263, + 89, + 616, + -932, + 950, + -771, + 497, + -217, + -9, + 151, + -208, + 198, + -148, + 86, + -32, + -5, + 23, + -26, + 20, + -12, + 5, + -1, + 0, + 1, + -3, + 4, + -4, + 0, + 11, + -29, + 52, + -70, + 74, + -49, + -14, + 115, + -241, + 361, + -428, + 394, + -215, + -127, + 613, + -1178, + 1708, + -2042, + 1962, + -1097, + -1745, + 25925, + 12534, + -5861, + 3238, + -1534, + 347, + 417, + -810, + 900, + -778, + 540, + -274, + 46, + 109, + -183, + 189, + -151, + 95, + -41, + 3, + 18, + -23, + 19, + -12, + 6, + -2, + 0, + 1, + -3, + 5, + -6, + 2, + 8, + -27, + 51, + -74, + 83, + -66, + 10, + 90, + -221, + 356, + -450, + 450, + -306, + -11, + 494, + -1092, + 1703, + -2173, + 2293, + -1713, + -675, + 26656, + 10897, + -5655, + 3365, + -1770, + 591, + 216, + -676, + 836, + -771, + 573, + -326, + 98, + 67, + -156, + 177, + -150, + 101, + -50, + 11, + 12, + -20, + 18, + -12, + 6, + -2, + 0, + 1, + -3, + 5, + -7, + 4, + 5, + -23, + 49, + -76, + 92, + -82, + 33, + 62, + -196, + 344, + -464, + 498, + -393, + 108, + 364, + -984, + 1666, + -2267, + 2593, + -2327, + 502, + 27233, + 9269, + -5360, + 3428, + -1968, + 819, + 16, + -532, + 757, + -751, + 594, + -370, + 148, + 24, + -127, + 162, + -147, + 106, + -58, + 19, + 6, + -16, + 17, + -12, + 6, + -2, + 0, + 1, + -3, + 6, + -8, + 6, + 2, + -20, + 46, + -76, + 98, + -97, + 57, + 32, + -167, + 326, + -469, + 539, + -475, + 228, + 224, + -856, + 1597, + -2323, + 2856, + -2928, + 1779, + 27649, + 7665, + -4988, + 3428, + -2124, + 1027, + -180, + -383, + 667, + -718, + 604, + -406, + 194, + -18, + -96, + 145, + -142, + 108, + -64, + 26, + 0, + -13, + 15, + -12, + 7, + -3, + 1, + 1, + -3, + 6, + -9, + 9, + -2, + -15, + 42, + -75, + 104, + -111, + 81, + 0, + -134, + 302, + -466, + 570, + -550, + 345, + 76, + -709, + 1498, + -2337, + 3076, + -3506, + 3145, + 27901, + 6101, + -4547, + 3367, + -2238, + 1211, + -368, + -230, + 567, + -672, + 604, + -435, + 235, + -59, + -64, + 125, + -134, + 109, + -70, + 32, + -5, + -9, + 13, + -11, + 7, + -3, + 1, + 1, + -3, + 6, + -10, + 11, + -5, + -10, + 38, + -73, + 107, + -123, + 104, + -32, + -98, + 271, + -455, + 592, + -616, + 459, + -76, + -546, + 1368, + -2309, + 3248, + -4050, + 4589, + 27985, + 4589, + -4050, + 3248, + -2309, + 1368, + -546, + -76, + 459, + -616, + 592, + -455, + 271, + -98, + -32, + 104, + -123, + 107, + -73, + 38, + -10, + -5, + 11, + -10, + 6, + -3, + 1, + 1, + -3, + 7, + -11, + 13, + -9, + -5, + 32, + -70, + 109, + -134, + 125, + -64, + -59, + 235, + -435, + 604, + -672, + 567, + -230, + -368, + 1211, + -2238, + 3367, + -4547, + 6101, + 27901, + 3145, + -3506, + 3076, + -2337, + 1498, + -709, + 76, + 345, + -550, + 570, + -466, + 302, + -134, + 0, + 81, + -111, + 104, + -75, + 42, + -15, + -2, + 9, + -9, + 6, + -3, + 1, + 1, + -3, + 7, + -12, + 15, + -13, + 0, + 26, + -64, + 108, + -142, + 145, + -96, + -18, + 194, + -406, + 604, + -718, + 667, + -383, + -180, + 1027, + -2124, + 3428, + -4988, + 7665, + 27649, + 1779, + -2928, + 2856, + -2323, + 1597, + -856, + 224, + 228, + -475, + 539, + -469, + 326, + -167, + 32, + 57, + -97, + 98, + -76, + 46, + -20, + 2, + 6, + -8, + 6, + -3, + 1, + 0, + -2, + 6, + -12, + 17, + -16, + 6, + 19, + -58, + 106, + -147, + 162, + -127, + 24, + 148, + -370, + 594, + -751, + 757, + -532, + 16, + 819, + -1968, + 3428, + -5360, + 9269, + 27233, + 502, + -2327, + 2593, + -2267, + 1666, + -984, + 364, + 108, + -393, + 498, + -464, + 344, + -196, + 62, + 33, + -82, + 92, + -76, + 49, + -23, + 5, + 4, + -7, + 5, + -3, + 1, + 0, + -2, + 6, + -12, + 18, + -20, + 12, + 11, + -50, + 101, + -150, + 177, + -156, + 67, + 98, + -326, + 573, + -771, + 836, + -676, + 216, + 591, + -1770, + 3365, + -5655, + 10897, + 26656, + -675, + -1713, + 2293, + -2173, + 1703, + -1092, + 494, + -11, + -306, + 450, + -450, + 356, + -221, + 90, + 10, + -66, + 83, + -74, + 51, + -27, + 8, + 2, + -6, + 5, + -3, + 1, + 0, + -2, + 6, + -12, + 19, + -23, + 18, + 3, + -41, + 95, + -151, + 189, + -183, + 109, + 46, + -274, + 540, + -778, + 900, + -810, + 417, + 347, + -1534, + 3238, + -5861, + 12534, + 25925, + -1745, + -1097, + 1962, + -2042, + 1708, + -1178, + 613, + -127, + -215, + 394, + -428, + 361, + -241, + 115, + -14, + -49, + 74, + -70, + 52, + -29, + 11, + 0, + -4, + 4, + -3, + 1, + 0, + -1, + 5, + -12, + 20, + -26, + 23, + -5, + -32, + 86, + -148, + 198, + -208, + 151, + -9, + -217, + 497, + -771, + 950, + -932, + 616, + 89, + -1263, + 3046, + -5972, + 14163, + 25047, + -2701, + -491, + 1608, + -1879, + 1683, + -1241, + 718, + -238, + -123, + 333, + -400, + 359, + -257, + 139, + -37, + -32, + 63, + -66, + 52, + -32, + 14, + -2, + -3, + 4, + -3, + 1, + -1, + -1, + 5, + -12, + 21, + -29, + 29, + -14, + -21, + 76, + -143, + 203, + -229, + 191, + -64, + -155, + 444, + -749, + 983, + -1040, + 807, + -177, + -960, + 2790, + -5978, + 15769, + 24033, + -3539, + 97, + 1237, + -1687, + 1629, + -1280, + 808, + -343, + -30, + 266, + -364, + 351, + -268, + 159, + -58, + -14, + 52, + -61, + 51, + -33, + 16, + -4, + -2, + 3, + -2, + 1, + -1, + 0, + 4, + -11, + 21, + -31, + 34, + -23, + -9, + 64, + -135, + 205, + -247, + 228, + -120, + -88, + 382, + -713, + 999, + -1132, + 989, + -447, + -629, + 2472, + -5873, + 17336, + 22894, + -4253, + 658, + 856, + -1470, + 1547, + -1296, + 882, + -439, + 61, + 197, + -323, + 336, + -273, + 175, + -78, + 3, + 40, + -54, + 49, + -34, + 18, + -6, + 0, + 2, + -2, + 1, + -1, + 0, + 3, + -10, + 21, + -32, + 38, + -31, + 3, + 51, + -125, + 203, + -260, + 261, + -175, + -18, + 311, + -663, + 997, + -1205, + 1157, + -717, + -277, + 2095, + -5651, + 18847, + 21640, + -4843, + 1182, + 472, + -1233, + 1439, + -1288, + 939, + -525, + 150, + 125, + -277, + 316, + -274, + 188, + -96, + 20, + 28, + -47, + 46, + -34, + 19, + -8, + 1, + 2, + -2, + 1, + -1, + 1, + 2, + -9, + 20, + -33, + 43, + -39, + 15, + 36, + -111, + 198, + -269, + 291, + -228, + 53, + 233, + -600, + 977, + -1257, + 1308, + -980, + 93, + 1663, + -5309, + 20286, + 20286, + -5309, + 1663, + 93, + -980, + 1308, + -1257, + 977, + -600, + 233, + 53, + -228, + 291, + -269, + 198, + -111, + 36, + 15, + -39, + 43, + -33, + 20, + -9, + 2, + 1, + -1, + 0 + +}; +struct src_stage src_int16_20_21_4020_5000 = { + 1, 1, 20, 53, 1060, 21, 20, 0, 0, + src_int16_20_21_4020_5000_fir}; diff --git a/src/include/reef/audio/coefficients/src/src_int16_21_20_4020_5000.h b/src/include/reef/audio/coefficients/src/src_int16_21_20_4020_5000.h new file mode 100644 index 0000000..678ed4f --- /dev/null +++ b/src/include/reef/audio/coefficients/src/src_int16_21_20_4020_5000.h @@ -0,0 +1,1056 @@ +const int16_t src_int16_21_20_4020_5000_fir[1050] = { + 1, + -3, + 5, + -9, + 11, + -9, + 0, + 19, + -51, + 96, + -151, + 208, + -253, + 270, + -235, + 130, + 64, + -357, + 750, + -1232, + 1783, + -2376, + 2996, + -3680, + 4818, + 29296, + 1867, + -2442, + 2405, + -2140, + 1762, + -1339, + 921, + -547, + 243, + -19, + -124, + 196, + -213, + 193, + -153, + 107, + -65, + 32, + -10, + -2, + 6, + -6, + 5, + -2, + 1, + -3, + 6, + -9, + 13, + -13, + 6, + 11, + -42, + 87, + -146, + 210, + -267, + 300, + -287, + 204, + -31, + -248, + 640, + -1142, + 1744, + -2434, + 3227, + -4251, + 6405, + 29032, + 527, + -1798, + 2058, + -1969, + 1705, + -1355, + 980, + -626, + 324, + -91, + -66, + 155, + -188, + 181, + -150, + 109, + -70, + 38, + -15, + 2, + 4, + -5, + 4, + -2, + 1, + -3, + 6, + -10, + 14, + -16, + 12, + 3, + -32, + 77, + -138, + 208, + -277, + 326, + -335, + 276, + -128, + -132, + 516, + -1030, + 1672, + -2450, + 3408, + -4773, + 8048, + 28594, + -709, + -1152, + 1686, + -1768, + 1619, + -1346, + 1020, + -691, + 397, + -160, + -9, + 113, + -160, + 166, + -144, + 110, + -73, + 42, + -19, + 5, + 2, + -4, + 3, + -2, + 1, + -3, + 6, + -11, + 16, + -20, + 17, + -5, + -21, + 65, + -127, + 202, + -281, + 347, + -377, + 345, + -224, + -11, + 380, + -895, + 1568, + -2421, + 3532, + -5235, + 9732, + 27989, + -1832, + -515, + 1297, + -1541, + 1506, + -1314, + 1041, + -743, + 462, + -225, + 47, + 69, + -130, + 148, + -136, + 108, + -76, + 46, + -23, + 8, + 0, + -3, + 3, + -2, + 1, + -3, + 6, + -11, + 18, + -23, + 23, + -14, + -9, + 51, + -113, + 193, + -281, + 362, + -414, + 409, + -318, + 113, + 233, + -742, + 1433, + -2346, + 3596, + -5626, + 11441, + 27221, + -2836, + 102, + 898, + -1292, + 1369, + -1259, + 1043, + -780, + 517, + -284, + 102, + 25, + -98, + 128, + -125, + 105, + -76, + 49, + -26, + 11, + -2, + -2, + 2, + -2, + 1, + -2, + 6, + -12, + 19, + -26, + 28, + -23, + 3, + 36, + -97, + 179, + -275, + 370, + -443, + 467, + -409, + 237, + 80, + -571, + 1268, + -2227, + 3596, + -5935, + 13160, + 26300, + -3715, + 690, + 495, + -1027, + 1211, + -1183, + 1026, + -802, + 561, + -337, + 153, + -18, + -66, + 106, + -113, + 99, + -76, + 51, + -29, + 13, + -4, + 0, + 2, + -1, + 0, + -2, + 6, + -12, + 20, + -28, + 34, + -31, + 15, + 20, + -79, + 162, + -264, + 372, + -466, + 517, + -494, + 360, + -79, + -385, + 1075, + -2063, + 3531, + -6153, + 14870, + 25235, + -4465, + 1240, + 97, + -751, + 1035, + -1087, + 991, + -810, + 595, + -383, + 200, + -60, + -32, + 83, + -99, + 93, + -74, + 51, + -31, + 16, + -6, + 1, + 1, + -1, + 0, + -2, + 5, + -12, + 20, + -30, + 38, + -39, + 28, + 3, + -59, + 142, + -248, + 367, + -480, + 559, + -572, + 479, + -240, + -189, + 858, + -1856, + 3397, + -6268, + 16557, + 24038, + -5085, + 1745, + -290, + -469, + 845, + -974, + 939, + -803, + 617, + -421, + 243, + -100, + 0, + 59, + -84, + 84, + -71, + 51, + -32, + 17, + -7, + 2, + 0, + -1, + 0, + -2, + 5, + -11, + 20, + -32, + 42, + -47, + 40, + -14, + -37, + 118, + -227, + 355, + -486, + 592, + -641, + 592, + -400, + 16, + 619, + -1609, + 3196, + -6275, + 18202, + 22722, + -5573, + 2198, + -660, + -186, + 644, + -846, + 872, + -782, + 628, + -450, + 280, + -138, + 32, + 34, + -67, + 75, + -66, + 50, + -33, + 19, + -9, + 3, + 0, + 0, + 0, + -1, + 4, + -11, + 20, + -33, + 46, + -54, + 52, + -32, + -14, + 92, + -201, + 337, + -483, + 615, + -700, + 696, + -556, + 226, + 363, + -1324, + 2927, + -6165, + 19788, + 21300, + -5932, + 2594, + -1006, + 93, + 437, + -706, + 790, + -747, + 627, + -471, + 312, + -172, + 63, + 10, + -50, + 64, + -61, + 48, + -33, + 20, + -10, + 4, + -1, + 0, + 0, + -1, + 4, + -10, + 20, + -33, + 48, + -61, + 64, + -50, + 10, + 63, + -172, + 312, + -471, + 627, + -747, + 790, + -706, + 437, + 93, + -1006, + 2594, + -5932, + 21300, + 19788, + -6165, + 2927, + -1324, + 363, + 226, + -556, + 696, + -700, + 615, + -483, + 337, + -201, + 92, + -14, + -32, + 52, + -54, + 46, + -33, + 20, + -11, + 4, + -1, + 0, + 0, + 0, + 3, + -9, + 19, + -33, + 50, + -66, + 75, + -67, + 34, + 32, + -138, + 280, + -450, + 628, + -782, + 872, + -846, + 644, + -186, + -660, + 2198, + -5573, + 22722, + 18202, + -6275, + 3196, + -1609, + 619, + 16, + -400, + 592, + -641, + 592, + -486, + 355, + -227, + 118, + -37, + -14, + 40, + -47, + 42, + -32, + 20, + -11, + 5, + -2, + 0, + -1, + 0, + 2, + -7, + 17, + -32, + 51, + -71, + 84, + -84, + 59, + 0, + -100, + 243, + -421, + 617, + -803, + 939, + -974, + 845, + -469, + -290, + 1745, + -5085, + 24038, + 16557, + -6268, + 3397, + -1856, + 858, + -189, + -240, + 479, + -572, + 559, + -480, + 367, + -248, + 142, + -59, + 3, + 28, + -39, + 38, + -30, + 20, + -12, + 5, + -2, + 0, + -1, + 1, + 1, + -6, + 16, + -31, + 51, + -74, + 93, + -99, + 83, + -32, + -60, + 200, + -383, + 595, + -810, + 991, + -1087, + 1035, + -751, + 97, + 1240, + -4465, + 25235, + 14870, + -6153, + 3531, + -2063, + 1075, + -385, + -79, + 360, + -494, + 517, + -466, + 372, + -264, + 162, + -79, + 20, + 15, + -31, + 34, + -28, + 20, + -12, + 6, + -2, + 0, + -1, + 2, + 0, + -4, + 13, + -29, + 51, + -76, + 99, + -113, + 106, + -66, + -18, + 153, + -337, + 561, + -802, + 1026, + -1183, + 1211, + -1027, + 495, + 690, + -3715, + 26300, + 13160, + -5935, + 3596, + -2227, + 1268, + -571, + 80, + 237, + -409, + 467, + -443, + 370, + -275, + 179, + -97, + 36, + 3, + -23, + 28, + -26, + 19, + -12, + 6, + -2, + 1, + -2, + 2, + -2, + -2, + 11, + -26, + 49, + -76, + 105, + -125, + 128, + -98, + 25, + 102, + -284, + 517, + -780, + 1043, + -1259, + 1369, + -1292, + 898, + 102, + -2836, + 27221, + 11441, + -5626, + 3596, + -2346, + 1433, + -742, + 233, + 113, + -318, + 409, + -414, + 362, + -281, + 193, + -113, + 51, + -9, + -14, + 23, + -23, + 18, + -11, + 6, + -3, + 1, + -2, + 3, + -3, + 0, + 8, + -23, + 46, + -76, + 108, + -136, + 148, + -130, + 69, + 47, + -225, + 462, + -743, + 1041, + -1314, + 1506, + -1541, + 1297, + -515, + -1832, + 27989, + 9732, + -5235, + 3532, + -2421, + 1568, + -895, + 380, + -11, + -224, + 345, + -377, + 347, + -281, + 202, + -127, + 65, + -21, + -5, + 17, + -20, + 16, + -11, + 6, + -3, + 1, + -2, + 3, + -4, + 2, + 5, + -19, + 42, + -73, + 110, + -144, + 166, + -160, + 113, + -9, + -160, + 397, + -691, + 1020, + -1346, + 1619, + -1768, + 1686, + -1152, + -709, + 28594, + 8048, + -4773, + 3408, + -2450, + 1672, + -1030, + 516, + -132, + -128, + 276, + -335, + 326, + -277, + 208, + -138, + 77, + -32, + 3, + 12, + -16, + 14, + -10, + 6, + -3, + 1, + -2, + 4, + -5, + 4, + 2, + -15, + 38, + -70, + 109, + -150, + 181, + -188, + 155, + -66, + -91, + 324, + -626, + 980, + -1355, + 1705, + -1969, + 2058, + -1798, + 527, + 29032, + 6405, + -4251, + 3227, + -2434, + 1744, + -1142, + 640, + -248, + -31, + 204, + -287, + 300, + -267, + 210, + -146, + 87, + -42, + 11, + 6, + -13, + 13, + -9, + 6, + -3, + 1, + -2, + 5, + -6, + 6, + -2, + -10, + 32, + -65, + 107, + -153, + 193, + -213, + 196, + -124, + -19, + 243, + -547, + 921, + -1339, + 1762, + -2140, + 2405, + -2442, + 1867, + 29296, + 4818, + -3680, + 2996, + -2376, + 1783, + -1232, + 750, + -357, + 64, + 130, + -235, + 270, + -253, + 208, + -151, + 96, + -51, + 19, + 0, + -9, + 11, + -9, + 5, + -3, + 1, + -3, + 5, + -8, + 8, + -5, + -5, + 26, + -58, + 102, + -153, + 202, + -235, + 235, + -181, + 55, + 156, + -457, + 844, + -1298, + 1788, + -2277, + 2720, + -3073, + 3302, + 29385, + 3302, + -3073, + 2720, + -2277, + 1788, + -1298, + 844, + -457, + 156, + 55, + -181, + 235, + -235, + 202, + -153, + 102, + -58, + 26, + -5, + -5, + 8, + -8, + 5, + -3, + 0 + +}; +struct src_stage src_int16_21_20_4020_5000 = { + 19, 20, 21, 50, 1050, 20, 21, 0, 0, + src_int16_21_20_4020_5000_fir}; diff --git a/src/include/reef/audio/coefficients/src/src_int16_3_1_4375_5000.h b/src/include/reef/audio/coefficients/src/src_int16_3_1_4375_5000.h new file mode 100644 index 0000000..a8d5813 --- /dev/null +++ b/src/include/reef/audio/coefficients/src/src_int16_3_1_4375_5000.h @@ -0,0 +1,252 @@ +const int16_t src_int16_3_1_4375_5000_fir[246] = { + 0, + -1, + 2, + -3, + 4, + -7, + 9, + -11, + 13, + -15, + 14, + -12, + 7, + 2, + -15, + 33, + -55, + 82, + -112, + 143, + -175, + 204, + -226, + 239, + -237, + 218, + -176, + 108, + -11, + -118, + 281, + -478, + 711, + -979, + 1286, + -1636, + 2044, + -2544, + 3231, + -4424, + 8001, + 29412, + -2495, + 372, + 409, + -786, + 974, + -1051, + 1053, + -1004, + 919, + -810, + 688, + -560, + 434, + -316, + 209, + -117, + 41, + 18, + -61, + 90, + -106, + 111, + -107, + 98, + -85, + 70, + -55, + 41, + -28, + 18, + -10, + 4, + 0, + -2, + 3, + -3, + 3, + -2, + 2, + -1, + 0, + 0, + 0, + -1, + 2, + -4, + 7, + -11, + 16, + -22, + 29, + -35, + 41, + -44, + 45, + -40, + 30, + -13, + -12, + 46, + -89, + 140, + -198, + 260, + -323, + 384, + -436, + 473, + -489, + 477, + -428, + 333, + -183, + -36, + 339, + -755, + 1332, + -2180, + 3582, + -6592, + 20737, + 20737, + -6592, + 3582, + -2180, + 1332, + -755, + 339, + -36, + -183, + 333, + -428, + 477, + -489, + 473, + -436, + 384, + -323, + 260, + -198, + 140, + -89, + 46, + -12, + -13, + 30, + -40, + 45, + -44, + 41, + -35, + 29, + -22, + 16, + -11, + 7, + -4, + 2, + -1, + 0, + 0, + 0, + -1, + 2, + -2, + 3, + -3, + 3, + -2, + 0, + 4, + -10, + 18, + -28, + 41, + -55, + 70, + -85, + 98, + -107, + 111, + -106, + 90, + -61, + 18, + 41, + -117, + 209, + -316, + 434, + -560, + 688, + -810, + 919, + -1004, + 1053, + -1051, + 974, + -786, + 409, + 372, + -2495, + 29412, + 8001, + -4424, + 3231, + -2544, + 2044, + -1636, + 1286, + -979, + 711, + -478, + 281, + -118, + -11, + 108, + -176, + 218, + -237, + 239, + -226, + 204, + -175, + 143, + -112, + 82, + -55, + 33, + -15, + 2, + 7, + -12, + 14, + -15, + 13, + -11, + 9, + -7, + 4, + -3, + 2, + -1, + 0 + +}; +struct src_stage src_int16_3_1_4375_5000 = { + 0, 1, 3, 82, 246, 1, 3, 0, 0, + src_int16_3_1_4375_5000_fir}; diff --git a/src/include/reef/audio/coefficients/src/src_int16_7_8_4375_5000.h b/src/include/reef/audio/coefficients/src/src_int16_7_8_4375_5000.h new file mode 100644 index 0000000..4b0eb73 --- /dev/null +++ b/src/include/reef/audio/coefficients/src/src_int16_7_8_4375_5000.h @@ -0,0 +1,657 @@ +const int16_t src_int16_7_8_4375_5000_fir[651] = { + 0, + 0, + 0, + -2, + 4, + -5, + 4, + 0, + -7, + 14, + -19, + 16, + -5, + -14, + 36, + -50, + 49, + -25, + -17, + 68, + -108, + 117, + -81, + 0, + 106, + -200, + 242, + -199, + 66, + 130, + -329, + 452, + -431, + 235, + 106, + -502, + 816, + -902, + 656, + -61, + -786, + 1673, + -2295, + 2280, + -1124, + -2459, + 23097, + 16168, + -5503, + 1769, + 321, + -1397, + 1681, + -1391, + 780, + -103, + -434, + 711, + -708, + 489, + -168, + -135, + 332, + -384, + 307, + -151, + -18, + 144, + -198, + 178, + -108, + 20, + 52, + -91, + 91, + -63, + 23, + 13, + -35, + 39, + -30, + 15, + 0, + -10, + 13, + -11, + 6, + -1, + -2, + 3, + -2, + 1, + 0, + -1, + 1, + 0, + -1, + 3, + -5, + 6, + -3, + -3, + 12, + -19, + 22, + -15, + -2, + 26, + -48, + 59, + -48, + 13, + 41, + -96, + 130, + -121, + 61, + 43, + -160, + 247, + -260, + 174, + 4, + -229, + 425, + -508, + 414, + -132, + -282, + 706, + -980, + 952, + -531, + -271, + 1315, + -2341, + 2983, + -2730, + 328, + 25336, + 12012, + -5744, + 2742, + -665, + -691, + 1357, + -1419, + 1047, + -464, + -112, + 517, + -672, + 587, + -340, + 42, + 205, + -337, + 336, + -231, + 78, + 66, + -157, + 179, + -141, + 67, + 9, + -64, + 85, + -74, + 43, + -8, + -20, + 33, + -32, + 21, + -7, + -4, + 10, + -11, + 8, + -3, + 0, + 2, + -2, + 1, + -1, + -1, + 1, + -1, + 0, + 3, + -6, + 7, + -6, + 1, + 8, + -18, + 25, + -24, + 11, + 12, + -40, + 62, + -65, + 42, + 7, + -70, + 125, + -147, + 116, + -28, + -97, + 219, + -288, + 263, + -128, + -95, + 341, + -520, + 544, + -361, + -15, + 496, + -929, + 1132, + -951, + 308, + 756, + -2069, + 3342, + -4177, + 3814, + 26503, + 7795, + -5248, + 3273, + -1492, + 59, + 876, + -1263, + 1168, + -751, + 212, + 263, + -550, + 605, + -462, + 208, + 56, + -247, + 320, + -279, + 160, + -18, + -98, + 157, + -154, + 104, + -34, + -30, + 67, + -74, + 56, + -26, + -4, + 24, + -30, + 25, + -14, + 2, + 6, + -9, + 8, + -5, + 1, + 1, + -2, + 1, + -1, + -1, + 1, + -2, + 1, + 1, + -5, + 8, + -9, + 6, + 2, + -14, + 25, + -30, + 24, + -4, + -26, + 56, + -74, + 67, + -30, + -34, + 104, + -154, + 157, + -98, + -18, + 160, + -279, + 320, + -247, + 56, + 208, + -462, + 605, + -550, + 263, + 212, + -751, + 1168, + -1263, + 876, + 59, + -1492, + 3273, + -5248, + 7795, + 26503, + 3814, + -4177, + 3342, + -2069, + 756, + 308, + -951, + 1132, + -929, + 496, + -15, + -361, + 544, + -520, + 341, + -95, + -128, + 263, + -288, + 219, + -97, + -28, + 116, + -147, + 125, + -70, + 7, + 42, + -65, + 62, + -40, + 12, + 11, + -24, + 25, + -18, + 8, + 1, + -6, + 7, + -6, + 3, + 0, + -1, + 1, + -1, + -1, + 1, + -2, + 2, + 0, + -3, + 8, + -11, + 10, + -4, + -7, + 21, + -32, + 33, + -20, + -8, + 43, + -74, + 85, + -64, + 9, + 67, + -141, + 179, + -157, + 66, + 78, + -231, + 336, + -337, + 205, + 42, + -340, + 587, + -672, + 517, + -112, + -464, + 1047, + -1419, + 1357, + -691, + -665, + 2742, + -5744, + 12012, + 25336, + 328, + -2730, + 2983, + -2341, + 1315, + -271, + -531, + 952, + -980, + 706, + -282, + -132, + 414, + -508, + 425, + -229, + 4, + 174, + -260, + 247, + -160, + 43, + 61, + -121, + 130, + -96, + 41, + 13, + -48, + 59, + -48, + 26, + -2, + -15, + 22, + -19, + 12, + -3, + -3, + 6, + -5, + 3, + -1, + 0, + 1, + -1, + 0, + 1, + -2, + 3, + -2, + -1, + 6, + -11, + 13, + -10, + 0, + 15, + -30, + 39, + -35, + 13, + 23, + -63, + 91, + -91, + 52, + 20, + -108, + 178, + -198, + 144, + -18, + -151, + 307, + -384, + 332, + -135, + -168, + 489, + -708, + 711, + -434, + -103, + 780, + -1391, + 1681, + -1397, + 321, + 1769, + -5503, + 16168, + 23097, + -2459, + -1124, + 2280, + -2295, + 1673, + -786, + -61, + 656, + -902, + 816, + -502, + 106, + 235, + -431, + 452, + -329, + 130, + 66, + -199, + 242, + -200, + 106, + 0, + -81, + 117, + -108, + 68, + -17, + -25, + 49, + -50, + 36, + -14, + -5, + 16, + -19, + 14, + -7, + 0, + 4, + -5, + 4, + -2, + 0, + 0, + 0, + 0, + 1, + -2, + 4, + -3, + 1, + 4, + -10, + 15, + -15, + 9, + 6, + -24, + 40, + -45, + 32, + -1, + -44, + 86, + -106, + 90, + -31, + -59, + 153, + -213, + 206, + -114, + -48, + 236, + -382, + 418, + -300, + 32, + 322, + -650, + 816, + -710, + 288, + 395, + -1173, + 1796, + -1960, + 1348, + 436, + -4418, + 19959, + 19959, + -4418, + 436, + 1348, + -1960, + 1796, + -1173, + 395, + 288, + -710, + 816, + -650, + 322, + 32, + -300, + 418, + -382, + 236, + -48, + -114, + 206, + -213, + 153, + -59, + -31, + 90, + -106, + 86, + -44, + -1, + 32, + -45, + 40, + -24, + 6, + 9, + -15, + 15, + -10, + 4, + 1, + -3, + 4, + -2, + 1, + 0, + 0 + +}; +struct src_stage src_int16_7_8_4375_5000 = { + 1, 1, 7, 93, 651, 8, 7, 0, 0, + src_int16_7_8_4375_5000_fir}; diff --git a/src/include/reef/audio/coefficients/src/src_int16_8_7_4375_5000.h b/src/include/reef/audio/coefficients/src/src_int16_8_7_4375_5000.h new file mode 100644 index 0000000..1ad7797 --- /dev/null +++ b/src/include/reef/audio/coefficients/src/src_int16_8_7_4375_5000.h @@ -0,0 +1,662 @@ +const int16_t src_int16_8_7_4375_5000_fir[656] = { + 0, + 0, + 1, + -2, + 4, + -7, + 10, + -13, + 17, + -21, + 23, + -23, + 21, + -14, + 3, + 14, + -37, + 65, + -99, + 136, + -174, + 211, + -242, + 263, + -269, + 256, + -219, + 152, + -53, + -81, + 251, + -458, + 702, + -979, + 1290, + -1635, + 2021, + -2471, + 3050, + -3986, + 6580, + 29785, + -1328, + -372, + 958, + -1207, + 1295, + -1286, + 1212, + -1095, + 951, + -792, + 628, + -469, + 322, + -190, + 79, + 10, + -77, + 123, + -150, + 161, + -159, + 146, + -128, + 105, + -82, + 60, + -40, + 23, + -10, + 1, + 5, + -9, + 10, + -9, + 8, + -6, + 5, + -3, + 2, + -1, + 0, + 0, + 0, + -1, + 3, + -5, + 9, + -13, + 18, + -23, + 28, + -32, + 34, + -33, + 27, + -15, + -3, + 29, + -62, + 102, + -147, + 195, + -243, + 287, + -322, + 342, + -341, + 314, + -253, + 155, + -14, + -175, + 414, + -709, + 1065, + -1493, + 2018, + -2695, + 3672, + -5455, + 11305, + 27819, + -4054, + 1304, + -212, + -361, + 684, + -859, + 934, + -938, + 889, + -804, + 696, + -574, + 449, + -327, + 215, + -117, + 36, + 28, + -74, + 104, + -119, + 123, + -117, + 105, + -89, + 71, + -53, + 37, + -23, + 12, + -4, + -1, + 4, + -6, + 6, + -5, + 4, + -3, + 2, + -1, + -1, + 1, + -1, + 0, + 1, + -3, + 6, + -11, + 16, + -23, + 30, + -38, + 44, + -48, + 49, + -44, + 33, + -13, + -15, + 52, + -99, + 153, + -212, + 274, + -333, + 385, + -422, + 438, + -426, + 378, + -287, + 143, + 60, + -332, + 686, + -1143, + 1741, + -2566, + 3846, + -6377, + 16134, + 24716, + -5794, + 2637, + -1264, + 480, + 17, + -342, + 547, + -665, + 715, + -712, + 670, + -600, + 513, + -417, + 319, + -225, + 140, + -68, + 9, + 35, + -66, + 84, + -92, + 91, + -83, + 72, + -59, + 46, + -33, + 22, + -13, + 6, + -1, + -2, + 3, + -3, + 3, + -2, + 2, + -1, + -1, + 1, + -2, + 2, + -1, + 0, + 3, + -7, + 12, + -19, + 28, + -38, + 48, + -57, + 64, + -68, + 65, + -55, + 36, + -6, + -35, + 88, + -151, + 223, + -300, + 377, + -449, + 509, + -548, + 559, + -531, + 454, + -316, + 106, + 197, + -619, + 1209, + -2077, + 3504, + -6542, + 20718, + 20718, + -6542, + 3504, + -2077, + 1209, + -619, + 197, + 106, + -316, + 454, + -531, + 559, + -548, + 509, + -449, + 377, + -300, + 223, + -151, + 88, + -35, + -6, + 36, + -55, + 65, + -68, + 64, + -57, + 48, + -38, + 28, + -19, + 12, + -7, + 3, + 0, + -1, + 2, + -2, + 1, + -1, + -1, + 2, + -2, + 3, + -3, + 3, + -2, + -1, + 6, + -13, + 22, + -33, + 46, + -59, + 72, + -83, + 91, + -92, + 84, + -66, + 35, + 9, + -68, + 140, + -225, + 319, + -417, + 513, + -600, + 670, + -712, + 715, + -665, + 547, + -342, + 17, + 480, + -1264, + 2637, + -5794, + 24716, + 16134, + -6377, + 3846, + -2566, + 1741, + -1143, + 686, + -332, + 60, + 143, + -287, + 378, + -426, + 438, + -422, + 385, + -333, + 274, + -212, + 153, + -99, + 52, + -15, + -13, + 33, + -44, + 49, + -48, + 44, + -38, + 30, + -23, + 16, + -11, + 6, + -3, + 1, + 0, + -1, + 1, + -1, + -1, + 2, + -3, + 4, + -5, + 6, + -6, + 4, + -1, + -4, + 12, + -23, + 37, + -53, + 71, + -89, + 105, + -117, + 123, + -119, + 104, + -74, + 28, + 36, + -117, + 215, + -327, + 449, + -574, + 696, + -804, + 889, + -938, + 934, + -859, + 684, + -361, + -212, + 1304, + -4054, + 27819, + 11305, + -5455, + 3672, + -2695, + 2018, + -1493, + 1065, + -709, + 414, + -175, + -14, + 155, + -253, + 314, + -341, + 342, + -322, + 287, + -243, + 195, + -147, + 102, + -62, + 29, + -3, + -15, + 27, + -33, + 34, + -32, + 28, + -23, + 18, + -13, + 9, + -5, + 3, + -1, + 0, + 0, + 0, + -1, + 2, + -3, + 5, + -6, + 8, + -9, + 10, + -9, + 5, + 1, + -10, + 23, + -40, + 60, + -82, + 105, + -128, + 146, + -159, + 161, + -150, + 123, + -77, + 10, + 79, + -190, + 322, + -469, + 628, + -792, + 951, + -1095, + 1212, + -1286, + 1295, + -1207, + 958, + -372, + -1328, + 29785, + 6580, + -3986, + 3050, + -2471, + 2021, + -1635, + 1290, + -979, + 702, + -458, + 251, + -81, + -53, + 152, + -219, + 256, + -269, + 263, + -242, + 211, + -174, + 136, + -99, + 65, + -37, + 14, + 3, + -14, + 21, + -23, + 23, + -21, + 17, + -13, + 10, + -7, + 4, + -2, + 1, + 0, + 0, + -1, + 2, + -3, + 5, + -7, + 10, + -12, + 14, + -16, + 15, + -12, + 5, + 5, + -20, + 40, + -64, + 92, + -122, + 151, + -178, + 199, + -209, + 205, + -184, + 140, + -72, + -24, + 147, + -298, + 474, + -673, + 887, + -1112, + 1339, + -1559, + 1765, + -1947, + 2097, + -2210, + 2280, + 30458, + 2280, + -2210, + 2097, + -1947, + 1765, + -1559, + 1339, + -1112, + 887, + -673, + 474, + -298, + 147, + -24, + -72, + 140, + -184, + 205, + -209, + 199, + -178, + 151, + -122, + 92, + -64, + 40, + -20, + 5, + 5, + -12, + 15, + -16, + 14, + -12, + 10, + -7, + 5, + -3, + 2, + -1, + 0 + +}; +struct src_stage src_int16_8_7_4375_5000 = { + 6, 7, 8, 82, 656, 7, 8, 0, 0, + src_int16_8_7_4375_5000_fir}; diff --git a/src/include/reef/audio/coefficients/src/src_int16_define.h b/src/include/reef/audio/coefficients/src/src_int16_define.h new file mode 100644 index 0000000..65954b0 --- /dev/null +++ b/src/include/reef/audio/coefficients/src/src_int16_define.h @@ -0,0 +1,11 @@ +/* SRC constants */ +#define MAX_FIR_DELAY_SIZE 450 +#define MAX_OUT_DELAY_SIZE 401 +#define MAX_BLK_IN 21 +#define MAX_BLK_OUT 21 +#define NUM_IN_FS 3 +#define NUM_OUT_FS 3 +#define STAGE1_TIMES_MAX 21 +#define STAGE2_TIMES_MAX 21 +#define STAGE_BUF_SIZE 168 +#define NUM_ALL_COEFFICIENTS 3908 diff --git a/src/include/reef/audio/coefficients/src/src_int16_table.h b/src/include/reef/audio/coefficients/src/src_int16_table.h new file mode 100644 index 0000000..e37dfae --- /dev/null +++ b/src/include/reef/audio/coefficients/src/src_int16_table.h @@ -0,0 +1,32 @@ +/* SRC conversions */ +#include <reef/audio/coefficients/src/src_int16_1_3_4375_5000.h> +#include <reef/audio/coefficients/src/src_int16_3_1_4375_5000.h> +#include <reef/audio/coefficients/src/src_int16_7_8_4375_5000.h> +#include <reef/audio/coefficients/src/src_int16_8_7_4375_5000.h> +#include <reef/audio/coefficients/src/src_int16_20_21_4020_5000.h> +#include <reef/audio/coefficients/src/src_int16_21_20_4020_5000.h> + +/* SRC table */ +int16_t fir_one = 16384; +struct src_stage src_int16_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, -1, &fir_one }; +struct src_stage src_int16_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, &fir_one }; +int src_in_fs[3] = { 16000, 44100, 48000}; +int src_out_fs[3] = { 16000, 44100, 48000}; +struct src_stage *src_table1[3][3] = { + { &src_int16_1_1_0_0, &src_int16_0_0_0_0, + &src_int16_1_3_4375_5000}, + { &src_int16_0_0_0_0, + &src_int16_1_1_0_0, &src_int16_21_20_4020_5000 + }, + { &src_int16_3_1_4375_5000, &src_int16_8_7_4375_5000, + &src_int16_1_1_0_0} +}; +struct src_stage *src_table2[3][3] = { + { &src_int16_1_1_0_0, &src_int16_0_0_0_0, + &src_int16_1_1_0_0}, + { &src_int16_0_0_0_0, + &src_int16_1_1_0_0, &src_int16_7_8_4375_5000 + }, + { &src_int16_1_1_0_0, &src_int16_20_21_4020_5000, + &src_int16_1_1_0_0} +}; -- 2.11.0
2 4
0 0
[Sound-open-firmware] [PATCH 1/3] heap: byt: balance heap block size map
by Liam Girdwood 04 Sep '17

04 Sep '17
Balance the heap block map size out to better fit real world usage by reducing small blocks to create extra larger blocks. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/platform/baytrail/include/platform/memory.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/platform/baytrail/include/platform/memory.h b/src/platform/baytrail/include/platform/memory.h index 6bd0e78..c6a1301 100644 --- a/src/platform/baytrail/include/platform/memory.h +++ b/src/platform/baytrail/include/platform/memory.h @@ -100,11 +100,11 @@ /* Heap section sizes for module pool */ #define HEAP_RT_COUNT8 0 -#define HEAP_RT_COUNT16 256 -#define HEAP_RT_COUNT32 128 +#define HEAP_RT_COUNT16 64 +#define HEAP_RT_COUNT32 64 #define HEAP_RT_COUNT64 64 -#define HEAP_RT_COUNT128 32 -#define HEAP_RT_COUNT256 16 +#define HEAP_RT_COUNT128 64 +#define HEAP_RT_COUNT256 64 #define HEAP_RT_COUNT512 8 #define HEAP_RT_COUNT1024 4 -- 2.11.0
1 2
0 0
[Sound-open-firmware] [PATCH] topology: src: fix W_SRC widget argument list order
by Liam Girdwood 04 Sep '17

04 Sep '17
Put format and data in correct order. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- topology/m4/local.m4 | 4 ++-- topology/sof/pipe-pcm-media.m4 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/topology/m4/local.m4 b/topology/m4/local.m4 index 5da77e2..5ff0a3d 100644 --- a/topology/m4/local.m4 +++ b/topology/m4/local.m4 @@ -17,7 +17,7 @@ define(`W_SRC', ` tuples."word" {' ` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR($3) ` SOF_TKN_COMP_PERIOD_SOURCE_COUNT' STR($4) -` SOF_TKN_COMP_PRELOAD_COUNT' STR($5) +` SOF_TKN_COMP_PRELOAD_COUNT' STR($6) ` }' `}' `SectionData."'N_SRC($1)`_data_w" {' @@ -39,7 +39,7 @@ define(`W_SRC', ` data [' ` "'N_SRC($1)`_data_w"' ` "'N_SRC($1)`_data_str"' -` "'$2`"' +` "'$5`"' ` ]' `}') diff --git a/topology/sof/pipe-pcm-media.m4 b/topology/sof/pipe-pcm-media.m4 index 0ce6faa..4a68eb4 100644 --- a/topology/sof/pipe-pcm-media.m4 +++ b/topology/sof/pipe-pcm-media.m4 @@ -73,7 +73,7 @@ W_PCM_PLAYBACK(Media Playback, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 2, 0, 2) W_PGA(0, PCM PCM_ID Playback Volume, PIPELINE_FORMAT, 2, 2, 2) # "SRC 0" has 2 sink and source periods. -W_SRC(0, media_src_conf, PIPELINE_FORMAT, 2, 2, 2) +W_SRC(0, PIPELINE_FORMAT, 2, 2, media_src_conf, 2) # Media Buffers W_BUFFER(0, COMP_BUFFER_SIZE(2, -- 2.11.0
1 2
0 0
[Sound-open-firmware] [PATCH] topology: bind kcontrols to PGA widgets.
by Liam Girdwood 01 Sep '17

01 Sep '17
Add an parameter to bind TLV volume kcontrol to volume widget. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- topology/m4/local.m4 | 13 ++++++---- topology/sof/pipe-low-latency-capture.m4 | 8 +++--- topology/sof/pipe-low-latency-playback.m4 | 16 ++++++------ topology/sof/pipe-passthrough-vol-playback.m4 | 36 ++++++++++++++++++++++++--- topology/sof/pipe-pcm-media.m4 | 6 ++--- topology/sof/pipe-tone.m4 | 6 ++--- 6 files changed, 59 insertions(+), 26 deletions(-) diff --git a/topology/m4/local.m4 b/topology/m4/local.m4 index 7bcebee..5da77e2 100644 --- a/topology/m4/local.m4 +++ b/topology/m4/local.m4 @@ -142,14 +142,14 @@ define(`W_PCM_CAPTURE', dnl PGA name) define(`N_PGA', `PGA'PIPELINE_ID`.'$1) -dnl W_PGA(name, format, periods_sink, periods_source, preload) +dnl W_PGA(name, kcontrol, format, periods_sink, periods_source, preload) define(`W_PGA', `SectionVendorTuples."'N_PGA($1)`_tuples_w" {' ` tokens "sof_comp_tokens"' ` tuples."word" {' -` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR($3) -` SOF_TKN_COMP_PERIOD_SOURCE_COUNT' STR($4) -` SOF_TKN_COMP_PRELOAD_COUNT' STR($5) +` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR($4) +` SOF_TKN_COMP_PERIOD_SOURCE_COUNT' STR($5) +` SOF_TKN_COMP_PRELOAD_COUNT' STR($6) ` }' `}' `SectionData."'N_PGA($1)`_data_w" {' @@ -158,7 +158,7 @@ define(`W_PGA', `SectionVendorTuples."'N_PGA($1)`_tuples_str" {' ` tokens "sof_comp_tokens"' ` tuples."string" {' -` SOF_TKN_COMP_FORMAT' STR($2) +` SOF_TKN_COMP_FORMAT' STR($3) ` }' `}' `SectionData."'N_PGA($1)`_data_str" {' @@ -172,6 +172,9 @@ define(`W_PGA', ` "'N_PGA($1)`_data_w"' ` "'N_PGA($1)`_data_str"' ` ]' +` mixer [' +` "'$2`"' +` ]' `}') dnl Mixer Name) diff --git a/topology/sof/pipe-low-latency-capture.m4 b/topology/sof/pipe-low-latency-capture.m4 index 3b53d0a..111aa86 100644 --- a/topology/sof/pipe-low-latency-capture.m4 +++ b/topology/sof/pipe-low-latency-capture.m4 @@ -48,7 +48,7 @@ SectionControlMixer.STR(PCM PCM_ID Capture Volume) { W_PCM_CAPTURE(Low Latency Capture, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 0, 2, 0) # "Capture Volume" has 2 sink and source periods for host and DAI ping-pong -W_PGA(Capture Volume, PIPELINE_FORMAT, 2, 2, 0) +W_PGA(0, PCM PCM_ID Capture Volume, PIPELINE_FORMAT, 2, 2, 0) # Capture Buffers W_BUFFER(0, COMP_BUFFER_SIZE(2, @@ -67,8 +67,8 @@ SectionGraph."pipe-ll-capture-PIPELINE_ID" { lines [ dapm(Low Latency Capture PCM_ID, N_PCM) dapm(N_PCM, N_BUFFER(1)) - dapm(N_BUFFER(1), N_PGA(Capture Volume)) - dapm(N_PGA(Capture Volume), N_BUFFER(0)) + dapm(N_BUFFER(1), N_PGA(0)) + dapm(N_PGA(0), N_BUFFER(0)) ] } @@ -81,7 +81,7 @@ indir(`define', concat(`PIPELINE_SINK_', PIPELINE_ID), N_BUFFER(0)) # Pipeline Configuration. # -W_PIPELINE(N_PGA(Capture Volume), SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, pipe_ll_schedule_plat) +W_PIPELINE(N_PGA(0), SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, pipe_ll_schedule_plat) # # PCM Configuration diff --git a/topology/sof/pipe-low-latency-playback.m4 b/topology/sof/pipe-low-latency-playback.m4 index 00f7447..a860c82 100644 --- a/topology/sof/pipe-low-latency-playback.m4 +++ b/topology/sof/pipe-low-latency-playback.m4 @@ -91,10 +91,10 @@ SectionControlMixer.STR(Master Playback Volume) { W_PCM_PLAYBACK(Low Latency Playback, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 2, 0, 2) # "Playback Volume" has 1 sink period and 2 source periods for host ping-pong -W_PGA(Playback Volume, PIPELINE_FORMAT, 1, 2, 1) +W_PGA(0, PCM PCM_ID Playback Volume, PIPELINE_FORMAT, 1, 2, 1) -# "Mixer Volume" has 1 source and 2 sink periods for DAI ping-pong -W_PGA(Mixer Volume, PIPELINE_FORMAT, 2, 1, 1) +# "Master Playback Volume" has 1 source and 2 sink periods for DAI ping-pong +W_PGA(1, Master Playback Volume, PIPELINE_FORMAT, 2, 1, 1) # Mixer 0 has 1 sink and source periods. W_MIXER(0, PIPELINE_FORMAT, 1, 1, 1) @@ -127,12 +127,12 @@ SectionGraph."pipe-ll-playback-PIPELINE_ID" { lines [ dapm(N_PCM, Low Latency Playback PCM_ID) dapm(N_BUFFER(0), N_PCM) - dapm(N_PGA(Playback Volume), N_BUFFER(0)) - dapm(N_BUFFER(1), N_PGA(Playback Volume)) + dapm(N_PGA(0), N_BUFFER(0)) + dapm(N_BUFFER(1), N_PGA(0)) dapm(N_MIXER(0), N_BUFFER(1)) dapm(N_BUFFER(2), N_MIXER(0)) - dapm(N_PGA(Mixer Volume), N_BUFFER(2)) - dapm(N_BUFFER(3), N_PGA(Mixer Volume)) + dapm(N_PGA(1), N_BUFFER(2)) + dapm(N_BUFFER(3), N_PGA(1)) ] } @@ -146,7 +146,7 @@ indir(`define', concat(`PIPELINE_MIXER_', PIPELINE_ID), N_MIXER(0)) # Pipeline Configuration. # -W_PIPELINE(N_PGA(Mixer Volume), SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, pipe_ll_schedule_plat) +W_PIPELINE(N_PGA(1), SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, pipe_ll_schedule_plat) # # PCM Configuration diff --git a/topology/sof/pipe-passthrough-vol-playback.m4 b/topology/sof/pipe-passthrough-vol-playback.m4 index ae2b569..bf131c3 100644 --- a/topology/sof/pipe-passthrough-vol-playback.m4 +++ b/topology/sof/pipe-passthrough-vol-playback.m4 @@ -7,6 +7,36 @@ # Include topology builder include(`local.m4') +# +# Controls +# +SectionControlMixer.STR(Master Playback Volume) { + + # control belongs to this index group + index STR(PIPELINE_ID) + + # Channel register and shift for Front Left/Right + channel."FL" { + reg "1" + shift "0" + } + channel."FR" { + reg "1" + shift "1" + } + + # control uses bespoke driver get/put/info ID 0 + ops."ctl" { + info "volsw" + get "256" + put "256" + } + + # TLV 32 steps from -90dB to +6dB for 3dB + max "32" + invert "false" + tlv "vtlv_m90s3" +} # # Components and Buffers @@ -17,7 +47,7 @@ include(`local.m4') W_PCM_PLAYBACK(Passthrough Playback, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 2, 0, 2) # "Volume" has 2 source and 2 sink periods -W_PGA(Volume, PIPELINE_FORMAT, 2, 2, 2) +W_PGA(0, Master Playback Volume, PIPELINE_FORMAT, 2, 2, 2) # Playback Buffers W_BUFFER(0, COMP_BUFFER_SIZE(2, @@ -48,8 +78,8 @@ SectionGraph."pipe-pass-vol-playback-PIPELINE_ID" { lines [ dapm(N_PCM, Passthrough Playback PCM_ID) dapm(N_BUFFER(0), N_PCM) - dapm(N_PGA(Volume), N_BUFFER(0)) - dapm(N_BUFFER(1), N_PGA(Volume)) + dapm(N_PGA(0), N_BUFFER(0)) + dapm(N_BUFFER(1), N_PGA(0)) dapm(N_DAI_OUT, N_BUFFER(1)) ] } diff --git a/topology/sof/pipe-pcm-media.m4 b/topology/sof/pipe-pcm-media.m4 index fd6db04..0ce6faa 100644 --- a/topology/sof/pipe-pcm-media.m4 +++ b/topology/sof/pipe-pcm-media.m4 @@ -70,7 +70,7 @@ SectionData."media_src_conf" { W_PCM_PLAYBACK(Media Playback, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 2, 0, 2) # "Playback Volume" has 2 sink period and 2 source periods for host ping-pong -W_PGA(Playback Volume, PIPELINE_FORMAT, 2, 2, 2) +W_PGA(0, PCM PCM_ID Playback Volume, PIPELINE_FORMAT, 2, 2, 2) # "SRC 0" has 2 sink and source periods. W_SRC(0, media_src_conf, PIPELINE_FORMAT, 2, 2, 2) @@ -95,8 +95,8 @@ SectionGraph."pipe-media-PIPELINE_ID" { lines [ dapm(N_PCM, Media Playback PCM_ID) dapm(N_BUFFER(0), N_PCM) - dapm(N_PGA(Playback Volume), N_BUFFER(0)) - dapm(N_BUFFER(1), N_PGA(Playback Volume)) + dapm(N_PGA(0), N_BUFFER(0)) + dapm(N_BUFFER(1), N_PGA(0)) dapm(N_SRC(0), N_BUFFER(1)) dapm(N_BUFFER(2), N_SRC(0)) ] diff --git a/topology/sof/pipe-tone.m4 b/topology/sof/pipe-tone.m4 index 386ddd3..0cfb73c 100644 --- a/topology/sof/pipe-tone.m4 +++ b/topology/sof/pipe-tone.m4 @@ -50,7 +50,7 @@ SectionControlMixer.STR(Tone Volume PIPELINE_ID) { W_TONE(0, PIPELINE_FORMAT, 2, 0, 0) # "Tone Volume" has 2 sink period and 2 source periods -W_PGA(Tone Volume, PIPELINE_FORMAT, 2, 2, 0) +W_PGA(0, Tone Volume PIPELINE_ID, PIPELINE_FORMAT, 2, 2, 0) # Low Latency Buffers W_BUFFER(0,COMP_BUFFER_SIZE(2, @@ -70,8 +70,8 @@ SectionGraph."pipe-tone-PIPELINE_ID" { lines [ dapm(N_BUFFER(0), N_TONE(0)) - dapm(N_PGA(Tone Volume), N_BUFFER(0)) - dapm(N_BUFFER(1), N_PGA(Tone Volume)) + dapm(N_PGA(0), N_BUFFER(0)) + dapm(N_BUFFER(1), N_PGA(0)) ] } -- 2.11.0
1 0
0 0
[Sound-open-firmware] [PATCH] EQs: Fix issue in sink and source buffer update
by Seppo Ingalsuo 31 Aug '17

31 Aug '17
The pointers advance is done in EQ func so the 2nd argument needs to be 0 to just update free/avail. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo(a)linux.intel.com> --- src/audio/eq_fir.c | 4 ++-- src/audio/eq_iir.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/audio/eq_fir.c b/src/audio/eq_fir.c index 534a4a1..80f727e 100644 --- a/src/audio/eq_fir.c +++ b/src/audio/eq_fir.c @@ -421,8 +421,8 @@ static int eq_fir_copy(struct comp_dev *dev) sd->eq_fir_func(dev, source, sink, dev->frames); /* calc new free and available */ - comp_update_buffer_consume(source, copy_bytes); - comp_update_buffer_produce(sink, copy_bytes); + comp_update_buffer_consume(source, 0); + comp_update_buffer_produce(sink, 0); return dev->frames; } diff --git a/src/audio/eq_iir.c b/src/audio/eq_iir.c index 0ac2ef9..971665e 100644 --- a/src/audio/eq_iir.c +++ b/src/audio/eq_iir.c @@ -431,8 +431,8 @@ static int eq_iir_copy(struct comp_dev *dev) cd->eq_iir_func(dev, source, sink, dev->frames); /* calc new free and available */ - comp_update_buffer_consume(source, copy_bytes); - comp_update_buffer_produce(sink, copy_bytes); + comp_update_buffer_consume(source, 0); + comp_update_buffer_produce(sink, 0); return dev->frames; } -- 2.11.0
2 1
0 0
  • ← Newer
  • 1
  • ...
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • ...
  • 157
  • Older →

HyperKitty Powered by HyperKitty version 1.3.8.