-
Notifications
You must be signed in to change notification settings - Fork 132
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
ALSA: hda: intel-nhlt: Ignore vbps when looking for DMIC 32 bps format #4690
ALSA: hda: intel-nhlt: Ignore vbps when looking for DMIC 32 bps format #4690
Conversation
sound/hda/intel-nhlt.c
Outdated
/* | ||
* The DMIC bps=32 configuration is described in some | ||
* table with vbps=32 (the DMIC hardware is vbps=24) | ||
*/ |
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.
@ujfalusi this patch feels a bit odd. May I suggest a different approach in the SOF driver by looking up both 32/32 and 24/32 when the bit-depth is 32 instead?
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.
@ranj063, I had that implementation first, but it felt out of place and hackish. The reason why I have moved it here is that it is the NHLT table itself which is incorrect and it is better to handle this in the NHLT code rather then in upper layer.
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.
no, the NHLT is not incorrect. It's really that vbs is irrelevant and should be ignored.
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.
OK, so rewording the comments and the commit message would suffice?
But then if the user asks for 32/32 then we need to look for 32/24 also, right? For DMIC, that is.
The NHLT core can do this:
if DMIC and bps == 32, set the vbps to 24 first, try to find the blob, if not found, look for it using vbps = 32.
Or pass vbps = 0 to nhlt_get_specific_cfg()
and if vbps is 0, do not try to match it, only look for bps match.
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.
pass vbps = 0 to
nhlt_get_specific_cfg()
and if vbps is 0, do not try to match it, only look for bps match.
that would be my preference. vbps is a wildcard - ignored.
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.
me too!
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.
I'm ok with this as long as we can limit this to DMIC in the caller (i.e. pass 0 to use a wildcard).
9205b48
to
f294891
Compare
Changes since v1:
|
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.
Code-wise ok. I have no favorites whether this should be on SOF or in intel-nhlt.c. I guess depends on wheter AVS et al assume this to be handled by intel-nhlt.c or not.
f294891
to
bcd24c4
Compare
Changes since v2:
|
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 couple of typos to fix before upstreaming
sound/hda/intel-nhlt.c
Outdated
* table have the vbps as 24, some have it as 32. | ||
* The DMIC hardware supports only one type of 32 bit sample | ||
* size, which is 24 bit sampling on the MSB side and bits[1:0] | ||
* is used for indicating the channel number. |
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 couple of typos: some NHLT tables .... bits[1:0] are used....
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.
we should also say that the 32 bit case is harmless, otherwise the whole point of ignoring vbs could be seen as a regression or a miss.
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.
done, both
bcd24c4
to
bb43bdd
Compare
Changes since v2:
|
bb43bdd
to
c315e56
Compare
Changes since v3:
|
sound/hda/intel-nhlt.c
Outdated
@@ -255,8 +255,12 @@ nhlt_get_specific_cfg(struct device *dev, struct nhlt_fmt *fmt, u8 num_ch, | |||
dev_dbg(dev, "Endpoint format: ch=%d fmt=%d/%d rate=%d\n", | |||
wfmt->channels, _vbps, _bps, wfmt->samples_per_sec); | |||
|
|||
/* | |||
* When looking for exact match of configuration ignore the vbps | |||
* from NHTL table when ignore_vbps is true |
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.
Typo NHTL 🙂
c315e56
to
00a77ff
Compare
Changers since v4:
|
SOFCI TEST |
1 similar comment
SOFCI TEST |
00a77ff
to
07cfd5b
Compare
When looking up DMIC blob from the NHLT table and the format is 32 bits, ignore the vbps matching for 32 bps for DMIC since some NHLT table have the vbps as 24, some have it as 32. The DMIC hardware supports only one type of 32 bit sample size, which is 24 bit sampling on the MSB side and bits[1:0] is used for indicating the channel number. Signed-off-by: Peter Ujfalusi <[email protected]>
Sorry, force pushed to kick a new CI run. The recent failures cannot be caused by this PR - they were not present in earlier versions and there were no change in functionality... |
When looking up DMIC blob from the NHLT table and the format is 32 bits,
ignore the vbps matching for 32 bps for DMIC since some NHLT table have
the vbps as 24, some have it as 32.
The DMIC hardware supports only one type of 32 bit sample size, which is
24 bit sampling on the MSB side and bits[1:0] is used for indicating the
channel number.