Skip to content
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

topology2: intel: bt-generic.conf: fix rate constraints #9068

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

kv2019i
Copy link
Collaborator

@kv2019i kv2019i commented Apr 22, 2024

Commit c77a4fe ("topology2: pcm_caps: Remove defaults for rate_min/rate_max") changed how rate constraints are described in topology. After this change, the rate_min/max was ignored by SOF Linux driver and the rate was incorrectly limited to 48000Hz for these topologies.

Fix this issue by enumerating the supported sampling rates with "rates".

Link: thesofproject/sof-test#1185

Commit c77a4fe ("topology2: pcm_caps: Remove defaults for
rate_min/rate_max") changed how rate constraints are described in
topology. After this change, the rate_min/max was ignored by SOF Linux
driver and the rate was incorrectly limited to 48000Hz for these
topologies.

Fix this issue by enumerating the supported sampling rates with "rates".

Link: https://github.com/thesofproject/sof/issues/9067
Signed-off-by: Kai Vehmanen <[email protected]>
@@ -245,8 +244,7 @@ Object.PCM.pcm [
direction "capture"
name $BT_CP_PCM_CAPS
formats 'S16_LE'
rate_min 8000
rate_max 48000
rates '8000,16000,48000'
Copy link
Contributor

@ujfalusi ujfalusi Apr 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The range previously included 16, 32, 44.1 at least, is it valid to only pick these three of the range?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, lets keep it simple.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ujfalusi These match the supported Bluetooth profiles. 8 and 16 for HFP, and 48 for A2DP.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kv2019i isn't 32kHz supported in the newer profiles with BT LE?

Copy link
Contributor

@fredoh9 fredoh9 Apr 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit complicated case for tplg parser.
8000/16000 + mono + S16_LE is one of supported cases
48000 + stereo + S16_LE is another supported case?

sof_tplgreader.py will set 48000 first to rate when 48000 is available in rates, so this will fail again.

aplay -Dhw:0,2 -r 48000 -c 1 -f S16_LE -d 5 /dev/zero -v -q

before thesofproject/sof-test#1174 merged, rate is from rate_min, it was working with below params,

aplay -Dhw:0,2 -r 8000 -c 1 -f S16_LE -d 5 /dev/zero -v -q

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fredoh9 explained this to me and I think the key issue is: assuming that rate and number of channels are independent of each other.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@plbossart yes, LE will have more rates, but we those also require addition of new SSP configurations which are not there yet, so until those added, we should advertise what we actually support (and that is 8/16/48 now)

@fredoh9 ack. this is just hitting the limits of what we can express in capabilities. the topology description of PCM cannot express the PCM does not support all combinations of supported channels and rates.

@lgirdwood
Copy link
Member

@ujfalusi good for you ?

@lgirdwood lgirdwood merged commit 278ecc5 into thesofproject:main Apr 26, 2024
44 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants