-
Notifications
You must be signed in to change notification settings - Fork 140
ASoC: SOF: hda: set autosuspend delay for hda bus device #977
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: hda: set autosuspend delay for hda bus device #977
Conversation
|
I'll copy my comment to this PR from my own tree:
|
|
@ranj063 without your PR(setting timeout to 2s), what is the timeout value for runtime suspend of the codec? @RanderWang has some finding that we might need add PM ops to hdac_hda.c and call the hda codec PM via hdac_hda.c PM ops. It's better if we can figure out more generic solution. |
@keyonjie without this patch autosuspend wouldn't be enabled at all, so, I think as soon as the ref-count reaches 0 the device(s) would be suspended with no delay. |
|
This might be related to same root problem as #978 is trying to address. If hda codec reset indeed causes unexpected side-effects to cAVS, then it would make sense fine-tuning the autosuspend delay will have impact (as codec suspend will kick less often). I do agree with @lyakh we should find the rootcause. Once rootcause is clear, then workaround patches may be considered still, but at least then we know better the pros and cons. Otherwise we risk just making bugs harder to reproduce but still there. |
|
The tests show that this PR does NOT fix the issue fully? |
@plbossart yes enabling autosuspend avoids 1422 from occuring with aplay stress test. But it still shows up in other stress test cases such as reboot/s3 stress test when the codec reset happens right before we send an IPC |
keyonjie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, how about move it to the bottom of hda_codec_probe_bus(), we need to call it only one time for the bus.
sound/soc/sof/intel/hda-codec.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, how about move it to the bottom of hda_codec_probe_bus(), we need to call it only one time for the bus.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is misplaced. The function returns in both preprocessor branches above
lgirdwood
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will also means less chance of pops and clicks.
|
@ranj063 CI is showing issue, but its false. Conflicts too. |
we don't need to add PM ops to hdac_hda.c. The codec driver in legacy hda has this PM ops. |
lyakh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a simple fix is needed
sound/soc/sof/intel/hda-codec.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is misplaced. The function returns in both preprocessor branches above
|
How about put it here: |
9944ebb to
5b9b769
Compare
plbossart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea but known issues with this solution already handled in the legacy HDaudio driver.
|
SOFCI TEST |
Set the autosuspend delay to 2s for hda bus device. This is needed to prevent the codec driver from entering runtime PM during stress tests involving back-to-back stream open/close. The legacy driver forbids autosuspend for some devices where a non-zero autosuspend delay causes pops/clicks. This needs to be addressed in the SOF driver when those devices are supported. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
5b9b769 to
56f58aa
Compare
|
@xiulipan why has jenkins failed? I get 404 page not found error when I click on it? |
|
@ranj063 |
plbossart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the commit message isn't very clear.
We should explain this is a work-around for now. I don't think we have a root cause and I don't see how/when we are going to deal with the power_save quirks either.
|
@ranj063 is this time to close this one? |
@plbossart yes I will close this one. Even though this is the right thing to do I have not seen any value with it so far. So maybe we can revisit later. |
|
@ranj063 @plbossart may I humbly disagree? I think this is an important feature. It's a real improvement over threshing the DSP immediately upon each close. I'm not sure how this translated to real-life use-cases, maybe a typical use-case is anyway you use a GUI audio player and it either keeps the driver awake anyway all the time, or it allows it to suspend, but then the user anyway doesn't restart the next playback within 2 seconds after finishing the previous one. Still, there are things like short system beeps and blips, notifications etc. I think we should merge this! |
|
I have no objection but let's add this later when we are done with the functional parts. |
|
@plbossart can we keep it open until then then? It would at least help me, otherwise it'd would completely slip under my radar. |
|
@ranj063 @plbossart any argument against merging this? I really think it's a bug not setting the idle timeout and this patch trivially fixes it. |
|
So it's not clear what this PR actually solves (what stress tests are broken?), and it's known to be problematic with legacy devices which don't work well with a non-zero autosuspend value. |
@plbossart I don't think any tests should break without that delay, a "perfect" driver should work with both 0 or any length delay. It's rather a statistical improvement - lower latencies when resume cycles are avoided, especially as with SOF where they involve loading and booting the firmware, restoring pipelines etc. |
|
@plbossart @lyakh |
|
Closing this one as it doesnt seem like it is needed anymore. |
Set the autosuspend delay for hda bus device. This prevents the hda codec device from entering runtime suspend when running stress tests involving opening/closing streams one after the other.
Fixes thesofproject/sof#1422
Likely fixes other isseus involving pulse audio as well. Needs to be checked.