On 12/17/18 4:10 PM, Mark Brown wrote:
On Mon, Dec 17, 2018 at 02:58:03PM +0200, Dimitris Papavasiliou wrote:
In general the clocks need to be switched during the hw_params callback (when the new callback specifies a new sample rate, which needs the other clock) and, as far as I can see, this can happen at more or less any time, i.e. in all power states and regardless of whether the device is opened or closed.
It shouldn't be called while the stream is running, if it is it'd be entirely fine to just return an error.
It's not called while the stream is running, or at least I haven't seen that happen. It can be called though, while the device is opened and fully powered up, for instance when switching tracks during playback, where the next track has a different sample rate. This scenario is relatively frequent during normal use of a DAC and can't be avoided, as far as I can see.