I agree. We just need a library which will:
- gather the information from hardware drivers
- a simple description of the bclk constrains
- create right constraints (hw_params rules) for the ALSA PCM API
- return the selected bclk when hw_params are installed
Yes, that's what the RFC patch I posted attempts to do. But it extends hw_params, which is clearly wrong.
The library should not extend hw_params (new interval), but it should work as a separate layer - use new structures / functions etc.
This, I could not work out how to approach :)
I am not sure I fully understand the ask but wanted to point out that for ASoC topology-based solutions the bclk rate is typically passed as a parameter from userspace (w/ a request_firmware and topology parsing) and might be forwarded over IPC to a DSP. On some Intel platforms which can't support 32x fs that is typically how we represent a bclk ratio multiple of 25. the kernel has no idea of the relationship between the representation of the stream in memory and the final bit clock, only the DSP which programs the hardware registers knows about the latter.
It's really quite typical that the DAI is programmed for a fixed configuration and the DSP takes care of the conversions. The kernel only deals with stream triggers and power management without know all the internal details of the audio graph.