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 a bug when calculating i2s apll parameters. (IDFGH-1365) #3648

Closed
wants to merge 1 commit into from

Conversation

redchenjs
Copy link
Contributor

@redchenjs redchenjs commented Jun 18, 2019

fix #2634, #3380
improve #3407

Tested with IDF v3.2:

I (527) I2S: APLL: Req RATE: 10675, real rate: 10675.000, BITS: 16, ERROR: 0.000000%
I (538) I2S: APLL: Req RATE: 10675, real rate: 10675.003, BITS: 24, ERROR: 0.000030%
I (554) I2S: APLL: Req RATE: 10675, real rate: 10675.006, BITS: 32, ERROR: 0.000055%

I (569) I2S: APLL: Req RATE: 11025, real rate: 11024.991, BITS: 16, ERROR: 0.000080%
I (585) I2S: APLL: Req RATE: 11025, real rate: 11024.992, BITS: 24, ERROR: 0.000071%
I (600) I2S: APLL: Req RATE: 11025, real rate: 11024.991, BITS: 32, ERROR: 0.000080%

I (616) I2S: APLL: Req RATE: 16000, real rate: 15999.986, BITS: 16, ERROR: 0.000085%
I (631) I2S: APLL: Req RATE: 16000, real rate: 15999.987, BITS: 24, ERROR: 0.000081%
I (646) I2S: APLL: Req RATE: 16000, real rate: 16000.003, BITS: 32, ERROR: 0.000018%

I (662) I2S: APLL: Req RATE: 22050, real rate: 22049.982, BITS: 16, ERROR: 0.000080%
I (677) I2S: APLL: Req RATE: 22050, real rate: 22049.984, BITS: 24, ERROR: 0.000071%
I (693) I2S: APLL: Req RATE: 22050, real rate: 22049.994, BITS: 32, ERROR: 0.000027%

I (708) I2S: APLL: Req RATE: 32000, real rate: 32000.006, BITS: 16, ERROR: 0.000018%
I (724) I2S: APLL: Req RATE: 32000, real rate: 31999.974, BITS: 24, ERROR: 0.000081%
I (739) I2S: APLL: Req RATE: 32000, real rate: 32000.006, BITS: 32, ERROR: 0.000018%

I (755) I2S: APLL: Req RATE: 44100, real rate: 44099.988, BITS: 16, ERROR: 0.000027%
I (770) I2S: APLL: Req RATE: 44100, real rate: 44099.969, BITS: 24, ERROR: 0.000071%
I (786) I2S: APLL: Req RATE: 44100, real rate: 44099.988, BITS: 32, ERROR: 0.000027%

I (801) I2S: APLL: Req RATE: 48000, real rate: 47999.961, BITS: 16, ERROR: 0.000081%
I (816) I2S: APLL: Req RATE: 48000, real rate: 48000.016, BITS: 24, ERROR: 0.000033%
I (832) I2S: APLL: Req RATE: 48000, real rate: 47999.992, BITS: 32, ERROR: 0.000016%

I (847) I2S: APLL: Req RATE: 96000, real rate: 95999.984, BITS: 16, ERROR: 0.000016%
I (863) I2S: APLL: Req RATE: 96000, real rate: 96000.031, BITS: 24, ERROR: 0.000033%
I (878) I2S: APLL: Req RATE: 96000, real rate: 95999.984, BITS: 32, ERROR: 0.000016%

Previous version:

I (516) I2S: APLL: Req RATE: 10675, real rate: 10675.000, BITS: 16, ERROR: 0.000000%
I (527) I2S: APLL: Req RATE: 10675, real rate: 10675.003, BITS: 24, ERROR: 0.000030%
I (543) I2S: APLL: Req RATE: 10675, real rate: 10675.006, BITS: 32, ERROR: 0.000055%

I (558) I2S: APLL: Req RATE: 11025, real rate: 11024.991, BITS: 16, ERROR: 0.000080%
I (573) I2S: APLL: Req RATE: 11025, real rate: 11024.992, BITS: 24, ERROR: 0.000071%
I (589) I2S: APLL: Req RATE: 11025, real rate: 11024.991, BITS: 32, ERROR: 0.000080%

I (604) I2S: APLL: Req RATE: 16000, real rate: 15999.986, BITS: 16, ERROR: 0.000085%
I (620) I2S: APLL: Req RATE: 16000, real rate: 15999.987, BITS: 24, ERROR: 0.000081%
I (635) I2S: APLL: Req RATE: 16000, real rate: 16000.003, BITS: 32, ERROR: 0.000018%

I (651) I2S: APLL: Req RATE: 22050, real rate: 22049.982, BITS: 16, ERROR: 0.000080%
I (666) I2S: APLL: Req RATE: 22050, real rate: 22049.984, BITS: 24, ERROR: 0.000071%
I (682) I2S: APLL: Req RATE: 22050, real rate: 21972.619, BITS: 32, ERROR: 0.350934%

I (697) I2S: APLL: Req RATE: 32000, real rate: 32000.006, BITS: 16, ERROR: 0.000018%
I (712) I2S: APLL: Req RATE: 32000, real rate: 31999.974, BITS: 24, ERROR: 0.000081%
I (728) I2S: APLL: Req RATE: 32000, real rate: 32000.006, BITS: 32, ERROR: 0.000018%

I (743) I2S: APLL: Req RATE: 44100, real rate: 43945.238, BITS: 16, ERROR: 0.350934%
I (759) I2S: APLL: Req RATE: 44100, real rate: 44099.969, BITS: 24, ERROR: 0.000071%
I (774) I2S: APLL: Req RATE: 44100, real rate: 43945.238, BITS: 32, ERROR: 0.350934%

I (790) I2S: APLL: Req RATE: 48000, real rate: 47999.961, BITS: 16, ERROR: 0.000081%
I (805) I2S: APLL: Req RATE: 48000, real rate: 46874.922, BITS: 24, ERROR: 2.343913%
I (821) I2S: APLL: Req RATE: 48000, real rate: 43945.238, BITS: 32, ERROR: 8.447420%

I (836) I2S: APLL: Req RATE: 96000, real rate: 87890.477, BITS: 16, ERROR: 8.447420%
I (852) I2S: APLL: Req RATE: 96000, real rate: 96000.031, BITS: 24, ERROR: 0.000033%
I (867) I2S: APLL: Req RATE: 96000, real rate: 107421.875, BITS: 32, ERROR: 11.897786%

@github-actions github-actions bot changed the title fix a bug when calculating i2s apll parameters. fix a bug when calculating i2s apll parameters. (IDFGH-1365) Jun 18, 2019
@mahavirj mahavirj self-requested a review June 20, 2019 07:48
@redchenjs
Copy link
Contributor Author

Merged.

@redchenjs redchenjs closed this Jun 30, 2019
@redchenjs redchenjs deleted the fix_i2s_apll_clk branch June 30, 2019 15:48
0xFEEDC0DE64 pushed a commit to 0xFEEDC0DE64/esp-idf that referenced this pull request May 5, 2021
…cal component but does not update CMakeLists.txt (espressif#3648)
jokubasver added a commit to jokubasver/saab-93NG-bluetooth-aux that referenced this pull request Dec 19, 2021
This seems to have been fixed ages ago in ESP-IDF:
espressif/esp-idf#3648

espressif/esp-idf#3380
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.

Unable to set I2S APLL Clock for 48khz 32bit 2ch (IDFGH-432)
2 participants