Skip to content

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

Merged
lgirdwood merged 1 commit into
thesofproject:mainfrom
kv2019i:202404-fix-bt-rates
Apr 26, 2024
Merged

lgirdwood merged 1 commit into
thesofproject:mainfrom
kv2019i:202404-fix-bt-rates

Conversation

@kv2019i

@kv2019i kv2019i commented Apr 22, 2024

Copy link
Copy Markdown
Collaborator

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 <kai.vehmanen@linux.intel.com>
formats 'S16_LE'
rate_min 8000
rate_max 48000
rates '8000,16000,48000'

@ujfalusi ujfalusi Apr 22, 2024 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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?

@fredoh9 fredoh9 Apr 22, 2024 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

@ujfalusi good for you ?

@lgirdwood
lgirdwood merged commit 278ecc5 into thesofproject:main Apr 26, 2024
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