Skip to content

[I2S] hardcoded initial rate in i2s_rxtx_begin() #6066

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

Closed
4 tasks done
Martin-Laclaustra opened this issue May 11, 2019 · 1 comment · Fixed by #6349
Closed
4 tasks done

[I2S] hardcoded initial rate in i2s_rxtx_begin() #6066

Martin-Laclaustra opened this issue May 11, 2019 · 1 comment · Fixed by #6349

Comments

@Martin-Laclaustra
Copy link

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.

Platform

Irrelevant

Settings in IDE

Irrelevant

Problem Description

In:

i2s_set_rate(44100);

the transfer rate is stablished within the i2s_rxtx_begin() (and thus also i2s_begin()). This overwrites any data rate or div ratios previously introduced.
I suggest to clearly document that data rate must be specified always AFTER begin().
Alternatively, a (one time only) flag could be set as soon as rate or div ratios functions are called stopping that line from changing them.
Current behavior might create confusion (at least to me). I spent several hours figuring out why the rate would not stick. I understood it only after reading the code line by line. I suggest to take some action that could avoid that for other programmers.

earlephilhower added a commit to earlephilhower/Arduino that referenced this issue Jul 26, 2019
Fixes esp8266#6066

Preserve any existing sample rate for the I2S unit when performing an
`i2s_begin`.  If nothing has ever been set, default to 44.1KHz as
before.
earlephilhower added a commit that referenced this issue Jul 28, 2019
Fixes #6066

Preserve any existing sample rate for the I2S unit when performing an
`i2s_begin`.  If nothing has ever been set, default to 44.1KHz as
before.
@Martin-Laclaustra
Copy link
Author

Thank you!

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 a pull request may close this issue.

1 participant