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

Tools: Topology2: Fix cavs-nocodec.conf SSP2 PCM rates #9382

Merged

Conversation

singalsu
Copy link
Collaborator

The rate_min and rate_max no more work with IPC4 topologies. The SSP2 PCM host pipeline contains a sample rate converter so it can support multiple rates. With attempt to play (or capture) with other than 48 kHz the error is printed and resulting playback has wrong pitch:

Warning: rate is not accurate (requested = 44100Hz, got = 48000Hz)
please, try the plug plugin

Use of rates with list of all rates in topology fixes the issue.

The rate_min and rate_max no more work with IPC4 topologies. The
SSP2 PCM host pipeline contains a sample rate converter so it can
support multiple rates. With attempt to play (or capture) with
other than 48 kHz the error is printed and resulting playback has
wrong pitch:

Warning: rate is not accurate (requested = 44100Hz, got = 48000Hz)
         please, try the plug plugin

Use of rates with list of all rates in topology fixes the issue.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
}

Object.PCM.pcm_caps.2 {
direction "capture"
name "SSP2 Capture"
formats 'S16_LE,S24_LE,S32_LE'
rate_min 8000
rate_max 192000
rates "8000,11025,16000,22050,32000,44100,48000,64000,88200,96000,176400,192000"
Copy link
Member

Choose a reason for hiding this comment

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

missing 24000?

@@ -988,16 +988,14 @@ IncludeByKey.PASSTHROUGH {
direction "playback"
name "SSP2 Playback"
formats 'S16_LE,S24_LE,S32_LE'
rate_min 8000
rate_max 192000
rates "8000,11025,16000,22050,32000,44100,48000,64000,88200,96000,176400,192000"
Copy link
Member

Choose a reason for hiding this comment

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

missing 24000?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep. I'll test it if can be used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Seems it can't be used. In tplg build:

[1/142] Generating sof-tgl-nocodec.tplg
saving nhlt as binary in nhlt-sof-tgl-nocodec.bin
ALSA lib pcm.c:366:(split_rate) unsupported stream rate 24000
ALSA lib parser.c:211:(tplg_load_config) failed to parse topology
Unable to load configuration: Invalid argument

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I think ALSA does not define this 24kHz rate by default but it should be fine if we used a KNOT approach - which may mean a driver change. @ujfalusi @ranj063 FYI.

}

Object.PCM.pcm_caps.2 {
direction "capture"
name "SSP2 Capture"
formats 'S16_LE,S24_LE,S32_LE'
rate_min 8000
rate_max 192000
rates "8000,11025,16000,22050,32000,44100,48000,64000,88200,96000,176400,192000"
Copy link
Member

Choose a reason for hiding this comment

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

do we support 44.1? Not sure how the clocks would be derived or maybe this assumes an SRC?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, there's a SRC in host pipeline for SSP2. I'm trying to replicate with this topology an issue with 44.1 kHz volume with HiFi4 and noticed other than 48 kHz no more worked.

@singalsu singalsu marked this pull request as ready for review August 21, 2024 13:34
Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

We can circle back on 24k if needed, not a blocker to merge. Best to focus on fixing the Hifi 4 SRC issue.

@kv2019i kv2019i merged commit 371245b into thesofproject:main Aug 22, 2024
45 of 47 checks passed
@singalsu singalsu deleted the tplg2_fix_nocodec_ssp2_pcm_rates branch August 23, 2024 08:19
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.

4 participants