-
Notifications
You must be signed in to change notification settings - Fork 140
ASoC: SOF: Intel: hda: call snd_hda_set_power_save from SOF code #1726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ASoC: SOF: Intel: hda: call snd_hda_set_power_save from SOF code #1726
Conversation
SOF sets its own pm_runtime suspend delay, but never calls snd_hda_set_power_save for the HDA codec. This means that HDA codec will have no pm_runtime suspend delay at all, so it will suspend very fast after idle. This is not very common "mode" for the codec PM as for example legacy HDA is always setting some pm_runtime suspend delay or disabling the PM altogether. If SOF is in suspend and there's a jack event, SOF will wake up, but the HDA codec will go immediately to suspend. We noticed that with some codecs (like ALC285) the quick suspend after wake up is messing up the jack detection as the codec might need some time for the detect measurement. So set the pm_runtime suspend delay time in HDA codec to same value as SOF sets itself. Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
|
One side effect on Mantis via below steps:
In step3, if open paplay ASAP instead of open sound setting, error also can be reproduced. This issue not exist without this PR |
This seems like a problem with the startup processing, which must be fixed, but it doesn't necessarily mean, that this patch is wrong. Do we understand how it works without this patch? This patch doesn't change the reboot behaviour, so, at the end of the probing the status should be the same with or without this patch. But then without this patch the codec immediately suspends, whereas with this patch it doesn't. That means, that if in that state we suspend the codec with headphones plugged in, we immediately get a wake up event from the codec, as if the headphones were just plugged in? Once we understand that well, we should be able to also fix this issue with this patch. |
|
@juimonen can we conclude if this PR is needed or not, and make it go away otherwise? |
|
@plbossart I've made my opinion clear: this is needed and the right thing to do. Issues that support this PR:
Issues against:
I'm not sure how to tackle the boot issue, but not merging this PR is not the way to go forward. I really have no idea how to satisfy both lenovo and dell case. We should have the PM off in boot and then enable it later? |
|
@juimonen well, put yourself in my shoes. If we have a fix for Lenovo that breaks Dell, should we merged this at all... |
|
@plbossart yes I understand. My point still is that this is a correct thing to do overall, and the Dell should be fixed in some other way. I think it is really strange operational mode that sof suspends in 2s, but codec is put to sleep at light speed. As I understand it is also strange from PM point of view having 0 suspend delay. Legacy HDA is either 3s, some integer value set in kernel config, someone setting something from userspace (I don't know what is the resolution there) or PM disabled (never sleep). I can only say, that maybe I have to start digging why Dell needs this obscure 0 suspend delay (PM enabled) in boot for the detection to work... |
If you have access to both devices, I'd start from the legacy driver on both, see what's going on, then apply similar fixes on the SOF side. it's painful I know but we all have to deal with hardware quirks. |
|
@juimonen can this be closed? |
|
yes we have solution sent upstream, so closing |
SOF sets its own pm_runtime suspend delay, but never calls
snd_hda_set_power_save for the HDA codec. This means that HDA codec will
have no pm_runtime suspend delay at all, so it will suspend very fast
after idle. This is not very common "mode" for the codec PM as for
example legacy HDA is always setting some pm_runtime suspend delay or
disabling the PM altogether.
If SOF is in suspend and there's a jack event, SOF will wake up, but the
HDA codec will go immediately to suspend. We noticed that with some
codecs (like ALC285) the quick suspend after wake up is messing up the
jack detection as the codec might need some time for the detect
measurement.
So set the pm_runtime suspend delay time in HDA codec to same value as SOF
sets itself.
Signed-off-by: Jaska Uimonen jaska.uimonen@linux.intel.com