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

Fix test_i2s_basic_slave and test_slave_bclk_invert tests #103

Merged
merged 7 commits into from
Feb 16, 2024

Conversation

shuchitak
Copy link
Contributor

@shuchitak shuchitak commented Feb 15, 2024

https://xmosjira.atlassian.net/browse/AP-371

I've tested both smoke and nightly and the tests pass on my local setup (MacOS).

pytest lib_i2s/test_i2s_basic_slave.py -s
pytest lib_i2s/test_i2s_basic_slave.py --nightly -s

Copy link
Contributor

@ACascarino ACascarino left a comment

Choose a reason for hiding this comment

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

Only a couple of things :)

static const unsigned bclk_freq_lut[NUM_BCLKS] = {
1228800
static const unsigned lr_freq_lut[NUM_BCLKS] = {
192000
};
#else
#define NUM_BCLKS 12
Copy link
Contributor

Choose a reason for hiding this comment

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

These two macros need updating and renaming

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Done.

@@ -10,6 +10,7 @@

num_in_out_args = {
"4ch_in,4ch_out": (4, 4),
"2ch_in,2ch_out": (2, 2),
Copy link
Contributor

@ACascarino ACascarino Feb 15, 2024

Choose a reason for hiding this comment

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

I think you'll also need to update the CMakeLists to get these to build properly, as well as the .sh files that actually do the building

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The 2,2 configuration is already present in the makefile and the build_lib_i2s_tests.sh. I think they were being tested at some point before getting mysteriously removed?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh that's exciting! Carry on then 😂

@@ -173,6 +176,8 @@ def run(self):
xsi.drive_port_pins(self._bclk, bclk1)
time = self.wait_until_ret(time + clock_half_period)


Copy link
Contributor

Choose a reason for hiding this comment

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

Unnecessary line breaks. I might actually suggest that at this point, any Python files committed here should have Black run on them first to unify code style - I started doing this myself

@@ -16,6 +16,10 @@ set(APP_LINK_OPTIONS
-target=XCORE-AI-EXPLORER
)

# Compile main.c which contains the i2s_callback_group_t functions in O3 mode. Needed for passing the
# test_i2s_basic_slave[4ch_in,4ch_out-32b] and test_i2s_basic_slave[4ch_in,4ch_out-16b] tests
set_source_files_properties(${CMAKE_CURRENT_LIST_DIR}/src/main.c PROPERTIES COMPILE_FLAGS "-O3")
Copy link
Contributor

Choose a reason for hiding this comment

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

This test is intended to check that the component is capable of operating using these settings, which it does - which is good. I would caution that this does highlight that the backpressure tolerance for the component in these settings is lower than we expected it to be - it would be useful to be able to profile these in the backpressure "test".

1228800, 614400, 384000, 192000, 44100,
22050, 96000, 176400, 88200, 48000, 24000, 352800
#define NUM_LRCLKS 12
#define NUM_LRCLKS_TO_CHECK 3
Copy link
Contributor

Choose a reason for hiding this comment

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

Approved, but, why are these 12 and 3? To be frank we could just make them 6 and 6, no point having clocks if we're not going to use them

@shuchitak shuchitak merged commit c5f06b2 into xmos:develop Feb 16, 2024
7 of 8 checks passed
@mbanth mbanth assigned shuchitak and unassigned mbanth Feb 19, 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.

3 participants