-
Notifications
You must be signed in to change notification settings - Fork 11
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
Changes from 6 commits
b91b946
d9ab794
d2a2bab
273666e
be5cfc2
1af7fbd
bca2034
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,17 +23,16 @@ xclock_t bclk = XS1_CLKBLK_1; | |
#define I2S_LOOPBACK_LATENCY 1 | ||
|
||
#if SMOKE == 1 | ||
#define NUM_BCLKS 1 | ||
#define NUM_BCLKS_TO_CHECK 1 | ||
static const unsigned bclk_freq_lut[NUM_BCLKS] = { | ||
1228800 | ||
#define NUM_LRCLKS 1 | ||
#define NUM_LRCLKS_TO_CHECK 1 | ||
static const unsigned lr_freq_lut[NUM_LRCLKS] = { | ||
192000 | ||
}; | ||
#else | ||
#define NUM_BCLKS 12 | ||
#define NUM_BCLKS_TO_CHECK 3 | ||
static const unsigned bclk_freq_lut[NUM_BCLKS] = { | ||
1228800, 614400, 384000, 192000, 44100, | ||
22050, 96000, 176400, 88200, 48000, 24000, 352800 | ||
#define NUM_LRCLKS 12 | ||
#define NUM_LRCLKS_TO_CHECK 3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
static const unsigned lr_freq_lut[NUM_LRCLKS] = { | ||
192000, 176400, 96000, 88200, 48000, 44100 | ||
}; | ||
#endif | ||
#ifndef DATA_BITS | ||
|
@@ -111,7 +110,7 @@ static int request_response( | |
return r; | ||
} | ||
|
||
static unsigned bclk_freq_index = 0; | ||
static unsigned lr_freq_index = 0; | ||
static unsigned frames_sent = 0; | ||
static unsigned rx_data_counter[MAX_CHANNELS] = {0}; | ||
static unsigned tx_data_counter[MAX_CHANNELS] = {0}; | ||
|
@@ -150,8 +149,9 @@ i2s_restart_t i2s_restart_check(void *app_data) | |
i2s_restart_t restart; | ||
|
||
frames_sent++; | ||
if (frames_sent == 4) | ||
if (frames_sent == 4) { | ||
restart = I2S_RESTART; | ||
} | ||
else | ||
restart = I2S_NO_RESTART; | ||
|
||
|
@@ -173,15 +173,15 @@ void i2s_init(void *app_data, i2s_config_t *i2s_config) | |
printf("Error\n"); | ||
} | ||
|
||
if (bclk_freq_index == NUM_BCLKS_TO_CHECK - 1) { | ||
if (lr_freq_index == NUM_LRCLKS_TO_CHECK - 1) { | ||
if (current_mode == I2S_MODE_I2S) { | ||
current_mode = I2S_MODE_LEFT_JUSTIFIED; | ||
bclk_freq_index = 0; | ||
lr_freq_index = 0; | ||
} else { | ||
_Exit(1); | ||
} | ||
} else { | ||
bclk_freq_index++; | ||
lr_freq_index++; | ||
} | ||
} | ||
|
||
|
@@ -196,7 +196,9 @@ void i2s_init(void *app_data, i2s_config_t *i2s_config) | |
rx_data_counter[i] = 0; | ||
} | ||
|
||
broadcast(bclk_freq_lut[bclk_freq_index], | ||
unsigned bclk_freq = lr_freq_lut[lr_freq_index] * DATA_BITS * I2S_CHANS_PER_FRAME; | ||
|
||
broadcast(bclk_freq, | ||
NUM_IN, | ||
NUM_OUT, DATA_BITS, i2s_config->mode == I2S_MODE_I2S); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
|
||
num_in_out_args = { | ||
"4ch_in,4ch_out": (4, 4), | ||
"2ch_in,2ch_out": (2, 2), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh that's exciting! Carry on then 😂 |
||
"1ch_in,1ch_out": (1, 1), | ||
"4ch_in,0ch_out": (4, 0), | ||
"0ch_in,4ch_out": (0, 4), | ||
|
There was a problem hiding this comment.
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".