Repository navigation
Conversation
|
Verified Basic Maxim-Speaker Functionality(non-dsm) & also issue mentioned at #2510 isn't observed. |
|
@bardliao checkpatch issues? |
661e38c to
d22df04
Compare
updated |
| * We can't get the feedback data when codec is off, set | ||
| * value = 0 and return 0 to avoid error. | ||
| */ | ||
| ucontrol->value.integer.value[0] = 0; |
There was a problem hiding this comment.
can we set value to 0xFFFFFFF make user be aware that it is invalid ?
There was a problem hiding this comment.
can we set value to 0xFFFFFFF make user be aware that it is invalid ?
I am fine with that. What is your opinion @ryans-lee ?
There was a problem hiding this comment.
Do you mean 0xFFFFFFF not 0xFFFFFFFF? Either ways are okay to me.
There was a problem hiding this comment.
@ryans-lee What does the value mean? My purpose is that user application will do nothing if it gets the value when codec is suspended. Which value is better to you? 0 or 0xFFFFFFFF? BTW ucontrol->value.integer.value[0] is long type, so we can set it to -1 if we want.
There was a problem hiding this comment.
@bardliao I've been reading through the previous PRs and it is starting to seem this may be the best option. One thing that still bugs me is that what user-space app is actually reading the values when the problem occurs. I did not find this info in thesofproject/sof#3541 for instance. How would the user-space application filter valid values from non-valid ones? Benefit of -EBUSY is that it's at least a well-documented interface and user-space knows it can't get the value now.
There was a problem hiding this comment.
I'd agree with @kv2019i - let's not re-invent the wheel. If .cache_only is enabled, regmap_read() returns -EBUSY. This isn't the only codec driver that uses regmap and supports rt-pm, is it? What do other drivers do? How do other user-space programs handle these cases?
There was a problem hiding this comment.
I'd agree with @kv2019i - let's not re-invent the wheel. If
.cache_onlyis enabled,regmap_read()returns-EBUSY. This isn't the only codec driver that uses regmap and supports rt-pm, is it? What do other drivers do? How do other user-space programs handle these cases?
regmap_read() returns -EBUSY because .cache_only is enabled AND the register is volatile. Using a volatile register in a kcontrol is not common. I think using specific _get/_put functions is a common way to handle a kcontrol which is not just simply read/write a register bit to get/set the kcontrol value.
ryans-lee
left a comment
There was a problem hiding this comment.
I'm not quite sure if codec driver really need to have similar bias level check for volatile register read in the future. It looks like workaround, but I do not have better idea. Thanks.
kv2019i
left a comment
There was a problem hiding this comment.
Still some questions on the chosen solution.
| * We can't get the feedback data when codec is off, set | ||
| * value = 0 and return 0 to avoid error. | ||
| */ | ||
| ucontrol->value.integer.value[0] = 0; |
There was a problem hiding this comment.
@bardliao I've been reading through the previous PRs and it is starting to seem this may be the best option. One thing that still bugs me is that what user-space app is actually reading the values when the problem occurs. I did not find this info in thesofproject/sof#3541 for instance. How would the user-space application filter valid values from non-valid ones? Benefit of -EBUSY is that it's at least a well-documented interface and user-space knows it can't get the value now.
@kv2019i I guess CRAS would try to get all values of kcontrols and we will get the
The user space application may not know if the value is valid or not. But those kcontrols are the feedback information used for speaker protection. So I think it is meaningless if the amp is not active. |
|
@bardliao wrote:
Hmm. I wonder if this should be discussed on alsa-devel directly. I understand this the warnings are misleading, But it's not obvious what is the correct behavior:
None of these are ideal. I kind of like (2) as it doesn't at least generate any silent errors. E.g.
But that's a lot of "ifs" in there. How does the CRAS function reading the kcontrols know that amp is not active? And how would other apps know of this dependency? If seems it would be better not to hide the dependencies, but rather make it explicit with either (2) or (4). This seems to be rare enough case that a a discussion on alsa-devel would probably be good to have to get recommendations which way to go. |
|
Agree with @kv2019i we should send this as an RFC to get feedback on what the expected behavior is when accessing a volatile register when a device is suspended. |
Sure, I will do it. |
@kv2019i Can we get any opinion from CRAS people?
|
0b5f60d
|
Tried for 3 iteration and observe that issue persists. This is just a top level analysis to indicate that still issue persists, seems like the same volatile registers are causing this issue. we can re-confirm with debug prints. |
0b5f60d to
d292191
Compare
|
@naveen-manohar Thanks for your test. Sorry, I forgot to assign |
| bool interleave_mode; | ||
| unsigned int ch_size; | ||
| bool tdm_mode; | ||
| /* cache for reading a vaild fake feedback value */ |
There was a problem hiding this comment.
'vaild' may be misspelled - perhaps 'valid'?
Also there are warnings from checkpatch - "WARNING: line over 80 characters"
There was a problem hiding this comment.
'vaild' may be misspelled - perhaps 'valid'?
Fixed, thanks.
Also there are warnings from checkpatch - "WARNING: line over 80 characters"
The limitation is 100 characters now. So, it should be fine.
d292191 to
f99dc26
Compare
|
I saw Mark has applied the previous version. So close |
|
@plbossart @ryans-lee Do you have any comment for this PR? If no, I will send it to upstream directly. |
You lost me here, I thought Mark applied the previous version? |
It seems to be applied, but I can't find it on Mark's tree. And https://www.spinics.net/lists/alsa-devel/msg119319.html shows |
Better if you ask Mark directly? |
|
Closing it for now as I resent it to upstream |
f99dc26 to
ebd1aae
Compare
We will set regcache_cache_only true in suspend. As a result, regmap_read will return error when we try to read volatile registers in suspend. Besides, it doesn't make sense to read feedback data when codec is not active. To make userspace happy, this patch returns a cached value shich should be a valid value. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
ebd1aae to
d942500
Compare
|
@naveen-manohar I updated the PR according to Mark's comment. Could you test it? |
Did verify the latest-patch-set(v3), speaker audio works fine and earlier warning logs are not observed during suspend.. |
Thanks for the test. I sent it to upstream so close it for now |
|
we are seeing the prints in ADL
platform too. We checked and this patch is already present in our
kernel. Please let us know any patch or setting that might have missed
in ADL tree?
[ 505.937871] max98373 sdw:2:19f:8373:0:3: ASoC: error at
soc_component_read_no_lock on sdw:2:19f:8373:0:3: -16
[ 505.937875] max98373 sdw:2:19f:8373:0:3: ASoC: error at
soc_component_read_no_lock on sdw:2:19f:8373:0:3: -16
[ 505.937889] max98373 sdw:2:19f:8373:0:3: ASoC: error at
soc_component_read_no_lock on sdw:2:19f:8373:0:3: -16
[ 505.937890] max98373 sdw:2:19f:8373:0:3: ASoC: error at
soc_component_read_no_lock on sdw:2:19f:8373:0:3: -16
[ 505.937899] max98373 sdw:2:19f:8373:0:3: ASoC: error at
soc_component_read_no_lock on sdw:2:19f:8373:0:3: -16
[ 505.937900] max98373 sdw:2:19f:8373:0:3: ASoC: error at
soc_component_read_no_lock on sdw:2:19f:8373:0:3: -16
[ 505.938111] max98373 sdw:2:19f:8373:0:7: ASoC: error at
soc_component_read_no_lock on sdw:2:19f:8373:0:7: -16
[ 505.938114] max98373 sdw:2:19f:8373:0:7: ASoC: error at
soc_component_read_no_lock on sdw:2:19f:8373:0:7: -16
[ 505.938149] max98373 sdw:2:19f:8373:0:7: ASoC: error at
soc_component_read_no_lock on sdw:2:19f:8373:0:7: -16
[ 505.938151] max98373 sdw:2:19f:8373:0:7: ASoC: error at
soc_component_read_no_lock on sdw:2:19f:8373:0:7: -16
[ 505.938162] max98373 sdw:2:19f:8373:0:7: ASoC: error at
soc_component_read_no_lock on sdw:2:19f:8373:0:7: -16
[ 505.938163] max98373 sdw:2:19f:8373:0:7: ASoC: error at
soc_component_read_no_lock on sdw:2:19f:8373:0:7: -16
@sathyap-chrome you file a separate bug for this?
Not sure what's going on with github, I don't see your initial comment btw.
|
|
Hi @plbossart i deleted the comment since the OS we used was old and hence this was seen. Later we re rechecked and its fine. |
ok let's keep this closed then. thanks for the information. |
We will set regcache_cache_only true in suspend. As a result,
regmap_read will return error when we try to read volatile
registers in suspend. Besides, it doesn't make sense to read
feedback data when codec is not active.
Signed-off-by: Bard Liao yung-chuan.liao@linux.intel.com