-
Notifications
You must be signed in to change notification settings - Fork 350
Description
Is your feature request related to a problem? Please describe.
Host drivers and userspace will pass PCM rates, formats and channels to the DSP when opening a stream. This currently require topology to match the DAI configuration to the userspace configuration and does not give much scope for refinement within the pipeline.
See https://github.com/orgs/thesofproject/teams/sof-developers/discussions/9
Describe the solution you'd like
We currently define pipelines that can accept a range of runtime params (like rate, channels, format) via the host component (as this component has the 1:1 driver connection). We do need to pass these params and any modifications (that components make) downstream from source to sink. i.e. this can be done by walking the graph in 3 passes
-
check the connected DAI for multiple configs and match to any hw_params.
-
Walk from DAI to all other endpoints setting component params to match hard coded DAI params.
At this point each component has a copy of the DAI params locally for each of it sources and sinks.
- Walk from host to all other endpoints and refine the params from the host sink/source to the DAI params.
Additional context - Examples
host (44.1kHz) -> volume -> DAI (48kHz)
Passes 1& 2 for the above pipeline would populate all the components (except host) with 48kHz rate.
Pass 3 would try and see where this rate could be converted from 44.1kHz to 48 kHz. i.e it would set volume to 44.1kHz but would ultimately fail as there would be no way to change the DAI to 44.1kHz.
host (16bit) -> volume -> DAI (24bit)
The same pipeline, but this time refining the format. Passes 1 & 2 sets all formats to 24 bit (except host).
Pass 3 Sets volume to 24 bit (which succeeds as volume can convert 16 -> 24bit).
The same algorithm would also be applicable to larger pipelines with multiple differences between host and DAI. They key thing is that topology permits the different params to allow the refinement within the pipeline.
We are currently missing passes 1 & 2 today.