Commit d8231a7
committed
ASoC: SOF: ipc4-topology: Change DeepBuffer from static to dynamic mode
Currently the DeepBuffer results static host DMA buffer and thus static
minimum ALSA period size which can be a limiting factor for user space.
DeepBuffer of static 100ms host DMA buffer can only be opened with at least
110ms ALSA period size, if for the same endpoint there is a need for
smaller (or larger) buffer then a new PCM device must be created with
different DeepBuffer configuration.
This does not scale in real life.
With Dynamic DeepBuffer the host DMA buffer size is calculated based on the
requested ALSA period size (with a headroom between the two) using the
DEEP_BUFFER token as a maximum limit for the host DMA buffer.
This way applications can use the same DeepBuffer enabled PCM for different
use cases and still benefit of the power saving of a bigger host DMA
buffer.
As an example, the DEEP_BUFFER in topology is set to 100ms (interpreted as
maximum size with this patch):
ALSA period time of 20ms will result 10ms host DMA Buffer
- before the patch if 10ms host DMA buffer was desired, the minimum ALSA
period size was 20ms
ALSA period size of 50ms will result 40ms host DMA buffer
- before the patch if 40ms host DMA buffer was desired, the minimum ALSA
period size was 50ms
ALSA period size of 110ms will result 100ms host DMA buffer
- before the patch if 100ms host DMA buffer was desired, the minimum ALSA
period size was 110ms
ALSA period size of 500ms will result 100ms host DMA buffer
- Like before this patch: 500ms ALSA period would use 100ms host DMA
buffer
The Dynamic DeepBuffer will give applications the means to choose between
lower latency (small host DMA buffer) or higher power save (big host DMA
buffer) with higher latency on the same device with topology providing a
meaningful upper limit of the buffer size.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>1 parent fedfcf1 commit d8231a7
2 files changed
+80
-44
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
669 | 669 | | |
670 | 670 | | |
671 | 671 | | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
| 672 | + | |
679 | 673 | | |
680 | 674 | | |
681 | 675 | | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
688 | 681 | | |
689 | 682 | | |
690 | 683 | | |
| |||
2042 | 2035 | | |
2043 | 2036 | | |
2044 | 2037 | | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
2045 | 2099 | | |
2046 | 2100 | | |
2047 | 2101 | | |
| |||
2063 | 2117 | | |
2064 | 2118 | | |
2065 | 2119 | | |
2066 | | - | |
2067 | 2120 | | |
2068 | 2121 | | |
2069 | 2122 | | |
| |||
2081 | 2134 | | |
2082 | 2135 | | |
2083 | 2136 | | |
2084 | | - | |
2085 | | - | |
2086 | | - | |
2087 | | - | |
2088 | | - | |
2089 | | - | |
2090 | | - | |
2091 | | - | |
2092 | | - | |
2093 | | - | |
2094 | 2137 | | |
2095 | 2138 | | |
2096 | 2139 | | |
| |||
2425 | 2468 | | |
2426 | 2469 | | |
2427 | 2470 | | |
| 2471 | + | |
| 2472 | + | |
| 2473 | + | |
| 2474 | + | |
| 2475 | + | |
2428 | 2476 | | |
2429 | 2477 | | |
2430 | 2478 | | |
2431 | 2479 | | |
2432 | | - | |
2433 | | - | |
2434 | | - | |
2435 | | - | |
2436 | | - | |
2437 | | - | |
2438 | | - | |
2439 | | - | |
2440 | | - | |
2441 | | - | |
2442 | 2480 | | |
2443 | 2481 | | |
2444 | 2482 | | |
2445 | 2483 | | |
2446 | | - | |
2447 | | - | |
2448 | | - | |
2449 | | - | |
2450 | | - | |
2451 | | - | |
2452 | | - | |
2453 | | - | |
2454 | | - | |
2455 | | - | |
2456 | 2484 | | |
2457 | 2485 | | |
2458 | 2486 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
79 | 87 | | |
80 | 88 | | |
81 | 89 | | |
| |||
0 commit comments