This repository was archived by the owner on Jan 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
tplg: refine topology file to support voulume with multi-channels #34
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| # Passthrough with multi-channels volume Pipeline and PCM | ||
| # | ||
| # Pipeline Endpoints for connection are :- | ||
| # | ||
| # host PCM_C <-- B0 <-- Volume 0 <-- B1 <-- source DAI0 | ||
|
|
||
| # Include topology builder | ||
| include(`utils.m4') | ||
| include(`buffer.m4') | ||
| include(`pcm.m4') | ||
| include(`pga.m4') | ||
| include(`dai.m4') | ||
| include(`mixercontrol.m4') | ||
| include(`pipeline.m4') | ||
|
|
||
| # | ||
| # Controls | ||
| # | ||
| # Volume Mixer control with max value of 32 | ||
| C_CONTROLMIXER(Master Capture Volume, PIPELINE_ID, | ||
| CONTROLMIXER_OPS(volsw, volsw binds the mixer control to volume get/put handlers, 1, 1), | ||
| CONTROLMIXER_MAX(, 32), | ||
| false, | ||
| CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB, vtlv_m90s3), | ||
| Channel register and shift for Front Left/Right, | ||
| LIST(` ', KCONTROL_CHANNEL_ARRAY(PIPELINE_CHANNELS, 1))) | ||
|
|
||
| # | ||
| # Components and Buffers | ||
| # | ||
|
|
||
| # Host "Passthrough Capture" PCM | ||
| # with 0 sink and 2 source periods | ||
| W_PCM_CAPTURE(PCM_ID, Passthrough Capture, 0, 2, 2) | ||
|
|
||
| # "Volume" has 2 source and 2 sink periods | ||
| W_PGA(0, PIPELINE_FORMAT, 2, 2, 2, LIST(` ', "Master Capture Volume PIPELINE_ID")) | ||
|
|
||
| # Capture Buffers | ||
| W_BUFFER(0, COMP_BUFFER_SIZE(2, | ||
| COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES), | ||
| PLATFORM_HOST_MEM_CAP) | ||
| W_BUFFER(1, COMP_BUFFER_SIZE(2, | ||
| COMP_SAMPLE_SIZE(DAI_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES), | ||
| PLATFORM_DAI_MEM_CAP) | ||
|
|
||
| # | ||
| # Pipeline Graph | ||
| # | ||
| # host PCM_P <-- B0 <-- Volume 0 <-- B1 <-- sink DAI0 | ||
|
|
||
| P_GRAPH(pipe-pass-vol-capture-PIPELINE_ID, PIPELINE_ID, | ||
| LIST(` ', | ||
| `dapm(Passthrough Capture PCM_ID, N_PCMC(PCM_ID))', | ||
| `dapm(N_PCMC(PCM_ID), N_BUFFER(0))', | ||
| `dapm(N_BUFFER(0), N_PGA(0))', | ||
| `dapm(N_PGA(0), N_BUFFER(1))')) | ||
|
|
||
| # | ||
| # Pipeline Source and Sinks | ||
| # | ||
| indir(`define', concat(`PIPELINE_SINK_', PIPELINE_ID), N_BUFFER(1)) | ||
| indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Capture PCM_ID) | ||
|
|
||
| # | ||
| # PCM Configuration | ||
| # | ||
|
|
||
| PCM_CAPABILITIES(Passthrough Capture PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, 8, 2, 16, 192, 16384, 65536, 65536) | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # Low Latency Passthrough with multi-channels volume Pipeline and PCM | ||
| # | ||
| # Pipeline Endpoints for connection are :- | ||
| # | ||
| # host PCM_P --> B0 --> Volume 0 --> B1 --> sink DAI0 | ||
|
|
||
| # Include topology builder | ||
| include(`utils.m4') | ||
| include(`buffer.m4') | ||
| include(`pcm.m4') | ||
| include(`pga.m4') | ||
| include(`dai.m4') | ||
| include(`mixercontrol.m4') | ||
| include(`pipeline.m4') | ||
|
|
||
| # | ||
| # Controls | ||
| # | ||
| # Volume Mixer control with max value of 32 | ||
| C_CONTROLMIXER(Master Playback Volume, PIPELINE_ID, | ||
| CONTROLMIXER_OPS(volsw, volsw binds the mixer control to volume get/put handlers, 1, 1), | ||
| CONTROLMIXER_MAX(, 32), | ||
| false, | ||
| CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB, vtlv_m90s3), | ||
| Channel register and shift for Front Left/Right, | ||
| LIST(` ', KCONTROL_CHANNEL_ARRAY(PIPELINE_CHANNELS, 1))) | ||
|
|
||
| # | ||
| # Components and Buffers | ||
| # | ||
|
|
||
| # Host "Passthrough Playback" PCM | ||
| # with 2 sink and 0 source periods | ||
| W_PCM_PLAYBACK(PCM_ID, Passthrough Playback, 2, 0, 2) | ||
|
|
||
| # "Volume" has 2 source and 2 sink periods | ||
| W_PGA(0, PIPELINE_FORMAT, 2, 2, 2, LIST(` ', "Master Playback Volume PIPELINE_ID")) | ||
|
|
||
| # Playback Buffers | ||
| W_BUFFER(0, COMP_BUFFER_SIZE(2, | ||
| COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES), | ||
| PLATFORM_HOST_MEM_CAP) | ||
| W_BUFFER(1, COMP_BUFFER_SIZE(2, | ||
| COMP_SAMPLE_SIZE(DAI_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES), | ||
| PLATFORM_DAI_MEM_CAP) | ||
|
|
||
| # | ||
| # Pipeline Graph | ||
| # | ||
| # host PCM_P --> B0 --> Volume 0 --> B1 --> sink DAI0 | ||
|
|
||
| P_GRAPH(pipe-pass-vol-playback-PIPELINE_ID, PIPELINE_ID, | ||
| LIST(` ', | ||
| `dapm(N_PCMP(PCM_ID), Passthrough Playback PCM_ID)', | ||
| `dapm(N_BUFFER(0), N_PCMP(PCM_ID))', | ||
| `dapm(N_PGA(0), N_BUFFER(0))', | ||
| `dapm(N_BUFFER(1), N_PGA(0))')) | ||
|
|
||
| # | ||
| # Pipeline Source and Sinks | ||
| # | ||
| indir(`define', concat(`PIPELINE_SOURCE_', PIPELINE_ID), N_BUFFER(1)) | ||
| indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Playback PCM_ID) | ||
|
|
||
|
|
||
| # | ||
| # PCM Configuration | ||
|
|
||
| # | ||
| PCM_CAPABILITIES(Passthrough Playback PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, 8, 2, 16, 192, 16384, 65536, 65536) | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit controversial. It's not because there are 8 channels that they will follow the speaker arrangement that you describe here. It's probably a better idea to keep the names less precise, e.g. vol_ch0..vo_chl7, to avoid confusions.
Take the example of capture on the GP-MRB, the channels are FM, AUX and mic, nothing to do with 7.1 speaker notation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed the topology definition in alsa lib, else it would be built failed