-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
DRAFT: Fixes for I2S #7117
Closed
Closed
DRAFT: Fixes for I2S #7117
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
later on, consider adding HW tests. Ideas:
|
This reverts commit b02596b.
@me-no-dev This PR can be later closed in favor of new implementation of I2S |
new I2S library was implemented here: #8714 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: Peripherals API
Relates to peripheral's APIs.
Status: Awaiting triage
Issue is waiting for triage
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
Few various fixes for I2S
WARNING - this is not yet tested and still may contain crashing bugs!
Major changes
Minor changes
print("Current mode is %s\n", i2s_mode_text[mode]);
_take_if_not_holding
and_give_if_top_call
has been simplified using recursive mutex and renamed to_take_mux
and_give_mux
. If the function fails it will still printlog_e
and return0
. If it succeeds it will return1
.log_x
will now also print the device index to distinct which object / I2S module is printing this message.setBufferSize
andgetBufferSize
has been renamed and extended tosetDMABufferFrameSize
,getDMABufferFrameSize
,getDMABufferSampleSize``getDMABufferByteSize
and also new functionsgetRingBufferSampleSize
,getRingBufferByteSize
has been added.getI2SNum
,isInitialized
,getSampleRate
,getBitsPerSample
._buffer_byte_size
has removed completely - instead of this is used functiongetRingBufferByteSize
.availableForWrite
has now another variantavailableSamplesForWrite
._i2s_dma_buffer_size
has been renamed to_i2s_dma_buffer_frame_size
to describe the unit.deviceIndex
.I2S_RIGHT_JUSTIFIED_MODE
andI2S_LEFT_JUSTIFIED_MODE
.Tests scenarios
Performed for Example sketches with following options:
SimpleTone, Philis mode: 8bps + 8000 Hz; 8bps + 44100 Hz; 32bps + 8000 Hz; 32bps + 44100 Hz;
SimpleTone, DAC mode: 16bps
InputSerialPlotter: 32bps, 8000 Hz and 32000 Hz
ADCPlotter: Only 16 bps is allowed, any other bps correctly prints Err msg and stops. Tested Sampling rates: 8000 and 44100.
_bitsPerSample
doesn't magically turn to 0 Second I2S on ESP32 non-working #7111Related links
#7111, #7107
Known issues
InputSerialPlotter
on my hardware reads lots of zeroes. If those are filtered out and not printed it may seem that the input is lagging.