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

Src tplg fix #8412

Merged
merged 2 commits into from
Nov 17, 2023
Merged

Src tplg fix #8412

merged 2 commits into from
Nov 17, 2023

Conversation

btian1
Copy link
Contributor

@btian1 btian1 commented Oct 30, 2023

No description provided.

@btian1 btian1 marked this pull request as ready for review October 30, 2023 12:19
@btian1 btian1 requested review from ranj063 and jsarha as code owners October 30, 2023 12:19
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.

@singalsu @andrula-song pls review.

@@ -27,7 +27,7 @@
]
out_bit_depth [ 32 ]
out_valid_bit_depth [ 32 ]
obs "$[($out_channels * (($[($out_rate + 999)] / 1000) + 4)) * ($out_bit_depth / 8)]"
obs "$[$out_channels * (($out_rate / 1000) + 1) * ($out_bit_depth / 8)]"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this would benefit from more explanation and examples with some values. So the base class version of obs calculation is not enough (output_audio_format.conf), but why is 1 extra word enough in this case. I think a similar documentation note as in output_audio_format.conf would be in order here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@btian1 Have you been able to run e.g. the SRC capture and playback in sof-nocodec topology with clean audio with this patched topology with any of these impacted rates?

Copy link
Collaborator

@singalsu singalsu Nov 3, 2023

Choose a reason for hiding this comment

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

Can't listen audio in real time with nocodec, but the topology is arranged such that you can capture from PCM the playback to PCM via SSP loopback. Launch arecord from one shell window and aplay from other. Then copy the recording to you PC and listen if it's clean and with correct rate/duration.

We don't have SRC tests coverage with topology in CI so this is do-it-yourself.

Copy link
Collaborator

@singalsu singalsu left a comment

Choose a reason for hiding this comment

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

I ran a test with SRCs in sof-tgl-nocodec.tplg. All supported rates combinations worked OK without glitches seen in "host -> SRC -> DAI (48 kHz) -> SRC -> host" processing chain.

@lgirdwood
Copy link
Member

@btian1 can you check IPC3 build test result, it looks like not related to this PR. Thanks

@btian1
Copy link
Contributor Author

btian1 commented Nov 14, 2023

@btian1 can you check IPC3 build test result, it looks like not related to this PR. Thanks

it is smart amp error, should already be fixed with latest, let me force push again to get pass result.

@btian1
Copy link
Contributor Author

btian1 commented Nov 14, 2023

SOFCI TEST

22050Hz obs also need a separate setting, this was missed when first
create this file, now move it to the group with obs setting.

Signed-off-by: Baofeng Tian <[email protected]>
From 48k input, the obs for 11025/22050/44100/88200/176400 setting
need take care, previous implementation left 5 words redundancy
for output, this change removed redundancy, since actual output
buffer size always use double obs size.

Signed-off-by: Baofeng Tian <[email protected]>
Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

Not sure why we need to override "obs" anymore if there is no change to baseclass definition, but the comment might be useful to remind why extra space is not required.
I'm not 100% sure how wise it is to rely on 2*obs definition. To me, if we have a field for output block size, modules should specify what they actually need, and not assume that the user of this information will anyways double the allocation. But seems others are happy, so let's go with this and leave the comment in place.

@@ -27,7 +27,8 @@
]
out_bit_depth [ 32 ]
out_valid_bit_depth [ 32 ]
obs "$[($out_channels * (($[($out_rate + 999)] / 1000) + 4)) * ($out_bit_depth / 8)]"
# actual buffer size in sof is obs * 2, so here simply set to its period size
obs "$[$out_channels * ($out_bit_depth / 8) * (($out_rate / 1000)) * ($period / 1000)]"
Copy link
Collaborator

Choose a reason for hiding this comment

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

@btian1 But isn't this the same definition we have in the baseline? So if this doesn't require custom obs logic, we can remove this altogether?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

obs "$[($out_channels * ($[($out_rate + 999)] / 1000)) * ($out_bit_depth / 8)]"

this adding period into count, however, this may change further, a lot of related changes are happening.
let's wait and see.

@kv2019i kv2019i merged commit a451d6b into thesofproject:main Nov 17, 2023
43 of 44 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.

5 participants