On Tue, Dec 18, 2018 at 12:39:09PM +0200, Dimitris Papavasiliou wrote:
On 12/17/18 6:52 PM, Mark Brown wrote:
The device being open shouldn't have any impact on the power state?
It's been a while since I tried it, but, as far as I recall, that was the observed behavior (determined via printk statements in the CODEC's set_bias_level callback). To test potential fixes, I have a script that opens the device and switches sampling rate between 44.1kHz and 48kHz every one second. It popped almost every time.
If you're saying you're keeping the device open while you're doing this (rather than closing the stream and reconfiguring) then I'd expect you're going to find other hardware which has similar issues, reclocking the device isn't something I'd expect to be able to do glitch free.
I would expect the stream to be closed and reopened by most applications in between reconfigurations like that, it certainly used to be the common pattern.
If by stream you mean the device, then perhaps they do. As explained above, I test using a script, instead of using applications, such as a media player, as it's easier to reproduce the problem repeatedly at will and under controlled conditions. At any rate, a potential fix of the problem, shouldn't depend on application behavior.
The application does have some responsibility for ensuring that things work cleanly, there are limiations on what hardware can reasonably do and often trying to do things behind the hardware to avoid problems in unusual situations results in a lot of effort that's perhaps not worth it.